modifs for not to modify django-1.3.tar.gz, better login management, add social_auth backend icons.
authorcavaliet
Mon, 18 Apr 2011 13:12:57 +0200
changeset 59 a06fab661ac4
parent 58 5c252fb36abb
child 60 77d07e49e245
child 61 517f98ea6b7e
modifs for not to modify django-1.3.tar.gz, better login management, add social_auth backend icons.
src/ldt/ldt/auth/views.py
virtualenv/res/lib/lib_create_env.py
virtualenv/res/src/Django-1.3-modified.tar.gz
virtualenv/res/src/Django-1.3.tar.gz
virtualenv/res/src/omab-django-social-auth-v0.3.10-modified.tar.gz
virtualenv/web/res/res_create_env.py
web/ldtplatform/templates/registration/login.html
web/ldtplatform/urls.py
web/static/ldt/img/logo_facebook.png
web/static/ldt/img/logo_google.png
web/static/ldt/img/logo_twitter.png
web/static/ldt/img/logo_yahoo.png
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/auth/views.py	Mon Apr 18 13:12:57 2011 +0200
@@ -0,0 +1,14 @@
+from social_auth.views import list as social_list
+from django.contrib.auth.views import login as django_login
+
+from django.contrib.auth import REDIRECT_FIELD_NAME
+from django.contrib.auth.forms import AuthenticationForm
+
+def login(request, template_name='registration/login.html',
+          redirect_field_name=REDIRECT_FIELD_NAME,
+          authentication_form=AuthenticationForm,
+          current_app=None):
+    
+    extra_context = {'social_list': social_list}
+    
+    return django_login(request, template_name,redirect_field_name,authentication_form,current_app,extra_context)
--- a/virtualenv/res/lib/lib_create_env.py	Thu Apr 14 18:00:39 2011 +0200
+++ b/virtualenv/res/lib/lib_create_env.py	Mon Apr 18 13:12:57 2011 +0200
@@ -14,7 +14,7 @@
 
 URLS = {
     'DISTRIBUTE': {'setup': 'distribute', 'url':'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz', 'local':"distribute-0.6.14.tar.gz"},
-    'DJANGO': {'setup': 'django', 'url': 'Django-1.3-modified.tar.gz', 'local':"Django-1.3-modified.tar.gz"},
+    'DJANGO': {'setup': 'django', 'url': 'http://www.djangoproject.com/download/1.3/tarball/', 'local':"Django-1.3.tar.gz"},
     'DJANGO-EXTENSIONS': { 'setup': 'django-extensions', 'url':'https://github.com/django-extensions/django-extensions/tarball/0.6', 'local':"django-extensions-0.6.tar.gz"},
     'DJANGO-REGISTRATION': { 'setup': 'django-registration', 'url':'http://bitbucket.org/ubernostrum/django-registration/get/tip.tar.gz', 'local':"django-registration.tar.gz"},
     'DJANGO-TAGGING': { 'setup': 'django-tagging', 'url':'http://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz', 'local':"django-tagging-0.3.1.tar.gz"},
Binary file virtualenv/res/src/Django-1.3-modified.tar.gz has changed
Binary file virtualenv/res/src/Django-1.3.tar.gz has changed
Binary file virtualenv/res/src/omab-django-social-auth-v0.3.10-modified.tar.gz has changed
--- a/virtualenv/web/res/res_create_env.py	Thu Apr 14 18:00:39 2011 +0200
+++ b/virtualenv/web/res/res_create_env.py	Mon Apr 18 13:12:57 2011 +0200
@@ -21,6 +21,7 @@
     ('DJANGO-EXTENSIONS', 'pip', None, None),
     ('DJANGO-REGISTRATION', 'easy_install', '-Z', None),
     ('DJANGO-TAGGING', 'pip', None, None),
+    ('DJANGO-PISTON', 'pip', None, None),
     ('HTTPLIB2', 'pip', None, None),
     ('OAUTH2', 'easy_install', None, None),
     ('DJANGO-OAUTH-PLUS', 'pip', None, None),
@@ -34,14 +35,11 @@
     ('JCC','easy_install',None,None),
     ('PSYCOPG2',install_psycopg2,None,None),
     ('PYLUCENE','easy_install',None,None),
-    # We have to install piston after and manually with pip install django-piston-0.2.2-modified.tar.gz, after having launched the virtualenv
-    #('DJANGO-PISTON', 'pip', None, None),
     ])
 else:
     INSTALLS.extend([
     ('PYLUCENE',install_pylucene,None,None),
     ('PSYCOPG2', 'pip', None, None),
-    ('DJANGO-PISTON', 'pip', None, None),
     ])
 
 if system_str == "Darwin":
@@ -50,8 +48,7 @@
     ])
 else:
     INSTALLS.extend([
-    # We have to install lxml after and manually with easy_install lxml-2.2.2-py2.6-win32.egg, after having launched the virtualenv
-    #('LXML', 'easy_install', None, None),
+    ('LXML', 'easy_install', None, None),
     ])
 
 
--- a/web/ldtplatform/templates/registration/login.html	Thu Apr 14 18:00:39 2011 +0200
+++ b/web/ldtplatform/templates/registration/login.html	Mon Apr 18 13:12:57 2011 +0200
@@ -32,8 +32,15 @@
 	        <ul id="login_fields_list">
 	        {{form.as_ul}}
 	        </ul>
-            <p>{% trans "Or login with your external account" %}</p>
-            {{social_list|safe}}
+            {% if social_list %}
+            <p>{% trans "Or login with your external account" %}&nbsp;:</p>
+            <ul>
+            {% for backend_name in social_list %}
+            <li><a href="{{ backend_name }}"><img src="{{LDT_MEDIA_PREFIX}}img/logo_{{backend_name}}.png" />&nbsp;{{ backend_name }}</a></li>
+            {% endfor %}
+            {% comment %}{{social_list|safe}}{% endcomment %}
+            </ul>
+            {% endif %}
 	        </div>
 	       	<div id="login_links" class="span-12 last">
 		       	<div id="login_links_list" class="span-12 last">
--- a/web/ldtplatform/urls.py	Thu Apr 14 18:00:39 2011 +0200
+++ b/web/ldtplatform/urls.py	Mon Apr 18 13:12:57 2011 +0200
@@ -2,8 +2,7 @@
 from django.contrib import admin
 from ldt.text import VERSION_STR
 from django.conf import settings
-from django.contrib.auth import views as auth_views
-
+from ldt.auth.views import login as pf_login
 
 # Uncomment the next two lines to enable the admin:
 admin.autodiscover()
@@ -28,7 +27,7 @@
 
     #(r'^accounts/', include('socialauth.urls')),
     (r'^accounts/', include('social_auth.urls')),
-    url(r'^accounts/login/$',auth_views.login,{'template_name': 'registration/login.html'},name='auth_login'),
+    url(r'^accounts/login/$',pf_login,{'template_name': 'registration/login.html'},name='auth_login'),
     (r'^oauth/', include('oauth_provider.urls')),
     
     #(r'^$', 'socialauth.views.signin_complete'),
Binary file web/static/ldt/img/logo_facebook.png has changed
Binary file web/static/ldt/img/logo_google.png has changed
Binary file web/static/ldt/img/logo_twitter.png has changed
Binary file web/static/ldt/img/logo_yahoo.png has changed