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

<xf:if is="$hasErrors">
	<div class="blockMessage blockMessage--error">
		{{ phrase('one_or_more_of_add_ons_in_this_batch_failed_to_install_upgrade') }}
	</div>
<xf:else />
	<div class="blockMessage blockMessage--success">
		{{ phrase('all_add_ons_in_this_batch_installed_upgraded_successfully') }}
	</div>
</xf:if>

<div class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:datalist data-xf-init="responsive-data-list">
				<xf:datarow rowtype="header">
					<xf:cell>{{ phrase('add_on') }}</xf:cell>
					<xf:cell>{{ phrase('action') }}</xf:cell>
					<xf:cell>{{ phrase('version') }}</xf:cell>
				</xf:datarow>
				<xf:foreach loop="$batch.results" key="$addOnId" value="$result">
					<xf:set var="$addOn" value="{{ $addOns.{$addOnId} ?: $batch.addon_ids.{$addOnId} }}" />
					<xf:datarow rowclass="dataList-row--noHover">
						<xf:cell>{{ $addOn.title ?: $addOnId }}</xf:cell>
						<xf:cell>
							<xf:if is="$result.status == 'error'">
								<span data-xf-init="tooltip" data-trigger="hover focus click" title="{$result.error}">
									<xf:fa icon="fas fa-exclamation-circle" style="color: #c84448;" />
									{{ phrase('error') }}
								</span>
							<xf:else />
								<span data-xf-init="tooltip" data-trigger="hover focus click"
									title="{{ phrase('action_completed_successfully')|for_attr }}">
									<xf:fa icon="fas fa-check-circle" style="color: #63b265;" />
									<xf:if is="$result.action == 'install'">
										{{ phrase('install') }}
									<xf:elseif is="$result.action == 'upgrade'" />
										{{ phrase('upgrade') }}
									<xf:elseif is="$result.action == 'rebuild'" />
										{{ phrase('rebuild') }}
									</xf:if>
								</span>
							</xf:if>
						</xf:cell>
						<xf:cell>
							<xf:if is="$action.action == 'upgrade'">
								{$result.old_version} -&gt; {$addOn.version_string}
							<xf:else />
								{$addOn.version_string}
							</xf:if>
						</xf:cell>
					</xf:datarow>
				</xf:foreach>
			</xf:datalist>
		</div>
		<div class="block-footer">
			<span class="block-footer-controls"><a
				href="{{ link('add-ons') }}">{{ phrase('view_all_add_ons') }}</a></span>
		</div>
	</div>
</div>