Commit c2a08a84 authored by Daniel W Bond's avatar Daniel W Bond

the small changes: updated allauth a release, gravatar defaults to a person...

the small changes: updated allauth a release, gravatar defaults to a person outline, messages appear on landing page, message font increased slightly
parent 6748d2d5
......@@ -2,7 +2,7 @@ Django==1.7.3
Whoosh==2.6.0
argparse==1.2.1
beautifulsoup4==4.3.2
django-allauth==0.19.0
django-allauth==0.20.0
django-analytical==0.19.0
django-autoslug==1.7.2
django-braces==1.4.0
......
......@@ -9,6 +9,7 @@ from model_utils.models import TimeStampedModel
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from django.contrib import messages
# third party imports
from autoslug import AutoSlugField
from randomslugfield import RandomSlugField
......@@ -201,12 +202,12 @@ class Student(TimeStampedModel):
def profile_image_url(self):
fb_uid = SocialAccount.objects.filter(user=self.user.id, provider='facebook')
print("profile_image")
#print("profile_image")
if len(fb_uid) > 0:
return "http://graph.facebook.com/{}/picture?width=175&height=175".format(fb_uid[0].uid)
return "http://www.gravatar.com/avatar/{}?s=175".format(hashlib.md5(self.user.email).hexdigest())
return "http://www.gravatar.com/avatar/{}?s=175&d=mm".format(hashlib.md5(self.user.email).hexdigest())
def get_absolute_url(self):
return reverse('detail_student', kwargs={'slug': self.slug})
......
......@@ -79,6 +79,7 @@ return_messages = [bug_reporting, privacy_reminder, disclaimer, whatsopen_plug,
def custom_cas_login(request, *args, **kwargs):
response = cas_login(request, *args, **kwargs)
# returns HttpResponseRedirect
if request.user.is_authenticated():
if request.user.student.completedName is False:
......@@ -469,7 +470,6 @@ class WelcomeMajor(LoginRequiredMixin, UpdateView):
kwargs={'slug':self.request.user.username})
# this is a work-in-progress catastrophuck
class WelcomeSocial(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
model = Student
form_class = WelcomeSocialForm
......
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist • Homepage {% endblock %} {% block content %}
{% include 'messages.html' %}
{% load cache %}
{% load gravatar %}
<h2>Welcome Back {{ request.user.first_name }}!</h2>
......
......@@ -2,7 +2,7 @@
{% for message in messages %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-{{ message.tags }} alert-dismissable text-center" role="alert">
<div class="alert alert-{{ message.tags }} alert-dismissable text-center" style='font-size:14px' role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
<strong>{{ message }}</strong>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment