[Checkins] SVN: grokapps/PlainLoginDemo/src/plainlogindemo/
simplified index view
Luciano Ramalho
luciano at ramalho.org
Mon Jan 14 19:34:49 EST 2008
Log message for revision 82879:
simplified index view
Changed:
U grokapps/PlainLoginDemo/src/plainlogindemo/app.py
U grokapps/PlainLoginDemo/src/plainlogindemo/app_templates/index.pt
U grokapps/PlainLoginDemo/src/plainlogindemo/ftests/join.txt
-=-
Modified: grokapps/PlainLoginDemo/src/plainlogindemo/app.py
===================================================================
--- grokapps/PlainLoginDemo/src/plainlogindemo/app.py 2008-01-14 23:54:29 UTC (rev 82878)
+++ grokapps/PlainLoginDemo/src/plainlogindemo/app.py 2008-01-15 00:34:48 UTC (rev 82879)
@@ -69,16 +69,10 @@
The main page, showing user data and member count.
"""
- def members(self):
+ def member_count(self):
# get the authentication utility
pau = getUtility(IAuthentication)
- result = len(pau['principals'])
- if result == 0:
- return _(u'No one has')
- elif result == 1:
- return _(u'One member has')
- else:
- return unicode(result) + _(u' members have')
+ return len(pau['principals'])
class Login(Master):
Modified: grokapps/PlainLoginDemo/src/plainlogindemo/app_templates/index.pt
===================================================================
--- grokapps/PlainLoginDemo/src/plainlogindemo/app_templates/index.pt 2008-01-14 23:54:29 UTC (rev 82878)
+++ grokapps/PlainLoginDemo/src/plainlogindemo/app_templates/index.pt 2008-01-15 00:34:48 UTC (rev 82879)
@@ -31,7 +31,7 @@
<td valign="top">
<h2>Membership</h2>
- <h3><span tal:replace="view/members" /> joined so far.</h3>
+ <h3>Member accounts: <span tal:replace="view/member_count" /></h3>
<p><a href="listing">View member listing</a> (requires login)</p>
Modified: grokapps/PlainLoginDemo/src/plainlogindemo/ftests/join.txt
===================================================================
--- grokapps/PlainLoginDemo/src/plainlogindemo/ftests/join.txt 2008-01-14 23:54:29 UTC (rev 82878)
+++ grokapps/PlainLoginDemo/src/plainlogindemo/ftests/join.txt 2008-01-15 00:34:48 UTC (rev 82879)
@@ -12,7 +12,7 @@
Initially, there are no accounts::
- >>> 'No one has joined so far.' in browser.contents
+ >>> 'Member accounts: 0' in browser.contents
True
Now we use the join form to create an account::
@@ -47,7 +47,7 @@
The main page now records the fact that there is an account now::
- >>> 'One member has joined so far.' in browser.contents
+ >>> 'Member accounts: 1' in browser.contents
True
In order to see the member listing, we must login again. If we click the
More information about the Checkins
mailing list