Skip to content

Commit

Permalink
Merge branch 'root-v1.21-and-main' into release/dcs/v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Sep 25, 2024
2 parents f8d7624 + 145765b commit faec174
Showing 1 changed file with 135 additions and 18 deletions.
153 changes: 135 additions & 18 deletions templates/shared/searchbuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
}
#search-builder-toggle {
cursor: pointer;
color: black;
font-weight: bold;
text-decoration: none;
padding-left: 20px;
font-style: italic;
cursor: pointer;
color: black;
font-weight: bold;
text-decoration: none;
padding-left: 20px;
font-style: italic;
}
#search-builder-arrow {
margin-left: 2px;
font-size:0.8em;
margin-left: 2px;
font-size: 0.8em;
}
#search-builder .input-group {
Expand Down Expand Up @@ -54,7 +54,8 @@
</style>

<div id="search-builder-toggle">Search Builder
<span id="search-builder-arrow">&#9654;</span></div>
<span id="search-builder-arrow">&#9654;</span>
</div>
<div id="search-builder">
</div>

Expand All @@ -81,17 +82,121 @@
{ name: 'query', tooltip: 'queries repo name, owner, description & topics. Allows partial match' },
{ name: 'topic', tooltip: 'the topic of a repo, e.g. tc-ready' },
{ name: 'lang', tooltip: 'language, e.g. en, fr' },
{ name: 'subject', tooltip: 'type of resource, e.g. Aligned Bible, Open Bibles Stories' },
{ name: 'subject', tooltip: 'type of resource, e.g. Aligned Bible, Open Bibles Stories', options: [
"Aligned Bible",
"Aramaic Grammar",
"Bible",
"Greek Grammar",
"Greek Lexicon",
"Greek New Testament",
"Hebrew Grammar",
"Hebrew Old Testament",
"Hebrew-Aramaic Lexicon",
"OBS Study Notes",
"OBS Study Questions",
"OBS Translation Notes",
"OBS Translation Questions",
"Open Bible Stories",
"Study Notes",
"Study Questions",
"Training Library",
"Translation Academy",
"Translation Notes",
"Translation Questions",
"Translation Words",
"TSV Study Notes",
"TSV Study Questions",
"TSV Translation Notes",
"TSV Translation Questions",
"TSV Translation Words Links",
"TSV OBS Study Notes",
"TSV OBS Study Questions",
"TSV OBS Translation Notes",
"TSV OBS Translation Questions",
"TSV OBS Translation Words Links"
]
},
{ name: 'owner', tooltip: 'user or organization, e.g. unfoldingWord' },
{ name: 'repo', tooltip: 'repository name, e.g. en_ult' },
{ name: 'abbreviation', tooltip: 'identifier or abbreviation of a resource, e.g. ult' },
{ name: 'book', tooltip: 'contains this Bible book, e.g. mat, mrk, luk, jhn' },
{ name: 'flavor', tooltip: 'scripture burrito flavor, e.g. textTranslation, gloss' },
{ name: 'flavor_type', tooltip: 'scripture burrito flavor type, e.g. scripture, parascriptural, textStories' },
{ name: 'metadata_type', tooltip: 'type of repo metadata schema, e.g. rc, sb, tc, ts' },
{ name: 'content_format', tooltip: 'content format, e.g. markdown, tsv7, tsv9, usfm' },
{ name: 'abbreviation', tooltip: 'identifier or abbreviation of a resource, e.g. ult', options: ['ult', 'ust', 'glt', 'gst', 'ta', 'tn', 'tq', 'tw', 'twl', 'obs', 'obs-tn', 'obs-tq', 'sn', 'sq'] },
{ name: 'book', tooltip: 'contains this Bible book, e.g. mat, mrk, luk, jhn', options: [
"gen",
"exo",
"lev",
"num",
"deu",
"jos",
"jdg",
"rut",
"1sa",
"2sa",
"1ki",
"2ki",
"1ch",
"2ch",
"ezr",
"neh",
"est",
"job",
"psa",
"pro",
"ecc",
"sng",
"isa",
"jer",
"lam",
"ezk",
"dan",
"hos",
"jol",
"amo",
"oba",
"jon",
"mic",
"nam",
"hab",
"zep",
"hag",
"zec",
"mal",
"mat",
"mrk",
"luk",
"jhn",
"act",
"rom",
"1co",
"2co",
"gal",
"eph",
"php",
"col",
"1th",
"2th",
"1ti",
"2ti",
"tit",
"phm",
"heb",
"jas",
"1pe",
"2pe",
"1jn",
"2jn",
"3jn",
"jud",
"rev",
"obs",
"frt",
"bak",
]
},
{ name: 'flavor_type', tooltip: 'scripture burrito flavor type, e.g. scripture, parascriptural, textStories', options: ['gloss', 'parascriptural', 'peripheral', 'scripture'] },
{ name: 'flavor', tooltip: 'scripture burrito flavor, e.g. textTranslation, textStories, gloss', options: ['audioTranslation', 'embossedBrailleScripture', 'signLanguageVideoTranslation', 'textTranslation', 'textStories', 'typesetScripture', 'wordAlignment'] },
{ name: 'metadata_type', tooltip: 'type of repo metadata schema, e.g. rc, sb, tc, ts', options: ['rc', 'sb', 'tc', 'ts'] },
{ name: 'content_format', tooltip: 'content format, e.g. markdown, tsv7, tsv9, usfm', options: ['markdown', 'tsv7', 'tsv9', 'usfm'] },
{ name: 'tag', tooltip: 'released with the given tag, e.g. v3' },
{ name: 'stage', tooltip: 'stage of the release: prod, preprod, latest or other' },
{ name: 'stage', tooltip: 'stage of the release: prod, preprod, latest or other', options: ['prod', 'preprod', 'latest', 'other'] },
];
qInput.addEventListener('input', updateAdvancedFields);
Expand All @@ -114,10 +219,22 @@
input.setAttribute('placeholder', fieldObj.tooltip);
input.addEventListener('input', updateQueryField)
if (fieldObj.options) {
const datalist = document.createElement('datalist');
datalist.id = fieldObj.name + '-options';
fieldObj.options.forEach(option => {
const optionElement = document.createElement('option');
optionElement.value = option;
datalist.appendChild(optionElement);
});
input.setAttribute('list', datalist.id);
inputGroup.appendChild(datalist);
}
inputGroup.appendChild(label);
inputGroup.appendChild(input);
if (!isCatalogSearch && catalogOnlyFields.includes(fieldObj.name)) {
inputGroup.style.display = 'none';
inputGroup.style.display = 'none';
}
advancedSearchContainer.appendChild(inputGroup);
});
Expand Down

0 comments on commit faec174

Please sign in to comment.