[gen] Added boolean param Config.userLink allowing to show/hide (show by default) the link, in the user strip, to go to the user page.

This commit is contained in:
Gaetan Delannay 2014-11-13 15:02:33 +01:00
parent 55c36a1123
commit f3849d4f92
12 changed files with 16 additions and 47 deletions

View file

@ -31,7 +31,8 @@ class Action(Field):
label=_(field.labelId);
descr=field.descrId and _(field.descrId) or None;
buttonWidth=ztool.getButtonWidth(label)"
id=":formId" action=":ztool.absolute_url() + '/do'">
id=":formId" action=":ztool.absolute_url() + '/do'"
style="display:inline">
<input type="hidden" name="action" value="ExecuteAction"/>
<input type="hidden" name="objectUid" value=":zobj.id"/>
<input type="hidden" name="fieldName" value=":name"/>

View file

@ -67,6 +67,8 @@ class Config:
# the browser-defined language will be used for choosing the language
# of returned pages.
languageSelector = False
# Show the link to the user profile in the user strip
userLink = True
# People having one of these roles will be able to create instances
# of classes defined in your application.
defaultCreators = ['Manager']

View file

@ -379,10 +379,6 @@ msgstr ""
msgid "app_home"
msgstr ""
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr ""

View file

@ -379,10 +379,6 @@ msgstr "كلمة السر"
msgid "app_home"
msgstr ""
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr ""

View file

@ -379,10 +379,6 @@ msgstr "Passwort"
msgid "app_home"
msgstr ""
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr "Dieses Login ist reserviert"

View file

@ -380,10 +380,6 @@ msgstr "Password"
msgid "app_home"
msgstr "Home"
#. Default: "Change password"
msgid "change_password"
msgstr "Change password"
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr "This login is reserved."

View file

@ -379,10 +379,6 @@ msgstr "Contraseña"
msgid "app_home"
msgstr "volver a mi página principal"
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr "Este login está reservado."

View file

@ -380,10 +380,6 @@ msgstr "Mot de passe"
msgid "app_home"
msgstr "Revenir à ma page principale"
#. Default: "Change password"
msgid "change_password"
msgstr "Changer le mot de passe"
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr "Ce login est réservé."

View file

@ -379,10 +379,6 @@ msgstr "Password"
msgid "app_home"
msgstr "Ritorno alla pagina di partenza"
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr ""

View file

@ -379,10 +379,6 @@ msgstr "Wachtwoord"
msgid "app_home"
msgstr "Keer terug naar de hoofdpagina"
#. Default: "Change password"
msgid "change_password"
msgstr ""
#. Default: "This login is reserved."
msgid "login_reserved"
msgstr "Dit login is voorbehouden"

View file

@ -14,13 +14,10 @@ class UserWrapper(AbstractWrapper):
layouts = summaryPageLayouts
# Display, in the user strip, links to the User instance of the logged user.
pxUserLinks = Px('''
pxUserLink = 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 isSpecial(self): return self.login in self.specialUsers

View file

@ -264,7 +264,7 @@ class AbstractWrapper(object):
<a href=":tool.url + '/performLogout'" title=":_('app_logout')">
<img src=":url('logout.gif')"/></a>
</td>
<x>:user.pxUserLinks</x>
<x if="cfg.userLink">:user.pxUserLink</x>
</tr>
</table>
</td>
@ -450,7 +450,7 @@ class AbstractWrapper(object):
# Shows the range of buttons (next, previous, save,...) and the workflow
# transitions for a given object.
pxButtons = Px('''
<div class="objectButtons" style=":'float: %s' % dleft"
<div class="objectButtons"
var="previousPage=phaseObj.getPreviousPage(page)[0];
nextPage=phaseObj.getNextPage(page)[0];
isEdit=layoutType == 'edit';
@ -543,14 +543,15 @@ class AbstractWrapper(object):
<x var="targetObj=zobj; buttonsMode='normal'"
if="mayAct and \
targetObj.showTransitions(layoutType)">:obj.pxTransitions</x>
</div>
<!-- Fields (actions) defined with layout "buttons" -->
<x if="layoutType != 'edit'">
<div class="objectButtons" style=":'float: %s' % dleft"
var="fields=zobj.getAppyTypes('buttons', page, type='Action');
layoutType='view'" if="fields">
<x for="field in fields">:field.pxRender</x></div>
</x>''')
<x if="layoutType != 'edit'"
var2="fields=zobj.getAppyTypes('buttons', page, type='Action');
layoutType='view'">
<!-- Call pxView and not pxRender to avoid having a table -->
<x for="field in fields" var2="name=field.name">:field.pxView</x>
</x>
</div>''')
# Displays the fields of a given page for a given object.
pxFields = Px('''