Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Iss11 #31

Merged
merged 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
59 info/templates/resume_list.html
@@ -0,0 +1,59 @@
+{% extends 'base.html' %}
+
+{% block title %} ΘΤ | Resumes {% endblock %}
+
+{% block content %}
+ <div class="container">
+
+ <div class="row">
+
+ <div class="col-lg-12">
+ <h1 class="page-header">Resumes</h1>
+ </div>
+
+ </div>
+
+ <div class="container">
+ <form method='GET' name='submit'>
+
+ <div class='row'>
+<!-- <div class='col-sm-2'>
+ Majors: <br />
+ {% for major in majors %}
+ <input type='checkbox' name='major' value='{{ major.majorName }}'>{{ major.majorName }}<br />
+ {% endfor %}
+ </div> -->
+ <div class='col-sm-2'>
+ Graduation Years: <br />
+ {% for year in years %}
+ <input type='checkbox' name='gradyear' value='{{ year }}'>{{ year }}<br />
+ {% endfor %}
+ </div>
+ </div>
+ <div class='row'>
+ <div class='col-lg-8'><input type='submit' value='Go' /></div>
+ </div>
+
+
+ </form>
+
+ </div>
+ <hr />
+ <div class='container'>
+
+ <div class="row">
+
+ {% for brother in brothers %}
+
+ <a href='{{ brother.resume }}'>{{ brother.lastName }}, {{ brother.firstName }} {{ brother.middleName }}</a> <br />
+
+ {% endfor %}
+
+ </div>
+
+ <hr />
+ </div>
+
+ </div><!-- /.container -->
+
+{% endblock %}
View
3  info/urls.py
@@ -13,6 +13,7 @@
url(r'^actives/$', views.actives, name='actives'),
url(r'^pledges/$', views.pledges, name='pledges'),
url(r'^alumni/$', views.alumni, name='alumni'),
- url(r'^brother/(?P<brother_id>\d+)', views.brother_profile, name="brother_profile")
+ url(r'^brother/(?P<brother_id>\d+)', views.brother_profile, name="brother_profile"),
+ url(r'^resumes/$', views.resumes, name='resumes')
)
View
19 info/views.py
@@ -1,10 +1,12 @@
import math
+from datetime import date
from django.http import HttpResponse
from django.template import Context, loader
from django.shortcuts import render, get_object_or_404
+from django.db.models import Q
-from info.models import Brother, Officer, BrotherEntity
+from info.models import Brother, Officer, BrotherEntity, Major
from info import utility
from marketing.models import Picture as MarketingPic
from articles.models import Article
@@ -79,6 +81,21 @@ def general_listing(request, isAlumniFilter, isPledgeFilter, name):
t = loader.get_template('brothers_list.html')
return HttpResponse(t.render(c))
+def resumes(request):
+ year = date.today().year
+ years = []
+ for i in xrange(5):
+ years.append(year+i)
+ grad_year_requests = request.GET.getlist('gradyear')
+ reqs = Q()
+ for grad_year_request in grad_year_requests:
+ reqs = reqs | Q(graduationYear=int(grad_year_request))
+ brothers = Brother.objects.filter(reqs).order_by('lastName', 'firstName', 'middleName')
+ majors = Major.objects.all().order_by('majorName')
+ c = Context({'brothers': brothers, 'majors': majors, 'years': years})
+ t = loader.get_template('resume_list.html')
+ return HttpResponse(t.render(c))
+
def convert_brothers_to_brotherentities(broList):
'''
Converts a set of brothers and converts them to brother entities
View
3  templates/base.html
@@ -55,6 +55,7 @@
<li><a href="/info/actives">Active Members</a></li>
<li><a href="/info/pledges">Pledges</a></li>
<li><a href="/info/alumni">Alumni</a></li>
+ <li><a href="/info/resumes">Resumes</a></li>
</ul></li>
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" style="color:#DADADA;">Past Events<b class="caret"></b></a>
@@ -64,7 +65,7 @@
<li><a href="/articles/social">Social</a></li>
<li><a href="/articles/">All</a></li>
</ul></li>
- <li><a href="/events" style="color:#DADADA;">Upcoming Events</a></li>
+ <li><a href="/events" style="color:#DADADA;">Upcoming Events</a></li>
<li><a href="/contact" style="color:#DADADA;">Contact Us</a></li>
</ul>
</div>
Something went wrong with that request. Please try again.