Skip to content

Commit

Permalink
display user avatars in generated templates where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Jul 10, 2014
1 parent 4efe5be commit 228565b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class StandardFields {
{* else just show the user name *}
{assign var='profileLink' value=$cr_uname}
{/if}
<dd class="avatar">{useravatar uid=$obj.createdUserId rating='g'}</dd>
<dd>{gt text='Created by %1$s on %2$s' tag1=$profileLink tag2=$obj.createdDate|dateformat html=true}</dd>
{/if}
{if isset($obj.updatedUserId) && $obj.updatedUserId}
Expand All @@ -94,6 +95,7 @@ class StandardFields {
{* else just show the user name *}
{assign var='profileLink' value=$lu_uname}
{/if}
<dd class="avatar">{useravatar uid=$obj.updatedUserId rating='g'}</dd>
<dd>{gt text='Updated by %1$s on %2$s' tag1=$profileLink tag2=$obj.updatedDate|dateformat html=true}</dd>
{/if}
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ class SimpleFields {
def private dispatch formField(UserField it, String groupSuffix, String idSuffix) '''
{«entity.container.application.appName.formatForDB»UserInput «groupAndId(groupSuffix, idSuffix)» mandatory=«mandatory.displayBool» readOnly=«readonly.displayBool» __title='Enter a part of the user name to search' cssClass='«IF mandatory»required«ENDIF»«IF !isLegacyApp»«IF mandatory» «ENDIF»form-control«ENDIF»'}
{if $mode ne 'create' && $«entity.name.formatForDB».«name.formatForDB» && !$inlineUsage}
<span class="«IF isLegacyApp»z-formnote«ELSE»help-block«ENDIF» avatar">
{useravatar uid=$«entity.name.formatForDB».«name.formatForDB» rating='g'}
</span>
{checkpermissionblock component='Users::' instance='::' level='ACCESS_ADMIN'}
<span class="«IF isLegacyApp»z-formnote«ELSE»help-block«ENDIF»"><a href="{modurl modname='«IF isLegacyApp»Users«ELSE»ZikulaUsersModule«ENDIF»' type='admin' func='modify' userid=$«entity.name.formatForDB».«name.formatForDB»}" title="{gt text='Switch to users administration'}">{gt text='Manage user'}</a></span>
{/checkpermissionblock}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class SimpleFields {
{if !isset($smarty.get.theme) || $smarty.get.theme ne 'Printer'}
«ENDIF»
{$«realName»|profilelinkbyuid}
<span class="avatar">{useravatar uid=$«realName» rating='g'}</span>
«IF page == 'display'»
{else}
{usergetvar name='uname' uid=$«realName»}
Expand Down

0 comments on commit 228565b

Please sign in to comment.