Commit 6226d682 authored by Nicholas Anderson's avatar Nicholas Anderson
Browse files

Merge branch 'master' of git.gmu.edu:srct/roomlist

parents 49c8fc1d 1050d0a4
......@@ -3,7 +3,7 @@ from __future__ import absolute_import, print_function
import random
# core django imports
from django.shortcuts import get_object_or_404
from django.http import HttpResponseForbidden
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.views.generic import (CreateView, ListView, DetailView, UpdateView,
FormView, DeleteView)
from django.core.urlresolvers import reverse
......@@ -21,22 +21,8 @@ from .forms import (StudentUpdateForm, WelcomeNameForm, WelcomePrivacyForm,
WelcomeSocialForm)
not_started = """Welcome to SRCT Roomlist! <a href="%s">Click here</a> to walk through
your profile setup."""
# 1 or 2
started = """Welcome back to SRCT Roomlist! It looks like you're not quite finished with
setting up your profile. <a href="%s">Click here</a> to return to your
welcome walkthrough."""
# 3
almost = """Welcome back to SRCT Roomlist! It looks like you're almost finished
with setting up your profile. <a href="%s">Click here</a> to return
to the last page of your welcome walkthrough."""
# walkthrough finished but Room is None
no_room = """It looks like you haven't set your room yet. Head to <a href="%s"> your
settings page</a> to get that taken care of."""
settings_redirect = """You've already finished the welcome walkthrough.
Your user settings can now be changed here on this page."""
#########
......@@ -82,30 +68,20 @@ def custom_cas_login(request, *args, **kwargs):
if request.user.is_authenticated():
if request.user.student.completedName is False:
rendered_url = reverse('welcomeName', args=[request.user.username])
add_url = not_started % rendered_url
messages.add_message(request, messages.INFO, mark_safe(add_url))
elif request.user.student.completedPrivacy is False:
rendered_url = reverse('welcomePrivacy', args=[request.user.username])
add_url = started % rendered_url
messages.add_message(request, messages.INFO, mark_safe(add_url))
elif request.user.student.completedMajor is False:
rendered_url = reverse('welcomeMajor', args=[request.user.username])
add_url = started % rendered_url
messages.add_message(request, messages.INFO, mark_safe(add_url))
elif request.user.student.completedName is False:
rendered_url = reverse('welcomeSocial', args=[request.user.username])
add_url = started % rendered_url
messages.add_message(request, messages.INFO, mark_safe(add_url))
elif request.user.student.room is None:
rendered_url = reverse('updateStudent', args=[request.user.username])
add_url = started % rendered_url
messages.add_message(request, messages.INFO, mark_safe(add_url))
if not request.user.student.totally_done():
if not request.user.student.completedName:
return HttpResponseRedirect(reverse('welcomeName',
kwargs={'slug':request.user.username}))
elif not request.user.student.completedPrivacy:
return HttpResponseRedirect(reverse('welcomePrivacy',
kwargs={'slug':request.user.username}))
elif not request.user.student.completedMajor:
return HttpResponseRedirect(reverse('welcomeMajor',
kwargs={'slug':request.user.username}))
elif not request.user.completedSocial:
return HttpResponseRedirect(reverse('welcomeSocial',
kwargs={'slug':request.user.username}))
else:
welcome_back = random.choice(return_messages)
messages.add_message(request, messages.INFO, mark_safe(welcome_back))
......@@ -336,9 +312,15 @@ class WelcomeName(LoginRequiredMixin, FormView):
if not(url_uname == self.request.user.username):
return HttpResponseForbidden()
elif self.request.user.student.totally_done():
messages.add_message(request, messages.INFO, settings_redirect)
return reverse('updateStudent',
kwargs={'slug':self.request.user.username})
else:
return super(WelcomeName, self).get(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super(WelcomeName, self).get_context_data(**kwargs)
......@@ -392,6 +374,10 @@ class WelcomePrivacy(LoginRequiredMixin, UpdateView):
if not(url_uname == self.request.user.username):
return HttpResponseForbidden()
elif self.request.user.student.totally_done():
messages.add_message(request, messages.INFO, settings_redirect)
return reverse('updateStudent',
kwargs={'slug':self.request.user.username})
else:
return super(WelcomePrivacy, self).get(request, *args, **kwargs)
......@@ -451,6 +437,10 @@ class WelcomeMajor(LoginRequiredMixin, UpdateView):
if not(url_uname == self.request.user.username):
return HttpResponseForbidden()
elif self.request.user.student.totally_done():
messages.add_message(request, messages.INFO, settings_redirect)
return reverse('updateStudent',
kwargs={'slug':self.request.user.username})
else:
return super(WelcomeMajor, self).get(request, *args, **kwargs)
......@@ -484,6 +474,10 @@ class WelcomeSocial(LoginRequiredMixin, UpdateView):
if not(url_uname == self.request.user.username):
return HttpResponseForbidden()
elif self.request.user.student.totally_done():
messages.add_message(request, messages.INFO, settings_redirect)
return reverse('updateStudent',
kwargs={'slug':self.request.user.username})
else:
return super(WelcomeSocial, self).get(request, *args, **kwargs)
......
......@@ -35,7 +35,7 @@ a[name] {
background-position: center;
box-shadow: inset 0px 0px 20px #333;
color: white;
text-shadow: 2px 2px 4px #000;
text-shadow: 2px 2px 5px #000;
padding-top: 75px;
padding-bottom: 75px;
}
......@@ -95,3 +95,12 @@ outline-offset: none;
.breadcrumb {background: rgba(245, 245, 245, 1); border: 2px solid rgba(245, 245, 245, 1); border-radius: 4px; display: block;}
.breadcrumb li {font-size: 20px;}
.polaroid {
max-height: 200px;
box-shadow: 0px 0px 0px 6px #fff, 0px 0px 0px 10px #DDDDDD; /* 10px 10px 10px 5px #bfbfbf; */
}
.img-right {
float: right;
}
......@@ -11,7 +11,7 @@
<div class="col-md-12 license">
<div class="jumbotron jumboindex">
<h1 class="text-center"><strong>SRCT</strong>&#8203;ROOMLIST</h1>
<h3 class="text-center">Find your on-campus neighbors.</h3>
<h3 class="text-center">Find your on-campus neighbors</h3>
</div>
<a href="https://creativecommons.org/licenses/by-nc/2.0/" target="_blank"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc/2.0/80x15.png" title="'North Section of President's Park Dorms' by Flickr user cgs_gmu2005 is licensed under a Creative Commons Attribution-NonCommercial 2.0 Generic License."
/>
......@@ -20,36 +20,129 @@
</div>
</div>
<legend></legend>
<hr/>
<div class="row">
<div class="col-md-3 text-center">
<h4><i class="fa fa-key fa-lg"></i></h4>
<h4>Log in with your Mason credentials</h4>
<div class="col-md-12 text-center">
<h4>
Roomlist is a voluntary, privacy-focused student housing directory for Mason
</h4>
</div>
<div class="col-md-3 text-center">
<h4><i class="fa fa-group fa-lg"></i></h4>
<h4>See who else lives on your floor</h4>
</div>
<hr />
<div class="row">
<div class="col-md-4 col-md-offset-1">
<h5><strong>
<i class="fa fa-key fa-2x"></i>&nbsp;&nbsp;
Log in with your Mason credentials
</strong></h5>
<h5>
Only people with a current, valid Mason username and password may join.
</h5>
</div>
<div class="col-md-3 text-center">
<h4><i class="fa fa-facebook fa-lg"></i></h4>
<h4>Link to your social media accounts</h4>
<div class="col-md-6">
<a href="{% url 'login' %}">
<img src="/static/img/login.png" class="img-responsive polaroid img-right"
alt="Mason CAS auth screen">
</a>
</div>
<div class="col-md-3 text-center">
<h4><i class="fa fa-lock fa-lg"></i></h4>
<h4>Choose to share by floor, building, or campus</h4>
</div>
<hr/>
<div class="row">
<div class="col-md-6 col-md-offset-1">
<a href="{% url 'login' %}">
<img src="/static/img/floormates.png" class="img-responsive polaroid"
alt="students on a floor">
</a>
</div>
<div class="col-md-4 text-right">
<h5><strong>
See who else lives on your floor&nbsp;&nbsp;
<i class="fa fa-group fa-2x"></i>
</strong></h5>
<h5>
A better way to foster community than accidentally running into neighbors
on the stairs or in an elevator.
</h5>
</div>
</div>
{% if not user.is_authenticated %}
<br />
<hr/>
<div class="row">
<div class="col-md-4 col-md-offset-1">
<h5><strong>
<i class="fa fa-university fa-2x"></i>&nbsp;&nbsp;
Find other students by major
</strong></h5>
<h5>
An easy way to identify people for developing study groups and making friends
within your major.
</h5>
</div>
<div class="col-md-6">
<a href="{% url 'login' %}">
<img src="/static/img/majors.png" class="img-responsive polaroid img-right"
alt="list of majors">
</a>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-6 col-md-offset-1">
<a href="{% url 'login' %}">
<img src="/static/img/privacy.png" class="img-responsive polaroid"
alt="privacy settings options">
</a>
</div>
<div class="col-md-4 text-right">
<h5><strong>
Limit your visibility to your floor or building&nbsp;&nbsp;
<i class="fa fa-lock fa-2x"></i>
</strong></h5>
<h5>
If you choose to select what room you live in, you have full control over
who else sees that information.
</h5>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-4 col-md-offset-1">
<h5><strong>
<i class="fa fa-share-alt fa-2x"></i>&nbsp;&nbsp;
Link to your social media accounts
</strong></h5>
<h5>
We're not recreating Facebook here. Link to your Facebook, Twitter, Instagram,
or Google pages.
</h5>
</div>
<div class="col-md-6">
<a href="{% url 'login' %}">
<img src="/static/img/social.png" class="img-responsive polaroid img-right"
alt="user's social media account links">
</a>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<a href="{% url 'login' %}" class="btn btn-primary btn-lg btn-block">Get Started</a>
</div>
</div>
{% endif %}
<br />
{% endcache %}
{% endblock content %}
......@@ -5,7 +5,7 @@
<div class="col-md-6">
Email the developers:
<a href="mailto:roomlist@lists.srct.gmu.edu">
roomlist@list.srct.gmu.edu
roomlist@lists.srct.gmu.edu
</a>
<br />
<a href="{% url 'about' %}" target="_blank">About</a> &middot;
......
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