зеркало из https://github.com/mozilla/bedrock.git
Rough job listings page. Work in progress, needs styling
This commit is contained in:
Родитель
461c6c9f33
Коммит
d1599a0ef8
|
@ -1 +1,42 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page_title %}{{ _('Open Positions | Mozilla') }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="title">
|
||||
<h1>{{ _('Open Positions') }}</h1>
|
||||
</div>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<ul id="categories">
|
||||
{% for category in categories %}
|
||||
<li{% if selected == category %} class="selected"{% endif %}>
|
||||
<a href="{{ url('careers.views.department', slug=category.slug) }}">{{ category.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if position %}
|
||||
<div id="position">
|
||||
<h1>{{ position.title }}</h1>
|
||||
<p>{{ position.description|safe }}</p>
|
||||
<a href="{{ position.apply_url }}">Apply</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if selected %}
|
||||
<div id="department">
|
||||
<h2>{{ selected.name }}</h2>
|
||||
{% if selected.description %}
|
||||
<p>{{ selected.description }}</p>
|
||||
{% endif %}
|
||||
<ul id="positions">
|
||||
{% for position in positions %}
|
||||
<li><a href="{{ url('careers.views.position', job_id=position.job_id) }}">{{ position.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,4 +4,6 @@ from django.conf.urls.defaults import patterns
|
|||
urlpatterns = patterns('',
|
||||
# Example:
|
||||
(r'^careers/?$', 'careers.views.careers'),
|
||||
(r'^careers/(?P<slug>[\w-]+)/$', 'careers.views.department'),
|
||||
(r'^careers/position/(?P<job_id>[\w]+)/$', 'careers.views.position'),
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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;
|
||||
}
|
Загрузка…
Ссылка в новой задаче