parent
93f6ffc571
commit
34c0a73cdb
|
@ -30,11 +30,11 @@ admin.site.register(Series, SeriesAdmin)
|
|||
|
||||
|
||||
class VolumeAdmin(reversion.VersionAdmin):
|
||||
list_display_links = ('number', )
|
||||
list_display = ('series', 'number', )
|
||||
# list_display_links = ('number', )
|
||||
list_display = ('series', 'number', 'release_date',)
|
||||
search_fields = ('number', 'series__name', )
|
||||
list_filter = ('series', )
|
||||
list_editable = ('series', )
|
||||
# list_filter = ('series', )
|
||||
# list_editable = ('series', )
|
||||
|
||||
admin.site.register(Volume, VolumeAdmin)
|
||||
|
||||
|
|
|
@ -4,18 +4,18 @@ from django.utils.translation import ugettext_lazy as _
|
|||
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
email = forms.EmailField(max_length=75)
|
||||
username = forms.CharField(max_length=75, label=_('Username'))
|
||||
password = forms.CharField(
|
||||
max_length=255, widget=forms.PasswordInput)
|
||||
max_length=255, widget=forms.PasswordInput, label=_('Password'))
|
||||
|
||||
def authenticate(self):
|
||||
result = None
|
||||
|
||||
if self.cleaned_data:
|
||||
email = self.cleaned_data['email']
|
||||
username = self.cleaned_data['username']
|
||||
password = self.cleaned_data['password']
|
||||
|
||||
result = authenticate(username=email, password=password)
|
||||
result = authenticate(username=username, password=password)
|
||||
|
||||
return result
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ ALLOWED_HOSTS = []
|
|||
# Application definition
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# Longer username to use the email!
|
||||
'longerusername',
|
||||
|
||||
# Admin
|
||||
|
|
|
@ -17,7 +17,7 @@ body {
|
|||
position: absolute;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
width: 300px;
|
||||
width: @width;
|
||||
}
|
||||
|
||||
/* Alternative behaviours for bootstrap */
|
||||
|
|
|
@ -24,21 +24,19 @@ $(function(){
|
|||
<h3 class="panel-title">{% trans "Access the site" %}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" class="form form-horizontal">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{% for field in login_form %}
|
||||
<div class="form-group {% if field.errors %}has-error has-feedback{% endif %} form-horizontal">
|
||||
{% for error in field.errors %}
|
||||
<p><span class="label label-danger">{{ error|striptags }}</span></p>
|
||||
{% endfor %}
|
||||
<label class="col-sm-2 control-label">{{ field.label }}</label>
|
||||
<div class="col-sm-offset-2 col-sm-8 field-{{ field.html_name }}">
|
||||
<div class="form-group {% if field.errors %}has-error has-feedback{% endif %}">
|
||||
<label class="control-label">{{ field.label }}</label>
|
||||
<input type="{{ field.field.widget.input_type }}" name="{{ field.html_name }}" class="form-control {{ field.classes }}" />
|
||||
{% if field.errors %}
|
||||
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Login" %}</button>
|
||||
</form>
|
||||
|
|
Reference in New Issue