[gen] A page can now be visible on edit but not on view (ie, the new User page containing only fields 'password' and 'retype password'. Default User class has now 2 pages: the 2 password fields are on a separate page. Zone containing user name in the user strip has evolved.

This commit is contained in:
Gaetan Delannay 2014-10-24 15:55:45 +02:00
parent c316ab896b
commit 412d9f939f
20 changed files with 150 additions and 106 deletions

View file

@ -1,4 +1,5 @@
# ------------------------------------------------------------------------------
from appy.px import Px
from appy.fields.string import String
from appy.gen import WorkflowOwner
from appy.gen.layout import summaryPageLayouts
@ -12,6 +13,16 @@ class UserWrapper(AbstractWrapper):
specialUsers = ('system', 'anon', 'admin')
layouts = summaryPageLayouts
# Display, in the user strip, links to the User instance of the logged user.
pxUserLinks = Px('''
<td class="userStripText" align=":dright">
<a href=":user.url"><img src=":url('user')"/>
<span style="padding: 0 3px">:user.getTitle()</span></a>
<!-- Page for modifying the password -->
<a if="user.showPassword()" class="changePassword"
href=":'%s/edit?page=passwords' % user.url">:_('change_password')</a>
</td>''')
def getTitle(self, normalized=False):
'''Returns a nice name for this user, based on available information:
name/first name or title or login. If p_normalized is True, special

View file

@ -264,12 +264,7 @@ class AbstractWrapper(object):
<a href=":tool.url + '/performLogout'" title=":_('app_logout')">
<img src=":url('logout.gif')"/></a>
</td>
<td class="userStripText" var="userInfo=ztool.getUserLine()"
align=":dright">
<span>:userInfo[0]</span>
<a if="userInfo[1]"
href=":userInfo[1]"><img src=":url('edit')"/></a>
</td>
<x>:user.pxUserLinks</x>
</tr>
</table>
</td>