Skip to content

Commit a4fd838

Browse files
committed
pull in new CSV additions (browse/about)
1 parent 4670bb8 commit a4fd838

33 files changed

Lines changed: 2004 additions & 238 deletions

_data/theme.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ home-banner-image-position: center # Default is top
5656

5757
########## Typical CollectionBuilder options ########
5858

59+
60+
##########
61+
# Browse PAGE
62+
#
63+
# see _data/browse-config.csv to define the metadata fields that will display.
64+
advanced-search: true # true / false, adds advanced search options to search, which are generated by clicking the advanced search button above the search box (this opens a modal in which the search can be constructed)
65+
faceted-search: true # true / false, adds a field option to the left of the search results that allows users to filter results by metadata field
66+
default-sort-field: # if a value is entered here, it must match one of the field values (first column) in the browse-config.csv file. If left blank or the value doesn't match a value in config-browse.csv's first column, the default sort will be a random sort
67+
68+
5969
##########
6070
# ITEM PAGE
6171
#
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#advancedSearchModal">
2+
Advanced<span class="d-none d-md-inline"> Search</span>
3+
</button>
4+
<div class="modal fade" id="advancedSearchModal" tabindex="-1">
5+
<div class="modal-dialog modal-lg">
6+
<div class="modal-content">
7+
<div class="modal-header">
8+
<h1 class="modal-title h4" id="advancedSearchModalLabel">Advanced Search</h1>
9+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
10+
</div>
11+
<div class="modal-body">
12+
<form id="advancedSearchForm">
13+
<div id="searchRows">
14+
<!-- Initial search rows will be inserted here -->
15+
</div>
16+
<div class="mt-3">
17+
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="addSearchRow()">
18+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
19+
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
20+
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
21+
</svg>
22+
Add Another Field
23+
</button>
24+
</div>
25+
</form>
26+
</div>
27+
<div class="modal-footer">
28+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
29+
<button type="button" class="btn btn-primary" onclick="submitAdvancedSearch()">Search</button>
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
35+
<!-- Template for search row -->
36+
<template id="searchRowTemplate">
37+
<div class="search-row mb-4">
38+
<div class="row align-items-center">
39+
<div class="col-4 col-md-2">
40+
<select class="form-select form-select-sm boolean-operator">
41+
<option value="AND">AND</option>
42+
<option value="OR">OR</option>
43+
<option value="NOT">NOT</option>
44+
</select>
45+
</div>
46+
<div class="col-5 col-md-3">
47+
<select class="form-select form-select-sm field-select">
48+
<option value="all">All Fields</option>
49+
<option value="title">Title</option>
50+
{% for f in site.data.config-browse %}{% assign cap-field = f.field | capitalize %}
51+
<option value="{{ f.field }}">{{ f.facet_name | default: f.display_name | default: cap-field }}</option>
52+
{% endfor %}
53+
</select>
54+
</div>
55+
<div class="col-10 col-md-6">
56+
<input type="text" class="form-control form-control-sm search-input" placeholder="Enter search term">
57+
<div class="date-range-inputs">
58+
<div class="date-input-group">
59+
<input type="text" class="form-control form-control-sm start-date" placeholder="Start Date">
60+
<span class="date-separator">to</span>
61+
<input type="text" class="form-control form-control-sm end-date" placeholder="End Date">
62+
</div>
63+
</div>
64+
</div>
65+
<div class="col-2 col-md-1">
66+
<button type="button" class="btn btn-outline-danger btn-sm remove-row" aria-label="Remove condition">×</button>
67+
</div>
68+
</div>
69+
</div>
70+
</template>

_includes/cb/jekyll-toc.html

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
{% capture tocWorkspace %}
2+
{% comment %}
3+
Copyright (c) 2017 Vladimir "allejo" Jimenez
4+
5+
Permission is hereby granted, free of charge, to any person
6+
obtaining a copy of this software and associated documentation
7+
files (the "Software"), to deal in the Software without
8+
restriction, including without limitation the rights to use,
9+
copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the
11+
Software is furnished to do so, subject to the following
12+
conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+
OTHER DEALINGS IN THE SOFTWARE.
25+
{% endcomment %}
26+
{% comment %}
27+
Version 1.2.0
28+
https://github.com/allejo/jekyll-toc
29+
30+
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
31+
32+
Usage:
33+
{% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
34+
35+
Parameters:
36+
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
37+
38+
Optional Parameters:
39+
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
40+
* class (string) : '' - a CSS class assigned to the TOC
41+
* id (string) : '' - an ID to assigned to the TOC
42+
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
43+
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
44+
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45+
* item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
46+
* submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level
47+
* base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
48+
* anchor_class (string) : '' - add custom class(es) for each anchor element
49+
* skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
50+
51+
Output:
52+
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
53+
generate the table of contents and will NOT output the markdown given to it
54+
55+
Modified:
56+
Functionality was modified for CollectionBuilder's context to allow site's creator to trigger a link to the technical credits in the side nav. Additions include lines 165-167 in this file, and the addition of an optional "credits" parameter in the include. credits=true will add "Technical" to the side nav with a link to the #technical anchor. credits=false or not including credits will remove "Technical" from the side nav.
57+
{% endcomment %}
58+
59+
{% capture newline %}
60+
{% endcapture %}
61+
{% assign newline = newline | rstrip %} <!-- Remove the extra spacing but preserve the newline -->
62+
63+
{% capture deprecation_warnings %}{% endcapture %}
64+
65+
{% if include.baseurl %}
66+
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "baseurl" has been deprecated, use "base_url" instead -->{{ newline }}{% endcapture %}
67+
{% endif %}
68+
69+
{% if include.skipNoIDs %}
70+
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "skipNoIDs" has been deprecated, use "skip_no_ids" instead -->{{ newline }}{% endcapture %}
71+
{% endif %}
72+
73+
{% capture jekyll_toc %}{% endcapture %}
74+
{% assign orderedList = include.ordered | default: false %}
75+
{% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
76+
{% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
77+
{% assign minHeader = include.h_min | default: 1 %}
78+
{% assign maxHeader = include.h_max | default: 6 %}
79+
{% assign nodes = include.html | strip | split: '<h' %}
80+
81+
{% assign firstHeader = true %}
82+
{% assign currLevel = 0 %}
83+
{% assign lastLevel = 0 %}
84+
85+
{% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %}
86+
87+
{% for node in nodes %}
88+
{% if node == "" %}
89+
{% continue %}
90+
{% endif %}
91+
92+
{% assign currLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
93+
94+
{% if currLevel < minHeader or currLevel > maxHeader %}
95+
{% continue %}
96+
{% endif %}
97+
98+
{% assign _workspace = node | split: '</h' %}
99+
100+
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
101+
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
102+
{% assign htmlID = _idWorkspace[0] %}
103+
104+
{% assign _classWorkspace = _workspace[0] | split: 'class="' %}
105+
{% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
106+
{% assign htmlClass = _classWorkspace[0] %}
107+
108+
{% if htmlClass contains "no_toc" %}
109+
{% continue %}
110+
{% endif %}
111+
112+
{% if firstHeader %}
113+
{% assign minHeader = currLevel %}
114+
{% endif %}
115+
116+
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
117+
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
118+
119+
{% if include.item_class and include.item_class != blank %}
120+
{% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %}
121+
{% endif %}
122+
123+
{% if include.submenu_class and include.submenu_class != blank %}
124+
{% assign subMenuLevel = currLevel | minus: 1 %}
125+
{% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %}
126+
{% endif %}
127+
128+
{% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
129+
130+
{% if htmlID %}
131+
{% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %}
132+
133+
{% if include.anchor_class %}
134+
{% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %}
135+
{% endif %}
136+
137+
{% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
138+
{% elsif skipNoIDs == true %}
139+
{% continue %}
140+
{% else %}
141+
{% capture listItem %}{{ anchorBody }}{% endcapture %}
142+
{% endif %}
143+
144+
{% if currLevel > lastLevel %}
145+
{% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %}
146+
{% elsif currLevel < lastLevel %}
147+
{% assign repeatCount = lastLevel | minus: currLevel %}
148+
149+
{% for i in (1..repeatCount) %}
150+
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
151+
{% endfor %}
152+
153+
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
154+
{% else %}
155+
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
156+
{% endif %}
157+
158+
{% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}
159+
160+
{% assign lastLevel = currLevel %}
161+
{% assign firstHeader = false %}
162+
{% endfor %}
163+
164+
{% assign repeatCount = minHeader | minus: 1 %}
165+
{% assign repeatCount = lastLevel | minus: repeatCount %}
166+
167+
{% for i in (1..repeatCount) %}
168+
{% if i == repeatCount and include.credits == true %}
169+
{% capture jekyll_toc %}{{ jekyll_toc }}<li><a href="#technical">Technical</a>{% endcapture %}
170+
{% endif %}
171+
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
172+
{% endfor %}
173+
174+
{% if jekyll_toc != '' %}
175+
{% assign rootAttributes = '' %}
176+
{% if include.class and include.class != blank %}
177+
{% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %}
178+
{% endif %}
179+
180+
{% if include.id and include.id != blank %}
181+
{% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
182+
{% endif %}
183+
184+
{% if rootAttributes %}
185+
{% assign nodes = jekyll_toc | split: '>' %}
186+
{% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
187+
{% endif %}
188+
{% endif %}
189+
{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}}

_includes/feature/accordion.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
- "title1", "title2", "title3" = title for each section of accordion (max three)
99
- "text1", "text2", "text3" = text for each section of accordion (max three). You will probably want to capture the text using a Liquid capture, then use the variable to provide text to this include.
1010
- "open" = optional, by default is "false". Add "true" to have the first section of the accordion open.
11-
- "heading_level" = customize the level of the heading if necessary for accessibility, choose "h1", "{{ include.heading_level | default: 'h2' | strip }}", "h3", etc (optional, default "{{ include.heading_level | default: 'h2' | strip }}")
11+
- "heading_level" = customize the level of the heading if necessary for accessibility, choose "h1", "h2", "h3", etc (optional, default "h3")
1212

1313
{%- endcomment -%}
14-
<div class="accordion mb-3" id="accordionInclude">
14+
<div class="accordion mb-3 narrow-content" id="accordionInclude">
1515
<div class="accordion-item">
16-
<{{ include.heading_level | default: 'h2' | strip }} class="accordion-header" id="headingOne">
16+
<{{ include.heading_level | default: 'h3' | strip }} class="accordion-header" id="headingOne">
1717
<button class="accordion-button{% unless include.open %} collapsed{% endunless %}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="{% if include.open == true %}true{% else %}false{% endif %}" aria-controls="collapseOne">
1818
{{ include.title1 }}
1919
</button>
20-
</{{ include.heading_level | default: 'h2' | strip }}>
20+
</{{ include.heading_level | default: 'h3' | strip }}>
2121
<div id="collapseOne" class="accordion-collapse collapse{% if include.open == true %} show{% endif %}" aria-labelledby="headingOne" data-bs-parent="#accordionInclude">
2222
<div class="accordion-body">
2323
{{ include.text1 | markdownify }}
@@ -26,11 +26,11 @@
2626
</div>
2727
{% if include.title2 %}
2828
<div class="accordion-item">
29-
<{{ include.heading_level | default: 'h2' | strip }} class="accordion-header" id="headingTwo">
29+
<{{ include.heading_level | default: 'h3' | strip }} class="accordion-header" id="headingTwo">
3030
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
3131
{{ include.title2 }}
3232
</button>
33-
</{{ include.heading_level | default: 'h2' | strip }}>
33+
</{{ include.heading_level | default: 'h3' | strip }}>
3434
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionInclude">
3535
<div class="accordion-body">
3636
{{ include.text2 | markdownify }}
@@ -40,11 +40,11 @@
4040
{% endif %}
4141
{% if include.title3 %}
4242
<div class="accordion-item">
43-
<{{ include.heading_level | default: 'h2' | strip }} class="accordion-header" id="headingThree">
43+
<{{ include.heading_level | default: 'h3' | strip }} class="accordion-header" id="headingThree">
4444
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
4545
{{ include.title3 }}
4646
</button>
47-
</{{ include.heading_level | default: 'h2' | strip }}>
47+
</{{ include.heading_level | default: 'h3' | strip }}>
4848
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionInclude">
4949
<div class="accordion-body">
5050
{{ include.text3 | markdownify }}

_includes/feature/alert.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- "align" = text alignment (center, right, left)
1111

1212
{%- endcomment -%}
13-
<div class="alert alert-{{ include.color | default: 'primary' }} feature-alert {% if include.align %}text-{{ include.align }}{% endif %}" role="alert">
14-
{{ include.text | markdownify }}
13+
<div class="narrow-content">
14+
<div class="alert alert-{{ include.color | default: 'primary' }} feature-alert {% if include.align %}text-{{ include.align | default: 'center' }}{% endif %}" role="alert">
15+
{{ include.text | markdownify }}
16+
</div>
1517
</div>

_includes/feature/button.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
- "float" = will use Bootstrap float utility to add float, choose from "start" (left) or "end" (right) (not recommended)
1515

1616
{%- endcomment -%}
17-
{% if include.centered %}<div class="text-center mb-3">{%- endif -%}
17+
{% if include.centered %}<p class="text-center mb-3">{%- endif -%}
1818
<a class="btn{% if include.size %} btn-{{ include.size }}{% endif %} btn-{{ include.color | default: 'secondary' }}{% if include.float %} float-{{ include.float }}{% endif %}{% if include.width %} w-{{ include.width }}{% endif %}" href="{{ include.link }}">{{ include.text }}</a>
19-
{% if include.centered %}</div>{%- endif -%}
19+
{% if include.centered %}</p>{%- endif -%}

0 commit comments

Comments
 (0)