Jump to content

Missing badges in topicFeed template


Gabriel Torres
 Share

Recommended Posts

forums > front > widgets > topicFeed

My suggestion is to improve this template to add some missing topic status badges, such as:

  • Topic is locked
  • Topic has moderation enabled
  • Topic has poll

The default list in this template:

{{if $topic->mapped('featured') || $topic->hidden() === -1 || $topic->hidden() === 1 || $topic->isSolved()}}
	{{if $topic->hidden() === -1}}
		<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
	{{elseif $topic->hidden() === 1}}
		<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
	{{endif}}
	{{if $topic->mapped('featured')}}
		<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
	{{endif}}
	{{if $topic->isSolved()}}
		<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="this_is_solved"}'><i class='fa fa-check'></i></span></span>
	{{endif}}
{{endif}}

My suggestion:

{{if $topic->locked()}}
	<span><i class='ipsType_medium fa fa-lock' data-ipsTooltip title='{lang="topic_locked"}'></i></span>
{{endif}}
{{if $topic->hidden() === -1}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning ipsBadge_small" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
{{elseif $topic->hidden() === -2}}
	<span><span class="ipsbadge ipsBadge_icon ipsBadge_warning ipsBadge_small" data-ipsTooltip title='{$topic->deletedBlurb()}'><i class='fa fa-trash'></i></span></span>
{{elseif $topic->hidden() === 1}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning ipsBadge_small" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
{{elseif $topic->canToggleItemModeration() and $topic->itemModerationEnabled()}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning ipsBadge_small" data-ipsTooltip title='{lang="topic_moderation_enabled"}'><i class='fa fa-user-times'></i></span></span>
{{endif}}
{{if $topic->mapped('pinned')}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive ipsBadge_small" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span>
{{endif}}
{{if $topic->mapped('featured')}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive ipsBadge_small" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
{{endif}}
{{if $topic->mapped('poll')}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_neutral ipsBadge_small" data-ipsTooltip title='{lang="topic_has_poll"}'><i class='fa fa-question'></i></span></span>
{{endif}}
{{if $topic->isSolved()}}
	<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive ipsBadge_small" data-ipsTooltip title='{lang="this_is_solved"}'><i class='fa fa-check'></i></span></span>
{{endif}}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...