From 7321ec63225bbf2d4ea1f8cc63f973db7f123c27 Mon Sep 17 00:00:00 2001 From: Kimberly Munoz Date: Wed, 10 Jun 2015 19:09:10 -0400 Subject: [PATCH 1/3] Moving FOIA to _single template & template fixes - Fixing if statements for cases without content --- .../forms/submit-a-request-form.html | 65 +------ offices/_single.html | 134 +++++++------- sub-pages/foia-faqs/index.html | 164 ------------------ 3 files changed, 69 insertions(+), 294 deletions(-) rename sub-pages/submit-a-request/index.html => _includes/forms/submit-a-request-form.html (89%) delete mode 100644 sub-pages/foia-faqs/index.html diff --git a/sub-pages/submit-a-request/index.html b/_includes/forms/submit-a-request-form.html similarity index 89% rename from sub-pages/submit-a-request/index.html rename to _includes/forms/submit-a-request-form.html index 5ae3e022d2c..02759cfe9a1 100644 --- a/sub-pages/submit-a-request/index.html +++ b/_includes/forms/submit-a-request-form.html @@ -1,43 +1,4 @@ -{% 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 %} -

{{ sub_page.title | safe }}

- {% endif %} - - {% if sub_page.content %} -
- {{ sub_page.content | safe }} - - {# TODO: Extra Content. Remove once content updates. #} -
    -
  1. Fill out the form
  2. -
  3. Generate a PDF
  4. -
  5. Email, fax or mail the PDF
  6. -
-
- {% endif %} - - -
@@ -407,26 +368,4 @@

Write your own letter

please make sure you include a waiver justification for us to consider. -
- - {% if activities_feed %} - - {% endif %} - -{% endblock %} \ No newline at end of file + \ No newline at end of file diff --git a/offices/_single.html b/offices/_single.html index 22a1f0deb94..a5486606a37 100644 --- a/offices/_single.html +++ b/offices/_single.html @@ -18,61 +18,59 @@ {% if office.title %}

{{ office.title | safe }}

{% endif %} - -
- {% if office.intro.text %} - {% set intro = office.intro %} - {% set show_subscription = intro.subscribe_form and intro.govdelivery_code %} -
-

{{ intro.text | safe if intro.text }}

-
- {% endif %} - {% if show_subscription %} -
-

Stay informed

-

Stay up to date with our email newsletter

- {% from "macros.html" import subscribe as subscribe with context %} - {{ subscribe(intro.govdelivery_code) }} + {% if office.intro.text %} +
+ {% set intro = office.intro %} + {% set show_subscription = intro.subscribe_form and intro.govdelivery_code %} +
+

{{ intro.text | safe if intro.text }}

- {% endif %} -
+ {% if show_subscription %} +
+

Stay informed

+

Stay up to date with our email newsletter

+ {% from "macros.html" import subscribe as subscribe with context %} + {{ subscribe(intro.govdelivery_code) }} +
+ {% endif %} +
+ {% endif %} {% if office.top_story %} {% set top_story = office.top_story %} - {% endif %} {% if office.resources %} -

{{ resource_title }} @@ -106,22 +104,23 @@

{{ resource.title | safe }}

{% endif %} - {% if vars.sub_pages %} -
-

- Our Work -

-
- {% for page in vars.sub_pages if page.show_in_office == "on" %} + {% for page in vars.sub_pages if page.show_in_office == "on" %} + {% if loop.first %} +
+

+ Our Work +

+
+ {% endif %}
- {% endfor %} -
-
- {% endif %} + {% if loop.last %} + +
+ {% endif %} + {% endfor %}
{{ sub_page.title | safe }} - {% endif %} - - {% if sub_page.content %} -
- {{ sub_page.content | safe }} -
- {% endif %} - -
-
-
- Frequently asked questions about applying -
-
- - - - -
-
-
- - {% if activities_feed %} - - {% endif %} - -{% endblock %} From ced6327229be7c447123054ee1e735b3eebb07c9 Mon Sep 17 00:00:00 2001 From: Kimberly Munoz Date: Wed, 10 Jun 2015 20:41:31 -0400 Subject: [PATCH 2/3] Added forms & reverted indenting for fewer merge conflicts --- offices/_single.html | 132 +++++++++++++++++++++-------------------- sub-pages/_single.html | 4 ++ 2 files changed, 71 insertions(+), 65 deletions(-) diff --git a/offices/_single.html b/offices/_single.html index a5486606a37..816fb95a012 100644 --- a/offices/_single.html +++ b/offices/_single.html @@ -18,57 +18,63 @@ {% if office.title %}

{{ office.title | safe }}

{% endif %} + {% if office.intro.text %} -
- {% set intro = office.intro %} - {% set show_subscription = intro.subscribe_form and intro.govdelivery_code %} -
-

{{ intro.text | safe if intro.text }}

-
- {% if show_subscription %} -
-

Stay informed

-

Stay up to date with our email newsletter

- {% from "macros.html" import subscribe as subscribe with context %} - {{ subscribe(intro.govdelivery_code) }} -
- {% endif %} +
+ {% set intro = office.intro %} + {% set show_subscription = intro.subscribe_form and intro.govdelivery_code %} +
+

{{ intro.text | safe if intro.text }}

+ {% if show_subscription %} +
+

Stay informed

+

Stay up to date with our email newsletter

+ {% from "macros.html" import subscribe as subscribe with context %} + {{ subscribe(intro.govdelivery_code) }} +
+ {% endif %} +
{% endif %} - {% if office.top_story %} + {% if office.top_story.head %} {% set top_story = office.top_story %} -
+ {% endif %} {% if office.resources %}
@@ -105,23 +111,20 @@

{{ resource.title | safe }}

{% endif %} {% for page in vars.sub_pages if page.show_in_office == "on" %} - {% if loop.first %} -
-

- Our Work -

-
- {% endif %} + {% if loop.first %} +
+

+ Our Work +

+
+ {% endif %}
{% if loop.last %} -
-
+ +
{% endif %} {% endfor %} @@ -174,7 +177,6 @@

block block__bg block__flush-sides"> - {% if activities_feed %}

diff --git a/sub-pages/_single.html b/sub-pages/_single.html index cc18516d68d..4069f211ee1 100644 --- a/sub-pages/_single.html +++ b/sub-pages/_single.html @@ -25,6 +25,10 @@

{{ sub_page.title | safe }}

{% endif %} + {% if sub_page.use_form == "on" %} + {%- include "forms/" + sub_page.slug + "-form.html" ignore missing %} + {% endif %} + {% if vars.sub_pages %}
From 468d40dac86edfbcd8bd9908db8f62959338b0c8 Mon Sep 17 00:00:00 2001 From: Kimberly Munoz Date: Thu, 11 Jun 2015 17:17:33 -0400 Subject: [PATCH 3/3] Small fixes: - indentation fixes --- _includes/forms/submit-a-request-form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/forms/submit-a-request-form.html b/_includes/forms/submit-a-request-form.html index 02759cfe9a1..bbb12c88caa 100644 --- a/_includes/forms/submit-a-request-form.html +++ b/_includes/forms/submit-a-request-form.html @@ -1,4 +1,4 @@ -