{% extends 'html/main.html' %}


{% block title %}{% trans %}Create a new user{% endtrans %}{% endblock %}


{% block content %}
	<header>
		<div class="pwic_ph1"><a href="/">{{pwic.emojis.finger_left}} {% if pwic.env.no_new_user %}{% trans %}Assign a new user{% endtrans %}{% else %}{% trans %}Create a new user{% endtrans %}{% endif %}</a></div>
	</header>

	{% include 'js/user-create.js' %}

	<article>
		{% if pwic.projects|count == 0 %}

			<p class="pwic_error">{{pwic.emojis.padlock}} {% trans %}You have no authorization to create a new user. Please contact your administrator.{% endtrans %}</p>

		{% else %}

			<p class="pwic_italic">{% trans %}Reminder: your password must be changed before you can add a new user to the selected project.{% endtrans %}</p>
			<p><strong>{% trans %}Project:{% endtrans %}</strong><br>
				<select id="create_project" name="project">
					{% for proj in pwic.projects %}
						<option value="{{proj.project|escape}}"
							{% if proj.project == pwic.default_project %} selected="selected" {% endif %}
						>{{proj.description|escape}} [{{proj.project|escape}}]</option>
					{% endfor %}
				</select>
			</p>
			<p><strong>{% trans %}User name:{% endtrans %}</strong> <input id="create_user" class="pwic_fill" type="text" name="user" autofocus required="true" spellcheck="false"></p>
			<p><input type="button" value="{{pwic.emojis.users}} {% trans %}Create the user{% endtrans %}" onclick="create_submit()"></p>

		{% endif %}
	</article>
{% endblock %}
