Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
etch
nuages
Commits
de4bbe01
Commit
de4bbe01
authored
Aug 19, 2014
by
Christophe Siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace registration with allauth. Activate persona.
parent
65a56743
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
85 additions
and
207 deletions
+85
-207
debian/control
debian/control
+4
-5
nuages/dev_settings.py
nuages/dev_settings.py
+4
-1
nuages/settings.py
nuages/settings.py
+28
-4
nuages/test_functional.py
nuages/test_functional.py
+9
-9
nuages/urls.py
nuages/urls.py
+6
-4
nuages_templates/static/css/nuages.css
nuages_templates/static/css/nuages.css
+17
-1
nuages_templates/templates/base.html
nuages_templates/templates/base.html
+14
-2
nuages_templates/templates/index.html
nuages_templates/templates/index.html
+3
-17
registration_templates/templates/registration/activate.html
registration_templates/templates/registration/activate.html
+0
-19
registration_templates/templates/registration/activation_complete.html
...templates/templates/registration/activation_complete.html
+0
-15
registration_templates/templates/registration/activation_email.txt
...ion_templates/templates/registration/activation_email.txt
+0
-7
registration_templates/templates/registration/activation_email_subject.txt
...lates/templates/registration/activation_email_subject.txt
+0
-1
registration_templates/templates/registration/login.html
registration_templates/templates/registration/login.html
+0
-20
registration_templates/templates/registration/logout.html
registration_templates/templates/registration/logout.html
+0
-6
registration_templates/templates/registration/password_change_done.html
...emplates/templates/registration/password_change_done.html
+0
-6
registration_templates/templates/registration/password_change_form.html
...emplates/templates/registration/password_change_form.html
+0
-11
registration_templates/templates/registration/password_reset_complete.html
...lates/templates/registration/password_reset_complete.html
+0
-11
registration_templates/templates/registration/password_reset_confirm.html
...plates/templates/registration/password_reset_confirm.html
+0
-21
registration_templates/templates/registration/password_reset_done.html
...templates/templates/registration/password_reset_done.html
+0
-6
registration_templates/templates/registration/password_reset_email.html
...emplates/templates/registration/password_reset_email.html
+0
-6
registration_templates/templates/registration/password_reset_form.html
...templates/templates/registration/password_reset_form.html
+0
-11
registration_templates/templates/registration/registration_complete.html
...mplates/templates/registration/registration_complete.html
+0
-6
registration_templates/templates/registration/registration_form.html
...n_templates/templates/registration/registration_form.html
+0
-18
No files found.
debian/control
View file @
de4bbe01
...
...
@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 9),
python-django-webtest,
python-django-datetime-widget,
python-django-jsonfield,
python-django-
registration
,
python-django-
allauth
,
python-django-debug-toolbar
Homepage: https://nuages.domainepublic.net
Vcs-Git: http://git.domainepublic.net/git/nuages.git/
...
...
@@ -20,7 +20,8 @@ Vcs-Browser: http://git.domainepublic.net/?p=nuages.git
Package: nuages
Architecture: all
Depends: python,
Depends: python-all (>= 2.6.6-3~),
${misc:Depends},
python-nuages (= ${source:Version}),
nginx | apache2 | httpd,
gunicorn | libapache2-mod-wsgi,
...
...
@@ -29,9 +30,7 @@ Depends: python,
python-django-webtest,
python-django-datetime-widget,
python-django-jsonfield,
python-django-registration,
python-all (>= 2.6.6-3~),
${misc:Depends}
python-django-allauth
Description: publish online polls
Nuages aims to provide a collaborative meeting poll system.
.
...
...
nuages/dev_settings.py
View file @
de4bbe01
...
...
@@ -5,6 +5,9 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG
=
True
TEMPLATE_DEBUG
=
True
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
ACCOUNT_DEFAULT_HTTP_PROTOCOL
=
'http'
# Make this unique.
SECRET_KEY
=
'3qm&@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
...
...
@@ -27,5 +30,5 @@ DATABASES = {
MEDIA_ROOT
=
os
.
path
.
join
(
PROJECT_DIR
,
'media'
)
STATIC_ROOT
=
os
.
path
.
join
(
PROJECT_DIR
,
'staticroot'
)
INSTALLED_APPS
+=
(
#
'debug_toolbar',
'debug_toolbar'
,
)
nuages/settings.py
View file @
de4bbe01
...
...
@@ -3,6 +3,7 @@
# Django settings for Nuages
import
os
import
socket
from
django.conf
import
global_settings
DEBUG
=
False
TEMPLATE_DEBUG
=
DEBUG
...
...
@@ -116,6 +117,27 @@ TEMPLATE_DIRS = (
# Don't forget to use absolute paths, not relative paths.
)
TEMPLATE_CONTEXT_PROCESSORS
=
global_settings
.
TEMPLATE_CONTEXT_PROCESSORS
+
(
# Required by allauth template tags
"django.core.context_processors.request"
,
# allauth specific context processors
"allauth.account.context_processors.account"
,
"allauth.socialaccount.context_processors.socialaccount"
,
)
AUTHENTICATION_BACKENDS
=
(
# Needed to login by username in Django admin, regardless of `allauth`
"django.contrib.auth.backends.ModelBackend"
,
# `allauth` specific authentication methods, such as login by e-mail
"allauth.account.auth_backends.AuthenticationBackend"
,
)
ACCOUNT_LOGOUT_ON_GET
=
True
ACCOUNT_DEFAULT_HTTP_PROTOCOL
=
'https'
ACCOUNT_USERNAME_MIN_LENGTH
=
3
INSTALLED_APPS
=
(
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
...
...
@@ -123,14 +145,16 @@ INSTALLED_APPS = (
'django.contrib.sites'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.admin'
,
'django.contrib.admindocs'
,
'south'
,
'registration'
,
'datetimewidget'
,
'nuages_templates'
,
'registration_templates'
,
'allauth'
,
'allauth.account'
,
'allauth.socialaccount'
,
'allauth.socialaccount.providers.persona'
,
'datetimewidget'
,
'meetingpoll'
,
'django.contrib.admin'
,
)
try
:
...
...
nuages/test_functional.py
View file @
de4bbe01
...
...
@@ -10,22 +10,22 @@ class LoginProcess(WebTest):
userFactory
()
def
testLoginProcess
(
self
):
login
=
self
.
app
.
get
(
reverse
(
'a
uth
_login'
))
login
.
form
[
'username
'
]
=
'username_1'
login
.
form
[
'password'
]
=
'password_1'
response
=
login
.
form
.
submit
().
follow
()
login
=
self
.
app
.
get
(
reverse
(
'a
ccount
_login'
))
login
.
form
s
[
1
][
'login
'
]
=
'username_1'
login
.
form
s
[
1
]
[
'password'
]
=
'password_1'
response
=
login
.
form
s
[
1
]
.
submit
().
follow
()
self
.
assertEquals
(
'200 OK'
,
response
.
status
)
self
.
assertContains
(
response
,
'My account'
,
count
=
1
,
status_code
=
200
)
def
testLoginWithInvalidCredentials
(
self
):
login
=
self
.
app
.
get
(
reverse
(
'a
uth
_login'
))
login
.
form
[
'username
'
]
=
'foo'
login
.
form
[
'password'
]
=
'bar'
response
=
login
.
form
.
submit
()
login
=
self
.
app
.
get
(
reverse
(
'a
ccount
_login'
))
login
.
form
s
[
1
][
'login
'
]
=
'foo'
login
.
form
s
[
1
]
[
'password'
]
=
'bar'
response
=
login
.
form
s
[
1
]
.
submit
()
self
.
assertContains
(
response
,
'
Please enter a correct
username and password
.
'
,
'
The
username and
/or
password
you specified are not correct
'
,
count
=
1
,
status_code
=
200
)
...
...
nuages/urls.py
View file @
de4bbe01
...
...
@@ -7,10 +7,11 @@ from django.views.generic import TemplateView, ListView
from
django.contrib
import
admin
admin
.
autodiscover
()
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
url
(
r
'^m/'
,
include
(
'meetingpoll.urls'
)),
url
(
r
'^accounts/'
,
include
(
'
registration.backends.default
.urls'
)),
#
url(r'^i18n/', include('django.conf.urls.i18n')),
url
(
r
'^accounts/'
,
include
(
'
allauth
.urls'
)),
url
(
r
'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r
'^admin/doc/'
,
include
(
'django.contrib.admindocs.urls'
)),
url
(
r
'^$'
,
...
...
@@ -29,7 +30,8 @@ urlpatterns = patterns('',
'meetingpoll.views.vote'
),
)
urlpatterns
+=
i18n_patterns
(
''
,
urlpatterns
+=
i18n_patterns
(
''
,
url
(
r
'^nuages/$'
,
TemplateView
.
as_view
(
template_name
=
'nuages.html'
),
name
=
'documentation_translated'
),
...
...
nuages_templates/static/css/nuages.css
View file @
de4bbe01
input
[
type
=
text
],
input
[
type
=
password
],
textarea
{
display
:
block
;
/*
display: block;
*/
/* width: 100%; */
/* height: 34px;*/
margin
:
6px
0
;
...
...
@@ -22,6 +22,22 @@ input:focus {
box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.075
),
0
0
8px
rgba
(
102
,
175
,
233
,
0.6
);
}
button
{
display
:
inline-block
;
padding
:
6px
12px
;
margin-bottom
:
0
;
font-size
:
14px
;
font-weight
:
400
;
line-height
:
1.42857143
;
text-align
:
center
;
white-space
:
nowrap
;
vertical-align
:
middle
;
cursor
:
pointer
;
user-select
:
none
;
background-image
:
none
;
border
:
1px
solid
transparent
;
border-radius
:
4px
}
.navbar-default
{
background-color
:
#fcfcfc
;
...
...
nuages_templates/templates/base.html
View file @
de4bbe01
...
...
@@ -36,21 +36,33 @@
<li><a
href=
"{% url 'home' %}"
title=
'{% trans "Homepage" %}'
>
Nuages
</a></li>
{% block menu %}{% endblock %}
{% if user.is_authenticated %}
<li><a
href=
"{% url 'a
uth
_logout' %}"
>
{% trans 'Logout' %}
</a></li>
<li><a
href=
"{% url 'a
ccount
_logout' %}"
>
{% trans 'Logout' %}
</a></li>
{% else %}
<li><a
href=
"{% url 'a
uth
_login' %}"
>
{% trans 'Login' %}
</a></li>
<li><a
href=
"{% url 'a
ccount
_login' %}"
>
{% trans 'Login' %}
</a></li>
{% endif %}
</ul>
</div>
<div
class=
"box"
>
{% block main %}{% endblock %}
{% block content %}{% endblock %}
</div>
<br
/><br
/>
<div
class=
"navi box"
>
{% block footer %}{% endblock %}
<p>
{% trans "This page is available in the following languages" %}:
{% get_available_languages as languages %}
{% for lang_code, lang_name in languages %}
{% language lang_code %}
<a
href=
"{% url 'home_translated' %}"
>
{{ lang_name }}
</a>
{% endlanguage %}
{% endfor %}.
</p>
<p>
{% trans "Nuages is brought to you by" %}
<a
href=
"http://www.domainepublic.net"
>
Domaine Public
</a>
.
<p>
</div>
...
...
nuages_templates/templates/index.html
View file @
de4bbe01
...
...
@@ -48,9 +48,9 @@
<ul>
<li>
{% trans "Username" %}: {{user}}
</li>
<li><a
href=
"{% url 'profile' %}"
>
{% trans 'Email notifications' %}
</a>
: {{ user.userprofile.email_notifications }}
</li>
<li><a
href=
"{% url 'a
uth
_password
_change
' %}"
>
{% trans 'Change password' %}
</a></li>
<!--
<li><a href="
/user/email/change/
">{% trans '
Ch
ange email ad
d
ress' %}</a>
</li>-->
<li><a
href=
"{% url 'a
uth
_logout' %}"
>
{% trans 'Logout' %}
</a></li>
<li><a
href=
"{% url 'a
ccount_change
_password' %}"
>
{% trans 'Change password' %}
</a></li>
<li><a
href=
"
{% url 'account_email' %}
"
>
{% trans '
M
an
a
ge email adress
es
' %}
</a>
<li><a
href=
"{% url 'a
ccount
_logout' %}"
>
{% trans 'Logout' %}
</a></li>
</ul>
{% else %}
{% endif %}
...
...
@@ -59,17 +59,3 @@
{% include 'nuages.html' %}
{% endblock %}
{% block footer %}
<p>
{% trans "This page is available in the following languages" %}:
{% get_available_languages as languages %}
{% for lang_code, lang_name in languages %}
{% language lang_code %}
<a
href=
"{% url 'home_translated' %}"
>
{{ lang_name }}
</a>
{% endlanguage %}
{% endfor %}.
</p>
{% endblock %}
registration_templates/templates/registration/activate.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block main %}
{% if account %}
<p>
{% trans "Account successfully activated" %}
</p>
<p><a
href=
"{% url 'auth_login' %}"
>
{% trans "Log in" %}
</a></p>
{% else %}
<p>
{% trans "Account activation failed" %}
</p>
{% endif %}
{% endblock %}
registration_templates/templates/registration/activation_complete.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block main %}
<h2>
Success
</h2>
<p
class=
"filet"
>
{% trans 'Your account has been created. You may now login.' %}
</p>
<ul>
<li><a
href=
"{% url 'auth_login' %}"
>
Log in
</a></li>
</ul>
{% endblock %}
registration_templates/templates/registration/activation_email.txt
deleted
100644 → 0
View file @
65a56743
{% load i18n %}
{% load url from future %}
{% trans "Activate account at" %} {{ site.name }}:
http://{{ site.domain }}{% url 'registration_activate' activation_key %}
{% blocktrans %}Link is valid for {{ expiration_days }} days.{% endblocktrans %}
registration_templates/templates/registration/activation_email_subject.txt
deleted
100644 → 0
View file @
65a56743
{% load i18n %}{% trans "Account activation on" %} {{ site.name }}
registration_templates/templates/registration/login.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block main %}
<h1>
{% trans "Authentication" %}
</h1>
<p
class=
"lead"
>
{% trans "Fill in the form with your credentials." %}
</p>
<form
method=
"post"
action=
"."
>
{% csrf_token %}
<table>
{{ form }}
<tr><th><label
class=
"hide"
>
</label></th><td><input
type=
"submit"
value=
"{% trans 'Log in' %}"
class=
"btn"
/></td></tr>
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</table>
</form>
<br
/>
<p>
{% trans "Forgot password" %}?
<a
href=
"{% url 'auth_password_reset' %}"
>
{% trans "Reset it" %}
</a>
!
</p>
<p>
{% trans "Not member" %}?
<a
href=
"{% url 'registration_register' %}"
>
{% trans "Register" %}
</a>
!
</p>
{% endblock %}
registration_templates/templates/registration/logout.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<p>
{% trans "Logged out" %}
</p>
{% endblock %}
registration_templates/templates/registration/password_change_done.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<p>
{% trans "Password changed" %}
</p>
{% endblock %}
registration_templates/templates/registration/password_change_form.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<form
method=
"post"
action=
"."
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"{% trans 'Submit' %}"
/>
</form>
{% endblock %}
registration_templates/templates/registration/password_reset_complete.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block main %}
<p>
{% trans "Password reset successfully" %}
</p>
<p><a
href=
"{% url 'auth_login' %}"
>
{% trans "Log in" %}
</a></p>
{% endblock %}
registration_templates/templates/registration/password_reset_confirm.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
{% if validlink %}
<form
method=
"post"
action=
"."
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"{% trans 'Submit' %}"
/>
</form>
{% else %}
<p>
{% trans "Password reset failed" %}
</p>
{% endif %}
{% endblock %}
registration_templates/templates/registration/password_reset_done.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<p>
{% trans "Email with password reset instructions has been sent." %}
</p>
{% endblock %}
registration_templates/templates/registration/password_reset_email.html
deleted
100644 → 0
View file @
65a56743
{% load i18n %}
{% load url from future %}
{% blocktrans %}Reset password at {{ site_name }}{% endblocktrans %}:
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uidb36=uid, token=token %}
{% endblock %}
registration_templates/templates/registration/password_reset_form.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<form
method=
"post"
action=
"."
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"{% trans 'Submit' %}"
/>
</form>
{% endblock %}
registration_templates/templates/registration/registration_complete.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block main %}
<p>
{% trans "You are now registered. Activation email sent." %}
</p>
{% endblock %}
registration_templates/templates/registration/registration_form.html
deleted
100644 → 0
View file @
65a56743
{% extends "base.html" %}
{% load i18n %}
{% block title %}Nuages - Create an account{% endblock %}
{% block main %}
<h1>
{% trans "Account creation" %}
</h1>
<p
class=
"lead"
>
{% trans "Fill in the form to create an account." %}
</p>
<form
action=
""
method=
"post"
>
{% csrf_token %}
<table>
{{ form }}
<tr><th><label
class=
"hide"
>
</label></th><td><input
type=
"submit"
value=
"Create the account"
class=
"btn"
></td></tr>
</table>
</form>
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment