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

<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:tags', $tag) }}" />

<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 id="inline_mod_macros::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>
	<div class="block-outer block-outer--after">
		<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" />
	</div>
</div>