Web (Storycraft): show a bar indicating the progress of the detailed game
This commit is contained in:
		
							parent
							
								
									576cea4c0a
								
							
						
					
					
						commit
						d2a6267d95
					
				@ -112,6 +112,19 @@ body {
 | 
				
			|||||||
    text-decoration: none;
 | 
					    text-decoration: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.gameitem .progressblock {
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    margin: 10px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.progressbar .yui-pb {
 | 
				
			||||||
 | 
					    height: 10px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.progressbar .yui-pb-bar {
 | 
				
			||||||
 | 
					    background-color: #811610;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.storyblock {
 | 
					.storyblock {
 | 
				
			||||||
    border: 1px solid #e0e0e0;
 | 
					    border: 1px solid #e0e0e0;
 | 
				
			||||||
    margin: 0px 10px;
 | 
					    margin: 0px 10px;
 | 
				
			||||||
 | 
				
			|||||||
@ -20,9 +20,6 @@ def game_index(request, game_id):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    game = get_object_or_404(StorycraftGame, pk=game_id)
 | 
					    game = get_object_or_404(StorycraftGame, pk=game_id)
 | 
				
			||||||
    players = StorycraftPlayer.objects.filter(game=game.id)
 | 
					    players = StorycraftPlayer.objects.filter(game=game.id)
 | 
				
			||||||
    lines = []
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if game.is_completed():
 | 
					 | 
				
			||||||
    lines = StorycraftLine.objects.filter(game=game.id)
 | 
					    lines = StorycraftLine.objects.filter(game=game.id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render_to_response('storycraft/game_index.html', {'game': game, 'players': players, 'lines': lines}, context_instance=RequestContext(request))
 | 
					    return render_to_response('storycraft/game_index.html', {'game': game, 'players': players, 'lines': lines}, context_instance=RequestContext(request))
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,17 @@
 | 
				
			|||||||
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 | 
					    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 | 
				
			||||||
    <title>dr.botzo — Storycraft</title>
 | 
					    <title>dr.botzo — Storycraft</title>
 | 
				
			||||||
    <link rel="stylesheet" href="/static/storycraft/page.css" type="text/css" />
 | 
					    <link rel="stylesheet" href="/static/storycraft/page.css" type="text/css" />
 | 
				
			||||||
 | 
					    <!-- Required CSS -->
 | 
				
			||||||
 | 
					    <link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/2.8.2r1/build/progressbar/assets/skins/sam/progressbar.css">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- Dependency source file -->
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js" ></script>
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js" ></script>
 | 
				
			||||||
 | 
					    <!-- Optional dependency source file -->
 | 
				
			||||||
 | 
					    <script src="http://yui.yahooapis.com/2.8.2r1/build/animation/animation-min.js" type="text/javascript"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- ProgressBar source file -->
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/progressbar/progressbar-min.js" ></script>
 | 
				
			||||||
  </head>
 | 
					  </head>
 | 
				
			||||||
  <body>
 | 
					  <body>
 | 
				
			||||||
    {% if messages %}
 | 
					    {% if messages %}
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,17 @@
 | 
				
			|||||||
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 | 
					    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 | 
				
			||||||
    <title>dr.botzo — Storycraft</title>
 | 
					    <title>dr.botzo — Storycraft</title>
 | 
				
			||||||
    <link rel="stylesheet" href="/static/storycraft/page.css" type="text/css" />
 | 
					    <link rel="stylesheet" href="/static/storycraft/page.css" type="text/css" />
 | 
				
			||||||
 | 
					    <!-- Required CSS -->
 | 
				
			||||||
 | 
					    <link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/2.8.2r1/build/progressbar/assets/skins/sam/progressbar.css">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- Dependency source file -->
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js" ></script>
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js" ></script>
 | 
				
			||||||
 | 
					    <!-- Optional dependency source file -->
 | 
				
			||||||
 | 
					    <script src="http://yui.yahooapis.com/2.8.2r1/build/animation/animation-min.js" type="text/javascript"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- ProgressBar source file -->
 | 
				
			||||||
 | 
					    <script src = "http://yui.yahooapis.com/2.8.2r1/build/progressbar/progressbar-min.js" ></script>
 | 
				
			||||||
  </head>
 | 
					  </head>
 | 
				
			||||||
  <body>
 | 
					  <body>
 | 
				
			||||||
    {% if messages %}
 | 
					    {% if messages %}
 | 
				
			||||||
 | 
				
			|||||||
@ -11,6 +11,12 @@
 | 
				
			|||||||
          {% endfor %}
 | 
					          {% endfor %}
 | 
				
			||||||
        </ul>
 | 
					        </ul>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
 | 
					        {% if lines %}
 | 
				
			||||||
 | 
					        <div class="progressblock" id="progressblock{{game.id}}">
 | 
				
			||||||
 | 
					          <div class="progressbar" id="progressbar{{game.id}}"></div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <script>var pb = new YAHOO.widget.ProgressBar().render('progressbar{{game.id}}'); var space = YAHOO.util.Dom.getRegion('progressblock{{game.id}}'); pb.set('width', space.width-35); pb.set('minValue', 0); pb.set('maxValue', {{ game.game_length }}); pb.set('value', 0); if (0) { pb.set('anim', true); var anim = pb.get('anim'); anim.duration = 2; } pb.set('value', {{ lines|length }});</script>
 | 
				
			||||||
 | 
					        {% endif %}
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!--
 | 
					<!--
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user