Commits

Chris Beelby committed 72b947f

Trying to keep render logic in template, possibly eventually have multiple templates which
are included from there. Setup some CSS for a basic "personality card" which eventually
should be able to be dragged around on the screen during group setup (dropped into a
group container for group A, B, C, or D)

Comments (0)

Files changed (3)

upfront/static/css/UpFront.css

+div .pcard-russia {
+    width: 150px;
+    height: 100px;
+    border: 1px solid black;
+    background-color: #bbbbbb;
+    position: relative;
+    margin: 5px;
+}
+
+div .pcard-russia .rank {
+    position: absolute;
+    right: 0px;
+    top: 0px;
+    font-weight: bold;
+    padding: 5px;
+    color: #ff0000;
+}
+
+div .pcard-russia .morale {
+    position: absolute;
+    bottom: 0px;
+    right: 0px;
+    padding: 5px;
+}
+
+div .pcard-russia .name {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    padding: 5px;
+}
+
+div .pcard-russia .panic {
+    position: absolute;
+    bottom: 0px;
+    left: 0px;
+    padding: 5px;
+}
+
+div .pcard-russia .weapon-type {
+    position: absolute;
+    left: 0px;
+    top: 30px;
+    padding: 5px;
+}
+

upfront/templates/base.mako

 <meta name="Robots" content="index,follow" />
 
 <link rel="stylesheet" href="/css/PixelGreen.css" type="text/css" />
+<link rel="stylesheet" href="/css/UpFront.css" type="text/css" />
 
 <title>${title}</title>
  

upfront/templates/game.mako

 <%inherit file="base.mako"/>
 
-${game.render(request.user)}
+% if game.state == 'setupGroups':
+%   if request.user == game.player1 or request.user == game.player2:
+    Hello, ${request.user.name}. Setup your groups
+    <p><b>Remember:</b>
+    <ul>
+    <li>Each group must have 2-10 men</li>
+    <li>You must have 2-4 groups</li>
+    </ul>
+    </p>
+<%
+        if request.user == game.player1:
+            cards = game.player1cards
+            nation = game.player1nation
+        else:
+            cards = game.player2cards
+            nation = game.player2nation
+%>
+%       for card in cards:
+    <div class="pcard-${nation}" id='pcard-${nation[0]}${card.id}'>
+        <span class="name">${card.name}</span>
+        <span class="rank">${card.rank if card.rank else ''}</span>
+        <span class="morale">M: ${card.morale}</span>
+        <span class="panic">P: ${card.panic}</span>
+        <span class="weapon-type">${card.weapon['type']}</span>
+    </div>
+%       endfor
+%   else:
+    The player are setting up their groups
+%   endif
+% elif game.state == 'open':
+    The game is open, join if you want to play
+% endif
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.