Skip to content

Commit f1b7a81

Browse files
authored
Merge pull request #6271 from WoltLab/6.2-unify-box-templates
Unify box templates
2 parents 14543f8 + 7262ebb commit f1b7a81

File tree

5 files changed

+43
-44
lines changed

5 files changed

+43
-44
lines changed
Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
1-
{if $boxPosition == 'sidebarLeft' || $boxPosition == 'sidebarRight'}
2-
<ol class="sidebarList">
3-
{foreach from=$boxUserTrophyList item=boxUserTrophy}
4-
<li class="sidebarListItem">
5-
<div class="sidebarListItem__avatar">
6-
{unsafe:$boxUserTrophy->getTrophy()->renderTrophy(32)}
7-
</div>
1+
<ol class="containerBoxList trophyCategoryList tripleColumned">
2+
{foreach from=$boxUserTrophyList item=boxUserTrophy}
3+
<li class="box64">
4+
<div>{unsafe:$boxUserTrophy->getTrophy()->renderTrophy(64)}</div>
85

9-
<div class="sidebarListItem__content">
10-
<h3 class="sidebarListItem__title">
11-
<a href="{$boxUserTrophy->getTrophy()->getLink()}" class="sidebarListItem__link">
12-
{$boxUserTrophy->getTrophy()->getTitle()}
13-
</a>
14-
</h3>
15-
</div>
16-
17-
<div class="sidebarListItem__meta">
18-
<div class="sidebarListItem__meta__author">
19-
{user object=$boxUserTrophy->getUserProfile() tabindex='-1'}
20-
</div>
21-
<div class="sidebarListItem__meta__time">
22-
{time time=$boxUserTrophy->time}
23-
</div>
24-
</div>
25-
</li>
26-
{/foreach}
27-
</ol>
28-
{else}
29-
<ol class="containerBoxList trophyCategoryList tripleColumned">
30-
{foreach from=$boxUserTrophyList item=boxUserTrophy}
31-
<li class="box64">
32-
<div>{@$boxUserTrophy->getTrophy()->renderTrophy(64)}</div>
33-
34-
<div class="sidebarItemTitle">
35-
<h3><a href="{$boxUserTrophy->getTrophy()->getLink()}">{$boxUserTrophy->getTrophy()->getTitle()}</a></h3>
36-
<small>{if !$boxUserTrophy->getDescription()|empty}<p>{@$boxUserTrophy->getDescription()}</p>{/if}<p>{user object=$boxUserTrophy->getUserProfile()} <span class="separatorLeft">{@$boxUserTrophy->time|time}</span></p></small>
37-
</div>
38-
</li>
39-
{/foreach}
40-
</ol>
41-
{/if}
6+
<div class="sidebarItemTitle">
7+
<h3><a href="{$boxUserTrophy->getTrophy()->getLink()}">{$boxUserTrophy->getTrophy()->getTitle()}</a></h3>
8+
<small>{if !$boxUserTrophy->getDescription()|empty}<p>{unsafe:$boxUserTrophy->getDescription()}</p>{/if}<p>{user object=$boxUserTrophy->getUserProfile()} <span class="separatorLeft">{time time=$boxUserTrophy->time}</span></p></small>
9+
</div>
10+
</li>
11+
{/foreach}
12+
</ol>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<ol class="sidebarList">
2+
{foreach from=$boxUserTrophyList item=boxUserTrophy}
3+
<li class="sidebarListItem">
4+
<div class="sidebarListItem__avatar">
5+
{unsafe:$boxUserTrophy->getTrophy()->renderTrophy(32)}
6+
</div>
7+
8+
<div class="sidebarListItem__content">
9+
<h3 class="sidebarListItem__title">
10+
<a href="{$boxUserTrophy->getTrophy()->getLink()}" class="sidebarListItem__link">
11+
{$boxUserTrophy->getTrophy()->getTitle()}
12+
</a>
13+
</h3>
14+
</div>
15+
16+
<div class="sidebarListItem__meta">
17+
<div class="sidebarListItem__meta__author">
18+
{user object=$boxUserTrophy->getUserProfile() tabindex='-1'}
19+
</div>
20+
<div class="sidebarListItem__meta__time">
21+
{time time=$boxUserTrophy->time}
22+
</div>
23+
</div>
24+
</li>
25+
{/foreach}
26+
</ol>

wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ protected function getTemplate()
9494
return WCF::getTPL()->render('wcf', 'boxArticleList', [
9595
'boxArticleList' => $this->objectList,
9696
'boxSortField' => $this->sortField,
97-
'boxPosition' => $this->box->position,
9897
]);
9998
}
10099
}

wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ public function getTemplate()
150150

151151
UserProfileRuntimeCache::getInstance()->cacheObjectIDs(\array_unique($userIDs));
152152

153-
return WCF::getTPL()->render('wcf', 'boxUserTrophyList', [
153+
$templateName = match ($this->getBox()->position) {
154+
'sidebarLeft', 'sidebarRight' => 'boxUserTrophyListSidebar',
155+
default => 'boxUserTrophyList',
156+
};
157+
158+
return WCF::getTPL()->render('wcf', $templateName, [
154159
'boxUserTrophyList' => $this->objectList,
155-
'boxPosition' => $this->box->position,
156160
]);
157161
}
158162
}

wcfsetup/install/files/lib/system/box/WhoWasOnlineBoxController.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ protected function getTemplate()
6464
{
6565
return WCF::getTPL()->render('wcf', 'boxWhoWasOnline', [
6666
'whoWasOnlineList' => $this->users,
67-
'boxPosition' => $this->box->position,
6867
'whoWasOnlineTimeFormat' => DateUtil::TIME_FORMAT,
6968
]);
7069
}

0 commit comments

Comments
 (0)