<xf:title>{{ phrase('bb_code_media_sites') }}</xf:title>

<xf:pageaction>
	<xf:button href="{{ link('bb-code-media-sites/add') }}" icon="add">{{ phrase('add_bb_code_media_site') }}</xf:button>
</xf:pageaction>

<xf:if is="$sites is not empty">
	<xf:form action="{{ link('bb-code-media-sites/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro id="filter_macros::quick_filter" arg-key="help-pages" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$sites" value="$site">
						<xf:datarow>
							<xf:main hash="{$site.media_site_id}"
								href="{{ link('bb-code-media-sites/edit', $site) }}" label="{$site.site_title}"
								hint="{$site.site_url}" />
							<xf:toggle name="active[{$site.media_site_id}]" selected="$site.active"
								class="dataList-cell--separated" submit="true"
								tooltip="{{ phrase('enable_disable_x', {'title': $site.site_title}) }}" />
							<xf:if is="{$site.site_url}">
								<xf:action href="{$site.site_url}">{{ phrase('visit_site') }}</xf:action>
							<xf:else />
								<xf:cell class="dataList-cell--alt">&nbsp;</xf:cell>
							</xf:if>
							<xf:delete href="{{ link('bb-code-media-sites/delete', $site) }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($sites) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>