mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 11:18:27 +02:00
Register new organizers
This commit is contained in:
43
apps/registration/templates/registration/add_organizer.html
Normal file
43
apps/registration/templates/registration/add_organizer.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!-- templates/signup.html -->
|
||||
{% extends 'base.html' %}
|
||||
{% load crispy_forms_filters %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Add organizer" %}{% endblock %}
|
||||
|
||||
{% block extracss %}
|
||||
{{ volunteer_registration_form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Add organizer" %}</h2>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<div id="registration_form"></div>
|
||||
<button class="btn btn-success" type="submit">
|
||||
{% trans "Add organizer" %}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div id="volunteer_registration_form" class="d-none">
|
||||
{{ volunteer_registration_form|crispy }}
|
||||
</div>
|
||||
<div id="admin_registration_form" class="d-none">
|
||||
{{ admin_registration_form|crispy }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$("#id_role").change(function() {
|
||||
let selected_role = $("#id_role :selected");
|
||||
if (selected_role.val() === "volunteer") {
|
||||
$("#registration_form").html($("#volunteer_registration_form").html());
|
||||
}
|
||||
else {
|
||||
$("#registration_form").html($("#admin_registration_form").html());
|
||||
}
|
||||
}).change();
|
||||
</script>
|
||||
{% endblock %}
|
@ -1,7 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load django_tables2 %}
|
||||
{% load django_tables2 i18n %}
|
||||
|
||||
{% block content %}
|
||||
{% if user.registration.is_admin %}
|
||||
<button href="{% url "registration:add_organizer" %}" class="btn btn-block btn-secondary">
|
||||
<i class="fas fa-user-plus"></i> {% trans "Add organizer" %}
|
||||
</button>
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% render_table table %}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user