|
13 | 13 | {% endblock %} |
14 | 14 |
|
15 | 15 | {% block content %} |
16 | | - <div class="page-header"> |
17 | | - {% if object %} |
18 | | - <h1>{% translate "Edit shift" %}</h1> |
19 | | - {% else %} |
20 | | - <h1>{% translate "Create new shift for event" %}</h1> |
21 | | - {% endif %} |
22 | | - </div> |
23 | 16 | <div class="row"> |
24 | | - <div class="col-md-9"> |
| 17 | + <div class="col"> |
| 18 | + <div class="page-header"> |
| 19 | + {% if object %} |
| 20 | + <h1>{% translate "Edit shift" %}</h1> |
| 21 | + {% else %} |
| 22 | + <h1>{% translate "Create new shift for event" %}</h1> |
| 23 | + {% endif %} |
| 24 | + </div> |
25 | 25 | <form method="post" class="form"> |
26 | 26 | {% csrf_token %} |
27 | | - <div class="row"> |
28 | | - {% crispy_field form.date wrapper_class="col-12 col-lg-6" %} |
29 | | - {% crispy_field form.meeting_time wrapper_class="col-12 col-lg-6" %} |
30 | | - {% crispy_field form.start_time wrapper_class="col-12 col-lg-6" %} |
31 | | - {% crispy_field form.end_time wrapper_class="col-12 col-lg-6" %} |
32 | | - </div> |
33 | | - {% crispy_field form.label %} |
34 | | - <hr class="border border-secondary border-dark opacity-75"> |
35 | | - <h2> |
36 | | - {% translate "Signup mode" %} |
37 | | - </h2> |
38 | | - {% crispy_field form.signup_flow_slug show_labels=False %} |
39 | | - <div data-ajax-replace-select="id_signup_flow_slug" |
40 | | - {% url "core:signup_flow_configuration_form" event.id "SELECT_VALUE" as flow_url %} |
41 | | - data-ajax-replace-url="{{ flow_url }}{% if object %}?shift_id={{ object.id }}{% endif %}"> |
42 | | - {% include 'core/fragments/shift_signup_config_form.html' with form=flow_configuration_form %} |
43 | | - </div> |
44 | | - <hr class="border border-secondary border-dark opacity-75"> |
45 | | - <h2> |
46 | | - {% translate "Structure" %} |
47 | | - </h2> |
48 | | - {% crispy_field form.structure_slug show_labels=False %} |
49 | | - <div data-ajax-replace-select="id_structure_slug" |
50 | | - {% url "core:shift_structure_configuration_form" event.id "SELECT_VALUE" as structure_url %} |
51 | | - data-ajax-replace-url="{{ structure_url }}{% if object %}?shift_id={{ object.id }}{% endif %}"> |
52 | | - {% include 'core/fragments/shift_signup_config_form.html' with form=structure_configuration_form %} |
53 | | - </div> |
54 | | - <hr class="border border-secondary border-dark opacity-75"> |
55 | | - <div class="plugin-forms"> |
56 | | - {% for plugin_form in plugin_forms %} |
57 | | - {{ plugin_form }} |
58 | | - {% endfor %} |
| 27 | + |
| 28 | + <nav> |
| 29 | + <ul class="nav nav-tabs" id="event-form-tabs" role="tablist"> |
| 30 | + <li class="nav-item" role="presentation"> |
| 31 | + <button class="nav-link active" id="general-tab" data-bs-toggle="tab" |
| 32 | + data-bs-target="#general-tab-pane" |
| 33 | + type="button" role="tab" aria-controls="general-tab-pane" aria-selected="true"> |
| 34 | + {% translate "General" %} |
| 35 | + </button> |
| 36 | + </li> |
| 37 | + <li class="nav-item" role="presentation"> |
| 38 | + <button class="nav-link" id="signup-tab" data-bs-toggle="tab" |
| 39 | + data-bs-target="#signup-tab-pane" |
| 40 | + type="button" role="tab" aria-controls="signup-tab-pane" aria-selected="false"> |
| 41 | + {% translate "Signup" %} |
| 42 | + </button> |
| 43 | + </li> |
| 44 | + <li class="nav-item" role="presentation"> |
| 45 | + <button class="nav-link" id="structure-tab" data-bs-toggle="tab" |
| 46 | + data-bs-target="#structure-tab-pane" |
| 47 | + type="button" role="tab" aria-controls="structure-tab-pane" aria-selected="false"> |
| 48 | + {% translate "Personnel" %} |
| 49 | + </button> |
| 50 | + </li> |
| 51 | + </ul> |
| 52 | + </nav> |
| 53 | + <div class="tab-content" id="event-form-panes"> |
| 54 | + <div class="tab-pane active" id="general-tab-pane" role="tabpanel" aria-labelledby="general-tab" |
| 55 | + tabindex="0"> |
| 56 | + <div class="row"> |
| 57 | + {% crispy_field form.date wrapper_class="col-12 col-lg-6" %} |
| 58 | + {% crispy_field form.meeting_time wrapper_class="col-12 col-lg-6" %} |
| 59 | + {% crispy_field form.start_time wrapper_class="col-12 col-lg-6" %} |
| 60 | + {% crispy_field form.end_time wrapper_class="col-12 col-lg-6" %} |
| 61 | + </div> |
| 62 | + {% crispy_field form.label %} |
| 63 | + <div class="plugin-forms"> |
| 64 | + {% for plugin_form in plugin_forms %} |
| 65 | + {{ plugin_form }} |
| 66 | + {% endfor %} |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + <div class="tab-pane" id="signup-tab-pane" role="tabpanel" |
| 70 | + aria-labelledby="signup-tab" |
| 71 | + tabindex="0"> |
| 72 | + <label for="{{ form.signup_flow_slug.id_for_label }}" class="form-label"> |
| 73 | + {% translate "Choose a mode of signup" %} |
| 74 | + </label> |
| 75 | + {% crispy_field form.signup_flow_slug show_labels=False %} |
| 76 | + <div data-ajax-replace-select="id_signup_flow_slug" |
| 77 | + {% url "core:signup_flow_configuration_form" event.id "SELECT_VALUE" as flow_url %} |
| 78 | + data-ajax-replace-url="{{ flow_url }}{% if object %}?shift_id={{ object.id }}{% endif %}"> |
| 79 | + {% include 'core/fragments/shift_signup_config_form.html' with form=flow_configuration_form %} |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + <div class="tab-pane" id="structure-tab-pane" role="tabpanel" |
| 83 | + aria-labelledby="structure-tab" |
| 84 | + tabindex="0"> |
| 85 | + <label for="{{ form.structure_slug.id_for_label }}" class="form-label"> |
| 86 | + {% translate "Choose a model for specifying personnel requirements" %} |
| 87 | + </label> |
| 88 | + |
| 89 | + {% crispy_field form.structure_slug show_labels=False %} |
| 90 | + <div data-ajax-replace-select="id_structure_slug" |
| 91 | + {% url "core:shift_structure_configuration_form" event.id "SELECT_VALUE" as structure_url %} |
| 92 | + data-ajax-replace-url=" |
| 93 | + {{ structure_url }}{% if object %}?shift_id={{ object.id }}{% endif %}"> |
| 94 | + {% include 'core/fragments/shift_signup_config_form.html' with form=structure_configuration_form %} |
| 95 | + </div> |
| 96 | + </div> |
59 | 97 | </div> |
60 | | - <div class="form-group"> |
61 | | - {% if object or event.active %} |
62 | | - <a role="button" class="btn btn-secondary" |
63 | | - href="{{ event.get_absolute_url }}"> |
64 | | - <span class="fas fa-arrow-left"></span> {% translate "Back to event" %} |
65 | | - </a> |
66 | | - {% if object and object.event.shifts.count > 1 %} |
67 | | - <a role="button" class="btn btn-danger" |
68 | | - href="{% url "core:shift_delete" object.pk %}"><span |
69 | | - class="fas fa-trash-alt"></span> {% translate "Delete" %}</a> |
| 98 | + |
| 99 | + <div class="row form-group mt-3"> |
| 100 | + <div class="col-auto"> |
| 101 | + {% if object or event.active %} |
| 102 | + <a role="button" class="btn btn-secondary" |
| 103 | + href="{{ event.get_absolute_url }}"> |
| 104 | + <span class="fas fa-arrow-left"></span> {% translate "Back to event" %} |
| 105 | + </a> |
| 106 | + |
| 107 | + {% if object and object.event.shifts.count > 1 %} |
| 108 | + <a role="button" class="btn btn-danger" |
| 109 | + href="{% url "core:shift_delete" object.pk %}"><span |
| 110 | + class="fas fa-trash-alt"></span> {% translate "Delete" %}</a> |
| 111 | + {% endif %} |
70 | 112 | {% endif %} |
71 | | - <button type="submit" class="btn btn-primary float-end ms-1"> |
72 | | - <span class="fas fa-save"></span> {% translate "Save" %} |
| 113 | + </div> |
| 114 | + <div class="col text-end"> |
| 115 | + <button type="submit" name="copyShift" class="btn btn-secondary mb-1"> |
| 116 | + <span class="fas fa-copy"></span> {% translate "Copy shift" %} |
73 | 117 | </button> |
74 | | - {% else %} |
75 | | - <a role="button" class="btn btn-danger" |
76 | | - href="{% url "core:event_delete" event.pk %}">{% translate "Discard event" %}</a> |
77 | | - <button type="submit" class="btn btn-primary float-end ms-1"> |
78 | | - <span class="fas fa-save"></span> {% translate "Save event" %} |
| 118 | + <button type="submit" name="addAnother" class="btn btn-secondary mb-1"> |
| 119 | + <span class="fas fa-plus"></span> {% translate "Add another shift" %} |
79 | 120 | </button> |
80 | | - {% endif %} |
81 | | - <button type="submit" name="addAnother" class="btn btn-secondary float-end"> |
82 | | - <span class="fas fa-plus"></span> {% translate "Add another shift" %} |
83 | | - </button> |
84 | | - <button type="submit" name="copyShift" class="btn btn-secondary float-end me-1"> |
85 | | - <span class="fas fa-copy"></span> {% translate "Copy shift" %} |
86 | | - </button> |
| 121 | + {% if object or event.active %} |
| 122 | + <button type="submit" class="btn btn-primary mb-1"> |
| 123 | + <span class="fas fa-save"></span> {% translate "Save" %} |
| 124 | + </button> |
| 125 | + {% else %} |
| 126 | + <a role="button" class="btn btn-danger" |
| 127 | + href="{% url "core:event_delete" event.pk %}">{% translate "Discard event" %}</a> |
| 128 | + <button type="submit" class="btn btn-primary mb-1"> |
| 129 | + <span class="fas fa-save"></span> {% translate "Save event" %} |
| 130 | + </button> |
| 131 | + {% endif %} |
| 132 | + </div> |
87 | 133 | </div> |
88 | 134 | </form> |
89 | 135 | </div> |
90 | | - <div class="col-md-3"> |
| 136 | + <div class="d-none d-lg-block col-3"> |
91 | 137 | <div class="card mb-2"> |
92 | 138 | <div class="card-body"> |
93 | 139 | <h5 class="card-title"> |
|
0 commit comments