<xf:title>{$user.username}</xf:title>

<div class="block">
	<div class="block-container">
		<h3 class="block-minorHeader">{{ phrase('active_user_upgrades') }}</h3>
		<div class="block-body">
			<xf:if is="$upgrades is not empty">
				<xf:datalist data-xf-init="responsive-data-list">
					<xf:datarow rowtype="header">
						<xf:cell>{{ phrase('upgrade_title') }}</xf:cell>
						<xf:cell>{{ phrase('start_date') }}</xf:cell>
						<xf:cell>{{ phrase('end_date') }}</xf:cell>
						<xf:cell></xf:cell>
						<xf:cell></xf:cell>
					</xf:datarow>
					<xf:foreach loop="$upgrades" value="$upgrade">
						<xf:datarow rowclass="dataList-row--noHover">
							<xf:cell>{$upgrade.Upgrade.title}</xf:cell>
							<xf:cell><xf:date time="{$upgrade.start_date}" /></xf:cell>
							<xf:cell>{{ $upgrade.end_date ? date($upgrade.end_date) : phrase('permanent') }}</xf:cell>
							<xf:action overlay="true" href="{{ link('user-upgrades/edit-active', null, {'user_upgrade_record_id': $upgrade.user_upgrade_record_id}) }}">{{ phrase('edit') }}</xf:action>
							<xf:action overlay="true" href="{{ link('user-upgrades/downgrade', null, {'user_upgrade_record_id': $upgrade.user_upgrade_record_id}) }}">{{ phrase('downgrade') }}</xf:action>
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			<xf:else />
				<div class="block-row">{{ phrase('none') }}</div>
			</xf:if>
		</div>

		<h3 class="block-minorHeader">{{ phrase('connected_accounts') }}</h3>
		<div class="block-body block-row">
			<xf:foreach loop="$connectedProviders" value="$provider" if="{$provider.isAssociated($user)}">
				<dl class="pairs pairs--columns pairs--fixedSmall">
					<dt>{$provider.title}</dt>
					<dd>{$provider.renderAssociated($user)|raw}</dd>
				</dl>
			<xf:else />
				{{ phrase('none') }}
			</xf:foreach>
		</div>
	</div>
</div>