From a63ae38d3ee939a3c925050d2ecb9b2d7a6629ea Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sat, 11 Jan 2014 12:47:53 -0500 Subject: [PATCH] Improving login experience --- .../0013_auto__chg_field_note_user.py | 6 ++-- karmaworld/apps/notes/models.py | 1 + karmaworld/apps/users/models.py | 29 +++++++++++++++++- karmaworld/assets/css/accounts.css | 14 ++------- karmaworld/assets/css/global.css | 8 +++-- karmaworld/assets/img/facebook.png | Bin 3919 -> 3848 bytes karmaworld/assets/img/google.png | Bin 0 -> 2470 bytes karmaworld/assets/img/twitter.png | Bin 0 -> 2830 bytes karmaworld/settings/common.py | 9 ++---- karmaworld/templates/account/base.html | 2 +- karmaworld/templates/account/login.html | 7 ++--- .../templates/courses/course_detail.html | 27 ---------------- karmaworld/templates/partial/filepicker.html | 12 +++++--- .../templates/socialaccount/connections.html | 2 -- .../socialaccount/snippets/provider_list.html | 4 +-- karmaworld/templates/user_profile.html | 23 +++++--------- 16 files changed, 61 insertions(+), 83 deletions(-) create mode 100644 karmaworld/assets/img/google.png create mode 100644 karmaworld/assets/img/twitter.png diff --git a/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py b/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py index 3eb44db..03d5126 100644 --- a/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py +++ b/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py @@ -114,12 +114,12 @@ class Migration(SchemaMigration): 'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}) }, 'notes.note': { - 'Meta': {'ordering': "['-uploaded_at']", 'object_name': 'Note'}, + 'Meta': {'ordering': "['-uploaded_at']", 'unique_together': "(('fp_file', 'upstream_link'),)", 'object_name': 'Note'}, 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Course']"}), 'file_type': ('django.db.models.fields.CharField', [], {'default': "'???'", 'max_length': '15', 'null': 'True', 'blank': 'True'}), 'flags': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'fp_file': ('django_filepicker.models.FPFileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'gdrive_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'gdrive_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'html': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}), @@ -133,7 +133,7 @@ class Migration(SchemaMigration): 'thanks': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'tweeted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow', 'null': 'True'}), - 'upstream_link': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'upstream_link': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), 'year': ('django.db.models.fields.IntegerField', [], {'default': '2014', 'null': 'True', 'blank': 'True'}) }, diff --git a/karmaworld/apps/notes/models.py b/karmaworld/apps/notes/models.py index f9f281a..d284977 100644 --- a/karmaworld/apps/notes/models.py +++ b/karmaworld/apps/notes/models.py @@ -189,6 +189,7 @@ class Note(Document): class Meta: unique_together = ('fp_file', 'upstream_link') + ordering = ['-uploaded_at'] def __unicode__(self): return u"Note at {0} (from {1})".format(self.fp_file, self.upstream_link) diff --git a/karmaworld/apps/users/models.py b/karmaworld/apps/users/models.py index 42d9704..53106dc 100644 --- a/karmaworld/apps/users/models.py +++ b/karmaworld/apps/users/models.py @@ -1,9 +1,11 @@ #!/usr/bin/env python # -*- coding:utf8 -*- # Copyright (C) 2013 FinalsClub Foundation +import random from allauth.account.signals import user_logged_in from django.contrib.auth.models import User -from django.db.models.signals import post_save +from django.core.exceptions import ObjectDoesNotExist +from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.db import models from karmaworld.apps.courses.models import School @@ -19,6 +21,31 @@ class UserProfile(models.Model): def __unicode__(self): return self.user.__unicode__() +def user_display_name(user): + """Return the best way to display a user's + name to them on the site.""" + if user.first_name or user.last_name: + return user.first_name + ' ' + user.last_name + else: + return user.username + + +@receiver(pre_save, sender=User, weak=True) +def assign_username(sender, instance, **kwargs): + # If a user does not have a username, they need + # one before we save to the database + if not instance.username: + if instance.email: + try: + # See if any other users have this email address + others = User.objects.get(email=instance.email) + except ObjectDoesNotExist: + instance.username = instance.email + else: + instance.username = 'user' + str(random.randint(10000, 100000)) + else: + instance.username = 'user' + str(random.randint(10000, 100000)) + @receiver(post_save, sender=User, weak=True) def create_user_profile(sender, instance, created, **kwargs): diff --git a/karmaworld/assets/css/accounts.css b/karmaworld/assets/css/accounts.css index 2d70e5c..ebb026d 100644 --- a/karmaworld/assets/css/accounts.css +++ b/karmaworld/assets/css/accounts.css @@ -24,16 +24,6 @@ ul list-style-type: none; } -button, -button:hover -{ - border: none; - background-color: white; - color: #f05a28; - cursor: pointer; - font: 30px/1.2em "MuseoSlab-300", serif; - margin: 1px; - text-align: center; - text-transform: uppercase; +.errorlist { + color: #c60f13 } - diff --git a/karmaworld/assets/css/global.css b/karmaworld/assets/css/global.css index 502ef73..962c112 100644 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@ -857,7 +857,9 @@ legend /* Social account integration */ -.facebook-login-btn -{ - content: url(../img/facebook.png); +ul.socialaccount_providers li { + list-style: none; + margin: 10px 0 5px 0; } + + diff --git a/karmaworld/assets/img/facebook.png b/karmaworld/assets/img/facebook.png index a9e2d57bd5618cdeaf3be13fbc97c05d8b301cda..8d0d202c68465148e12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6{?IyN?z-2&PwGcx5u z;W^%eBOf2dc=1%ik=bOz$#D&FHB;Q@ek8Zu-E z7u<^kQMAWeTCG;cMt3&{j}DNd{0(HUlr7$y8j}1>^;WMb-r1`uBO%D4Y^T}s=S=SC z(W7kEM~oQ3yKL&zsZ1`lWdbR&uy7F|7p$Z+%O%ECKJz3%g|*x7JLuzJYm5Ra`~xw64~F=_SAQd$PJ#dGzYv%W+@c!2m3BmK5VpDFy88z19JqDs7H?`;9&8BIg`0KOUew`E;cbLm*yNBE@gp|<@#Du? z|0qb@;KG%b+Z~70>*6-KPzK~>at2s!vr=hA75_BmB%`1yt#vdh%HY@mt_p|*1zoss zfzPti)6-c=^XJc}UJ%0+0vK;PUzBN_nFoi*`27(4j*)Jb-mXwuxt0 z0}yP(h7G)qIB$i{7cXAS<>}L>d~$${-BY>MbHHC9*CD%cg`aXB(QmeDdQoAgmv%k> zLZJ%^A<5`hpJaT7S+djLJDX@|u*4*F2b>c@8CW=Bt`Wn*qM$uuw4k6MzDKNa?%X-L zfB!xQvB-LHKX>k2nlfbylNjHk4U{Jm0cCq7pfG=be-4rX^>^yN)DZ05jgK_Y z_Yp?YRoa{$7P})LCgv_qK#+^whWChPaAbhC>({U6Ls|{qhe+6(8_%hMOqq#?bET#L zR%0ijr~#IP`N|B*D?hQwaCF|2uf~>Xm0%tw{HOPk>;EV-S;w zU{;yVYxqC=>y)nvkkivRLc`ZjyfS$~&5|T(+R)&2eD+XQ5bvCv0sT>AF&Z>@6Q48q zED$fFyu5sb%*0@%)|%zh;4Mps1k`4;;Xia|fOvUwNs=FA%H@0cK1frO1}^}IrrB~? gnwXfF|8D^X0CRvgkza{CzyJUM07*qoM6N<$f(rqOGynhq literal 0 HcmV?d00001 diff --git a/karmaworld/settings/common.py b/karmaworld/settings/common.py index e7d55f7..4b20c2f 100644 --- a/karmaworld/settings/common.py +++ b/karmaworld/settings/common.py @@ -217,7 +217,6 @@ THIRD_PARTY_APPS = ( # ... include the providers you want to enable: 'allauth.socialaccount.providers.facebook', 'allauth.socialaccount.providers.google', - 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.twitter', ) @@ -255,13 +254,9 @@ ACCOUNT_USER_MODEL_EMAIL_FIELD = "email" ACCOUNT_USERNAME_REQUIRED = False SOCIALACCOUNT_EMAIL_REQUIRED = True SOCIALACCOUNT_EMAIL_VERIFICATION = "optional" +ACCOUNT_USER_DISPLAY = 'karmaworld.apps.users.models.user_display_name' -# You can't log in with a username, -# you must use an authenitcation provider -ACCOUNT_USER_MODEL_USERNAME_FIELD = None -ACCOUNT_USER_MODEL_EMAIL_FIELD = None - -AUTH_PROFILE_MODULE = 'accounts.UserProfile' +AUTH_PROFILE_MODULE = 'users.UserProfile' ######### END AUTHENTICATION diff --git a/karmaworld/templates/account/base.html b/karmaworld/templates/account/base.html index d9e59dc..ab64a01 100644 --- a/karmaworld/templates/account/base.html +++ b/karmaworld/templates/account/base.html @@ -44,7 +44,7 @@
-
+
{% block content %} {% endblock %}
diff --git a/karmaworld/templates/account/login.html b/karmaworld/templates/account/login.html index 83cf279..6857607 100644 --- a/karmaworld/templates/account/login.html +++ b/karmaworld/templates/account/login.html @@ -11,9 +11,8 @@

{% trans "Sign In" %}

{% if socialaccount.providers %} -

{% blocktrans with site.name as site_name %}Please sign in with one -of your existing third party accounts. Or, sign up -for a {{site_name}} account and sign in below:{% endblocktrans %}

+

You can sign in to KarmaNotes with any of the existing accounts you might have below. +Or, sign up for a KarmaNotes account and sign in below.

@@ -25,8 +24,6 @@ for a {{site_name}} account and sign in below:{% endblocktrans %}

-{% include "socialaccount/snippets/login_extra.html" %} - {% else %}

{% blocktrans %}If you have not created an account yet, then please sign up first.{% endblocktrans %}

diff --git a/karmaworld/templates/courses/course_detail.html b/karmaworld/templates/courses/course_detail.html index c5a1443..410d437 100644 --- a/karmaworld/templates/courses/course_detail.html +++ b/karmaworld/templates/courses/course_detail.html @@ -82,40 +82,13 @@ {% include 'partial/filepicker.html' %} - - {% if request.GET.thankyou == '' %} -
-
-
-

- Thank you for uploading - {{ request.GET.name }}. - Share another or take a - quick survey to help us make KarmaNotes even better. -

- - -
-
-
- {% endif %} - -

- -
- {% for note in note_set %} {% include 'notes/note_list_entry.html' with note=note %} {% endfor %} diff --git a/karmaworld/templates/partial/filepicker.html b/karmaworld/templates/partial/filepicker.html index d675074..c4580cc 100644 --- a/karmaworld/templates/partial/filepicker.html +++ b/karmaworld/templates/partial/filepicker.html @@ -3,7 +3,7 @@
-
+
We'd love to have you sign up so you can claim the notes you just uploaded, and build a reputation for uploading great notes.

-

- -

+
+
    + {% include "socialaccount/snippets/provider_list.html" with process="login" %} +
+ Sign up for a traditional account +
{% endif %}
@@ -146,6 +149,7 @@ } $('#success').show(); $('#save-btn').hide(); + $('#filepicker_row').hide(); $('#forms_container .inline-form').remove(); if (document.location.host === 'www.karmanotes.org' || document.location.host === 'karmanotes.org') { diff --git a/karmaworld/templates/socialaccount/connections.html b/karmaworld/templates/socialaccount/connections.html index def62e1..d24cf00 100644 --- a/karmaworld/templates/socialaccount/connections.html +++ b/karmaworld/templates/socialaccount/connections.html @@ -50,6 +50,4 @@ {% include "socialaccount/snippets/provider_list.html" with process="connect" %} -{% include "socialaccount/snippets/login_extra.html" %} - {% endblock %} diff --git a/karmaworld/templates/socialaccount/snippets/provider_list.html b/karmaworld/templates/socialaccount/snippets/provider_list.html index 202c5c2..4fd1ba8 100644 --- a/karmaworld/templates/socialaccount/snippets/provider_list.html +++ b/karmaworld/templates/socialaccount/snippets/provider_list.html @@ -7,13 +7,13 @@ {{brand.name}} + > {% endfor %} {% endif %}
  • {{provider.name}} + href="{% provider_login_url provider.id process=process %}">
  • {% endfor %} diff --git a/karmaworld/templates/user_profile.html b/karmaworld/templates/user_profile.html index 219a70b..39654aa 100644 --- a/karmaworld/templates/user_profile.html +++ b/karmaworld/templates/user_profile.html @@ -7,20 +7,11 @@ {% endblock %} {% block content %} -
    - -
    -
    -

    Hello there, {% user_display user %}.

    -

    Here are the notes that you've uploaded:

    - -
    -
    - - -
    +

    Hello there,
    {% user_display user %}.

    +

    Here are the notes that you've uploaded:

    + {% endblock %} -- 2.25.1