{% include 'overall_header.html' %}
{% EVENT memberlist_email_before %}

<div class="iz-page">

	<form method="post" action="{{ S_POST_ACTION }}" id="post" class="iz-form">

		<header class="iz-pagehead" aria-labelledby="iz-email-title">
			<h2 class="iz-pagehead__title" id="iz-email-title">
				{% if S_CONTACT_ADMIN %}
					{{ L_CONTACT_ADMIN }}
				{% elseif S_SEND_USER %}
					{{ L_SEND_EMAIL_USER }}
				{% else %}
					{{ L_EMAIL_TOPIC }}
				{% endif %}
			</h2>
		</header>


		{% if CONTACT_INFO %}
			<section class="iz-card" aria-labelledby="iz-contact-info-title">
				<header class="iz-card__header">
					<h3 class="iz-card__title" id="iz-contact-info-title">{{ L_INFORMATION }}</h3>
				</header>
				<div class="iz-card__body">
					<div class="iz-prose">
						{{ CONTACT_INFO }}
					</div>
				</div>
			</section>
		{% endif %}


		<section class="iz-card" aria-labelledby="iz-email-form-title">
			<header class="iz-card__header">
				<h3 class="iz-card__title" id="iz-email-form-title">{{ L_OPTIONS }}</h3>
			</header>

			<div class="iz-card__body">

				{% if ERROR_MESSAGE %}
					<p class="iz-alert iz-alert--warn" role="alert">
						<strong>{{ L_INFO_BOX }}</strong>&nbsp;{{ ERROR_MESSAGE }}
					</p>
				{% endif %}

				<div class="iz-grid iz-grid--2">

					{% if S_SEND_USER %}
						<div class="iz-field">
							<label class="iz-label" for="username_display">{{ L_RECIPIENT }}{{ L_COLON }}</label>
							<div id="username_display" class="iz-meta">{{ USERNAME_FULL }}</div>
						</div>

						<div class="iz-field">
							<label class="iz-label" for="subject">{{ L_SUBJECT }}{{ L_COLON }}</label>
							<input class="iz-input" type="text" name="subject" id="subject" value="{{ SUBJECT }}" />
						</div>

					{% elseif S_CONTACT_ADMIN %}
						<div class="iz-field">
							<label class="iz-label" for="username">{{ L_RECIPIENT }}{{ L_COLON }}</label>
							<input class="iz-input" type="text" name="username" id="username" value="{{ L_ADMINISTRATOR }}" disabled="disabled" />
						</div>

						{% if not S_IS_REGISTERED %}
							<div class="iz-field">
								<label class="iz-label" for="email">{{ L_SENDER_EMAIL_ADDRESS }}{{ L_COLON }}</label>
								<input class="iz-input" type="text" name="email" id="email" value="{{ EMAIL }}" />
							</div>

							<div class="iz-field">
								<label class="iz-label" for="name">{{ L_SENDER_NAME }}{{ L_COLON }}</label>
								<input class="iz-input" type="text" name="name" id="name" value="{{ NAME }}" />
							</div>
						{% endif %}

						<div class="iz-field">
							<label class="iz-label" for="subject">{{ L_SUBJECT }}{{ L_COLON }}</label>
							<input class="iz-input" type="text" name="subject" id="subject" value="{{ SUBJECT }}" />
						</div>

					{% else %}
						<div class="iz-field">
							<label class="iz-label" for="email">{{ L_EMAIL_ADDRESS }}{{ L_COLON }}</label>
							<input class="iz-input" type="text" name="email" id="email" value="{{ EMAIL }}" />
						</div>

						<div class="iz-field">
							<label class="iz-label" for="name">{{ L_REAL_NAME }}{{ L_COLON }}</label>
							<input class="iz-input" type="text" name="name" id="name" value="{{ NAME }}" />
						</div>

						<div class="iz-field">
							<label class="iz-label" for="lang">{{ L_DEST_LANG }}{{ L_COLON }}</label>
							<p class="iz-help">{{ L_DEST_LANG_EXPLAIN }}</p>
							<select class="iz-select" name="lang" id="lang">{{ S_LANG_OPTIONS }}</select>
						</div>
					{% endif %}

				</div>


				<div class="iz-field">
					<label class="iz-label" for="message">{{ L_MESSAGE_BODY }}{{ L_COLON }}</label>
					<textarea class="iz-textarea"
							  name="message"
							  id="message"
							  rows="6"
							  tabindex="4"
							  placeholder="{{ L_MESSAGE_BODY }}">{{ MESSAGE }}</textarea>
					<p class="iz-help">{{ L_EMAIL_BODY_EXPLAIN }}</p>

					<label class="iz-choice" for="cc_sender">
						<input class="iz-choice__input" type="checkbox" name="cc_sender" id="cc_sender" value="1" checked="checked" tabindex="5" />
						<span class="iz-choice__label">{{ L_CC_SENDER }}</span>
					</label>
				</div>


				<fieldset class="iz-actions iz-actions--inline">
					<button type="submit" tabindex="6" name="submit" class="iz-btn iz-btn--primary" value="{{ L_SEND_EMAIL }}">
						{{ L_SEND_EMAIL }}
					</button>
					{{ S_FORM_TOKEN }}
				</fieldset>

			</div>
		</section>

	</form>

</div>

{% include 'overall_footer.html' %}
