Changeset 21174
- Timestamp:
- 10/12/08 18:07:18 (3 months ago)
- Location:
- lang/python/saichugen/gae
- Files:
-
- 4 modified
-
app.yaml (modified) (1 diff)
-
saichugen/main/views.py (modified) (4 diffs)
-
template/game.html (modified) (1 diff)
-
template/index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/python/saichugen/gae/app.yaml
r21099 r21174 1 application: saichugen 1 application: saichugen-online 2 2 version: 1 3 3 runtime: python -
lang/python/saichugen/gae/saichugen/main/views.py
r21172 r21174 11 11 def main(req): 12 12 user = users.get_current_user() 13 if user:14 15 result = "Hello, " + user.nickname()16 else:17 result = "Welcome! You can <a href='%s'>login</a>" % users.create_login_url(req.get_full_path())18 19 13 return HttpResponse( 20 template.render("template/index.html", dict(obj=1)) + result 21 ) 14 template.render( 15 "template/index.html", 16 dict( 17 user=user, 18 login_url=users.create_login_url(req.get_full_path()), 19 logout_url=users.create_logout_url(req.get_full_path()), ))) 20 22 21 23 22 def start_single_game(req): … … 26 25 game_score = [0, 0, 0], 27 26 round_score = [0, 0, 0], 27 round_score_log = [], 28 28 winner_of_turn = [], 29 29 plays = [], … … 52 52 for card_id in sorted(info["hands"][0])] 53 53 tvalue["myhand"] = myhand 54 if game.step % 3 == 0 and game.step > 0: 55 tvalue["last_score_round"] = info["round_score_log"][-1] 56 tvalue["last_winner_of_round"] = info["winner_of_round"][-1] 54 57 55 58 # 過去の手をリアルなプレイに似せて出力 … … 158 161 info["winner_of_round"].append(winner) 159 162 addTimeLog(info, "System", "END_ROUND", game.get_round()) 163 info["round_score_log"].append(rs) 160 164 info["round_score"] = [0, 0, 0] 161 165 if game.get_round() < 5: -
lang/python/saichugen/gae/template/game.html
r21172 r21174 9 9 {% for card in last_play %} {{ card }} {% endfor %} 10 10 </p> 11 {% if last_score_round %} 12 Last round's score is {{ last_round_score }}, Player {{ last_winner_of_round }} won. 13 {% endif %} 14 11 15 {% endif %} 12 16 <hr> -
lang/python/saichugen/gae/template/index.html
r21153 r21174 2 2 <body> 3 3 <h1>最中限(Saichugen)</h1> 4 <p> 5 {% if user %} 6 Hello, {{ user.nickname }} ! 7 <p> 8 You can <a href='/start_single_game'>start new game</a> or <a href=' {{ logout_url }}'>log out</a>. 9 10 {% else %} 11 Welcome! You can <a href='{{ login_url }}'>login</a> to play new game. 12 {% endif %} 13 14 4 15 5 16 <p> 6 <a href='/start_single_game'>start new game</a> 7 8 <p> 17 <hr> 18 <div style="align: left;"> 9 19 by NISHIO Hirokazu 10 11 <hr> 12 13 {{ obj }} 20 </div>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)