Skip to content
Snippets Groups Projects
Verified Commit 17440e81 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Migrate group and person templates to materialize

Close #125
parent 6da0201e
No related branches found
No related tags found
1 merge request!104Resolve "Migrate missing templates to materialize"
Pipeline #534 failed
......@@ -2,43 +2,22 @@
{% extends "core/base.html" %}
{% load bootstrap4 i18n static %}
{% load i18n static %}
{% load render_table from django_tables2 %}
{% block bootstrap4_title %}{% blocktrans %}Group{% endblocktrans %} - {{ block.super }}{% endblock %}
{% block content %}
<div class="col-sm-12 col-md-12">
{% if group %}
<h2>{{ group.name }} <small>{{ group.short_name }}</small></h2>
<p>
<a href="{% url 'edit_group_by_id' group.id %}">
<span class="mdi mdi-pencil"></span>
</a>
</p>
<h3>{% blocktrans %}Details{% endblocktrans %}</h3>
<table class="table table-responsive-xl table-border table-striped">
<tr>
<td><span class="mdi mdi-account-group"></span></td>
<td>{{ group.name }}</td>
<td>{{ group.short_name }}</td>
</tr>
</table>
<h3>{% blocktrans %}Owners{% endblocktrans %}</h3>
{% render_table owners_table %}
<h4>{{ group.name }} <small class="grey-text">{{ group.short_name }}</small></h4>
<p>
<a href="{% url 'edit_group_by_id' group.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
</p>
<h3>{% blocktrans %}Members{% endblocktrans %}</h3>
{% render_table members_table %}
<h5>{% blocktrans %}Owners{% endblocktrans %}</h5>
{% render_table owners_table %}
{% else %}
<h2>{% blocktrans %}Group not found{% endblocktrans %}</h2>
<h5>{% blocktrans %}Members{% endblocktrans %}</h5>
{% render_table members_table %}
<p>
{% blocktrans %}
There is no group with this id.
{% endblocktrans %}
</p>
{% endif %}
</div>
{% endblock %}
......@@ -2,19 +2,16 @@
{% extends "core/base.html" %}
{% load bootstrap4 i18n %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% block bootstrap4_title %}{% blocktrans %}Groups{% endblocktrans %} - {{ block.super }}{% endblock %}
{% block page_title %}{% blocktrans %}Groups{% endblocktrans %}{% endblock %}
{% block content %}
<div class="btn-group" role="group" aria-lable="Group actions">
<a href="{% url 'create_group' %}" class="btn btn-dark">
<span class="mdi mdi-plus"></span>
</a>
</div>
<a class="btn green waves-effect waves-light" href="{% url 'create_group' %}">
<i class="material-icons left">add</i>
{% trans "Create group" %}
</a>
{% render_table groups_table %}
{% endblock %}
......@@ -2,77 +2,79 @@
{% extends "core/base.html" %}
{% load bootstrap4 i18n static cropping %}
{% load i18n static cropping %}
{% load render_table from django_tables2 %}
{% block bootstrap4_title %}{% blocktrans %}Person{% endblocktrans %} - {{ block.super }}{% endblock %}
{% block content %}
<div class="col-sm-12 col-md-12">
{% if person %}
<h2>{{ person.first_name }} {{ person.last_name }}</h2>
<p>
<a href="{% url 'edit_person_by_id' person.id %}">
<span class="mdi mdi-pencil"></span>
</a>
</p>
<h3>{% blocktrans %}Contact details{% endblocktrans %}</h3>
<h4>{{ person.first_name }} {{ person.last_name }}</h4>
<p>
<a href="{% url 'edit_person_by_id' person.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
</p>
<h5>{% blocktrans %}Contact details{% endblocktrans %}</h5>
<div class="row">
<div class="col s12 m4">
{% if person.photo %}
<img class="person-img" src="{% cropped_thumbnail person 'photo_cropping' max_size='300x400' %}"
alt="{{ person.first_name }} {{ person.last_name }}"/>
{% else %}
<img class="person-img" src="{% static 'img/fallback.png' %}"
alt="{{ person.first_name }} {{ person.last_name }}"/>
{% endif %}
</div>
<div class="col s12 m8">
<table class="table table-responsive-xl table-border table-striped">
<tr>
<td rowspan="6">
{% if person.photo %}
<img class="person-img" src="{% cropped_thumbnail person 'photo_cropping' max_size='300x400' %}" alt="{{ person.first_name }} {{ person.last_name }}" />
{% else %}
<img class="person-img" src="{% static 'img/fallback.png' %}" alt="{{ person.first_name }} {{ person.last_name }}" />
{% endif %}
</td>
<td>
<i class="material-icons small">person</i>
</td>
<td><span class="mdi mdi-account"></span></td>
<td>{{ person.first_name }}</td>
<td>{{ person.additional_name }}</td>
<td>{{ person.last_name }}</td>
</tr>
<tr>
<td><span class="mdi mdi-gender-male-female"></td>
<td>
<i class="material-icons small">face</i>
</td>
<td colspan="3">{{ person.get_sex_display }}</td>
</tr>
<tr>
<td><span class="mdi mdi-home"></span></td>
<td>
<i class="material-icons small">home</i>
</td>
<td colspan="2">{{ person.street }} {{ person.housenumber }}</td>
<td colspan="2">{{ person.postal_code }} {{ person.place }}</td>
</tr>
<tr>
<td><span class="mdi mdi-phone"></span></td>
<td>
<i class="material-icons small">phone</i>
</td>
<td>{{ person.phone_number }}</td>
<td>{{ person.mobile_number }}</td>
</tr>
<tr>
<td><span class="mdi mdi-email"></span></td>
<td>
<i class="material-icons small">email</i>
</td>
<td colspan="3">{{ person.email }}</td>
</tr>
<tr>
<td><span class="mdi mdi-cake"></span></td>
<td>
<i class="material-icons small">cake</i>
</td>
<td colspan="3">{{ person.date_of_birth|date }}</td>
</tr>
{% comment %}
<tr>
<td><span class="mdi mdi-school"></span></td>
<td>Class</td>
<td>Teacher</td>
</tr>
{% endcomment %}
</table>
<h3>{% blocktrans %}Groups{% endblocktrans %}</h3>
{% render_table groups_table %}
{% else %}
<h2>{% blocktrans %}Person not found{% endblocktrans %}</h2>
<p>
{% blocktrans %}
There is no person with this id.
{% endblocktrans %}
</p>
{% endif %}
</div>
</div>
<h5>{% blocktrans %}Groups{% endblocktrans %}</h5>
{% render_table groups_table %}
{% endblock %}
......@@ -2,11 +2,9 @@
{% extends "core/base.html" %}
{% load bootstrap4 i18n %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% block bootstrap4_title %}{% blocktrans %}Persons{% endblocktrans %} - {{ block.super }}{% endblock %}
{% block page_title %}{% blocktrans %}Persons{% endblocktrans %}{% endblock %}
{% block content %}
......
......@@ -2,27 +2,16 @@
{% extends "core/base.html" %}
{% load bootstrap4 i18n %}
{% block bootstrap4_extra_head %}
{{ block.super }}
{{ persons_accounts_formset.media.css }}
{% endblock %}
{% block bootstrap4_extra_script %}
{{ block.super }}
{{ persons_accounts_formset.media.js }}
{% endblock %}
{% block bootstrap4_title %}{% blocktrans %}Link persons to accounts{% endblocktrans%} - {{ block.super }}{% endblock %}
{% load i18n %}
{% block page_title %}
{% blocktrans %}Link persons to accounts{% endblocktrans %}
{% endblock %}
{% block content %}
<div class="jumbotron">
<div class="alert info">
<p>
<i class="material-icons left">info</i>
{% blocktrans %}
You can use this form to assign user accounts to persons. Use the
dropdowns to select existing accounts; use the text fields to create new
......@@ -36,7 +25,12 @@
{% csrf_token %}
{{ persons_accounts_formset.management_form }}
<table class="table table-striped table-bordered table-hover table-condensed table-responsive w-100 d-block d-md-table">
<button type="submit" class="btn green waves-effect waves-light">
<i class="material-icons left">save</i>
{% blocktrans %}Update{% endblocktrans %}
</button>
<table>
<tr>
<th>{% blocktrans %}Person{% endblocktrans %}</th>
<th>{% blocktrans %}Existing account{% endblocktrans %}</th>
......@@ -55,7 +49,8 @@
{% endfor %}
</table>
<button type="submit" class="btn btn-dark">
<button type="submit" class="btn green waves-effect waves-light">
<i class="material-icons left">save</i>
{% blocktrans %}Update{% endblocktrans %}
</button>
</form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment