Skip to content

Commit

Permalink
Show last activity in user card
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed Dec 20, 2024
1 parent cef743b commit 7da8df3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
21 changes: 21 additions & 0 deletions com.woltlab.wcf/templates/userCard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@
{/hascontent}

{event name='afterButtons'}

{hascontent}
<div class="userCard__details">
<dl class="plain dataList">
{content}
{event name='beforeDetails'}

{if $user->canViewOnlineStatus() && $user->getLastActivityTime()}
<dt>{lang}wcf.user.usersOnline.lastActivity{/lang}</dt>
<dd>{time time=$user->getLastActivityTime()}</dd>
{if $user->getCurrentLocation()}
<dt>{lang}wcf.user.usersOnline.location{/lang}</dt>
<dd>{unsafe:$user->getCurrentLocation()}</dd>
{/if}
{/if}

{event name='afterDetails'}
{/content}
</dl>
</div>
{/hascontent}
</div>

{hascontent}
Expand Down
6 changes: 6 additions & 0 deletions wcfsetup/install/files/style/ui/userCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@
}
}

.userCard__details {
@include wcfFontSmall;
margin-top: auto;
padding-top: 5px;
}

.popoverContainer[data-identifier="com.woltlab.wcf.user"] {
--padding: 0;
--maxHeight: none;
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/lang/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5131,7 +5131,7 @@ Sobald {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} Benutzerkonto freige
<item name="wcf.user.usersOnline.invisible"><![CDATA[ (unsichtbar)]]></item>
<item name="wcf.user.usersOnline.marking.legend"><![CDATA[Legende]]></item>
<item name="wcf.user.usersOnline.guests"><![CDATA[Gäste]]></item>
<item name="wcf.user.usersOnline.location"><![CDATA[Ort]]></item>
<item name="wcf.user.usersOnline.location"><![CDATA[Aufenthaltsort]]></item>
<item name="wcf.user.usersOnline.ipAddress"><![CDATA[IP-Adresse]]></item>
<item name="wcf.user.usersOnline.userAgent"><![CDATA[Browser]]></item>
<item name="wcf.user.usersOnline.lastActivity"><![CDATA[Letzte Aktivität]]></item>
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/lang/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5130,7 +5130,7 @@ You also received a list of backup codes to use when your second factor becomes
<item name="wcf.user.usersOnline.invisible"><![CDATA[ (invisible)]]></item>
<item name="wcf.user.usersOnline.marking.legend"><![CDATA[Legend]]></item>
<item name="wcf.user.usersOnline.guests"><![CDATA[Guests]]></item>
<item name="wcf.user.usersOnline.location"><![CDATA[Location]]></item>
<item name="wcf.user.usersOnline.location"><![CDATA[Page Viewing]]></item>
<item name="wcf.user.usersOnline.ipAddress"><![CDATA[IP Address]]></item>
<item name="wcf.user.usersOnline.userAgent"><![CDATA[Browser]]></item>
<item name="wcf.user.usersOnline.lastActivity"><![CDATA[Last Activity]]></item>
Expand Down

0 comments on commit 7da8df3

Please sign in to comment.