<xf:macro id="expanded" arg-phrase="!" arg-language="!">
	<xf:js src="xf/translation.js" min="1" />
	<xf:css src="phrase_translate.less" />

	<xf:form action="{{ link('phrases/translate', $phrase) }}" ajax="true" data-xf-init="translate-submit" class="block block--phrase {{ ($phrase.language_id == 0 ? '' : ($phrase.language_id == $language.language_id ? 'block--phrase--custom' : 'block--phrase--parentCustom')) }}">
		<div class="block-container">
			<div class="block-body">
				<xf:textboxrow name="title" rowtype="fullWidth" value="{$phrase.title}"
					label="{{ phrase('title') }}" />

				<xf:formrow rowtype="fullWidth noLabel">
					<ul class="listPlain inputGroup-container">
						<li>
							<div class="inputGroup">
								<span class="inputGroup-label">{{ phrase('phrase_text') }}</span>
								<span class="inputGroup-splitter"></span>
								<span class="inputGroup-label">{{ phrase('master_value') }}</span>
							</div>
						</li>
						<li>
							<div class="inputGroup">
								<xf:textarea name="phrase_text" rows="2" autosize="true" dir="{$language.text_direction}" class="input--fitHeight--short" value="{$phrase.phrase_text}" />
								<span class="inputGroup-splitter"></span>
								<xf:textarea rows="2" autosize="true" readonly="true" dir="{$language.text_direction}" tabindex="-1" class="input--fitHeight--short" value="{{ $phrase.language_id == 0 ? $phrase.phrase_text : $phrase.Master.phrase_text }}" />
							</div>
						</li>
					</ul>
				</xf:formrow>
			</div>
			<xf:submitrow icon="save" rowtype="simple"><xf:html>
				<xf:button type="submit" name="skip">{{ phrase('skip') }}</xf:button>
				<xf:if is="$language.language_id AND $phrase.isUpdate() AND $phrase.language_id == $language.language_id">
					<xf:button type="submit" name="revert">{{ phrase('revert') }}</xf:button>
				</xf:if>
			</xf:html></xf:submitrow>
		</div>
		<xf:hiddenval name="language_id">{$language.language_id}</xf:hiddenval>
		<xf:hiddenval name="addon_id">{$phrase.addon_id}</xf:hiddenval>
		<xf:hiddenval name="global_cache">{$phrase.global_cache}</xf:hiddenval>
	</xf:form>
</xf:macro>

<xf:macro id="collapsed" arg-phrase="!" arg-language="!">
	<xf:if is="$phrase">
		<xf:form action="{{ link('phrases/translate', $phrase) }}" ajax="true" data-xf-init="translate-submit" class="block block--phrase block block--phrase {{ ($phrase.language_id == 0 ? '' : ($phrase.language_id == $language.language_id ? 'block--phrase--custom' : 'block--phrase--parentCustom')) }}">
			<div class="block-outer">
				<div class="block-outer-opposite">
					<div class="buttonGroup">
						<xf:button type="submit" name="edit" icon="edit" class="button--link" />
						<xf:if is="$language.language_id AND $phrase.isUpdate() AND $phrase.language_id == $language.language_id">
							<xf:button type="submit" name="revert" class="button--link">{{ phrase('revert') }}</xf:button>
						</xf:if>
					</div>
				</div>
			</div>
			<div class="block-container">
				<div class="block-body">
					<xf:formrow rowtype="fullWidth">
						<dl class="pairs pairs--inline">
							<dt>{{ phrase('title') }}</dt>
							<dd>{$phrase.title}</dd>
						</dl>
					</xf:formrow>
					<xf:formrow rowtype="fullWidth">
						<dl class="pairs pairs--inline">
							<dt>{{ phrase('phrase_text') }}</dt>
							<dd>
								{$phrase.phrase_text|nl2br}
							</dd>
						</dl>
					</xf:formrow>
				</div>
			</div>
			<xf:hiddenval name="language_id">{$language.language_id}</xf:hiddenval>
		</xf:form>
	</xf:if>
</xf:macro>