Skip to content

Commit

Permalink
Unify layout / appearance of sidebar item lists
Browse files Browse the repository at this point in the history
Closes #6160
  • Loading branch information
BurntimeX committed Jan 14, 2025
1 parent 2761d4f commit acc808f
Show file tree
Hide file tree
Showing 15 changed files with 294 additions and 120 deletions.
42 changes: 28 additions & 14 deletions com.woltlab.wcf/templates/boxArticleList.tpl
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
{if $boxPosition == 'sidebarLeft' || $boxPosition == 'sidebarRight'}
<ul class="sidebarItemList">
<ul class="sidebarList">
{foreach from=$boxArticleList item=boxArticle}
<li class="box24 sidebarItem">
<a href="{$boxArticle->getLink()}" aria-hidden="true" tabindex="-1">{unsafe:$boxArticle->getUserProfile()->getAvatar()->getImageTag(24)}</a>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$boxArticle->getUserProfile() type='avatar24' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarItemTitle">
<h3>{anchor object=$boxArticle class='articleLink' title=$boxArticle->getTitle()}</h3>

<small>
{if $boxSortField == 'time'}
<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{anchor object=$boxArticle class='articleLink sidebarListItem__link' title=$boxArticle->getTitle()}
</h3>
</div>

<div class="sidebarListItem__meta">
{if $boxSortField == 'time'}
<div class="sidebarListItem__meta__author">
{user object=$boxArticle->getUserProfile() tabindex='-1'}
<span class="separatorLeft">{time time=$boxArticle->time}</span>
{elseif $boxSortField == 'views'}
</div>
<div class="sidebarListItem__meta__time">
{time time=$boxArticle->time}
</div>
{elseif $boxSortField == 'views'}
<div class="sidebarListItem__meta__views">
{lang article=$boxArticle}wcf.article.articleViews{/lang}
{elseif $boxSortField == 'comments'}
</div>
{elseif $boxSortField == 'comments'}
<div class="sidebarListItem__meta__comments">
{$boxArticle->getDiscussionProvider()->getDiscussionCountPhrase()}
{elseif $boxSortField == 'cumulativeLikes'}
</div>
{elseif $boxSortField == 'cumulativeLikes'}
<div class="sidebarListItem__meta__reactions">
{if MODULE_LIKE && $__wcf->getSession()->getPermission('user.like.canViewLike') && $boxArticle->cachedReactions}
{include file='shared_topReaction' cachedReactions=$boxArticle->cachedReactions render='full'}
{/if}
{/if}
</small>
</div>
{/if}
</div>
</li>
{/foreach}
Expand Down
25 changes: 17 additions & 8 deletions com.woltlab.wcf/templates/boxFollowingsOnline.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$usersOnlineList item=userOnline}
<li class="box32">
{user object=$userOnline type='avatar32' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>{user object=$userOnline}</h3>
<small>{@$userOnline->lastActivityTime|time}</small>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$userOnline type='avatar32' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{user object=$userOnline class='sidebarListItem__link'}
</h3>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__time">
{time time=$userOnline->lastActivityTime}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>
37 changes: 23 additions & 14 deletions com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$subscriptions item=subscription}
<li>
<div class="sidebarItemTitle">
<h3>{$subscription->getTitle()}</h3>
<small>{lang}wcf.paidSubscription.formattedCost{/lang}</small>
<li class="sidebarListItem">
<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{$subscription->getTitle()}
</h3>

<div class="sidebarListItem__description">
{lang}wcf.paidSubscription.formattedCost{/lang}
</div>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__buttons">
{if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION && $__wcf->user->canPurchasePaidSubscriptions()}
<ul class="buttonList">
{foreach from=$subscription->getPurchaseButtons() item=button}
<li>{@$button}</li>
{/foreach}
</ul>
{/if}
</div>
</div>

{if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION && $__wcf->user->canPurchasePaidSubscriptions()}
<ul class="buttonList">
{foreach from=$subscription->getPurchaseButtons() item=button}
<li>{@$button}</li>
{/foreach}
</ul>
{/if}
</li>
{/foreach}
</ul>
</ol>

{if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION && $__wcf->user->canPurchasePaidSubscriptions()}
<a class="button small more" href="{link controller='PaidSubscriptionList'}{/link}">{lang}wcf.paidSubscription.button.moreInformation{/lang}</a>
Expand Down
30 changes: 20 additions & 10 deletions com.woltlab.wcf/templates/boxRecentActivitySidebar.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$eventList item=event}
<li class="box24{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID, 2)} ignoredUserContent{/if}">
{user object=$event->getUserProfile() type='avatar24' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>
{user object=$event->getUserProfile()}
<small class="separatorLeft">{@$event->time|time}</small>
<li class="sidebarListItem{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID, 2)} ignoredUserContent{/if}">
<div class="sidebarListItem__avatar">
{user object=$event->getUserProfile() type='avatar24' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{if $event->getLink()}
<a href="{$event->getLink()}" class="sidebarListItem__link">{unsafe:$event->getTitle()}</a>
{else}
{unsafe:$event->getTitle()}
{/if}
</h3>
<small>{@$event->getTitle()}</small>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__time">
{time time=$event->time}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>
33 changes: 23 additions & 10 deletions com.woltlab.wcf/templates/boxSidebarCommentList.tpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$boxCommentList item=boxComment}
<li>
<div class="sidebarItemTitle">
<h3><a href="{$boxComment->getLink()}">{$boxComment->title}</a></h3>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$boxComment->getUserProfile() type='avatar24' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarCommentContent">
<small>{@$boxComment->getExcerpt(50)}</small>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
<a href="{$boxComment->getLink()}" class="sidebarListItem__link">{$boxComment->title}</a>
</h3>

<div class="sidebarListItem__description">
{unsafe:$boxComment->getExcerpt(150)}
</div>
</div>
<div>
<small>{user object=$boxComment->getUserProfile()} <span class="separatorLeft">{@$boxComment->time|time}</span></small>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__author">
{user object=$boxComment->getUserProfile() tabindex='-1'}
</div>

<div class="sidebarListItem__meta__time">
{time time=$boxComment->time}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>
39 changes: 23 additions & 16 deletions com.woltlab.wcf/templates/boxStaffOnline.tpl
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$usersOnlineList item=userOnline}
<li class="box32">
{user object=$userOnline type='avatar32' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$userOnline type='avatar32' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{event name='beforeUsername'}
{user object=$userOnline}
{user object=$userOnline class='sidebarListItem__link'}
</h3>
{if MODULE_USER_RANK}
{if $userOnline->getUserTitle()}
<p><span class="badge userTitleBadge{if $userOnline->getRank() && $userOnline->getRank()->cssClassName} {@$userOnline->getRank()->cssClassName}{/if}">{$userOnline->getUserTitle()}</span></p>
{/if}
{if $userOnline->getRank() && $userOnline->getRank()->rankImage}
<p><span class="userRankImage">{@$userOnline->getRank()->getImage()}</span></p>
{/if}
{/if}
</div>

{if MODULE_USER_RANK}
<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__userRank">
{if $userOnline->getUserTitle()}
<p><span class="badge userTitleBadge{if $userOnline->getRank() && $userOnline->getRank()->cssClassName} {@$userOnline->getRank()->cssClassName}{/if}">{$userOnline->getUserTitle()}</span></p>
{/if}
{if $userOnline->getRank() && $userOnline->getRank()->rankImage}
<p><span class="userRankImage">{@$userOnline->getRank()->getImage()}</span></p>
{/if}
</div>
</div>
{/if}
</li>
{/foreach}
</ul>
</ol>
25 changes: 17 additions & 8 deletions com.woltlab.wcf/templates/boxTodaysBirthdays.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$birthdayUserProfiles item=birthdayUserProfile}
<li class="box32">
{user object=$birthdayUserProfile type='avatar32' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>{user object=$birthdayUserProfile}</h3>
<small>{$birthdayUserProfile->getBirthday()}</small>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$birthdayUserProfile type='avatar32' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{user object=$birthdayUserProfile class='sidebarListItem__link'}
</h3>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__birthday">
{$birthdayUserProfile->getBirthday()}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>

{if $birthdayUserProfiles|count >= 10}
<button type="button" class="jsTodaysBirthdays button small more jsOnly">{lang}wcf.global.button.showAll{/lang}</button>
Expand Down
25 changes: 17 additions & 8 deletions com.woltlab.wcf/templates/boxTodaysFollowingBirthdays.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$birthdayUserProfiles item=birthdayUserProfile}
<li class="box32">
{user object=$birthdayUserProfile type='avatar32' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>{user object=$birthdayUserProfile}</h3>
<small>{$birthdayUserProfile->getBirthday()}</small>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$birthdayUserProfile type='avatar32' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{user object=$birthdayUserProfile class='sidebarListItem__link'}
</h3>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__birthday">
{$birthdayUserProfile->getBirthday()}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>
36 changes: 26 additions & 10 deletions com.woltlab.wcf/templates/boxUserListSidebar.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$boxUsers item=boxUser}
<li class="box24">
{user object=$boxUser type='avatar24' ariaHidden='true' tabindex='-1'}

<div class="sidebarItemTitle">
<h3>{user object=$boxUser}</h3>
{capture assign='__boxUserLanguageItem'}{lang __optional=true}wcf.user.boxList.description.{$boxSortField}{/lang}{/capture}
{if $__boxUserLanguageItem}
<small>{@$__boxUserLanguageItem}</small>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{user object=$boxUser type='avatar32' ariaHidden='true' tabindex='-1'}
</div>

<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
{user object=$boxUser class='sidebarListItem__link'}
</h3>
</div>

<div class="sidebarListItem__meta">
{if $boxSortField == 'activityPoints'}
<div class="sidebarListItem__meta__points">
{lang}wcf.user.boxList.description.activityPoints{/lang}
</div>
{elseif $boxSortField == 'likesReceived'}
<div class="sidebarListItem__meta__likes">
{lang}wcf.user.boxList.description.likesReceived{/lang}
</div>
{elseif $boxSortField == 'registrationDate'}
<div class="sidebarListItem__meta__time">
{time time=$boxUser->registrationDate}
</div>
{/if}
</div>
</li>
{/foreach}
</ul>
</ol>
31 changes: 20 additions & 11 deletions com.woltlab.wcf/templates/boxUserTrophyList.tpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
{if $boxPosition == 'sidebarLeft' || $boxPosition == 'sidebarRight'}
<ul class="sidebarItemList">
<ol class="sidebarList">
{foreach from=$boxUserTrophyList item=boxUserTrophy}
<li class="box32">
<div>{@$boxUserTrophy->getTrophy()->renderTrophy(32)}</div>
<li class="sidebarListItem">
<div class="sidebarListItem__avatar">
{unsafe:$boxUserTrophy->getTrophy()->renderTrophy(32)}
</div>

<div class="sidebarItemTitle">
<h3>
<a href="{$boxUserTrophy->getTrophy()->getLink()}">{$boxUserTrophy->getTrophy()->getTitle()}</a>
<div class="sidebarListItem__content">
<h3 class="sidebarListItem__title">
<a href="{$boxUserTrophy->getTrophy()->getLink()}" class="sidebarListItem__link">
{$boxUserTrophy->getTrophy()->getTitle()}
</a>
</h3>
<small>
{user object=$boxUserTrophy->getUserProfile()}
<span class="separatorLeft">{@$boxUserTrophy->time|time}</span>
</small>
</div>

<div class="sidebarListItem__meta">
<div class="sidebarListItem__meta__author">
{user object=$boxUserTrophy->getUserProfile() tabindex='-1'}
</div>
<div class="sidebarListItem__meta__time">
{time time=$boxUserTrophy->time}
</div>
</div>
</li>
{/foreach}
</ul>
</ol>
{else}
<ol class="containerBoxList trophyCategoryList tripleColumned">
{foreach from=$boxUserTrophyList item=boxUserTrophy}
Expand Down
Loading

0 comments on commit acc808f

Please sign in to comment.