From d1599a0ef825fb4a664fa527163abfeaf538f389 Mon Sep 17 00:00:00 2001 From: Paul Osman Date: Fri, 3 Jun 2011 08:29:02 -0400 Subject: [PATCH] Rough job listings page. Work in progress, needs styling --- apps/careers/templates/careers/home.html | 41 ++++++++++++++++++++++++ apps/careers/urls.py | 2 ++ apps/careers/views.py | 29 +++++++++++++++-- media/css/careers.css | 36 +++++++++++++++++++++ 4 files changed, 106 insertions(+), 2 deletions(-) diff --git a/apps/careers/templates/careers/home.html b/apps/careers/templates/careers/home.html index 94d9808cc7..3888b79de1 100644 --- a/apps/careers/templates/careers/home.html +++ b/apps/careers/templates/careers/home.html @@ -1 +1,42 @@ {% extends "base.html" %} + +{% block page_title %}{{ _('Open Positions | Mozilla') }}{% endblock %} + +{% block content %} +
+

{{ _('Open Positions') }}

+
+ +
+ + + + {% if position %} +
+

{{ position.title }}

+

{{ position.description|safe }}

+ Apply +
+ {% endif %} + {% if selected %} +
+

{{ selected.name }}

+ {% if selected.description %} +

{{ selected.description }}

+ {% endif %} + +
+ {% endif %} + +
+{% endblock %} diff --git a/apps/careers/urls.py b/apps/careers/urls.py index 448bc55eaa..97f9259ded 100644 --- a/apps/careers/urls.py +++ b/apps/careers/urls.py @@ -4,4 +4,6 @@ from django.conf.urls.defaults import patterns urlpatterns = patterns('', # Example: (r'^careers/?$', 'careers.views.careers'), + (r'^careers/(?P[\w-]+)/$', 'careers.views.department'), + (r'^careers/position/(?P[\w]+)/$', 'careers.views.position'), ) diff --git a/apps/careers/views.py b/apps/careers/views.py index 17f23b5845..92df216a0d 100644 --- a/apps/careers/views.py +++ b/apps/careers/views.py @@ -1,5 +1,30 @@ import jingo +from django.shortcuts import get_object_or_404 -def careers(request): - return jingo.render(request, 'careers/home.html') +from django_jobvite.models import Position, Category + + +def careers(request, slug=None): + categories = Category.objects.all() + return jingo.render(request, 'careers/home.html', { + 'categories': categories, + }) + + +def department(request, slug): + selected = get_object_or_404(Category, slug=slug) + categories = Category.objects.all() + positions = Position.objects.filter(category=selected) + return jingo.render(request, 'careers/home.html', { + 'categories': categories, + 'positions': positions, + 'selected': selected, + }) + + +def position(request, job_id=None): + position = get_object_or_404(Position, job_id=job_id) + return jingo.render(request, 'careers/home.html', { + 'position': position, + }) diff --git a/media/css/careers.css b/media/css/careers.css index e69de29bb2..0134b0c116 100644 --- a/media/css/careers.css +++ b/media/css/careers.css @@ -0,0 +1,36 @@ +#title { + text-align: center; + border-bottom: 2px solid #ccc; +} + +#title h1 { + font-family: verdana, sans-serif; + font-weight: bold; + font-style: normal; +} + +ul#categories { + list-style-type: none; +} + +ul#categories li { + padding: 2px 0px; +} + +ul#categories li.selected a { + font-weight: bold; + font-size: 120%; + color: #000; +} + +ul#categories a { + color: #8b8878; +} + +ul#positions { + list-style-type: none; +} + +ul#positions li { + padding: 3px 0px; +} \ No newline at end of file