Commit 0e52a105 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'noauthlinks' into amherst

parents 4cacd072 9fac32be
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | Majors | {{ major.name }} {% endblock title %} {% block title %} SRCT Roomlist | Majors {% endblock title %}
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist Majors"/>
<meta property="og:description" content="Undergraduate majors on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors."/>
{% endblock %}
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist Majors" />
<meta name="twitter:description" content="Undergraduate majors on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors." />
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% include 'no_auth.html' %}
{% load cache %} {% load cache %}
{% cache 900 list_majors %} {% cache 900 list_majors %}
......
...@@ -316,14 +316,12 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView): ...@@ -316,14 +316,12 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView):
# majors pages # majors pages
class ListMajors(LoginRequiredMixin, ListView): class ListMajors(ListView):
model = Major model = Major
queryset = Major.objects.all().order_by('name') queryset = Major.objects.all().order_by('name')
context_object_name = 'majors' context_object_name = 'majors'
template_name = 'list_majors.html' template_name = 'list_majors.html'
login_url = 'login'
class DetailMajor(LoginRequiredMixin, DetailView): class DetailMajor(LoginRequiredMixin, DetailView):
model = Major model = Major
......
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; {{ building.name }} {% endblock %} {% block title %} SRCT Roomlist &bull; {{ building.name }} {% endblock %}
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist - {{ building.name }}"/>
<meta property="og:description" content="Do you live in {{ building.name }}? Log in with your Mason username and password to find your neighbors."/>
{% endblock %}
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist - {{ building.name }}" />
<meta name="twitter:description" content="Do you live in {{ building.name }}? Log in with your Mason username and password to find your neighbors." />
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% include 'no_auth.html' %}
{% load cache %} {% load cache %}
{% cache 900 detail_building building %} {% cache 900 detail_building building %}
......
...@@ -2,7 +2,20 @@ ...@@ -2,7 +2,20 @@
{% block title %} SRCT Roomlist &bull; Neighborhoods {% endblock title %} {% block title %} SRCT Roomlist &bull; Neighborhoods {% endblock title %}
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist Neighborhoods"/>
<meta property="og:description" content="Housing locations on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors."/>
{% endblock og_metadata %}
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist Neighborhoods" />
<meta name="twitter:description" content="Housing locations on SRCT Roomlist. Log in with your Mason username and password to find your on-campus neighbors." />
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% include 'no_auth.html' %}
{% load cache %} {% load cache %}
{% cache 900 list_buildings %} {% cache 900 list_buildings %}
......
...@@ -10,15 +10,13 @@ from accounts.models import Student ...@@ -10,15 +10,13 @@ from accounts.models import Student
# a list of neighborhoods and their buildings # a list of neighborhoods and their buildings
class ListBuildings(LoginRequiredMixin, ListView): class ListBuildings(ListView):
model = Building model = Building
queryset = Building.objects.all() queryset = Building.objects.all()
# paginate_by # paginate_by
context_object_name = 'buildings' context_object_name = 'buildings'
template_name = 'list_buildings.html' template_name = 'list_buildings.html'
login_url = 'login'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(ListBuildings, self).get_context_data(**kwargs) context = super(ListBuildings, self).get_context_data(**kwargs)
context['rappahannock'] = Building.objects.filter(neighbourhood='ra').order_by('name') context['rappahannock'] = Building.objects.filter(neighbourhood='ra').order_by('name')
...@@ -28,14 +26,12 @@ class ListBuildings(LoginRequiredMixin, ListView): ...@@ -28,14 +26,12 @@ class ListBuildings(LoginRequiredMixin, ListView):
# building floors, other information # building floors, other information
class DetailBuilding(LoginRequiredMixin, DetailView): class DetailBuilding(DetailView):
model = Building model = Building
slug_field = 'slug__iexact' slug_field = 'slug__iexact'
context_object_name = 'building' context_object_name = 'building'
template_name = 'detail_building.html' template_name = 'detail_building.html'
login_url = 'login'
def get_object(self): def get_object(self):
url_parts = self.request.get_full_path().split('/') url_parts = self.request.get_full_path().split('/')
# [u'', u'housing', u'building',] # [u'', u'housing', u'building',]
...@@ -55,6 +51,8 @@ class DetailFloor(LoginRequiredMixin, DetailView): ...@@ -55,6 +51,8 @@ class DetailFloor(LoginRequiredMixin, DetailView):
context_object_name = 'floor' context_object_name = 'floor'
template_name = 'detail_floor.html' template_name = 'detail_floor.html'
login_url = 'login'
def get_object(self): def get_object(self):
url_parts = self.request.get_full_path().split('/') url_parts = self.request.get_full_path().split('/')
# [u'', u'housing', u'building', u'floor', ] # [u'', u'housing', u'building', u'floor', ]
...@@ -81,6 +79,8 @@ class DetailRoom(LoginRequiredMixin, DetailView): ...@@ -81,6 +79,8 @@ class DetailRoom(LoginRequiredMixin, DetailView):
context_object_name = 'room' context_object_name = 'room'
template_name = 'detail_room.html' template_name = 'detail_room.html'
login_url = 'login'
def get_object(self): def get_object(self):
url_parts = self.request.get_full_path().split('/') url_parts = self.request.get_full_path().split('/')
# [u'', u'housing', u'building', u'floor', u'room', ] # [u'', u'housing', u'building', u'floor', u'room', ]
......
...@@ -5,6 +5,7 @@ from django.conf.urls import patterns, include, url ...@@ -5,6 +5,7 @@ from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView from django.views.generic import TemplateView
from django.contrib import admin from django.contrib import admin
from django.views.generic import RedirectView
# imports from your apps # imports from your apps
from .views import HomePageView from .views import HomePageView
from haystack.views import SearchView from haystack.views import SearchView
...@@ -30,6 +31,9 @@ urlpatterns = patterns('', ...@@ -30,6 +31,9 @@ urlpatterns = patterns('',
# search # search
url(r'^search/', login_required(SearchView(), login_url='login'), name='search'), url(r'^search/', login_required(SearchView(), login_url='login'), name='search'),
# redirects
url(r'^majors/', RedirectView.as_view(pattern_name='list_majors')),
# login and logout # login and logout
url(r'^login/', 'accounts.views.custom_cas_login', name='login'), url(r'^login/', 'accounts.views.custom_cas_login', name='login'),
url(r'^logout/', 'cas.views.logout', name='logout'), url(r'^logout/', 'cas.views.logout', name='logout'),
......
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} {% block title %} SRCT Roomlist &bull; About {% endblock %}
SRCT Roomlist &bull; About
{% block og_metadata %}
<meta property="og:title" content="About SRCT Roomlist"/>
<meta property="og:description" content="Roomlist is a Mason student housing directory, developed and hosted by Student-Run Computing and Tech, a registered student org."/>
{% endblock %} {% endblock %}
{% block tw_metadata %}
<meta name="twitter:title" content="About SRCT Roomlist" />
<meta name="twitter:description" content="Roomlist is a Mason student housing directory, developed and hosted by Student-Run Computing and Tech, a registered student org." />
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% load cache %} {% load cache %}
......
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist &bull; Homepage {% endblock title %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock title %}
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist"/>
<meta property="og:description" content="Welcome to SRCT Roomlist! Log in with your Mason username and password to find your on-campus neighbors."/>
{% endblock %}
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist" />
<meta name="twitter:description" content="Welcome to SRCT Roomlist! Log in with your Mason username and password to find your on-campus neighbors." />
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% load cache %} {% load cache %}
......
...@@ -9,7 +9,26 @@ ...@@ -9,7 +9,26 @@
<link href="/static/css/style.css" rel="stylesheet" media="screen"> <link href="/static/css/style.css" rel="stylesheet" media="screen">
<link href="/static/css/font-awesome.min.css" rel="stylesheet"> <link href="/static/css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="/static/img/favicon.ico"> <link rel="icon" href="/static/img/favicon.ico">
<title> {% block title %} {% endblock %}</title> <title>{% block title %} {% endblock %}</title>
<!-- Facebook -->
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist"/>
<meta property="og:description" content="Log in with your Mason username and password to find your on-campus neighbors."/>
{% endblock og_metadata %}
<meta property="og:type" content="website"/>
<meta property="og:image" content="https://srct.gmu.edu/static/media/SRCT_square_sm.png"/>
<meta property="og:url" content="{{ request.build_absolute_uri }}"/>
<meta property="og:site_name" content="SRCT Roomlist"/>
<!-- Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@MasonSRCT" />
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist" />
<meta name="twitter:description" content="Log in with your Mason username and password to find your on-campus neighbors." /> <!-- Maximum 200 characters. -->
{% endblock tw_metadata %}
<!-- Twitterbot now automatically crawls for the url: no url tag. -->
<meta name="twitter:image" content="https://srct.gmu.edu/static/media/SRCT_square_sm.png" />
<meta name="twitter:img:alt" content="SRCT's square logo" />
</head> </head>
<body> <body>
......
...@@ -11,13 +11,12 @@ ...@@ -11,13 +11,12 @@
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
{% if user.is_authenticated %} {% if not user.is_authenticated %}
<li><a href="{% url 'about' %}">About</a>
{% endif %}
<li><a href="{% url 'list_buildings' %}">Buildings</a></li> <li><a href="{% url 'list_buildings' %}">Buildings</a></li>
<li><a href="{% url 'list_majors' %}">Majors</a></li> <li><a href="{% url 'list_majors' %}">Majors</a></li>
{% else %}
<li><a href="{% url 'about' %}">About</a>
</li> </li>
{% endif %}
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %} {% if user.is_authenticated %}
......
{% if not user.is_authenticated %}
<div class="row">
<div class="col-md-12 text-center">
<a href="{% url 'login' %}" class="btn btn-info btn-block">Not on Roomlist yet? Log in with your Mason username and password!</a>
</div>
</div>
{% endif %}
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
SRCT Roomlist &bull; Privacy Policy SRCT Roomlist &bull; Privacy Policy
{% endblock %} {% endblock %}
{% block og_metadata %}
<meta property="og:title" content="SRCT Roomlist Privacy Policy"/>
<meta property="og:description" content="Roomlist is available only to individuals with full Mason credentials. Control who sees your information on your settings page."/>
{% endblock %}
{% block tw_metadata %}
<meta name="twitter:title" content="SRCT Roomlist Privacy Policy" />
<meta name="twitter:description" content="Roomlist is available only to individuals with full Mason credentials. Control who sees your information on your settings page."/>
{% endblock tw_metadata %}
{% block content %} {% block content %}
{% load cache %} {% load cache %}
{% cache 900 privacy %} {% cache 900 privacy %}
......
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