Skip to content

Commit ab876ba

Browse files
committed
frontend: improve HTML for register + edit profile forms
1 parent 1e394b7 commit ab876ba

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/divbase-api/src/divbase_api/templates/auth_pages/register.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88
{% include "components/registration_form.html" %}
99
</div>
1010
{% endblock %}
11+
12+
13+
{% block custom_scripts %}
14+
<script src="/static/js/organisation_dropdown.js"></script>
15+
{% endblock %}

packages/divbase-api/src/divbase_api/templates/components/registration_form.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2>Create an account </h2>
5757
<i class="bi bi-building"></i>
5858
</span>
5959
<select class="form-select" id="organisation_dropdown" name="organisation" required>
60-
<option value="" disabled selected>Select an organisation...</option>
60+
<option value="" disabled {% if not organisation %}selected{% endif %}>Select an organisation...</option>
6161
<option value="Other" {% if organisation == 'Other' %}selected{% endif %}>Other</option>
6262
{% for org in swedish_universities %}
6363
<option value="{{ org }}" {% if organisation == org %}selected{% endif %}>{{ org }}</option>
@@ -142,7 +142,8 @@ <h2>Create an account </h2>
142142
<i class="bi bi-person-plus me-2"></i>Create Account
143143
</button>
144144
</div>
145-
145+
146+
</form>
146147
<hr class="my-4">
147148
<div class="text-center d-flex justify-content-center align-items-center gap-3 flex-wrap">
148149
<div>
@@ -162,8 +163,4 @@ <h2>Create an account </h2>
162163
</div>
163164
</div>
164165
</div>
165-
</div>
166-
167-
{% block custom_scripts %}
168-
<script src="/static/js/organisation_dropdown.js"></script>
169-
{% endblock %}
166+
</div>

packages/divbase-api/src/divbase_api/templates/profile_pages/edit_profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h5 class="mb-0"><i class="bi bi-person-gear me-2"></i>Personal Information</h5>
4848
<i class="bi bi-building"></i>
4949
</span>
5050
<select class="form-select" id="organisation_dropdown" name="organisation" required>
51-
<option value="" disabled selected>Select an organisation...</option>
51+
<option value="" disabled {% if not organisation %}selected{% endif %}>Select an organisation...</option>
5252
<option value="Other" {% if organisation == 'Other' %}selected{% endif %}>Other</option>
5353
{% for org in swedish_universities %}
5454
<option value="{{ org }}" {% if organisation == org %}selected{% endif %}>{{ org }}</option>

0 commit comments

Comments
 (0)