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

<xf:pageaction>
	<form action="{{ link('tools/file-check') }}" method="post" class="u-pullRight">
		<xf:button type="submit">{{ phrase('re_run_check') }}</xf:button>
		<xf:csrf />
	</form>
</xf:pageaction>

<xf:if is="$fileCheck.check_state == 'success'">
	<div class="blockMessage blockMessage--success blockMessage--iconic">
		{{ phrase('file_health_check_okay', {'numFiles': $fileCheck.total_checked|number}) }} {{ smilie(':)') }}
	</div>
<xf:else />
	<div class="blockMessage blockMessage--error blockMessage--iconic">
		{{ phrase('check_completed_on_x_files', {'total_checked': $fileCheck.total_checked|number})|nl2br }}
	</div>

	<xf:if is="$results">
		<div class="block">
			<div class="block-container">
				<div class="block-body">
					<xf:datalist>
						<xf:foreach loop="$addOns" key="$addOnId" value="$addOn">
							<xf:if is="{$results.missing.{$addOnId}} OR {$results.inconsistent.{$addOnId}}">
								<xf:datarow rowtype="subsection" rowclass="dataList-row--noHover">
									<xf:cell>{$addOn.title}</xf:cell>
								</xf:datarow>

								<xf:foreach loop="{$results.missing.{$addOnId}}" value="$path">
									<xf:datarow rowclass="dataList-row--noHover">
										<xf:cell dir="auto">
											{$path}
											<span class="label label--primary label--smallest" title="{{ phrase('file_not_found')|for_attr }}" data-xf-init="tooltip">
												{{ phrase('missing') }}
											</span>
										</xf:cell>
									</xf:datarow>
								</xf:foreach>

								<xf:foreach loop="{$results.inconsistent.{$addOnId}}" value="$path">
									<xf:datarow rowclass="dataList-row--noHover">
										<xf:cell dir="auto">
											{$path}
											<span class="label label--primary label--smallest" title="{{ phrase('file_contents_unexpected')|for_attr }}" data-xf-init="tooltip">
												{{ phrase('unexpected_contents') }}
											</span>
										</xf:cell>
									</xf:datarow>
								</xf:foreach>
							</xf:if>
						</xf:foreach>
					</xf:datalist>
				</div>
			</div>
		</div>
	<xf:else />
		<div class="blockMessage">{{ phrase('file_check_results_file_not_found_please_rerun') }}</div>
	</xf:if>
</xf:if>