From 5c3593b0ad037d872dc31ced33199bb883e007d7 Mon Sep 17 00:00:00 2001 From: Ross Bruniges Date: Fri, 15 Feb 2013 15:58:18 +0000 Subject: [PATCH] Closes #70 - making the filtered projects view rather easier to handle --- make_mozilla/projects/templates/projects/index.html | 12 ++++++++---- make_mozilla/projects/views.py | 7 ++++--- media/css/base.less | 11 +++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/make_mozilla/projects/templates/projects/index.html b/make_mozilla/projects/templates/projects/index.html index 30eff3d..bce2257 100644 --- a/make_mozilla/projects/templates/projects/index.html +++ b/make_mozilla/projects/templates/projects/index.html @@ -1,10 +1,14 @@ {% extends "projects/base.html" %} +{% if query %} +{% block page_title %}Filtered by {{ filters }} | {{ super() }}{% endblock %} +{% endif %} + {% block page_id %}projects-index{% endblock %} -{% block page_class %}{{ super() }} brochure-page{% endblock %} +{% block page_class %}{{ super() }} brochure-page {% if query %}filtered{% endif %}{% endblock %} {% block content %} - {% if featured %} + {% if featured and not query %} {% endif %} -
+

Filter projects by

{% for field in filter_form %} @@ -37,7 +41,7 @@

Filter projects by

{% if projects %} -

Webmaker Projects:

+

Webmaker Projects{% if query %} - filtered by {{ filters }}{% endif %}:

    {% for project in projects %}
  • diff --git a/make_mozilla/projects/views.py b/make_mozilla/projects/views.py index 3e787eb..4832fc3 100644 --- a/make_mozilla/projects/views.py +++ b/make_mozilla/projects/views.py @@ -107,14 +107,15 @@ def __call__(self, request): 'pagination': pagination, 'filter_form': filter_form, 'invitation': invitation, - 'query': qs + 'query': qs, + 'filters': ", ".join(query.values()) }) index = Index() def submit(request): - return jingo.render(request, 'projects/submit.html'); + return jingo.render(request, 'projects/submit.html') def details(request, slug): @@ -126,4 +127,4 @@ def details(request, slug): return jingo.render(request, 'projects/detail.html', { 'project': project - }); + }) diff --git a/media/css/base.less b/media/css/base.less index 6ec940c..38c45ca 100644 --- a/media/css/base.less +++ b/media/css/base.less @@ -2772,6 +2772,17 @@ ul.tri-set img { margin-top: -91px; position: relative; } +#projects-index.filtered #content { + border-top: none; + margin-top: 0; +} +#projects-index.filtered #content::before { + background: transparent; + height: 0; +} +#projects-index.filtered #content .constrained { + margin-top: 0; +} #projects-index #featured { position: absolute;