1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 02:43:01 +00:00

Template formating on member app

This commit is contained in:
Alexandre Iooss 2020-08-23 14:21:31 +02:00
parent c64de202a6
commit e14c8734c2
6 changed files with 76 additions and 63 deletions

View File

@ -2,6 +2,7 @@
{% comment %} {% comment %}
SPDX-License-Identifier: GPL-3.0-or-later SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %} {% endcomment %}
{% block contenttitle %}{% endblock %}
{# Use a fluid-width container #} {# Use a fluid-width container #}
{% block containertype %}container-fluid{% endblock %} {% block containertype %}container-fluid{% endblock %}

View File

@ -1,11 +1,12 @@
{% load i18n static pretty_money perms %} {% load i18n pretty_money perms %}
<div class="card bg-light shadow">
<div class="card-header text-center"> <div class="card bg-light">
<h4> Club {{ club.name }} </h4> <h4 class="card-header text-center">
</div> Club {{ club.name }}
</h4>
<div class="card-top text-center"> <div class="card-top text-center">
<a href="{% url 'member:club_update_pic' club.pk %}"> <a href="{% url 'member:club_update_pic' club.pk %}">
<img src="{{ club.note.display_image.url }}" class="img-thumbnail mt-2" > <img src="{{ club.note.display_image.url }}" class="img-thumbnail mt-2">
</a> </a>
</div> </div>
<div class="card-body" id="profile_infos"> <div class="card-body" id="profile_infos">
@ -14,7 +15,9 @@
<dd class="col-xl-6">{{ club.name }}</dd> <dd class="col-xl-6">{{ club.name }}</dd>
{% if club.parent_club %} {% if club.parent_club %}
<dt class="col-xl-6"><a href="{% url 'member:club_detail' club.parent_club.pk %}">{% trans 'Club Parent'|capfirst %}</a></dt> <dt class="col-xl-6">
<a href="{% url 'member:club_detail' club.parent_club.pk %}">{% trans 'Club Parent'|capfirst %}</a>
</dt>
<dd class="col-xl-6"> {{ club.parent_club.name }}</dd> <dd class="col-xl-6"> {{ club.parent_club.name }}</dd>
{% endif %} {% endif %}
@ -61,10 +64,12 @@
{% if not club.weiclub %} {% if not club.weiclub %}
<div class="card-footer text-center"> <div class="card-footer text-center">
{% if can_add_members %} {% if can_add_members %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}" data-turbolinks="false"> {% trans "Add member" %}</a> <a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}"
data-turbolinks="false"> {% trans "Add member" %}</a>
{% endif %} {% endif %}
{% if ".change_"|has_perm:club %} {% if ".change_"|has_perm:club %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}" data-turbolinks="false"> {% trans "Edit" %}</a> <a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}" data-turbolinks="false">
{% trans "Edit" %}</a>
{% endif %} {% endif %}
{% url 'member:club_detail' club.pk as club_detail_url %} {% url 'member:club_detail' club.pk as club_detail_url %}
{%if request.path_info != club_detail_url %} {%if request.path_info != club_detail_url %}

View File

@ -1,5 +1,4 @@
{% extends "member/club_detail.html" %} {% extends "member/club_detail.html" %}
{% load i18n static pretty_money django_tables2 crispy_forms_tags %}
{% block profile_content%} {% block profile_content%}
{% include "member/picture_update.html" %} {% include "member/picture_update.html" %}

View File

@ -1,9 +1,9 @@
{% load i18n pretty_money perms %} {% load i18n pretty_money perms %}
<div class="card bg-light shadow"> <div class="card bg-light">
<div class="card-header text-center"> <h4 class="card-header text-center">
<h4>{% trans "Account #" %}{{ user_object.pk }}</h4> {% trans "Account #" %}{{ user_object.pk }}
</div> </h4>
<div class="card-top text-center"> <div class="card-top text-center">
<a href="{% url 'member:user_update_pic' user_object.pk %}"> <a href="{% url 'member:user_update_pic' user_object.pk %}">
<img src="{{ user_object.note.display_image.url }}" class="img-thumbnail mt-2"> <img src="{{ user_object.note.display_image.url }}" class="img-thumbnail mt-2">
@ -52,7 +52,6 @@
{% for alias in user_object.note.alias_set.all %} {% for alias in user_object.note.alias_set.all %}
<span class="badge badge-secondary">{{ alias }}</span> <span class="badge badge-secondary">{{ alias }}</span>
{% endfor %} {% endfor %}
</div> </div>
<div class="card-footer"> <div class="card-footer">
<a class="btn btn-sm btn-secondary" href="{% url 'member:user_update_profile' user_object.pk %}"> <a class="btn btn-sm btn-secondary" href="{% url 'member:user_update_profile' user_object.pk %}">
@ -66,5 +65,7 @@
</div> </div>
{% if user_object.pk == user_object.pk %} {% if user_object.pk == user_object.pk %}
<a class="small float-right text-decoration-none" href="{% url 'member:auth_token' %}">{% trans 'Manage auth token' %}</a> <a class="small float-right text-decoration-none" href="{% url 'member:auth_token' %}">
{% trans 'Manage auth token' %}
</a>
{% endif %} {% endif %}

View File

@ -1,5 +1,4 @@
{% extends "member/profile_detail.html" %} {% extends "member/profile_detail.html" %}
{% load i18n static pretty_money django_tables2 crispy_forms_tags %}
{% block profile_content%} {% block profile_content%}
{% include "member/picture_update.html" %} {% include "member/picture_update.html" %}

View File

@ -3,14 +3,22 @@
{% comment %} {% comment %}
SPDX-License-Identifier: GPL-3.0-or-later SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %} {% endcomment %}
{% block contenttitle %}{% endblock %}
{% block content %} {% block content %}
<form method="post"> <div class="card bg-light">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form | crispy }}
{{ profile_form|crispy }} {{ profile_form | crispy }}
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
{% trans "Save Changes" %} {% trans "Save Changes" %}
</button> </button>
</form> </form>
</div>
</div>
{% endblock %} {% endblock %}