Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #641 from cfpb/DF-2047-foia-data
Browse files Browse the repository at this point in the history
Replacing static form with use_form convention & Changes to office page
KimberlyMunoz committed Jun 11, 2015
2 parents e4eb67d + 460551d commit 5f5eaba
Showing 4 changed files with 22 additions and 241 deletions.
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
{% set sub_page = get_document('sub_page', 'submit-a-request') %}
{% set path = '/sub-pages/' + sub_page.slug %}

{% extends 'layout-side-nav.html' %}
{% import '_vars-sub-pages.html' as vars with context %}
{% set active_nav_id = sub_page.slug %}

{% set activity_type = 'FOIA' %}
{% from 'post-macros.html' import activity_snippets as activity_snippets with context %}
{% set activities_feed = activity_snippets(activity_type) %}

{% block title -%}
{{ sub_page.title | safe if sub_page.title }}
{%- endblock %}

{% block content_main_modifiers -%}
{{ super() }} content__flush-bottom
{%- endblock %}

{% block content_main %}

{% if sub_page.title %}
<h1>{{ sub_page.title | safe }}</h1>
{% endif %}

{% if sub_page.content %}
<section class="initiative_description block block__flush-top">
{{ sub_page.content | safe }}

{# TODO: Extra Content. Remove once content updates. #}
<ol class="list list__steps short-desc">
<li class="list-item">Fill out the form</li>
<li class="list-item">Generate a PDF</li>
<li class="list-item">Email, fax or mail the PDF</li>
</ol>
</section>
{% endif %}

<!-- Start Form Module. -->
<section class="block
block__bg
block__border
@@ -407,26 +368,4 @@ <h3>Write your own letter</h3>
please make sure you include a waiver justification for us to consider.
</li>
</ul>
</section>

{% if activities_feed %}
<aside class="block
block__flush-sides
block__bg
u-mb0
u-mt0">
<section class="office_activities">
<h1 class="header-slug">
<span class="header-slug_inner">
Latest Office Activities
</span>
</h1>
{{ activities_feed }}
<a class="jump-link jump-link__right" href="/activity-log/">
View all of our activity
</a>
</section>
</aside>
{% endif %}

{% endblock %}
</section>
32 changes: 17 additions & 15 deletions offices/_single.html
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@
<h1>{{ office.title | safe }}</h1>
{% endif %}

{% if office.intro.text %}
<section class="block block__flush-top content-l content-l__main content-l__large-gutters">
{% if office.intro.text %}
{% set intro = office.intro %}
{% set show_subscription = intro.subscribe_form and intro.govdelivery_code %}
<section class="office_intro content-l_col
@@ -32,7 +32,6 @@ <h1>{{ office.title | safe }}</h1>
">
<p class="h3">{{ intro.text | safe if intro.text }}</p>
</section>
{% endif %}
{% if show_subscription %}
<section class="content-l_col content-l_col-1-2 content-l_col__before-divider">
<p class="h3 u-show-on-mobile">Stay informed</p>
@@ -42,16 +41,22 @@ <h1>{{ office.title | safe }}</h1>
</section>
{% endif %}
</section>
{% endif %}

{% if office.top_story %}
{% if office.top_story.head %}
{% set top_story = office.top_story %}
<section class="office_featured block block__padded-top block__border-top">
{% if top_story.head %}
<h1 class="h3">{{ top_story.head | safe }}</h1>
{% endif %}
<div class="content-l content-l__main content-l__large-gutters">
{% if top_story.desc %}
<div class="content-l_col content-l_col-1-2">
<div class="content-l_col
{% if top_story.links -%}
content-l_col-1-2
{% else -%}
content-l_col-1
{% endif -%}">
<p class="short-desc">{{ top_story.desc | safe }}</p>
</div>
{% endif %}
@@ -72,7 +77,6 @@ <h1 class="h3">{{ top_story.head | safe }}</h1>
</section>
{% endif %}
{% if office.resources %}

<section class="office_resources block block__padded-top block__border-top">
<h1 class="h2">
{{ resource_title }}
@@ -106,23 +110,21 @@ <h2 class="h3">{{ resource.title | safe }}</h2>
</section>
{% endif %}

{% if vars.sub_pages %}
{% for page in vars.sub_pages if page.show_in_office == "on" %}
{% if loop.first %}
<section class="office_sub_pages block block__sub block__padded-top block__border-top">
<h1 class="h2">
Our Work
</h1>
<div class="content-l content-l__main content-l__large-gutters expandables-group">
{% for page in vars.sub_pages if page.show_in_office == "on" %}
{% endif %}
<div class="office_initiative
expandable
expandable__expanded
expandable__mobile-only
content-l_col
{% if vars.sub_pages.result_dict|length > 1 -%}
content-l_col-1-2
{% else -%}
content-l_col-1
{%- endif %}
{# TODO: When we upgrade to Jinja2 2.8 we can use loop.length to conditionally set this to one column or two. #}
content-l_col-1-2
">
<button class="expandable_header expandable_target u-show-on-mobile">
{% if page.short_title or page.title %}
@@ -165,16 +167,16 @@ <h2 class="h4 u-hide-on-mobile">
{% endif %}
</div>
</div><!-- END .expandable -->
{% endfor %}
{% if loop.last %}
</div>
</section>
{% endif %}
{% endif %}
{% endfor %}

<div class="u-mb0
block
block__bg
block__flush-sides">

{% if activities_feed %}
<section class="office_activities">
<h1 class="header-slug">
4 changes: 4 additions & 0 deletions sub-pages/_single.html
Original file line number Diff line number Diff line change
@@ -28,6 +28,10 @@ <h1>{{ sub_page.title | safe }}</h1>
</section>
{% endif %}

{% if sub_page.use_form == "on" %}
{%- include "forms/" + sub_page.slug + "-form.html" ignore missing %}
{% endif %}

{% if sub_pages and sub_pages.total %}
<section class="block
block__padded-top
164 changes: 0 additions & 164 deletions sub-pages/foia-faqs/index.html

This file was deleted.

0 comments on commit 5f5eaba

Please sign in to comment.