Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue #26: Create a careers page that lists all jobs held by brothers #36

Merged
merged 3 commits into from

1 participant

This page is out of date. Refresh to see the latest.
View
BIN  db.sqlite3
Binary file not shown
View
6 info/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from info.models import PledgeClass, Brother, Department, Major, Officer, HeldPosition, Position
+from info.models import PledgeClass, Brother, Department, Major, Officer, HeldPosition, Position, Job, JobType
# Register your models here.
@@ -10,4 +10,6 @@
admin.site.register(Major)
admin.site.register(Officer)
admin.site.register(HeldPosition)
-admin.site.register(Position)
+admin.site.register(Position)
+admin.site.register(Job)
+admin.site.register(JobType)
View
23 info/models.py
@@ -55,6 +55,29 @@ def __unicode__(self):
def __str__(self):
return self.__unicode__()
+
+class JobType(models.Model):
+ name = models.CharField(max_length=50)
+
+ def __unicode__(self):
+ return self.name
+
+ def __str__(self):
+ return self.__unicode__()
+
+class Job(models.Model):
+ type = models.ForeignKey(JobType)
+ company = models.CharField(max_length=100)
+ title = models.CharField(max_length=100)
+ brother = models.ForeignKey(Brother)
+ year = models.IntegerField()
+
+ def __unicode__(self):
+ return " - ".join([str(self.year), str(self.brother.lastName + ", " + self.brother.firstName), self.company, self.title, str(self.type)])
+
+ def __str__(self):
+ return self.__unicode__()
+
class Alumni(models.Model):
brother = models.ForeignKey(Brother)
currentJob = models.CharField(max_length=100, blank=True)
View
32 info/templates/careers.html
@@ -0,0 +1,32 @@
+{% extends 'base.html' %}
+
+{% block title %} ΘΤ | Careers {% endblock %}
+
+{% block content %}
+
+<div class="container">
+
+ <div class="row">
+
+ <div class="col-lg-12">
+ <h1 class="page-header">Careers</h1>
+ </div>
+
+ </div>
+
+
+ <div class="container">
+ {% for job in jobs %}
+ <div class="row">
+ <div class="col=sm-3"><a href='/info/brother/{{ job.brother.id }}'>{{ job.brother.firstName }} {{ job.brother.lastName }}</a></div>
+ <div class="col-sm-3">{{ job.company }}</div>
+ <div class="col-sm-3">{{ job.title }}</div>
+ <div class="col-sm-3">{{ job.type.name }}</div>
+ <div class="col-sm-3">{{ job.year }}</div>
+ </div>
+ <hr />
+ {% endfor %}
+ </div>
+</div>
+
+{% endblock %}
View
3  info/urls.py
@@ -14,6 +14,7 @@
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'^resumes/$', views.resumes, name='resumes')
+ url(r'^resumes/$', views.resumes, name='resumes'),
+ url(r'^careers/$', views.careers, name='careers')
)
View
6 info/views.py
@@ -6,7 +6,7 @@
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
-from info.models import Brother, Officer, BrotherEntity, Major
+from info.models import Brother, Officer, BrotherEntity, Major, Job
from info import utility
from marketing.models import Picture as MarketingPic
from articles.models import Article
@@ -96,6 +96,10 @@ def resumes(request):
t = loader.get_template('resume_list.html')
return HttpResponse(t.render(c))
+def careers(request):
+ jobs = Job.objects.all()
+ return render(request, 'careers.html', {'jobs': jobs})
+
def convert_brothers_to_brotherentities(broList):
'''
Converts a set of brothers and converts them to brother entities
View
7 templates/base.html
@@ -55,7 +55,6 @@
<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>
@@ -66,6 +65,12 @@
<li><a href="/articles/">All</a></li>
</ul></li>
<li><a href="/events" style="color:#DADADA;">Upcoming Events</a></li>
+ <li class="dropdown"><a href="#" class="dropdown-toggle"
+ data-toggle="dropdown" style="color:#DADADA;">Recruit &Theta;&Tau;<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="/info/resumes">Resumes</a></li>
+ <li><a href="/info/careers">Careers</a></li>
+ </ul></li>
<li><a href="/contact" style="color:#DADADA;">Contact Us</a></li>
</ul>
</div>
Something went wrong with that request. Please try again.