Skip to content

Commit 698f220

Browse files
authored
Merge pull request #6333 from WoltLab/6.2-user-templates-unsafe
Refactor user templates
2 parents 5efd229 + bf3dd1c commit 698f220

42 files changed

Lines changed: 192 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

com.woltlab.wcf/templates/email_notification_userFollowFollowing.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{capture assign='userContent'}
1313
<table cellpadding="0" cellspacing="0" border="0">
1414
<tr>
15-
<td><a href="{link controller='User' object=$user isHtmlEmail=true}{/link}" title="{$user->username}">{@$user->getAvatar()->getSafeImageTag($avatarSize)}</a></td>
15+
<td><a href="{link controller='User' object=$user isHtmlEmail=true}{/link}" title="{$user->username}">{unsafe:$user->getAvatar()->getSafeImageTag($avatarSize)}</a></td>
1616
<td class="boxContent">
1717
{include file='email_userInformationHeadline'}
1818
</td>

com.woltlab.wcf/templates/email_userInformationHeadline.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div>
55
{if $__wcf->getSession()->getPermission('user.profile.canViewUserProfile') && $user->isAccessible('canViewProfile')}
66
{if $user->isVisibleOption('gender') && $user->gender}{$user->getFormattedUserOption('gender')}, {/if}
7-
{if $user->isVisibleOption('birthday') && $user->getAge()}{@$user->getAge()}, {/if}
7+
{if $user->isVisibleOption('birthday') && $user->getAge()}{$user->getAge()}, {/if}
88
{if $user->isVisibleOption('location') && $user->location}{lang}wcf.user.membersList.location{/lang}, {/if}
99
{/if}
1010
{lang}wcf.user.membersList.registrationDate{/lang}

com.woltlab.wcf/templates/groupedUserReactionList.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{foreach from=$groupedUsers item=group}
22
{if $group}
33
<section class="section sectionContainerList">
4-
<h2 class="sectionTitle">{@$group}</h2>
4+
<h2 class="sectionTitle">{unsafe:$group}</h2>
55
{/if}
66

77
{if $group|count}

com.woltlab.wcf/templates/groupedUserTrophyList.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{if $userTrophyList|count}
22
<ol class="containerList jsUserTrophyList">
33
{foreach from=$userTrophyList item=userTrophy}
4-
<li data-object-id="{@$userTrophy->userTrophyID}">
4+
<li data-object-id="{$userTrophy->userTrophyID}">
55
<div class="box48">
6-
<div><a href="{link controller='Trophy' object=$userTrophy->getTrophy()}{/link}">{@$userTrophy->getTrophy()->renderTrophy(48)}</a></div>
6+
<div><a href="{link controller='Trophy' object=$userTrophy->getTrophy()}{/link}">{unsafe:$userTrophy->getTrophy()->renderTrophy(48)}</a></div>
77

88
<div class="containerHeadline">
99
<h3><a href="{link controller='Trophy' object=$userTrophy->getTrophy()}{/link}">{$userTrophy->getTrophy()->getTitle()}</a></h3>
10-
<small>{if !$userTrophy->getDescription()|empty}<span class="separatorRight">{@$userTrophy->getDescription()}</span> {/if}{@$userTrophy->time|time}</small>
10+
<small>{if !$userTrophy->getDescription()|empty}<span class="separatorRight">{unsafe:$userTrophy->getDescription()}</span> {/if}{time time=$userTrophy->time}</small>
1111
</div>
1212
</div>
1313
</li>

com.woltlab.wcf/templates/ignoredUsers.tpl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
{capture assign='contentTitleBadge'}<span class="badge">{#$items}</span>{/capture}
44

55
{capture assign='contentInteractionPagination'}
6-
{pages print=true assign=pagesLinks controller='IgnoredUsers' link="pageNo=%d"}
6+
{if $pages > 1}
7+
<woltlab-core-pagination page="{$pageNo}" count="{$pages}" url="{link controller='IgnoredUsers'}{/link}"></woltlab-core-pagination>
8+
{/if}
79
{/capture}
810

911
{include file='header' __sidebarLeftHasMenu=true}
@@ -12,7 +14,7 @@
1214
<div class="section sectionContainerList">
1315
<ol class="containerList userList jsReloadPageWhenEmpty">
1416
{foreach from=$objects item=user}
15-
<li class="jsIgnoredUser" data-object-id="{@$user->getObjectID()}">
17+
<li class="jsIgnoredUser" data-object-id="{$user->getObjectID()}">
1618
<div class="box48">
1719
{user object=$user type='avatar48' ariaHidden='true' tabindex='-1'}
1820

@@ -42,11 +44,11 @@
4244
</div>
4345

4446
<footer class="contentFooter">
45-
{hascontent}
47+
{if $pages > 1}
4648
<div class="paginationBottom">
47-
{content}{@$pagesLinks}{/content}
49+
<woltlab-core-pagination page="{$pageNo}" count="{$pages}" url="{link controller='IgnoredUsers'}{/link}"></woltlab-core-pagination>
4850
</div>
49-
{/hascontent}
51+
{/if}
5052

5153
{hascontent}
5254
<nav class="contentFooterNavigation">
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{hascontent}
22
<div id="{$option->optionName}" class="htmlContent">
33
{content}
4-
{@$value}
4+
{unsafe:$value}
55
{/content}
66
</div>
77

88
<script data-relocate="true">
9-
$(function() {
10-
$('#{$option->optionName}').parents('dl:eq(0)').addClass('wide');
11-
});
9+
const element = document.getElementById('{unsafe:$option->optionName|encodeJS}');
10+
if (element) {
11+
const dl = element.closest('dl');
12+
if (dl) {
13+
dl.classList.add('wide');
14+
}
15+
}
1216
</script>
13-
{/hascontent}
17+
{/hascontent}

com.woltlab.wcf/templates/shared_bbcode_user.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
{* user no longer exists, use plain output rather than using a broken link *}
33
{$username}{* no newline after the tag
44
*}{else}
5-
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{@$userProfile->userID}">{@$userProfile->getFormattedUsername()}</a>{* no newline after the tag
5+
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{$userProfile->userID}">{unsafe:$userProfile->getFormattedUsername()}</a>{* no newline after the tag
66
*}{/if}

com.woltlab.wcf/templates/shared_userConditions.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{/if}
1818

1919
{foreach from=$conditionObjectTypes item='condition'}
20-
{@$condition->getProcessor()->getHtml()}
20+
{unsafe:$condition->getProcessor()->getHtml()}
2121
{/foreach}
2222

2323
{if $conditionGroup != 'userOptions'}

com.woltlab.wcf/templates/shared_userFormField.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
<script data-relocate="true">
1111
require(['WoltLabSuite/Core/Ui/ItemList/User'], function(UiItemListUser) {
12-
UiItemListUser.init('{@$field->getPrefixedId()|encodeJS}', {
12+
UiItemListUser.init('{unsafe:$field->getPrefixedId()|encodeJS}', {
1313
{if $field->getMaximumMultiples() !== -1}
14-
maxItems: {@$field->getMaximumMultiples()},
14+
maxItems: {$field->getMaximumMultiples()},
1515
{/if}
1616
});
1717
});

com.woltlab.wcf/templates/shared_userOptionsCondition.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{foreach from=$optionTree item='category'}
22
<section class="section">
33
<header class="sectionHeader">
4-
<h2 class="sectionTitle">{lang}wcf.user.option.category.{@$category[object]->categoryName}{/lang}</h2>
5-
{hascontent}<p class="sectionDescription">{content}{lang __optional=true}wcf.user.option.category.{@$category[object]->categoryName}.description{/lang}{/content}</p>{/hascontent}
4+
<h2 class="sectionTitle">{lang}wcf.user.option.category.{$category[object]->categoryName}{/lang}</h2>
5+
{hascontent}<p class="sectionDescription">{content}{lang __optional=true}wcf.user.option.category.{$category[object]->categoryName}.description{/lang}{/content}</p>{/hascontent}
66
</header>
77

88
{include file='optionFieldList' options=$category[options] langPrefix='wcf.user.option.'}

0 commit comments

Comments
 (0)