Small spelling fixes in email, use real name in header bar when logged in, add fields to Account admin
This commit is contained in:
parent
8a63da154c
commit
92b6370ed7
3 changed files with 10 additions and 4 deletions
|
@ -1,11 +1,14 @@
|
|||
from django.contrib import admin
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from .models import Account, Badge, BadgeGrant
|
||||
from .models import Account, Badge, BadgeGrant, EmailConfirmation
|
||||
|
||||
# Register your models here.
|
||||
class AccountAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'acctname')
|
||||
list_display = ('user', 'acctname', 'email', 'is_email_confirmed')
|
||||
def email(self, obj):
|
||||
return obj.user.email
|
||||
email.short_description = 'Email'
|
||||
admin.site.register(Account, AccountAdmin)
|
||||
|
||||
class BadgeAdmin(admin.ModelAdmin):
|
||||
|
@ -19,4 +22,7 @@ class GrantAdmin(admin.ModelAdmin):
|
|||
list_display = ('badge', 'account', 'expires', 'granted_by')
|
||||
admin.site.register(BadgeGrant, GrantAdmin)
|
||||
|
||||
class ConfirmationAdmin(admin.ModelAdmin):
|
||||
list_display = ('email', 'user', 'key', 'expires')
|
||||
admin.site.register(EmailConfirmation, ConfirmationAdmin)
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ form {
|
|||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarUserMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Welcome {{ request.user.username }}
|
||||
<img class="rounded-circle mr-1" src="{{request.user.profile.avatar}}" height="24px"/>{% if request.user.profile.realname %}{{ request.user.profile.realname }}{% else %}{{ request.user.username }}{% endif %}
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarUserMenuLink">
|
||||
<a class="dropdown-item" href="{% url 'edit-profile' %}">Profile</a>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<p>The confirmation link is invalid. Either it does not belong to <strong>{{request.user.email}}</strong> or the confirmation key has expired.</p>
|
||||
|
||||
<p><a href={% url 'send-confirm-email' %}" class="btn btn-primary">Resend confirmation email</a></p>
|
||||
<p><a href="{% url 'send-confirm-email' %}" class="btn btn-primary">Resend confirmation email</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue