<xf:macro name="serious_errors" arg-upgradeCheck="!">
	<xf:if contentcheck="true">
		<div class="blockMessage blockMessage--error blockMessage--iconic">
			{{ phrase('upgrade_check_errors_must_be_resolved', {'link': link('tools/upgrade-check')}) }}
			<ul>
			<xf:contentcheck>
				<xf:if is="$upgradeCheck.error_code">
					<li>{$upgradeCheck.error_message}</li>
				<xf:else />
					<xf:if is="!$upgradeCheck.branding_valid">
						<li>{{ phrase('default_copyright_notice_branding_has_been_removed') }}</li>
					</xf:if>
					<xf:foreach loop="$upgradeCheck.invalid_add_ons" key="$addOnId" value="$reason">
						<xf:if is="$reason == 'using_newer'">
							<li>{{ phrase('running_version_of_x_which_is_newer_than_permitted', {'title':
								{$upgradeCheck.RelevantAddOns.{$addOnId}.title}}) }}
							</li>
						<xf:elseif is="$reason == 'no_license'" />
							<li>{{ phrase('running_x_which_not_permitted', {'title':
								{$upgradeCheck.RelevantAddOns.{$addOnId}.title}}) }}
							</li>
						</xf:if>
					</xf:foreach>
				</xf:if>
			</xf:contentcheck>
			</ul>
		</div>
	</xf:if>
</xf:macro>

<xf:macro name="warnings" arg-upgradeCheck="!">
	<xf:if is="!$upgradeCheck.hasLicenseErrors()">
		<xf:if contentcheck="true">
			<div class="blockMessage blockMessage--warning blockMessage--iconic">
				{{ phrase('upgrade_check_warnings_should_be_resolved', {'link': link('tools/upgrade-check')}) }}
				<ul>
				<xf:contentcheck>
					<xf:if is="!$upgradeCheck.board_url_valid">
						<li>{{ phrase('board_url_option_not_match_license_url', {'link':
							link('options/groups/basicBoard/') . '#boardUrl'}) }}
						</li>
					</xf:if>
					<xf:if is="$upgradeCheck.license_expired">
						<li>{{ phrase('your_license_has_now_expired_explain') }}</li>
					</xf:if>
				</xf:contentcheck>
				</ul>
			</div>
		</xf:if>
	</xf:if>
</xf:macro>

<xf:macro name="updates" arg-upgradeCheck="!">
	<xf:if is="$xf.visitor.hasAdminPermission('upgradeXenForo') AND $upgradeCheck.available_updates AND !$upgradeCheck.hasLicenseErrors()">
		<xf:if contentcheck="true">
			<div class="blockMessage blockMessage--highlight blockMessage--iconic">
				<xf:contentcheck>
					<xf:if is="$upgradeCheck.hasAvailableUpdate('XF')">
						{{ phrase('xenforo_x_is_now_available', {'version': $upgradeCheck.available_updates.XF.version_string}) }}
						<div style="margin-top: .5em">
							<xf:button href="{{ link('tools/upgrade-xf') }}" class="button--link">{{ phrase('upgrade_now') }}
							</xf:button>
						</div>
					<xf:elseif is="$upgradeCheck.hasAvailableAddOnUpdate()" />
						{{ phrase('following_updates_official_add_ons_now_available') }}
						<ul class="listInline listInline--comma listInline--selfInline">
							<xf:foreach loop="$upgradeCheck.available_updates" key="$addOnId" value="$update" if="$upgradeCheck.hasAvailableUpdate($addOnId)">
								<li>{$upgradeCheck.RelevantAddOns.{$addOnId}.title} {$update.version_string}</li>
							</xf:foreach>
						</ul>
						<div style="margin-top: .5em">
							<xf:button href="{{ link('tools/upgrade-xf-add-on') }}" class="button--link">
								{{ phrase('upgrade_now') }}
							</xf:button>
						</div>
					</xf:if>
				</xf:contentcheck>
			</div>
		</xf:if>
	</xf:if>
</xf:macro>

<xf:macro name="installable_add_ons" arg-upgradeCheck="!">
	<xf:if is="$xf.visitor.hasAdminPermission('upgradeXenForo') AND $upgradeCheck.installable_add_ons AND !$upgradeCheck.hasLicenseErrors()">
		<xf:if contentcheck="true">
			<div class="blockMessage blockMessage--highlight blockMessage--iconic">
				<xf:contentcheck>
					<xf:if is="$upgradeCheck.installable_add_ons">
						{{ phrase('following_official_add_ons_now_available_to_install') }}
						<ul class="listInline listInline--comma listInline--selfInline">
							<xf:foreach loop="$upgradeCheck.installable_add_ons" key="$addOnId" value="$install">
								<li>{$install.title} {$install.version_string}</li>
							</xf:foreach>
						</ul>
						<div style="margin-top: .5em">
							<xf:button href="{{ link('tools/install-xf-add-on') }}" class="button--link">
								{{ phrase('install_now') }}
							</xf:button>
						</div>
					</xf:if>
				</xf:contentcheck>
			</div>
		</xf:if>
	</xf:if>
</xf:macro>

<xf:macro name="full_status"
	arg-upgradeCheck="!"
	arg-showSeriousErrors="{{ false }}"
	arg-showWarnings="{{ true }}"
	arg-showUpdates="{{ true }}"
	arg-showInstalls="{{ false }}"
	arg-showSuccess="{{ false }}">

	<xf:if is="$showSeriousErrors">
		<xf:macro name="serious_errors" arg-upgradeCheck="{$upgradeCheck}" />
	</xf:if>
	<xf:if is="$showWarnings">
		<xf:macro name="warnings" arg-upgradeCheck="{$upgradeCheck}" />
	</xf:if>
	<xf:if is="$showUpdates">
		<xf:macro name="updates" arg-upgradeCheck="{$upgradeCheck}" />
	</xf:if>
	<xf:if is="$showInstalls">
		<xf:macro name="installs" arg-upgradeCheck="{$upgradeCheck}" />
	</xf:if>

	<xf:if is="$showSuccess AND !$upgradeCheck.hasNotice()">
		<div class="blockMessage blockMessage--success">
			{{ phrase('version_of_xenforo_and_official_add_ons_fully_up_to_date_no_issues') }}
		</div>
	</xf:if>
</xf:macro>