8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 19:33:11 +00:00

Merge branch 'frontend_profile' into 'dev'

Use a detailed list rather than a table on profile

See merge request federez/re2o!377
This commit is contained in:
chirac 2018-12-30 13:07:51 +01:00
commit 93215eb0a9
2 changed files with 177 additions and 137 deletions

View file

@ -79,19 +79,6 @@ a > i.fa {
vertical-align: middle; vertical-align: middle;
} }
/* Pull sidebars to the bottom */
@media (min-width: 767px) {
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.row > [class*='col-'] {
flex-direction: column;
}
}
/* On small screens, set height to 'auto' for sidenav and grid */ /* On small screens, set height to 'auto' for sidenav and grid */
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
.sidenav { .sidenav {
@ -145,3 +132,14 @@ th.long_text{
.dashboard{ .dashboard{
text-align: center; text-align: center;
} }
/* Detailed information on profile page */
dl.profile-info {
margin-top: -16px;
margin-bottom: 0;
}
dl.profile-info > div {
padding: 8px;
border-top: 1px solid #ddd;
}

View file

@ -117,147 +117,189 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel-group" id="accordion"> <div class="panel-group" id="accordion">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse1"> <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
<h3 class="panel-title pull-left" > data-target="#collapse1">
<i class="fa fa-user"></i>{% trans " Detailed information" %} <h3 class="panel-title pull-left">
<i class="fa fa-user"></i>{% trans " Detailed information" %}
</h3> </h3>
</div> </div>
<div class="panel-collapse collapse in" id="collapse1"> <div class="panel-collapse collapse in" id="collapse1">
<div class="panel-body"> <div class="panel-body">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}">
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
{% trans "Edit" %} {% trans "Edit" %}
</a> </a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}">
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
{% trans "Change the password" %} {% trans "Change the password" %}
</a> </a>
{% can_change User state %} {% can_change User state %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}">
<i class="fa fa-id-badge"></i> <i class="fa fa-id-badge"></i>
{% trans "Change the state" %} {% trans "Change the state" %}
</a> </a>
{% acl_end %} {% acl_end %}
{% can_change User groups %} {% can_change User groups %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}">
<i class="fa fa-check"></i> <i class="fa fa-check"></i>
{% trans "Edit the groups" %} {% trans "Edit the groups" %}
</a> </a>
{% acl_end %} {% acl_end %}
{% history_button users text=True %} {% history_button users text=True %}
</ul> </ul>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="table-responsive"> <dl class="dl-horizontal row profile-info">
<table class="table table-striped"> <div class="col-md-6">
<tr>
{% if users.is_class_club %} {% if users.is_class_club %}
<th>{% trans "Mailing" %}</th> <dt>{% trans "Mailing" %}</dt>
{% if users.club.mailing %} {% if users.club.mailing %}
<td>{{ users.pseudo }}(-admin)</td> <dd>{{ users.pseudo }}(-admin)</dd>
{% else %} {% else %}
<td>{% trans "Mailing disabled" %}</td> <dd>{% trans "Mailing disabled" %}</dd>
{% endif %} {% endif %}
{% else %}
<th>{% trans "Firt name" %}</th>
<td>{{ users.name }}</td>
{% endif %}
<th>{% trans "Surname" %}</th>
<td>{{ users.surname }}</td>
</tr>
<tr>
<th>{% trans "Username" %}</th>
<td>{{ users.pseudo }}</td>
<th>{% trans "Email address" %}</th>
<td><a href="mailto:{{ users.email }}">{{users.email}}</a></td>
</tr>
<tr>
<th>{% trans "Room" %}</th>
<td>{{ users.room }} {% can_view_all Port %}{% if users.room.port_set.all %} / {{ users.room.port_set.all|join:", " }} {% endif %}{% acl_end %}</td>
<th>{% trans "Telephone number" %}</th>
<td>{{ users.telephone }}</td>
</tr>
<tr>
<th>{% trans "School" %}</th>
<td>{{ users.school }}</td>
<th>{% trans "Comment" %}</th>
<td>{{ users.comment }}</td>
</tr>
<tr>
<th>{% trans "Registration date" %}</th>
<td>{{ users.registered }}</td>
<th>{% trans "Last login" %}</th>
<td>{{ users.last_login }}</td>
</tr>
<tr>
<th>{% trans "End of membership" %}</th>
{% if users.end_adhesion != None %}
<td><i class="text-success">{{ users.end_adhesion }}</i></td>
{% else %} {% else %}
<td><i class="text-danger">{% trans "Not a member" %}</i></td> <dt>{% trans "Firt name" %}</dt>
<dd>{{ users.name }}</dd>
{% endif %} {% endif %}
<th>{% trans "Whitelist" %}</th> </div>
{% if users.end_whitelist != None %}
<td><i class="text-success">{{ users.end_whitelist }}</i></td>
{% else %}
<td><i class="text-warning">{% trans "None" %}</i></td>
{% endif %}
<tr>
<th>{% trans "Ban" %}</th>
{% if users.end_ban != None %}
<td><i class="text-danger">{{ users.end_ban }}</i></td>
{% else %}
<td><i class="text-success">{% trans "Not banned" %}</i></td>
{% endif %}
<th>{% trans "State" %}</th>
{% if users.state == 0 %}
<td><i class="text-success">{% trans "Active" %}</i></td>
{% elif users.state == 1 %}
<td><i class="text-warning">{% trans "Disabled" %}</i></td>
{% elif users.state == 2 %}
<td><i class="text-danger">{% trans "Archived" %}</i></td>
{% elif users.state == 3 %}
<td><i class="text-danger">{% trans "Not yet Member" %}</i></td>
<div class="col-md-6">
<dt>{% trans "Surname" %}</dt>
<dd>{{ users.surname }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Username" %}</dt>
<dd>{{ users.pseudo }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Email address" %}</dt>
<dd><a href="mailto:{{ users.email }}">{{ users.email }}</a></dd>
</div>
<div class="col-md-6">
<dt>{% trans "Room" %}</dt>
<dd>
{{ users.room }} {% can_view_all Port %}{% if users.room.port_set.all %} /
{{ users.room.port_set.all|join:", " }} {% endif %}{% acl_end %}
</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Telephone number" %}</dt>
<dd>{{ users.telephone }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "School" %}</dt>
<dd>{{ users.school }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Comment" %}</dt>
<dd>{{ users.comment }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Registration date" %}</dt>
<dd>{{ users.registered }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "Last login" %}</dt>
<dd>{{ users.last_login }}</dd>
</div>
<div class="col-md-6">
<dt>{% trans "End of membership" %}</dt>
{% if users.end_adhesion != None %}
<dd><i class="text-success">{{ users.end_adhesion }}</i></dd>
{% else %}
<dd><i class="text-danger">{% trans "Not a member" %}</i></dd>
{% endif %} {% endif %}
</tr> </div>
<tr>
<th>{% trans "Internet access" %}</th> <div class="col-md-6">
<dt>{% trans "Whitelist" %}</dt>
{% if users.end_whitelist != None %}
<dd><i class="text-success">{{ users.end_whitelist }}</i></dd>
{% else %}
<dd><i class="text-warning">{% trans "None" %}</i></dd>
{% endif %}
</div>
<div class="col-md-6">
<dt>{% trans "Ban" %}</dt>
{% if users.end_ban != None %}
<dd><i class="text-danger">{{ users.end_ban }}</i></dd>
{% else %}
<dd><i class="text-success">{% trans "Not banned" %}</i></dd>
{% endif %}
</div>
<div class="col-md-6">
<dt>{% trans "State" %}</dt>
{% if users.state == 0 %}
<dd><i class="text-success">{% trans "Active" %}</i></dd>
{% elif users.state == 1 %}
<dd><i class="text-warning">{% trans "Disabled" %}</i></dd>
{% elif users.state == 2 %}
<dd><i class="text-danger">{% trans "Archived" %}</i></dd>
{% elif users.state == 3 %}
<dd><i class="text-danger">{% trans "Not yet Member" %}</i></dd>
{% endif %}
</div>
<div class="col-md-6">
<dt>{% trans "Internet access" %}</dt>
{% if users.has_access == True %} {% if users.has_access == True %}
<td><i class="text-success">{% blocktrans with end_access=users.end_access %}Active (until {{ end_access }}){% endblocktrans %}</i></td> <dd><i class="text-success">
{% blocktrans with end_access=users.end_access %}Active
(until {{ end_access }}){% endblocktrans %}</i></dd>
{% else %} {% else %}
<td><i class="text-danger">{% trans "Disabled" %}</i></td> <dd><i class="text-danger">{% trans "Disabled" %}</i></dd>
{% endif %} {% endif %}
<th>{% trans "Groups of rights" %}</th> </div>
<div class="col-md-6">
<dt>{% trans "Groups of rights" %}</dt>
{% if users.groups.all %} {% if users.groups.all %}
<td>{{ users.groups.all|join:", "}}</td> <dd>{{ users.groups.all|join:", " }}</dd>
{% else %} {% else %}
<td>{% trans "None" %}</td> <dd>{% trans "None" %}</dd>
{% endif %} {% endif %}
</tr> </div>
<tr>
<th>{% trans "Balance" %}</th> <div class="col-md-6">
<td>{{ users.solde }} € <dt>{% trans "Balance" %}</dt>
{% if user_solde %} <dd>
<a class="btn btn-primary btn-sm" style='float:right' role="button" href="{% url 'cotisations:credit-solde' users.pk%}"> {{ users.solde }} €
<i class="fa fa-eur"></i> {% if user_solde %}
{% trans "Refill" %} <a class="btn btn-primary btn-sm" style='float:right' role="button"
</a> href="{% url 'cotisations:credit-solde' users.pk %}">
{% endif %} <i class="fa fa-eur"></i>
</td> {% trans "Refill" %}
{% if users.adherent.gpg_fingerprint %} </a>
<th>{% trans "GPG fingerprint" %}</th> {% endif %}
<td>{{ users.adherent.gpg_fingerprint }}</td> </dd>
{% endif %} </div>
</tr>
<tr> {% if users.adherent.gpg_fingerprint %}
{% if users.shell %} <div class="col-md-6 col-xs-12">
<th>{% trans "Shell" %}</th> <dt>{% trans "GPG fingerprint" %}</dt>
<td>{{ users.shell }}</td> <dd>{{ users.adherent.gpg_fingerprint }}</dd>
{% endif %} </div>
</tr> {% endif %}
</table>
</div> {% if users.shell %}
<div class="col-md-6 col-xs-12">
<dt>{% trans "Shell" %}</dt>
<dd>{{ users.shell }}</dd>
</div>
{% endif %}
</dl>
</div> </div>
</div> </div>
</div> </div>