[Assorted-commits] SF.net SVN: assorted:[1430] pitch-in/trunk/src/pitchin
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-05-25 17:28:38
|
Revision: 1430 http://assorted.svn.sourceforge.net/assorted/?rev=1430&view=rev Author: yangzhang Date: 2009-05-25 17:28:28 +0000 (Mon, 25 May 2009) Log Message: ----------- refactored templates/views; tweaked design Modified Paths: -------------- pitch-in/trunk/src/pitchin/pitchin/templates/created.html pitch-in/trunk/src/pitchin/pitchin/templates/main.html pitch-in/trunk/src/pitchin/pitchin/templates/pool.html pitch-in/trunk/src/pitchin/pitchin/views.py pitch-in/trunk/src/pitchin/static/default.css Added Paths: ----------- pitch-in/trunk/src/pitchin/pitchin/templates/base.html Added: pitch-in/trunk/src/pitchin/pitchin/templates/base.html =================================================================== --- pitch-in/trunk/src/pitchin/pitchin/templates/base.html (rev 0) +++ pitch-in/trunk/src/pitchin/pitchin/templates/base.html 2009-05-25 17:28:28 UTC (rev 1430) @@ -0,0 +1,19 @@ +<html> + <head> + <title>{% block title %}PitchIn{% endblock %}</title> + <link rel="stylesheet" type="text/css" href="static/default.css"/> + </head> + <body> + <div class="box"> + <div class="boxtop"><div></div></div> + <div class="header"> + <img src="static/pitchin.png"/> + </div> + <div class="body"> + {% block body %}{% endblock %} + <small>PitchIn © 2009 <a href="http://www.mit.edu/~y_z/">Yang Zhang</a></small> + </div> + <div class="boxbottom"><div></div></div> + </div> + </body> +</html> Modified: pitch-in/trunk/src/pitchin/pitchin/templates/created.html =================================================================== --- pitch-in/trunk/src/pitchin/pitchin/templates/created.html 2009-05-25 17:20:56 UTC (rev 1429) +++ pitch-in/trunk/src/pitchin/pitchin/templates/created.html 2009-05-25 17:28:28 UTC (rev 1430) @@ -1,25 +1,11 @@ -<html> - <head> - <title>PitchIn - Pool Successfully Created</title> - <link rel="stylesheet" type="text/css" href="static/default.css"/> - </head> - <body> - <div class="box"> - <div class="boxtop"><div></div></div> - <div class="header"> - <img src="static/pitchin.png"/> - </div> - <div class="body"> - <p> - Congrats! You've successfully created a new money pool. - Send this URL out to anyone you're inviting to - participate: - </p> - <p> - <a href="/pool?key={{key}}">http://pitch-in.appspot.com/pool?key={{key}}</a> - </p> - </div> - <div class="boxbottom"><div></div></div> - </div> - </body> -</html> +{% extends 'base.html' %} +{% block body %} + <p> + Congrats! You've successfully created a new money pool. + Send this URL out to anyone you're inviting to + participate: + </p> + <p> + <a href="/pool?key={{key|urlencode}}">http://pitch-in.appspot.com/pool?key={{key|urlencode}}</a> + </p> +{% endblock %} Modified: pitch-in/trunk/src/pitchin/pitchin/templates/main.html =================================================================== --- pitch-in/trunk/src/pitchin/pitchin/templates/main.html 2009-05-25 17:20:56 UTC (rev 1429) +++ pitch-in/trunk/src/pitchin/pitchin/templates/main.html 2009-05-25 17:28:28 UTC (rev 1430) @@ -1,35 +1,21 @@ -<html> - <head> - <title>PitchIn!</title> - <link rel="stylesheet" type="text/css" href="static/default.css"/> - </head> - <body> - <div class="box"> - <div class="boxtop"><div></div></div> - <div class="header"> - <img src="static/pitchin.png"/> - </div> - <div class="body"> - <p class="line">Easily create and manage a money pool that others can contribute to.</p> - <p> - To create a pool, just enter a description of what it's for here, and you - will be provided a URL that you can distribute to the people you want to - participate in the pool. - </p> - <p class="error">{{error}}</p> - <form action="/create" method="post"> - <div> - <input class="text-input" type="text" name="descrip"/> - <input type="submit" width="50" value="Create Pool"> - </div> - </form> - <div class="example"> - <p style="font-size: larger; font-weight: bold">Example descriptions:</p> - <p>“Birthday gift for Amy (we're aiming for $180 Rock Band set)”</p> - <p>“Holiday vacation trip”</p> - </div> - </div> - <div class="boxbottom"><div></div></div> +{% extends 'base.html' %} +{% block body %} + <p class="line">Easily create and manage a money pool that others can contribute to.</p> + <p> + To create a pool, just enter a description of what it's for here, and you + will be provided a URL that you can distribute to the people you want to + participate in the pool. + </p> + <p class="error">{{error}}</p> + <form action="/create" method="post"> + <div> + <input class="text-input" type="text" name="descrip"/> + <input type="submit" width="50" value="Create Pool"> </div> - </body> -</html> + </form> + <div class="example"> + <p style="font-size: larger; font-weight: bold">Example descriptions:</p> + <p>“Birthday gift for Amy (we're aiming for $180 Rock Band set)”</p> + <p>“Holiday vacation trip”</p> + </div> +{% endblock %} Modified: pitch-in/trunk/src/pitchin/pitchin/templates/pool.html =================================================================== --- pitch-in/trunk/src/pitchin/pitchin/templates/pool.html 2009-05-25 17:20:56 UTC (rev 1429) +++ pitch-in/trunk/src/pitchin/pitchin/templates/pool.html 2009-05-25 17:28:28 UTC (rev 1430) @@ -1,36 +1,27 @@ -<html> - <head> - <title>PitchIn!</title> - <link rel="stylesheet" type="text/css" href="static/default.css"/> - </head> - <body> - <div class="box"> - <div class="boxtop"><div></div></div> - <div class="header"> - <img src="static/pitchin.png"/> - </div> - <div class="body"> - <p style="font-size: larger"><span style="font-weight: bold">Pool:</span> {{descrip}}</p> - {{contribs}} - <p> - To add or update your own contribution to the pool, enter - the following information. - </p> - <form action="/pool" method="post"> - <p class="error">{{error}}</p> - <input type="hidden" name="key" value="{{key}}"/> - <div> - <label name="name">Name:</label> - <input type="text" name="name"/> - </div> - <div> - <label name="amount">Contribution:</label> - <input type="text" name="amount"/> - </div> - <div><input type="submit" value="Enter the pool!"/></div> - </form> - </div> - <div class="boxbottom"><div></div></div> +{% extends 'base.html' %} +{% block body %} + <p style="font-size: larger"><span style="font-weight: bold">Pool:</span> {{descrip|escape}}</p> + {% for contrib in contribs %} + <div class="row{% cycle 0,1 %}">{{contrib.0|escape}}: {{contrib.1|escape}}</div> + {% endfor %} + {% for contrib in aggcontribs %} + <div class="aggrow">{{contrib.0|escape}}: {{contrib.1|escape}}</div> + {% endfor %} + <p> + To add or update your own contribution to the pool, enter + the following information. + </p> + <form action="/pool" method="post"> + <p class="error">{{error}}</p> + <input type="hidden" name="key" value="{{key|urlencode}}"/> + <div> + <label name="name">Name:</label> + <input type="text" name="name"/> </div> - </body> -</html> + <div> + <label name="amount">Contribution:</label> + <input type="text" name="amount"/> + </div> + <div><input type="submit" value="Enter the pool!"/></div> + </form> +{% endblock %} Modified: pitch-in/trunk/src/pitchin/pitchin/views.py =================================================================== --- pitch-in/trunk/src/pitchin/pitchin/views.py 2009-05-25 17:20:56 UTC (rev 1429) +++ pitch-in/trunk/src/pitchin/pitchin/views.py 2009-05-25 17:28:28 UTC (rev 1430) @@ -13,6 +13,8 @@ if len(contribs) == 0: return '<p style="font-style: italic;">(no participants yet)</p>' else: + return contribs.items() , [('Max total', sum(contribs.itervalues())), + ('If everyone paid the minimum', len(contribs) * min(contribs.itervalues()))] s = '<div class="rows">' for i, (name, amount) in enumerate(contribs.iteritems()): s += '<div class="row%d">%s: %d</div>' % (i % 2, cgi.escape(name), amount) @@ -45,8 +47,9 @@ pool = getPool(request) return render_to_response('pool.html', dict(error = error, - descrip = cgi.escape(pool.descrip), - contribs = showContribs(pool), + descrip = pool.descrip, + contribs = showContribs(pool)[0], + aggcontribs = showContribs(pool)[1], key = request.REQUEST['key'])) def update(request): Modified: pitch-in/trunk/src/pitchin/static/default.css =================================================================== --- pitch-in/trunk/src/pitchin/static/default.css 2009-05-25 17:20:56 UTC (rev 1429) +++ pitch-in/trunk/src/pitchin/static/default.css 2009-05-25 17:28:28 UTC (rev 1430) @@ -28,4 +28,4 @@ .row0, .row1, .aggrow { padding-top: 3px; padding-bottom: 3px; } .row0 { background-color: #dddddd; } .row1 { background-color: #eeeeee; } -.aggrow { color: white; background-color: black; font-weight: bold; } +.aggrow { font-weight: bold; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |