Display edit password button
This commit is contained in:
parent
b4da740fb6
commit
a454441097
|
@ -20,7 +20,7 @@ class RegistrationTable(tables.Table):
|
||||||
|
|
||||||
def order_type(self, queryset, desc):
|
def order_type(self, queryset, desc):
|
||||||
types = ["volunteerregistration__adminregistration", "volunteerregistration", "participantregistration"]
|
types = ["volunteerregistration__adminregistration", "volunteerregistration", "participantregistration"]
|
||||||
return queryset.order_by(*(("" if desc else "-") + t for t in types)), True
|
return queryset.order_by(*(("-" if desc else "") + t for t in types)), True
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
attrs = {
|
attrs = {
|
||||||
|
@ -28,5 +28,5 @@ class RegistrationTable(tables.Table):
|
||||||
}
|
}
|
||||||
model = Registration
|
model = Registration
|
||||||
fields = ('last_name', 'user__first_name', 'user__email', 'type',)
|
fields = ('last_name', 'user__first_name', 'user__email', 'type',)
|
||||||
order_by = ('volunteerregistration__adminregistration', 'volunteerregistration', 'last_name', 'first_name',)
|
order_by = ('type', 'last_name', 'first_name',)
|
||||||
template_name = 'django_tables2/bootstrap4.html'
|
template_name = 'django_tables2/bootstrap4.html'
|
||||||
|
|
|
@ -21,6 +21,15 @@
|
||||||
<dd class="col-sm-6"><a href="mailto:{{ user_object.email }}">{{ user_object.email }}</a>
|
<dd class="col-sm-6"><a href="mailto:{{ user_object.email }}">{{ user_object.email }}</a>
|
||||||
{% if not user_object.registration.email_confirmed %} (<em>{% trans "Not confirmed" %}, <a href="{% url "registration:email_validation_resend" pk=user_object.pk %}">{% trans "resend the validation link" %}</a></em>){% endif %}</dd>
|
{% if not user_object.registration.email_confirmed %} (<em>{% trans "Not confirmed" %}, <a href="{% url "registration:email_validation_resend" pk=user_object.pk %}">{% trans "resend the validation link" %}</a></em>){% endif %}</dd>
|
||||||
|
|
||||||
|
{% if user_object == user %}
|
||||||
|
<dt class="col-sm-6 text-right">{% trans "Password:" %}</dt>
|
||||||
|
<dd class="col-sm-6">
|
||||||
|
<a href="{% url 'password_change' %}" class="btn-sm btn-secondary" data-turbolinks="false">
|
||||||
|
<i class="fas fa-edit"></i> {% trans "Change password" %}
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if user_object.registration.participates %}
|
{% if user_object.registration.participates %}
|
||||||
<dt class="col-sm-6 text-right">{% trans "Team:" %}</dt>
|
<dt class="col-sm-6 text-right">{% trans "Team:" %}</dt>
|
||||||
{% trans "any" as any %}
|
{% trans "any" as any %}
|
||||||
|
|
Loading…
Reference in New Issue