Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Last changes of the year: created a basic frontend for the alpha stag…

…e. Fixed login with facebook Oauth.
  • Loading branch information...
commit b16fd5abd40ff3b5b7239864ce332dc362a92313 1 parent 25da7bc
@dethos dethos authored
Showing with 650 additions and 497 deletions.
  1. +2 −1  stock_market_game/gamecore/admin.py
  2. BIN  stock_market_game/gamecore/admin.pyc
  3. +14 −8 stock_market_game/gamecore/views.py
  4. BIN  stock_market_game/gamecore/views.pyc
  5. BIN  stock_market_game/local_settings.pyc
  6. +2 −1  stock_market_game/playerinfo/admin.py
  7. BIN  stock_market_game/playerinfo/admin.pyc
  8. +1 −1  stock_market_game/settings.py
  9. BIN  stock_market_game/settings.pyc
  10. BIN  stock_market_game/static/Intro.png
  11. BIN  stock_market_game/static/loginbutton.png
  12. +173 −0 stock_market_game/static/style.css
  13. +18 −41 stock_market_game/templates/article_list.html
  14. +30 −46 stock_market_game/templates/article_view.html
  15. +18 −35 stock_market_game/templates/cannot.html
  16. +49 −0 stock_market_game/templates/companyprofile.html
  17. +49 −51 stock_market_game/templates/dash.html
  18. +73 −48 stock_market_game/templates/event.html
  19. +1 −0  stock_market_game/templates/footer.html
  20. +9 −0 stock_market_game/templates/header.html
  21. +18 −39 stock_market_game/templates/home.html
  22. +14 −23 stock_market_game/templates/nav.html
  23. +62 −45 stock_market_game/templates/profile.html
  24. +3 −34 stock_market_game/templates/proposal.html
  25. +15 −35 stock_market_game/templates/success.html
  26. +44 −43 stock_market_game/templates/trade.html
  27. +53 −45 stock_market_game/templates/wallet.html
  28. +2 −1  stock_market_game/urls.py
  29. BIN  stock_market_game/urls.pyc
View
3  stock_market_game/gamecore/admin.py
@@ -1,4 +1,4 @@
-from gamecore.models import Company, Investment, GEvent, MenuItem, Proposal
+from gamecore.models import Company, Investment, GEvent, MenuItem, Proposal, EventComment
from django.contrib import admin
class MenuItemList(admin.ModelAdmin):
@@ -9,3 +9,4 @@ class MenuItemList(admin.ModelAdmin):
admin.site.register(GEvent)
admin.site.register(MenuItem,MenuItemList)
admin.site.register(Proposal)
+admin.site.register(EventComment)
View
BIN  stock_market_game/gamecore/admin.pyc
Binary file not shown
View
22 stock_market_game/gamecore/views.py
@@ -31,7 +31,7 @@ def proposal_view(request, prop_id):
actual_pro=Proposal.objects.get(id=int(prop_id))
menu_items=MenuItem.objects.all()
- return render_to_response('proposal.html', {'actual_pro':actual_pro, 'menu_items':menu_items})
+ return render_to_response('proposal.html', {'actual_pro':actual_pro, 'menu_items':menu_items}, context_instance=RequestContext(request))
@login_required
def buy(request, prop_id):
@@ -47,17 +47,17 @@ def buy(request, prop_id):
menu_items=MenuItem.objects.all()
if request.user.username == proposal.player_from.username:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
if proposal.shares < nshares:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
if proposal.p_type == 'sell':
if proposal.per_share > svalue:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
ucredits=UserCredit.objects.get(user=request.user)
if ucredits.current_credits < nshares*svalue:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
invest=Investment(owner=request.user,of_company=proposal.company,n_shares=nshares, initial_value=svalue)
invest.save()
@@ -79,10 +79,10 @@ def buy(request, prop_id):
elif proposal.p_type== 'buy':
if proposal.per_share < svalue:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
ucredits=UserCredit.objects.get(user=proposal.player_from)
if ucredits.current_credits < nshares*svalue:
- return render_to_response('cannot.html', {'menu_items':menu_items})
+ return render_to_response('cannot.html', {'menu_items':menu_items},context_instance=RequestContext(request))
invest=Investment(owner=proposal.player_from,of_company=proposal.company,n_shares=nshares, initial_value=svalue)
invest.save()
@@ -107,7 +107,7 @@ def buy(request, prop_id):
proposal.shares = proposal.shares - nshares;
proposal.save()
- return render_to_response('success.html', {'menu_items':menu_items})
+ return render_to_response('success.html', {'menu_items':menu_items}, context_instance=RequestContext(request))
@login_required
def wallet(request):
@@ -157,6 +157,12 @@ def eventdetails(request, event_id):
form=CommentForm()
return render_to_response('event.html',{'event_data':event_data, 'comments':comments, 'menu_items':menu_items, 'form':form}, context_instance=RequestContext(request) )
+def companypage(request, company_id):
+ institution=Company.objects.get(id=int(company_id))
+ menu_items=MenuItem.objects.all()
+ owners=Investment.objects.filter(of_company=institution)
+ return render_to_response('companyprofile.html', {'institution':institution, 'menu_items':menu_items, 'owners':owners},context_instance=RequestContext(request))
+
#Auxiliar functions
def generate_diference(todays, yesterday):
if not todays or not yesterday:
View
BIN  stock_market_game/gamecore/views.pyc
Binary file not shown
View
BIN  stock_market_game/local_settings.pyc
Binary file not shown
View
3  stock_market_game/playerinfo/admin.py
@@ -1,5 +1,6 @@
-from playerinfo.models import UserCredit, Award
+from playerinfo.models import UserCredit, Award, PrivateMessage
from django.contrib import admin
admin.site.register(UserCredit)
admin.site.register(Award)
+admin.site.register(PrivateMessage)
View
BIN  stock_market_game/playerinfo/admin.pyc
Binary file not shown
View
2  stock_market_game/settings.py
@@ -132,7 +132,7 @@
#Login URLs need to change it later
LOGIN_URL = '/login-form/'
-LOGIN_REDIRECT_URL = '/logged-in/'
+LOGIN_REDIRECT_URL = '/dashboard/'
LOGIN_ERROR_URL = '/login-error/'
#Auth Complete Urls change later too
SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete'
View
BIN  stock_market_game/settings.pyc
Binary file not shown
View
BIN  stock_market_game/static/Intro.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  stock_market_game/static/loginbutton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
173 stock_market_game/static/style.css
@@ -0,0 +1,173 @@
+/* Temporary StyleSheet for the Beta Release of the Game */
+
+
+
+/* General Text Types */
+.pageTitle{
+
+}
+
+.pageSubTitle{
+
+}
+
+.regularText{
+
+}
+
+.tableHeader{
+ font-family: sans-serif;
+ text-align: center;
+ background-color: #323232;
+ color: #FFFFFF;
+}
+
+.tableText{
+ font-family: sans-serif;
+ background-color: #C4DA2A;
+}
+
+.menu{
+ background-color: #323232;
+ border-spacing: 10px;
+ width: 100%;
+}
+
+.menuText{
+ font-size: 16px;
+ font-family: sans-serif;
+ font-weight: normal;
+ color: #FFFFFF;
+ text-align: left;
+}
+
+/*
+.menuText:hover{color:#FFFFFF;}
+
+.menuText:visited{color:#FFFFFF;}
+
+.menuText:link{color:#FFFFFF;}
+
+.menuText:active{color:#FFFFFF;}
+*/
+
+body{
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-width:0px;
+ margin-height:0px;
+}
+
+
+a:hover{
+ text-decoration:none;
+}
+
+a:visited{
+ text-decoration:none;
+ color: #FFFFFF;
+}
+
+a:active{
+ text-decoration:none;
+}
+
+a:link{
+ text-decoration:none;
+ color: #FFFFFF;
+}
+
+
+
+/* Page specifics Types */
+
+/* Login Page */
+.textMessage{
+
+}
+
+.logo{
+
+}
+
+.loginButton{
+
+}
+
+/* DashBoard */
+
+.innerTable{
+ width: 100%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+}
+
+/* Press */
+
+.pressTable{
+ width: 80%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+
+/* Profile */
+.profileTable{
+ width: 60%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+/* Wallet */
+.walletTable{
+ width: 80%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.walletValueTable{
+ width: 80%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+}
+
+/* Trade Center */
+
+.tradeTable{
+ width: 80%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+
+/* Event Details */
+
+.eventTable{
+ width: 60%;
+ border-spacing: 10px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+/* Message Pages */
+.message{
+ width: 40%;
+ border-spacing: 20px;
+ vertical-align: text-top;
+ margin-left: auto;
+ margin-right: auto;
+}
View
59 stock_market_game/templates/article_list.html
@@ -1,44 +1,21 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- {% for article in articles %}
- <p><b>{{article.atitle}}</b></p>
- <p>{{article.adate}}</p>
- <p>{{article.acontent}}</p>
- {%endfor%}
-
+ {% include "nav.html"%}
+ <table class="pressTable">
+ {% for article in articles %}
+ <tr class="tableHeader">
+ <td>
+ {{article.atitle}} - {{article.adate}}
+ </td>
+ </tr>
+ <tr class="tableText">
+ <td>
+ {{article.acontent}} <br/>
+ <a href="/press/{{article.id}}"> Comments </a>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
</body>
-</html>
+{% include "footer.html" %}
View
76 stock_market_game/templates/article_view.html
@@ -1,49 +1,33 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p><b>{{article.atitle}}</b></p>
- <p>{{article.adate}}</p>
- <p>{{article.acontent}}</p>
- {% if comments %}
- <p><b>Comments:</b>
- {%endif %}
- {% for comment in comments %}
- <p><b>{{comment.ccontent}}</b></p>
- <p>{{comment.cdate}}</p>
- <p>by {{comment.cauthor.username}}</p>
- {%endfor%}
+ {% include "nav.html"%}
+ <table class="pressTable">
+ <tr>
+ <td class ="tableHeader">
+ {{article.atitle}} - {{article.adate}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableText">
+ {{article.acontent}}
+ </td>
+ </tr>
+ {% if comments %}
+ <tr>
+ <td class="tableHeader">
+ Comments:
+ </td>
+ </tr>
+ {%endif %}
+ {% for comment in comments %}
+ <tr>
+ <td class = "tableText">
+ <a href="/profile/{{comment.cauthor.id}}">{{comment.cauthor.username}}</a> - {{comment.cdate}}<br/>
+ {{comment.ccontent}}
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
</body>
-</html>
+{% include "footer.html" %}
View
53 stock_market_game/templates/cannot.html
@@ -1,40 +1,23 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p><b>You Cannot Buy this item</b> </p>
+ {% include "nav.html"%}
+
+ <table class = "message">
+ <tr>
+ <td class = "tableText" >
+ <br/>
+ <br/>
+ For some reason you are not able to do this action.<br/>
+ Check the following reasons:<br/>
+ - Not enough credits.<br/>
+ - your own assets.<br/>
+ - selected more shares than the amount for available for trade.<br/>
+ <br/>
+ <br/>
+ </td>
+ </tr>
</body>
-</html>
+{% include "footer.html" %}
View
49 stock_market_game/templates/companyprofile.html
@@ -0,0 +1,49 @@
+{% include "header.html" %}
+<body>
+ {% include "nav.html" %}
+ <table class="profileTable">
+ <tr>
+ <td class="tableHeader">
+ {{institution.name}} Company Profile
+ </td>
+ </tr>
+ <table>
+ <table class="profileTable">
+ <tr>
+ <td class="tableHeader" width="200">
+ Website:
+ </td>
+ <td class="tableText">
+ {{institution.website}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableHeader">
+ Creation Date:
+ </td>
+ <td class="tableText">
+ {{institution.foundation}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableHeader">
+ About:
+ </td>
+ <td class="tableText">
+ {{instituition.about}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableHeader">
+ Shareholders:
+ </td>
+ <td class="tableText">
+ {% for shareolder in owners %}
+ - {{shareolder.owner.username}} has {{shareolder.n_shares}} shares <br/>
+ {% endfor %}
+ </td>
+ </tr>
+ </table>
+</body>
+
+{% include "footer.html" %}
View
100 stock_market_game/templates/dash.html
@@ -1,54 +1,52 @@
-<!--
- dash.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>DashBoard></title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p>Bem-vindo {{name}} o seu username é {{user}} e tem {{credits}} creditos</p>
- <p>Ultimos eventos no mercado:</p>
- <ul>{% for event in last_events %}
- <li><a href='/event/{{event.id}}'>{{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}</a></li>
- {% endfor %}
- </ul>
-
- <p>Suas Messagens privadas:</p>
- <ul>{% for msg in private_messages %}
- <li>{{msg.sender.username}}- {{msg.send_date}} - {{msg.content}}</li>
- {% endfor %}
- </ul>
-
- <p>Enviar nova mensagem:</p>
- <p><form action="/msgsend/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Send" /> </form></p>
-
+ {% include "nav.html"%}
+
+ <table width="100%">
+ <tr valign="top">
+ <td>
+ <table class="innerTable">
+ <tr>
+ <td class="tableHeader">
+ Private Messages
+ </td>
+ </tr>
+ {% for msg in private_messages %}
+ <tr>
+ <td class="tableText">
+ De: {{msg.sender.username}}<br/>
+ Envidado: {{msg.send_date}}<br/>
+ Mensagem: <br/>
+ {{msg.content}}
+ </td>
+ </tr>
+ {% endfor %}
+ <tr>
+ <td class="tableHeader">
+ New message:<br/>
+ <form action="/msgsend/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Send" /> </form>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table class="innerTable">
+ <tr>
+ <td class="tableHeader">
+ Last market events
+ </td>
+ </tr>
+ {% for event in last_events %}
+ <tr>
+ <td class="tableText">
+ <a href='/event/{{event.id}}'>{{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}</a>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ </td>
+ </tr>
+ </table>
</body>
-</html>
+{% include "footer.html" %}
View
121 stock_market_game/templates/event.html
@@ -1,53 +1,78 @@
-<!--
- event.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
+{%include "header.html" %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<body>
+ {% include "nav.html"%}
+ <table class= "eventTable">
+ <tr>
+ <td class = "tableHeader">
+ Event Details:
+ </td>
+ </tr>
+ </table>
+ <table class= "eventTable">
+ <tr>
+ <td class = "tableHeader" width ="200px">
+ Company:
+ </td>
+ <td class="tableText">
+ {{event_data.company.name}}
+ </td>
+ </tr>
+ <tr>
+ <td class = "tableHeader">
+ Seller:
+ </td>
+ <td class = "tableText">
+ {{event_data.player_from.username}}
+ </td>
+ </tr>
+ <tr>
+ <td class = "tableHeader">
+ Buyer:
+ </td>
+ <td class = "tableText">
+ {{event_data.player_to.username}}
+ </td>
+ </tr>
+ <tr>
+ <td class = "tableHeader">
+ Number of Shares:
+ </td>
+ <td class = "tableText">
+ {{event_data.amount_of_shares}}
+ </td>
+ </tr>
+ <tr>
+ <td class = "tableHeader">
+ Credits:
+ </td>
+ <td class = "tableText">
+ {{event_data.total_credits}}
+ </td>
+ </tr>
+ </table>
-<head>
- <title>sem título</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
+ <table class= "eventTable">
+ <tr>
+ <td class = "tableHeader">
+ Comments:
+ </td>
+ </tr>
+ {% for comment in comments %}
+ <tr>
+ <td class = "tableText">
+ <a href="/profile/{{comment.author.id}}">{{comment.author.username}}:</a> - {{comment.content}}
+ </td>
+ </tr>
+ {% endfor %}
+ <tr>
+ <td class = "tableHeader">
+ Add a Comment:<br/>
+ <form action="/event/{{event_data.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Send" /> </form>
+ </td>
+ </tr>
-<body>
- <p>{% include "nav.html"%}</p>
- <p>Event Details:</p>
- <p><b>Company:</b> {{event_data.company.name}}</p>
- <p><b>From:</b> {{event_data.player_from.username}}</p>
- <p><b>To:</b> {{event_data.player_to.username}}</p>
- <p><b>Shares:</b> {{event_data.amount_of_shares}}</p>
- <p><b>Credits::</b> {{event_data.total_credits}}</p>
-
- <p><b>Comments:</b></p>
- {% for comment in comments %}
- <p><b>{{comment.author.username}}:</b> {{comment.content}}</p>
- {% endfor %}
-
- <p><form action="/event/{{event_data.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Send" /> </form></p>
+ </table>
</body>
-</html>
-
-</html>
+{% include "footer.html" %}
View
1  stock_market_game/templates/footer.html
@@ -0,0 +1 @@
+</html>
View
9 stock_market_game/templates/header.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <title>{{Title}}</title>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
+</head>
View
57 stock_market_game/templates/home.html
@@ -1,41 +1,20 @@
-<!--
- home.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>Faça login</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>Faça login com:</p>
- {% for name, backend in backends %}
- <p><a rel="nofollow" href="{% url socialauth_begin name %}">{{ name|title }}</a></p>
- {% endfor %}
-</body>
+ <table align="center">
+ <tr>
+ <td>
+ <img src="{{STATIC_URL}}Intro.png">
+ </td>
+ </tr>
+ <tr>
+ <td align="center">
+ {% for name, backend in backends %}
+ <a rel="nofollow" href="{% url socialauth_begin name %}"><img src="{{STATIC_URL}}loginbutton.png"></a>
+ {% endfor %}
+ </td>
+ </tr>
+
-</html>
+ </table>
+</body>
+{% include "footer.html" %}
View
37 stock_market_game/templates/nav.html
@@ -1,23 +1,14 @@
-<!--
- nav.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-<p>{% for link in menu_items %} <a href="{{link.link_url}}">{{link.link_name}}</a> {% if not forloop.last %} | {%endif %} {%endfor%}</p>
+<div id='topmenu'>
+ <table class = "menu">
+ <tr>
+ <td class='menuText'>
+ {% for link in menu_items %}
+ <a href="{{link.link_url}}">{{link.link_name}}</a>&nbsp&nbsp&nbsp&nbsp
+ {%endfor%}
+ </td>
+ <td class="menuText" align="right">
+ Username: {{user}} &nbsp&nbsp Credits: {{credits}}
+ </td>
+ </tr>
+ </table>
+</div>
View
107 stock_market_game/templates/profile.html
@@ -1,52 +1,69 @@
-<!--
- dash.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
+{% include "header.html" %}
+<body>
+ {% include "nav.html"%}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <table class="profileTable">
+ <tr>
+ <td class="tableHeader">
+ {{userob.username}} Profile
+ </td>
+ </tr>
+ <table>
-<head>
- <title>DashBoard></title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
+ <table class="profileTable">
+ <tr>
+ <td class="tableHeader" width="200">
+ Name:
+ </td>
+ <td class="tableText">
+ {{userob.first_name}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableHeader">
+ Credits:
+ </td>
+ <td class="tableText">
+ {{ucredits.current_credits}}
+ </td>
+ </tr>
+ <tr>
+ <td class="tableHeader">
+ Awards:
+ </td>
+ <td class="tableText">
+ {% for badge in uawards %}<IMG SRC="{{ STATIC_URL }}{{badge.badge}}" alt="badge.title">{% endfor %}
+ </td>
+ </tr>
+ </table>
-<body>
- <p>{% include "nav.html"%}</p>
- <p>Primeiro Nome: {{userob.first_name}} <br/> Username: {{userob.username}} <br/> Créditos: {{ucredits.current_credits}}</p>
- <p>Prémios:</p>
- <p>{% for badge in uawards %}<IMG SRC="{{ STATIC_URL }}{{badge.badge}}"> incha{% endfor %}</p>
- <p>Ultimas vendas do utilizador:</p>
- <ul>{% for event in sells %}
- <li>{{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}</li>
+ <table class="profileTable">
+ <tr>
+ <td class="tableHeader">
+ Last Sells:
+ </td>
+ </tr>
+ {% for event in sells %}
+ <tr>
+ <td class= "tableText">
+ {{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}
+ </td>
+ </tr>
{% endfor %}
- </ul>
-
- <p>Ultimas compras do utilizador:</p>
- <ul>{% for event in buys %}
- <li>{{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}</li>
+
+ <tr>
+ <td class="tableHeader">
+ Last Buys:
+ </td>
+ </tr>
+ {% for event in buys %}
+ <tr>
+ <td class= "tableText">
+ {{event.player_to.username}} bought {{event.amount_of_shares}} shares of {{event.company.name}}, for {{event.total_credits}} credits from {{event.player_from.username}}
+ </td>
+ </tr>
{% endfor %}
- </ul>
+ <table>
</body>
-</html>
+{% include "footer.html" %}
View
37 stock_market_game/templates/proposal.html
@@ -1,38 +1,7 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
+{% include "header.html"%}
<body>
- <p>{% include "nav.html"%}</p>
+ {% include "nav.html"%}
<p>Proposal Details:</p>
<p><b>Seller:</b> {{actual_pro.player_from.username}}</p>
<p><b>Proposal Type:</b> {{actual_pro.p_type}}</p>
@@ -40,4 +9,4 @@
<p><b>Amount:</b> {{actual_pro.shares}}</p>
</body>
-</html>
+{% include "footer.html" %}
View
50 stock_market_game/templates/success.html
@@ -1,40 +1,20 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p><b>Trade Complete</b> </p>
+ {% include "nav.html"%}
+
+ <table class = "message">
+ <tr>
+ <td class = "tableHeader">
+ <br/>
+ <br/>
+ Trade Complete
+ <br/>
+ <br/>
+ <br/>
+ </td>
+ </tr>
</body>
-</html>
+{% include "footer.html" %}
View
87 stock_market_game/templates/trade.html
@@ -1,46 +1,47 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p>Market State</p>
- {%for comp, yest, tod, dif in values_list %}
- <p>{{comp}} - {{yest}} - {{tod}} - {{dif}}</p>
- {%endfor %}
- <p>Market proposals:</p>
- {% for prop in proposals %}
- <p>{{prop.player_from.username}} wants to {{prop.p_type}} {{prop.shares}} shares from {{prop.company.name}} - <a href="/trading/{{prop.id}}">view</a> - <a href="/buy/{{prop.id}}">Trade</a> <form action="/buy/{{prop.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Submit" /> </form></p>
- {% endfor %}
+ {% include "nav.html"%}
+ <table class="tradeTable">
+ <tr>
+ <td class = "tableHeader">
+ Market state
+ </td>
+ </tr>
+ </table>
+ <table class="tradeTable">
+ {%for comp, yest, tod, dif in values_list %}
+ <tr>
+ <td class = "tableHeader">
+ {{comp}}
+ </td>
+ <td class = "tableText">
+ {{yest}}
+ </td>
+ <td class = "tableText">
+ {{tod}}
+ </td>
+ <td class = "tableText">
+ {{dif}}
+ </td>
+ </tr>
+ {%endfor %}
+ </table>
+
+ <table class="tradeTable">
+ <tr>
+ <td class = "tableHeader">
+ Current proposals:
+ </td>
+ </tr>
+ {% for prop in proposals %}
+ <tr>
+ <td class = "tableText">
+ {{prop.player_from.username}} wants to {{prop.p_type}} {{prop.shares}} shares from {{prop.company.name}} - <a href="/trading/{{prop.id}}">view</a>
+ <form action="/buy/{{prop.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Submit" /> </form>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
</body>
-</html>
+{% include "footer.html" %}
View
98 stock_market_game/templates/wallet.html
@@ -1,48 +1,56 @@
-<!--
- sales_list.html
-
- Copyright 2011 Gonçalo Valério <dethos@dmachine>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
-
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>untitled</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 0.20" />
-</head>
-
+{% include "header.html" %}
<body>
- <p>{% include "nav.html"%}</p>
- <p>Your Assets:</p>
- {% for invest in userinvest %}
- <p>{{invest.n_shares}} of {{invest.of_company.name}} <br/>
- <form action="/addproposal/{{invest.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Sell" /> </form>
- </p>
- {% endfor %}
- <p>Your Assets recent value:</p>
- {%for comp, yest, tod, dif, init, gainloss in values_list %}
- <p>{{comp}} - {{yest}} - {{tod}} - {{dif}} - {{init}} - {{gainloss}}</p>
- {%endfor %}
+ {% include "nav.html"%}
+ <table class = "walletTable">
+ <tr>
+ <td class = "tableHeader">
+ Your Assets:
+ </td>
+ </tr>
+ {% for invest in userinvest %}
+ <tr>
+ <td class = "tableText">
+ - {{invest.n_shares}} shares of <a href="/company/{{invest.of_company.id}}"> {{invest.of_company.name}} </a>
+ <br/>
+ TEMPORARY
+ <form action="/addproposal/{{invest.id}}/" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Sell" /> </form>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+
+ <table class = "walletTable">
+ <tr>
+ <td class = "tableHeader">
+ Assets current market value:
+ </td>
+ </tr>
+ </table>
+ <table class = "walletValueTable">
+ {%for comp, yest, tod, dif, init, gainloss in values_list %}
+ <tr>
+ <td class= "tableHeader">
+ {{comp}}
+ </td>
+ <td class= "tableText">
+ {{yest}}
+ </td>
+ <td class= "tableText">
+ {{tod}}
+ </td>
+ <td class= "tableText">
+ {{dif}}
+ </td>
+ <td class= "tableText">
+ {{init}}
+ </td>
+ <td class= "tableText">
+ {{gainloss}}
+ </td>
+ </tr>
+ {%endfor %}
+ </table>
+
</body>
-</html>
+{% include "footer.html" %}
View
3  stock_market_game/urls.py
@@ -1,7 +1,7 @@
from django.conf.urls.defaults import patterns, include, url
from gamepress.views import bloglist, article_view
-from gamecore.views import trading, proposal_view, buy, wallet, addproposal, eventdetails
+from gamecore.views import trading, proposal_view, buy, wallet, addproposal, eventdetails, companypage
from playerinfo.views import home , dashboard, exit_game, profile, send
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
@@ -31,4 +31,5 @@
url(r'^profile/(?P<user_id>\d+)/$', profile, name='profile'),
url(r'^event/(?P<event_id>\d+)/$', eventdetails, name='eventdetails'),
url(r'^msgsend/$', send, name='send'),
+ url(r'^company/(?P<company_id>\d+)/$', companypage, name='companypage'),
)
View
BIN  stock_market_game/urls.pyc
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.