<xf:title page="{$page}">{$tag.tag}</xf:title>

<xf:breadcrumb href="{{ link('tags') }}">{{ phrase('tags') }}</xf:breadcrumb>

<xf:if is="$activeModType">
	<xf:js src="xf/inline_mod.js" min="1" />
</xf:if>

<div class="block" data-xf-init="{{ $activeModType ? 'inline-mod' : '' }}" data-type="{$activeModType}" data-href="{{ link('inline-mod') }}">
	<xf:if is="$modTypes">
		<div class="block-outer">
			<div class="block-outer-opposite">
				<div class="buttonGroup">
					<xf:if is="$activeModType">
						<xf:macro template="inline_mod_macros" name="button" />
					</xf:if>
					<div class="buttonGroup-buttonWrapper">
						<xf:button class="button--link menuTrigger" data-xf-click="menu" aria-expanded="false" aria-haspopup="true">{{ phrase('enable_moderation') }}</xf:button>
						<div class="menu" data-menu="menu" aria-hidden="true">
							<div class="menu-content">
								<h3 class="menu-header">{{ phrase('enable_moderation') }}</h3>
								<xf:foreach loop="$modTypes" key="$type" value="$text">
									<a href="{{ link('tags', $tag, {'mod': $type,  'page': $page}) }}" class="menu-linkRow {{ $activeModType == $type ? 'is-selected' : '' }}">{$text}</a>
								</xf:foreach>
								<xf:if is="$activeModType">
									<hr class="menu-separator" />
									<a href="{{ link('tags', $tag, {'page': $page}) }}" class="menu-linkRow">{{ phrase('disable') }}</a>
								</xf:if>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</xf:if>

	<div class="block-container">
		<ol class="block-body">
			<xf:foreach loop="$results" value="$result">
				{{ $result.render({'mod': $activeModType})|raw }}
			</xf:foreach>
		</ol>
	</div>
	<xf:if contentcheck="true">
		<div class="block-outer block-outer--after">
			<xf:contentcheck>
				<xf:pagenav
					page="{$page}" perpage="{$perPage}" total="{$totalResults}"
					link="tags" data="{$tag}" params="{{ {'mod': $activeModType} }}"
					wrapperclass="block-outer-main" />
				<xf:showignored wrapperclass="block-outer-opposite" />
			</xf:contentcheck>
		</div>
	</xf:if>
</div>