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

<xf:pageaction>
	<xf:button href="{{ link('class-extensions/add') }}" icon="add">{{ phrase('add_class_extension') }}</xf:button>
</xf:pageaction>

<xf:if is="$extensions is not empty">
	<xf:form action="{{ link('class-extensions/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="extensions" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist data-xf-init="responsive-data-list" data-trigger-width="medium">
					<thead>
						<xf:datarow rowtype="header">
							<xf:cell>{{ phrase('base_class_name') }}</xf:cell>
							<xf:cell>{{ phrase('extension_class_name') }}</xf:cell>
							<xf:cell>&nbsp;</xf:cell>
							<xf:cell>&nbsp;</xf:cell>
						</xf:datarow>
					</thead>
					<xf:foreach loop="$extensions" key="$addOnId" value="$addOnExtensions">
						<tbody class="dataList-rowGroup">
							<xf:datarow rowtype="subsection" rowclass="dataList-row--noHover">
								<xf:cell colspan="4">
									<xf:if is="{{ {$addOns.{$addOnId}} }}">
										{$addOns.{$addOnId}.title}
									<xf:else />
										{{ phrase('custom_class_extensions') }}
									</xf:if>
								</xf:cell>
							</xf:datarow>
							<xf:foreach loop="$addOnExtensions" value="$extension">
								<xf:datarow>
									<xf:cell hash="{$extension.extension_id}"
										href="{{ link('class-extensions/edit', $extension) }}"
										dir="auto">
										{$extension.from_class|split_long(25)}
									</xf:cell>
									<xf:cell href="{{ link('class-extensions/edit', $extension) }}" dir="auto">
										{$extension.to_class|split_long(25)}
									</xf:cell>
									<xf:toggle name="active[{$extension.extension_id}]" selected="$extension.active"
										class="dataList-cell--separated" submit="true"
										tooltip="{{ phrase('enable_disable_x', {'title': $extension.from_class}) }}" />
									<xf:delete href="{{ link('class-extensions/delete', $extension) }}" />
								</xf:datarow>
							</xf:foreach>
						</tbody>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($totalExtensions, $total) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>