fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c49f9c
)
better login/register page (new default login)
author
Jan Szejko
<janek37@gmail.com>
Tue, 8 May 2018 11:09:48 +0000
(13:09 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 8 May 2018 11:09:48 +0000
(13:09 +0200)
src/ajaxable/templates/ajaxable/form.html
patch
|
blob
|
history
src/wolnelektury/settings/auth.py
patch
|
blob
|
history
src/wolnelektury/templates/auth/login_register.html
patch
|
blob
|
history
src/wolnelektury/templates/auth/register.html
patch
|
blob
|
history
src/wolnelektury/templates/auth/register_form.html
[new file with mode: 0644]
patch
|
blob
src/wolnelektury/views.py
patch
|
blob
|
history
diff --git
a/src/ajaxable/templates/ajaxable/form.html
b/src/ajaxable/templates/ajaxable/form.html
index
3363bc8
..
0af34f4
100755
(executable)
--- a/
src/ajaxable/templates/ajaxable/form.html
+++ b/
src/ajaxable/templates/ajaxable/form.html
@@
-3,7
+3,7
@@
<h1>{{ title }}</h1>
<h1>{{ title }}</h1>
-<form action="{
{ action }
}" method="post" accept-charset="utf-8"
+<form action="{
% if action_url %}{% url action_url %}{% else %}{{ action }}{% endif %}{% if action_query %}?{{ action_query }}{% endif %
}" method="post" accept-charset="utf-8"
class="cuteform{% if placeholdize %} hidelabels{% endif %}">
{% ssi_csrf_token %}
{% if honeypot %}
class="cuteform{% if placeholdize %} hidelabels{% endif %}">
{% ssi_csrf_token %}
{% if honeypot %}
diff --git
a/src/wolnelektury/settings/auth.py
b/src/wolnelektury/settings/auth.py
index
2034db7
..
e704dc6
100644
(file)
--- a/
src/wolnelektury/settings/auth.py
+++ b/
src/wolnelektury/settings/auth.py
@@
-7,7
+7,7
@@
AUTHENTICATION_BACKENDS = [
# 'allauth.account.auth_backends.AuthenticationBackend',
]
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
# 'allauth.account.auth_backends.AuthenticationBackend',
]
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
-LOGIN_URL = '/uzytkownik/
login
/'
+LOGIN_URL = '/uzytkownik/
zaloguj-utworz
/'
LOGIN_REDIRECT_URL = '/'
LOGIN_REDIRECT_URL = '/'
diff --git
a/src/wolnelektury/templates/auth/login_register.html
b/src/wolnelektury/templates/auth/login_register.html
index
31d137c
..
6be2054
100755
(executable)
--- a/
src/wolnelektury/templates/auth/login_register.html
+++ b/
src/wolnelektury/templates/auth/login_register.html
@@
-6,16
+6,5
@@
{% block extra %}
{{ block.super }}
{% block extra %}
{{ block.super }}
- <h1>{% trans "or register" %}:</h1>
-
- <form action="{% url 'register' %}" method="post" accept-charset="utf-8"
- class="cuteform hidelabels">
- {% ssi_csrf_token %}
- {% render_honeypot_field %}
- <ol>
- <div id="id_register-__all__"></div>
- {{ register_form.as_ul }}
- <li><input type="submit" value="{{ register_submit }}"/></li>
- </ol>
- </form>
+ {% include "auth/register_form.html" with form=register_form title=_("or register") action_url='register' action_query=request.GET.urlencode honeypot=True submit=register_submit %}
{% endblock %}
{% endblock %}
diff --git
a/src/wolnelektury/templates/auth/register.html
b/src/wolnelektury/templates/auth/register.html
index
967fc6f
..
6849438
100644
(file)
--- a/
src/wolnelektury/templates/auth/register.html
+++ b/
src/wolnelektury/templates/auth/register.html
@@
-1,27
+1,16
@@
-{% extends "ajaxable/form.html" %}
{% load i18n %}
{% load i18n %}
-{% load ajaxable_tags %}
-{% block form_fields %}
- {{ form.username|pretty_field }}
- {{ form.email|pretty_field }}
- {{ form.password1|pretty_field }}
- {{ form.password2|pretty_field }}
- {{ form.agree_newsletter|pretty_checkbox }}
-{% endblock %}
-
-
-{% block extra %}
+{% include "auth/register_form.html" %}
{% if USE_OPENID %}
{% if USE_OPENID %}
-<h1>{% trans "Sign in using:" %}</h1>
+ <div class="form-extra">
+ <h1>{% trans "Sign in using:" %}</h1>
-<ul class="socialaccount_providers">
- {% include "socialaccount/snippets/provider_list.html" %}
-</ul>
+
<ul class="socialaccount_providers">
+
{% include "socialaccount/snippets/provider_list.html" %}
+
</ul>
-{% include "socialaccount/snippets/login_extra.html" %}
+ {% include "socialaccount/snippets/login_extra.html" %}
+ </div>
{% endif %}
{% endif %}
-
-{% endblock %}
diff --git a/src/wolnelektury/templates/auth/register_form.html
b/src/wolnelektury/templates/auth/register_form.html
new file mode 100644
(file)
index 0000000..
d9fb6a1
--- /dev/null
+++ b/
src/wolnelektury/templates/auth/register_form.html
@@ -0,0
+1,11
@@
+{% extends "ajaxable/form.html" %}
+{% load ajaxable_tags %}
+
+
+{% block form_fields %}
+ {{ form.username|pretty_field }}
+ {{ form.email|pretty_field }}
+ {{ form.password1|pretty_field }}
+ {{ form.password2|pretty_field }}
+ {{ form.agree_newsletter|pretty_checkbox }}
+{% endblock %}
\ No newline at end of file
diff --git
a/src/wolnelektury/views.py
b/src/wolnelektury/views.py
index
c62c2e5
..
6108122
100644
(file)
--- a/
src/wolnelektury/views.py
+++ b/
src/wolnelektury/views.py
@@
-115,7
+115,7
@@
class LoginRegisterFormView(LoginFormView):
def extra_context(self, request, obj):
return {
def extra_context(self, request, obj):
return {
- "register_form": placeholdized(
UserCre
ationForm(prefix='register')),
+ "register_form": placeholdized(
Registr
ationForm(prefix='register')),
"register_submit": _('Register'),
}
"register_submit": _('Register'),
}