<xf:title>
	<xf:if is="$dropdown.isInsert()">
		{{ phrase('add_dropdown') }}
	<xf:else />
		{{ phrase('edit_dropdown:') }} {$dropdown.title}
	</xf:if>
</xf:title>

<xf:macro template="bb_code_button_manager_editor" name="setup" />

<xf:form action="{{ link('button-manager/dropdown/save', $dropdown) }}" ajax="true" data-xf-init="editor-manager" data-command-tray-class=".js-dragList-commandTrayDropdown">
	<div class="block">
		<div class="block-container">
			<div class="block-body">
				<xf:if is="$dropdown.isInsert()">
					<xf:textboxrow name="cmd" label="{{ phrase('command_id') }}" />
				<xf:else />
					<xf:formrow label="{{ phrase('command_id') }}">{$dropdown.cmd}</xf:formrow>
				</xf:if>

				<xf:textboxrow name="title" label="{{ phrase('title') }}" value="{{ $dropdown.isUpdate() ? $dropdown.MasterTitle.phrase_text : '' }}" />

				<xf:textboxrow name="icon" label="{{ phrase('icon') }}" value="{$dropdown.icon}">
					<xf:explain>{{ phrase('you_can_preview_icons_and_their_names_here') }}</xf:explain>
				</xf:textboxrow>

				<xf:macro template="display_order_macros" name="row" arg-value="{$dropdown.display_order}" />

				<xf:checkboxrow label="">
					<xf:option name="active" selected="$dropdown.active"
						label="{{ phrase('dropdown_is_active') }}" />
				</xf:checkboxrow>
			</div>
		</div>
	</div>

	<div class="block">
		<div class="block-container">
			<h2 class="block-header">
				{{ phrase('available_buttons') }}
			</h2>
			<xf:macro template="bb_code_button_manager_editor"
				name="toolbar_block"
				arg-buttons="{{ array_keys($buttonData) }}"
				arg-buttonData="{$buttonData}"
				arg-toolbarType="commandTrayDropdown"
				arg-displayTooltips="{{ true }}" />

			<div class="block-row block-row--minor u-muted">
				{{ phrase('note_not_all_buttons_supported_inside_dropdowns') }}
			</div>
		</div>
	</div>

	<div class="block">
		<div class="block-container">
			<h2 class="block-header">
				{{ phrase('dropdown_buttons') }}
			</h2>

			<xf:macro template="bb_code_button_manager_editor"
				name="toolbar_block"
				arg-name="buttons"
				arg-buttons="{$dropdown.buttons}"
				arg-buttonData="{$buttonData}"
				arg-toolbarType="toolbarDropdown" />

			<xf:submitrow icon="save" />
		</div>
	</div>
</xf:form>