registration setting

This commit is contained in:
InspectorCaracal 2022-12-17 14:06:18 -07:00
parent 0bde1a034b
commit 04e036978c
4 changed files with 39 additions and 23 deletions

View file

@ -78,9 +78,11 @@ folder and edit it to add/remove links to the menu.
<li>
<a class="nav-link" href="{% url 'login' %}?next={{ request.path }}">Log In</a>
</li>
<li>
<a class="nav-link" href="{% url 'register' %}">Register</a>
</li>
{% if register_enabled %}
<li>
<a class="nav-link" href="{% url 'register' %}">Register</a>
</li>
{% endif %}
{% endif %}
{% endblock %}
</ul>

View file

@ -27,26 +27,29 @@ Register
{% endif %}
{% if not user.is_authenticated %}
<form method="post" action="?">
{% csrf_token %}
{% for field in form %}
<div class="form-field my-3">
{{ field.label_tag }}
{{ field | addclass:"form-control" }}
{% if field.help_text %}
<small class="form-text text-muted">{{ field.help_text|safe }}</small>
{% endif %}
</div>
{% endfor %}
<hr />
<div class="form-group">
<input class="form-control btn btn-outline-secondary" type="submit" value="Register" />
<input type="hidden" name="next" value="{{ next }}" />
</div>
</form>
{% if register_enabled %}
<form method="post" action="?">
{% csrf_token %}
{% for field in form %}
<div class="form-field my-3">
{{ field.label_tag }}
{{ field | addclass:"form-control" }}
{% if field.help_text %}
<small class="form-text text-muted">{{ field.help_text|safe }}</small>
{% endif %}
</div>
{% endfor %}
<hr />
<div class="form-group">
<input class="form-control btn btn-outline-secondary" type="submit" value="Register" />
<input type="hidden" name="next" value="{{ next }}" />
</div>
</form>
{% else %}
<p>Registration is currently disabled.</p>
{% endif %}
{% endif %}
</div>
</div>