Skip to content

Commit 9b9c3be

Browse files
committed
Apply suggestions from code review
1 parent 56cc203 commit 9b9c3be

File tree

4 files changed

+49
-37
lines changed

4 files changed

+49
-37
lines changed

com.woltlab.wcf/templates/article.tpl

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -121,42 +121,35 @@
121121
{/if}
122122

123123
{hascontent}
124-
<ul class="entry__footerButtons buttonGroup buttonList smallButtons" role="menu">
124+
<div class="entry__footerButtons">
125125
{content}
126126
{if $__wcf->session->getPermission('user.profile.canReportContent')}
127-
<li role="presentation">
128-
<button
129-
type="button"
130-
role="menuitem"
131-
title="{lang}wcf.moderation.report.reportContent{/lang}"
132-
class="button jsTooltip"
133-
data-report-content="com.woltlab.wcf.article"
134-
data-object-id="{$articleContent->articleID}"
135-
>
136-
{icon name='triangle-exclamation'}
137-
<span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span>
138-
</button>
139-
</li>
127+
<button
128+
type="button"
129+
class="button jsTooltip"
130+
title="{lang}wcf.moderation.report.reportContent{/lang}"
131+
data-report-content="com.woltlab.wcf.article"
132+
data-object-id="{$articleContent->articleID}"
133+
>
134+
{icon name='triangle-exclamation'}
135+
</button>
140136
{/if}
141137
{if MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canLike') && $article->userID != $__wcf->user->userID}
142-
<li role="presentation">
143-
<button
144-
type="button"
145-
role="menuitem"
146-
class="button jsTooltip reactButton{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID} active{/if}"
147-
title="{lang}wcf.reactions.react{/lang}"
148-
data-reaction-type-id="{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID}{$articleLikeData[$article->articleID]->reactionTypeID}{else}0{/if}"
149-
>
150-
{icon name='face-smile'} <span class="invisible">{lang}wcf.reactions.react{/lang}</span>
151-
</button>
152-
</li>
138+
<button
139+
type="button"
140+
class="button jsTooltip reactButton{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID} active{/if}"
141+
title="{lang}wcf.reactions.react{/lang}"
142+
data-reaction-type-id="{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID}{$articleLikeData[$article->articleID]->reactionTypeID}{else}0{/if}"
143+
>
144+
{icon name='face-smile'}
145+
</button>
153146
{/if}
154147

155148
{event name='articleLikeButtons'}{* deprecated: use footerButtons instead *}
156149
{event name='articleButtons'}{* deprecated: use footerButtons instead *}
157150
{event name='footerButtons'}
158151
{/content}
159-
</ul>
152+
</div>
160153
{/hascontent}
161154
</footer>
162155
</div>

com.woltlab.wcf/templates/entryTags.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ul class="tagList">
44
{foreach from=$tags item=tag}
55
<li>
6-
<a href="{link controller='Tagged' object=$tag}objectType={$objectType}{/link}" class="tag">
6+
<a href="{link controller='Tagged' object=$tag objectType=$objectType}{/link}" class="tag">
77
{icon name='tag'}
88
{$tag->name}
99
</a>

wcfsetup/install/files/lib/system/listView/AbstractListView.class.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class AbstractListView
4242
private bool $allowFiltering = true;
4343
private bool $allowSorting = true;
4444
private bool $allowInteractions = true;
45-
private int $maxItems = 0;
45+
private int $fixedNumberOfItems = 0;
4646

4747
/**
4848
* @var array<string, string>
@@ -86,19 +86,19 @@ public function setItemsPerPage(int $itemsPerPage): void
8686
}
8787

8888
/**
89-
* Gets the maximum number of items shown.
89+
* Gets the fixed number of items shown.
9090
*/
91-
public function getMaxItems(): int
91+
public function getFixedNumberOfItems(): int
9292
{
93-
return $this->maxItems;
93+
return $this->fixedNumberOfItems;
9494
}
9595

9696
/**
9797
* Sets the maximum number of items shown.
9898
*/
99-
public function setMaxItems(int $maxItems): void
99+
public function setFixedNumberOfItems(int $fixedNumberOfItems): void
100100
{
101-
$this->maxItems = $maxItems;
101+
$this->fixedNumberOfItems = $fixedNumberOfItems;
102102
}
103103

104104
/**
@@ -199,8 +199,8 @@ public function getBaseUrl(): string
199199
protected function initObjectList(): void
200200
{
201201
$this->objectList = $this->createObjectList();
202-
$this->objectList->sqlLimit = $this->getMaxItems() ?: $this->getItemsPerPage();
203-
if (!$this->getMaxItems()) {
202+
$this->objectList->sqlLimit = $this->getFixedNumberOfItems() ?: $this->getItemsPerPage();
203+
if (!$this->getFixedNumberOfItems()) {
204204
$this->objectList->sqlOffset = ($this->getPageNo() - 1) * $this->getItemsPerPage();
205205
}
206206
if ($this->getSortField()) {
@@ -262,8 +262,8 @@ public function countItems(): int
262262
{
263263
if (!isset($this->objectCount)) {
264264
$this->objectCount = $this->getObjectList()->countObjects();
265-
if ($this->getMaxItems() && $this->getMaxItems() < $this->objectCount) {
266-
$this->objectCount = $this->getMaxItems();
265+
if ($this->getFixedNumberOfItems() && $this->getFixedNumberOfItems() < $this->objectCount) {
266+
$this->objectCount = $this->getFixedNumberOfItems();
267267
}
268268
}
269269

wcfsetup/install/files/style/ui/entry.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,28 @@
4343
}
4444

4545
.entry__footerButtons {
46+
display: flex;
47+
gap: 1px;
48+
flex-wrap: wrap;
4649
margin-inline-start: auto;
4750
}
4851

52+
.entry__footerButtons .button {
53+
padding: 6px 8px;
54+
55+
@include wcfFontSmall;
56+
}
57+
58+
.entry__footerButtons .button:not(:first-child) {
59+
border-top-left-radius: 0;
60+
border-bottom-left-radius: 0;
61+
}
62+
63+
.entry__footerButtons .button:not(:last-child) {
64+
border-top-right-radius: 0;
65+
border-bottom-right-radius: 0;
66+
}
67+
4968
.entry__aboutAuthor {
5069
display: flex;
5170
gap: 20px;

0 commit comments

Comments
 (0)