Skip to content

Commit

Permalink
Merge pull request #642 from GSA/OGPWEB-16842-2
Browse files Browse the repository at this point in the history
Ogpweb 16842
  • Loading branch information
arnayv-47 authored Feb 11, 2025
2 parents 3344ad1 + f4dff08 commit f35037d
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 41 deletions.
4 changes: 4 additions & 0 deletions _includes/resource-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
<!--{% if resource.filters contains 'portal-opportunities' %}
<span class="card-tag">Portal Opportunities</span>
{% endif %}-->

{% if resource.filters contains 'historical' %}
<span class="historical-label">Historical</span>
{% endif %}

{% if resource.external_url %}
<a class="anchor-fill text-ink text-no-underline" href="http://{{ resource.external_url }}" aria-label="{{ resource.aria-label }} link (opens in a new window)" target="_blank">
Expand Down
17 changes: 17 additions & 0 deletions _includes/resources-buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<a class="usa-button btn-primary margin-bottom-2" href="{{ site.baseurl }}/resources/#subject=*&role=*&status=*">Reset Filter</a>

<nav id="filter" class="filters" aria-label="filter menu">

<h2 class="filter-title font-sans-sm">Filter by Resource Type</h2>
<ul class="filter-list" data-filter-group="resource">
<li><a aria-label="Filter by Type: Legislation" role="checkbox" href="javascript:void(0)" data-filter=".legislation" class="usa-tooltip" data-position="right" title="Relevant law" tabindex="0">Legislation</a></li>
Expand Down Expand Up @@ -54,5 +55,21 @@ <h2 class="filter-title font-sans-sm">Filter by Year</h2>
<li><a aria-label="Filter by Type: 2024" role="checkbox" href="javascript:void(0)" data-filter=".2024">2024</a></li>
<li><a aria-label="Filter by Type: 2025" role="checkbox" href="javascript:void(0)" data-filter=".2025">2025</a></li>
</ul>

<h2 class="filter-title font-sans-sm">Filter by Historical</h2>
<ul class="filter-list" data-filter-group="historical">
<li>
<a aria-label="Filter by Historical Documents"
role="checkbox"
href="javascript:void(0)"
data-filter="*"
class="usa-tooltip"
id="filter-list-historical"
data-position="right"
title="Show Historical Documents">
Show Historical Documents
</a>
</li>
</ul>
</nav>
</div>
2 changes: 1 addition & 1 deletion _resources/2023-03-09-ap-chapter-2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ external_url: www.whitehouse.gov/wp-content/uploads/2023/03/ap_12_evidence_fy202
aria-label: Building and Using Evidence to Improve Government Effectiveness (FY 2024 Analytical Perspectives – Chapter 12)
content_tags:
type: link
filters: analytical-perspectives omb 2024 evaluation evidence-act evidence-use
filters: analytical-perspectives omb 2024 evaluation evidence-act evidence-use historical
post-date: March 13, 2023
---
2 changes: 1 addition & 1 deletion _resources/2023-03-09-highlight-from-evidence-chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ doc-link: assets/resources/2024 Evidence Chapter in Brief.pdf
aria-label: Highlights from the FY 24 Analytical Perspectives Evidence Chapter
content_tags:
type: link
filters: quick-reference omb 2024 evaluation evidence-act evidence-use
filters: quick-reference omb 2024 evaluation evidence-act evidence-use historical
post-date: March 13, 2023
---
2 changes: 1 addition & 1 deletion _resources/2024-3-14-Building-and-Using-Evidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ external_url: www.whitehouse.gov/wp-content/uploads/2024/03/ap_13_evidence_fy202
aria-label: Building and Using Evidence to Improve Government Effectiveness
content_tags:
type: link
filters: omb 2025 evaluation evidence-act evidence-use analytical-perspectives
filters: omb 2025 evaluation evidence-act evidence-use analytical-perspectives historical
post-date: March 19, 2024
---
2 changes: 1 addition & 1 deletion _resources/2024-3-14-highlights-2025.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ doc-link: assets/resources/Evaluation.gov - FY 25 Highlights - Formatted.pdf
aria-label: Highlights from the FY 25 Analytical Perspectives Evidence Chapter
content_tags:
type: link
filters: omb 2025 evaluation evidence-act evidence-use quick-reference
filters: omb 2025 evaluation evidence-act evidence-use quick-reference historical
post-date: March 19, 2024
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: obamawhitehouse.archives.gov/sites/default/files/omb/budget/fy2017
aria-label: FY 2017 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2017
filters: analytical-perspectives omb 2017 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.whitehouse.gov/wp-content/uploads/2018/10/Building-and-Using-E
aria-label: FY 2018 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2018
filters: analytical-perspectives omb 2018 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.whitehouse.gov/wp-content/uploads/2018/02/ap_6_evidence-fy2019
aria-label: FY 2019 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2019
filters: analytical-perspectives omb 2019 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.whitehouse.gov/wp-content/uploads/2019/03/ap_6_evidence-fy2020
aria-label: FY 2020 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2020
filters: analytical-perspectives omb 2020 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.whitehouse.gov/wp-content/uploads/2022/03/ap_6_evidence_fy2023
aria-label: FY 2023 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2023
filters: analytical-perspectives omb 2023 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2016-PER/pdf/BUDGET-2016-PER-4-
aria-label: FY 2016 Analytical Perspectives
content_tags:
type: link
filters: analytical-perspectives omb 2016
filters: analytical-perspectives omb 2016 historical
---
2 changes: 1 addition & 1 deletion _resources/evaluation-policy-and-federal-workforce.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ doc-link: assets/resources/Evaluation Policy and the Federal Workforce.pdf
aria-label: Evaluation Policy and the Federal Workforce
content_tags:
type: pdf
filters: report 2022 evaluation omb
filters: report 2022 evaluation omb historical
post-date: May 2, 2022 # # must add post date to show the "new" icon
---
2 changes: 1 addition & 1 deletion _resources/president-biden-budget-invests-in-evidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ external_url: www.whitehouse.gov/omb/briefing-room/2022/03/30/fact-sheet-preside
aria-label: President Biden’s FY 2023 Budget Invests in Evidence
content_tags:
type: link
filters: quick-reference omb 2022 evaluation
filters: quick-reference omb 2022 evaluation historical
post-date: April 28, 2022
---
2 changes: 1 addition & 1 deletion _resources/program-evaluation-FY-2011.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2011-PER/pdf/BUDGET-2011-PER.pd
aria-label: FY 2011 Analytical Perspectives - Chapter 8
content_tags:
type: link
filters: analytical-perspectives omb 2011
filters: analytical-perspectives omb 2011 historical
---
2 changes: 1 addition & 1 deletion _resources/program-evaluation-FY-2012.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2012-PER/pdf/BUDGET-2012-PER.pd
aria-label: FY 2012 Analytical Perspectives - Chapter 8
content_tags:
type: link
filters: analytical-perspectives omb 2012
filters: analytical-perspectives omb 2012 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2013-PER/pdf/BUDGET-2013-PER.pd
aria-label: FY 2013 Analytical Perspectives - Chapter 8
content_tags:
type: link
filters: analytical-perspectives omb 2013
filters: analytical-perspectives omb 2013 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2014-PER/pdf/BUDGET-2014-PER.pd
aria-label: FY 2014 Analytical Perspectives - Chapter 8
content_tags:
type: link
filters: analytical-perspectives omb 2014
filters: analytical-perspectives omb 2014 historical
---
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ external_url: www.govinfo.gov/content/pkg/BUDGET-2015-PER/pdf/BUDGET-2015-PER.pd
aria-label: FY 2015 Analytical Perspectives - Chapter 7
content_tags:
type: link
filters: analytical-perspectives omb 2015
filters: analytical-perspectives omb 2015 historical
---
17 changes: 17 additions & 0 deletions _sass/_resources.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,21 @@ a.checked {
right: 12px;
max-width: 15%;
}

.policy {
position: relative;
}

.historical-label {
position: absolute;
bottom: 0.5rem;
right: 0.7rem;
font-size: 0.75rem;
background: #07648d;
color: #fff;
padding: 2px 6px;
border-radius: 4px;
font-weight: 600;
}


55 changes: 31 additions & 24 deletions assets/js/isotope.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jQuery(document).ready(function ($) {
filters["role"] = hashFilter["role"];
filters["content"] = hashFilter["content"];
filters["year"] = hashFilter["year"];
filters["historical"] = hashFilter["historical"];
// data-filter attribute of clicked button
var currentFilter = $(this).attr("data-filter");
// Navigation group (subject or role) as object
Expand All @@ -76,16 +77,18 @@ jQuery(document).ready(function ($) {
// data-filter-group key for the current nav group
var filterGroup = $navGroup.attr("data-filter-group");
// If the current data-filter attribute matches the current filter,
if (currentFilter == hashFilter["resource"] || currentFilter == hashFilter["role"] || currentFilter == hashFilter["content"] || currentFilter == hashFilter["year"]) {
// Reset group filter as the user has unselected the button
filters[filterGroup] = "*";
if (filterGroup === "historical") {
filters[filterGroup] = $(this).hasClass("checked") ? ":not(.historical)" : "*";
} else {
// Set data-filter of current button as value with filterGroup as key
filters[filterGroup] = $(this).attr("data-filter");
if (currentFilter == hashFilter[filterGroup]) {
filters[filterGroup] = "*";
} else {
filters[filterGroup] = currentFilter;
}
}
// Create new hash
// var newHash = "subject=" + encodeURIComponent( filters["subject"] ) + "&role=" + encodeURIComponent( filters["role"] ) + "&status=" + encodeURIComponent( filters["status"] );
var newHash = "resource=" + filters["resource"] + "&role=" + filters["role"] + "&content=" + filters["content"] + "&year=" + filters["year"];
var newHash = "resource=" + filters["resource"] + "&role=" + filters["role"] + "&content=" + filters["content"] + "&year=" + filters["year"] + "&historical=" + filters["historical"];
// If sort value exists, add it to hash
if (sortValue) {
newHash = newHash + "&sort=" + encodeURIComponent(sortValue);
Expand All @@ -101,6 +104,7 @@ jQuery(document).ready(function ($) {
var $navGroup = $(this).parents(".filter-list");
// data-filter-group key for the current nav group
var filterGroup = $navGroup.attr("data-filter-group");

// If the current data-filter attribute matches the current filter,
if (currentFilter == hashFilter["content"]) {
// Reset group filter as the user has unselected the button
Expand All @@ -124,38 +128,38 @@ jQuery(document).ready(function ($) {
function onHashChange() {
// Current hash value
var hashFilter = getHashFilter();
// Concatenate subject and role for Isotope filtering
if (link.indexOf("/resources/") != -1) {
var theFilter = hashFilter["resource"] + hashFilter["role"] + hashFilter["content"] + hashFilter["year"];
var theFilter = hashFilter["resource"] + hashFilter["role"] + hashFilter["content"] + hashFilter["year"] + hashFilter["historical"];
if (hashFilter) {
// Repaint Isotope container with current filters and sorts
$container.isotope({
filter: decodeURIComponent(theFilter),
sortBy: hashFilter["sorts"]
});

updateFilterCount();
// Toggle checked status of sort button

if (hashFilter["sorts"]) {
$(".sort").addClass("checked");
} else {
$(".sort").removeClass("checked");
}
// Toggle checked status of filter buttons
$(".filter-list").find(".checked").removeClass("checked").attr("aria-checked", "false");
var resourceFilters = hashFilter["resource"].split(",");
var roleFilters = hashFilter["role"].split(",");
var contentFilters = hashFilter["content"].split(",");
var yearFilters = hashFilter["year"].split(",");
var allFilters = resourceFilters.concat(roleFilters);
allFilters = allFilters.concat(contentFilters);
allFilters = allFilters.concat(yearFilters);
for (filter in allFilters) {
$(".filter-list").find("[data-filter='" + allFilters[filter] + "']").addClass("checked").attr("aria-checked", "true");
}
// $( ".filter-list" ).find("[data-filter='" + hashFilter["subject"] + "'],[data-filter='" + hashFilter["role"] + "'] ,[data-filter='" + hashFilter["status"] + "']").addClass("checked").attr("aria-checked","true");
$(".filter-list a").removeClass("checked").attr("aria-checked", "false");

$(".filter-list").each(function(){
var group = $(this).attr("data-filter-group");
var value = hashFilter[group];

if (group === "historical") {
if (value === "*") {
$(this).find("[data-filter='*']").addClass("checked").attr("aria-checked", "true");
}
} else {
if (value !== "*") {
$(this).find("[data-filter='" + value + "']").addClass("checked").attr("aria-checked", "true");
}
}
});
}
//News Page
} else if (link.indexOf("/news/") != -1) {
var theFilter = hashFilter["content"];

Expand Down Expand Up @@ -193,7 +197,9 @@ jQuery(document).ready(function ($) {
var role = location.hash.match(/role=([^&]+)/i);
var content = location.hash.match(/content=([^&]+)/i);
var year = location.hash.match(/year=([^&]+)/i);
var historical = location.hash.match(/historical=([^&]+)/i);
var sorts = location.hash.match(/sort=([^&]+)/i);


// Set up a hashFilter array
var hashFilter = {};
Expand All @@ -202,6 +208,7 @@ jQuery(document).ready(function ($) {
hashFilter["role"] = role ? role[1] : "*";
hashFilter["content"] = content ? content[1] : "*";
hashFilter["year"] = year ? year[1] : "*";
hashFilter["historical"] = historical ? historical[1] : ":not(.historical)";
hashFilter["sorts"] = sorts ? sorts[1] : "";

return hashFilter;
Expand Down

0 comments on commit f35037d

Please sign in to comment.