Compare commits

...

2 commits

Author SHA1 Message Date
7682dc94c7 Override signup page 2025-03-18 12:53:00 +01:00
e06b472d62 Reduce template code duplication 2025-03-18 11:56:02 +01:00
5 changed files with 94 additions and 87 deletions

View file

@ -6,48 +6,40 @@
{% translate "Sign In" %} {% translate "Sign In" %}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}
{% block content %} {% block card_content %}
<section class="section"> {% if SOCIALACCOUNT_ENABLED %}
<div class="card"> {% get_providers as socialaccount_providers %}
<div class="card-content"> {% if socialaccount_providers %}
<div class="card-body"> {% for provider in socialaccount_providers %}
{% if SOCIALACCOUNT_ENABLED %} {% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
{% get_providers as socialaccount_providers %} <form method="post" action="{{ href }}">
{% if socialaccount_providers %} {% csrf_token %}
{% for provider in socialaccount_providers %} <button href="{{ href }}"
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %} class="btn btn-warning btn-lg icon icon-left"
<form method="post" action="{{ href }}"> title="{{ provider.name }}">
{% csrf_token %} <img src="{% static 'img/keycloak.svg' %}" style="height: 30px">
<button href="{{ href }}" <span class="mx-1">{% translate "Sign in with your" %} {{ provider.name }}</span>
class="btn btn-warning btn-lg icon icon-left" </button>
title="{{ provider.name }}"> </form>
<img src="{% static 'img/keycloak.svg' %}" style="height: 30px"> {% endfor %}
<span class="mx-1">{% translate "Sign in with your" %} {{ provider.name }}</span> {% endif %}
</button> {% endif %}
</form> <div class="mt-2">
{% endfor %} <a data-bs-toggle="collapse"
{% endif %} href="#login-form"
{% endif %} role="button"
<div class="mt-2"> aria-controls="login-form"
<a data-bs-toggle="collapse" class="d-flex align-items-center">
href="#login-form" <i class="bi bi-chevron-right me-2 ms-1 mb-2 collapse-icon"></i>
role="button" {% translate "Log in with email and password instead" %}
aria-controls="login-form" </a>
class="d-flex align-items-center"> <div class="collapse mt-3 ms-3"
<i class="bi bi-chevron-right me-2 ms-1 mb-2 collapse-icon"></i> id="login-form"
{% translate "Log in with email and password instead" %} class="form form-vertical"
</a> style="max-width: 400px">
<div class="collapse mt-3 ms-3" {% url 'account_login' as form_action %}
id="login-form" {% translate "Sign In" as form_submit_label %}
class="form form-vertical" {% include "includes/form.html" %}
style="max-width: 400px">
{% url 'account_login' as form_action %}
{% translate "Sign In" as form_submit_label %}
{% include "includes/form.html" %}
</div>
</div>
</div>
</div>
</div> </div>
</section> </div>
{% endblock content %} {% endblock content %}

View file

@ -32,6 +32,17 @@
{% include "includes/message.html" %} {% include "includes/message.html" %}
{% endfor %} {% endfor %}
{% block content %} {% block content %}
<section class="section">
<div class="card">
{% block card_header %}{% endblock %}
<div class="card-content">
<div class="card-body">
{% block card_content %}
{% endblock card_content %}
</div>
</div>
</div>
</section>
{% endblock content %} {% endblock content %}
</div> </div>
<footer> <footer>

View file

@ -5,12 +5,6 @@
{% translate "Create a new organization" %} {% translate "Create a new organization" %}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}
{% block content %} {% block card_content %}
<section class="section"> {% include "includes/form.html" %}
<div class="card"> {% endblock card_content %}
<div class="card-content">
<div class="card-body">{% include "includes/form.html" %}</div>
</div>
</div>
</section>
{% endblock content %}

View file

@ -5,39 +5,33 @@
{% translate "Profile" %} {% translate "Profile" %}
{% endblock page_title %} {% endblock page_title %}
{% endblock html_title %} {% endblock html_title %}
{% block content %} {% block card_header %}
<section class="section"> <div class="card-header">
<div class="card"> <h4 class="card-title">{% translate "Account" %}</h4>
<div class="card-header"> </div>
<h4 class="card-title">{% translate "Account" %}</h4> {% endblock %}
</div> {% block card_content %}
<div class="card-content"> <p>
<div class="card-body"> {% blocktranslate trimmed %}
<p class="card-text"> You are logged in with your VSHN user account. You will be able to change your password and other settings here in the future.
{% blocktranslate trimmed %} {% endblocktranslate %}
You are logged in with your VSHN user account. You will be able to change your password and other settings here in the future. </p>
{% endblocktranslate %} <div class="table-responsive">
</p> <table class="table table-lg">
<div class="table-responsive"> <tbody>
<table class="table table-lg"> <tr>
<tbody> <th>{% translate "E-mail" %}</th>
<tr> <td>{{ request.user.email }}</td>
<th>{% translate "E-mail" %}</th> </tr>
<td>{{ request.user.email }}</td> <tr>
</tr> <th>{% translate "First name" %}</th>
<tr> <td>{{ request.user.first_name }}</td>
<th>{% translate "First name" %}</th> </tr>
<td>{{ request.user.first_name }}</td> <tr>
</tr> <th>{% translate "Last name" %}</th>
<tr> <td>{{ request.user.last_name }}</td>
<th>{% translate "Last name" %}</th> </tr>
<td>{{ request.user.last_name }}</td> </tbody>
</tr> </table>
</tbody> </div>
</table>
</div>
</div>
</div>
</div>
</section>
{% endblock content %} {% endblock content %}

View file

@ -0,0 +1,16 @@
{% extends "frontend/base.html" %}
{% load i18n %}
{% block html_title %}
{% block page_title %}
{% translate "Sign Up" %}
{% endblock page_title %}
{% endblock html_title %}
{% block card_content %}
<p>
{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to
{{site_name}}. As a final step, please complete the following form:{% endblocktrans %}
</p>
{% url 'socialaccount_signup' as form_action %}
{% translate "Sign Up" as form_submit_label %}
<div style="max-width: 300px">{% include "includes/form.html" %}</div>
{% endblock card_content %}