Skip to content

Commit

Permalink
Icons für Ths-Einträge; keine Icons für Textfelder
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerning committed Oct 10, 2023
1 parent 18083d0 commit 7b0ee92
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 34 deletions.
13 changes: 7 additions & 6 deletions src/main/java/tla/web/model/CorpusObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private static List<String> extractDateComment(CorpusObject corpusobj) {
).forEach(
node -> dateComment.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
// .replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
para -> para.strip()
).collect(
Expand Down Expand Up @@ -156,7 +157,7 @@ protected static List<String> extractBibliography(CorpusObject corpusobj) {
).forEach(
node -> bibliography.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
bibref -> bibref.strip()
).collect(
Expand Down Expand Up @@ -227,7 +228,7 @@ private static List<String> extractComment(Passport passport, String searchStrin
passport.extractProperty(searchString).forEach(
node -> comment.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
para -> para.strip()
).collect(
Expand Down Expand Up @@ -430,7 +431,7 @@ private static List<String> extractProtocol(CorpusObject corpusobj) {
).forEach(
node -> protocol.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
bibref -> bibref.strip()
).collect(
Expand Down Expand Up @@ -480,7 +481,7 @@ private static Passport extractDescription(CorpusObject corpusobj) { //only one
descriptionPassport = corpusobj.getPassport().extractProperty(
PASSPORT_PROP_DESCR
).get(0);
//node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
//node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")


} catch (Exception e) {
Expand Down Expand Up @@ -511,7 +512,7 @@ private static List<String> extractFileComment(CorpusObject corpusobj) {
).forEach(
node -> fileComment.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
bibref -> bibref.strip()
).collect(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tla/web/model/Lemma.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private static List<String> extractDescription(Lemma lemma) {
).forEach(
node -> description.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
descr -> descr.strip()
).collect(
Expand Down Expand Up @@ -221,7 +221,7 @@ private static List<String> extractFileComment(Lemma lemma) {
).forEach(
node -> fileComment.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
comment -> comment.strip()
).collect(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tla/web/model/ThsEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static List<String> extractDescription(ThsEntry thsEntry) {
).forEach(
node -> description.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
descr -> descr.strip()
).collect(
Expand Down Expand Up @@ -93,7 +93,7 @@ private static List<String> extractFileComment(ThsEntry thsEntry) {
).forEach(
node -> fileComment.addAll(
Arrays.asList(
node.getLeafNodeValue().replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
).stream().map(
comment -> comment.strip()
).collect(
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/static/css/tla-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ span.lc:hover {
color: var(--BBAWred) !important;
}

.fa-tag,
.fa-folder {
color: var(--BBAWlightbluegrey);
}

.object-path-icon:before {
display: none;
font-family: 'Font Awesome 5 Free';
Expand Down
47 changes: 24 additions & 23 deletions src/main/resources/templates/fragments/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2 class="id ml-3 mt-sm-1">
<span class="external-reference" th:each="ref : ${entry.value}">
<!--<p th:text="${ref}"/>-->
<a th:if="${ref.href} != null" th:href="${ref.href}" target="_blank">
<span class="fas fa-arrow-circle-right red"></span>
<i class="fas fa-arrow-circle-right"></i>
<span th:text="${ref.value}" class="external-reference-id">ext. Identifier</span>
</a>
<span th:unless="${ref.href} != null">
Expand Down Expand Up @@ -116,7 +116,7 @@ <h2 class="id ml-3 mt-sm-1">
<br/>
<ul class="no-bullet-list">
<li th:each="bib, iStat : ${obj.bibliography}">
<span class="fas fa-arrow-circle-right"></span>
<!--<span class="fas fa-arrow-circle-right"></span>-->
<span class="bibliographic-reference" th:utext="${{bib}}"></span>
<br th:unless="${iStat.last}"/>
</li>
Expand All @@ -130,7 +130,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_script}" class="details-property-label">Skript</strong>:
<a th:href="${'/thesaurus/'+obj.getSkript.id}" th:text="${obj.getSkript.name}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.getSkript.id}" th:text="${obj.getSkript.name}"></a>
</p>
</div>

Expand All @@ -151,7 +151,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr>
<p>
<strong th:text="#{object_property_language}" class="details-property-label">Language</strong>:
<a th:href="${'/thesaurus/'+obj.getLanguage.id}" th:text="${obj.getLanguage.name}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.getLanguage.id}" th:text="${obj.getLanguage.name}"></a>
</p>
</div>

Expand All @@ -172,7 +172,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr>
<p>
<strong th:text="#{object_property_texttype}" class="details-property-label">Texttype</strong>:
<a th:href="${'/thesaurus/'+obj.getTexttype.id}" th:text="${obj.getTexttype.name}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.getTexttype.id}" th:text="${obj.getTexttype.name}"></a>
</p>
</div>

Expand Down Expand Up @@ -204,7 +204,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_objecttype}" class="details-property-label">Object type</strong>:
<a th:href="${'/thesaurus/'+obj.objType.getId()}" th:text="${obj.objType.getName()}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.objType.getId()}" th:text="${obj.objType.getName()}"></a>
</p>
</div>

Expand All @@ -215,7 +215,7 @@ <h2 class="id ml-3 mt-sm-1">
<p>
<strong th:text="#{object_property_components}" class="details-property-label">Components</strong>:
<span th:each="elem, elemStat : ${obj.components}">
<a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
</span>
</p>
</div>
Expand Down Expand Up @@ -279,7 +279,7 @@ <h2 class="id ml-3 mt-sm-1">
<ul class="no-bullet-list">
<li th:each="place, placeStat : ${findspot.getPlaces}">
<p>
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-tag"></i>
<a th:href="${'/thesaurus/'+place.getPlace().getId()}" th:text="${place.getPlace().getName()}"></a>
<th:block th:unless="${place.getCertainty}==null">
<br/><strong th:text="#{object_property_certainty}" class="details-property-label"></strong>:
Expand Down Expand Up @@ -308,7 +308,7 @@ <h2 class="id ml-3 mt-sm-1">
<li th:each="place, placeStat : ${findspot.getFormerPlaces}">
<p>
<th:block th:unless="${place.getPlace()}==null">
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-tag"></i>
<a th:href="${'/thesaurus/'+place.getPlace().getId()}" th:text="${place.getPlace().getName()}"></a>
</th:block>
<th:block th:unless="${place.getCertainty}==null">
Expand Down Expand Up @@ -350,7 +350,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_grouping}" class="details-property-label">Object grouping</strong>:
<a th:href="${'/thesaurus/'+obj.grouping.getId()}" th:text="${obj.grouping.getName()}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.grouping.getId()}" th:text="${obj.grouping.getName()}"></a>
</p>
</div>

Expand All @@ -364,13 +364,13 @@ <h2 class="id ml-3 mt-sm-1">
<li th:each="location, elemStat : ${obj.getLocations}">
<p>
<th:block th:unless="${location.getLocation()}==null">
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-tag"></i>
<a th:href="${'/thesaurus/'+location.getLocation().getId()}" th:text="${location.getLocation().getName()}"></a>
</th:block>
<th:block th:unless="${location.getInventory_number}==null">
<br/><strong th:text="#{object_property_inv_no}" class="details-property-label"></strong>:
<span th:each="idno, idnoStat : ${location.getInventory_number}">
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-folder"></i>
<span th:text="${idno}"></span>
<span th:unless="${idnoStat.last}">, </span>
</span>
Expand Down Expand Up @@ -412,7 +412,7 @@ <h2 class="id ml-3 mt-sm-1">
<p>
<strong th:text="#{object_property_materials}" class="details-property-label">Materials</strong>:
<span th:each="elem, elemStat : ${obj.materials}">
<a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
</span>
</p>
</div>
Expand All @@ -424,7 +424,7 @@ <h2 class="id ml-3 mt-sm-1">
<p>
<strong th:text="#{object_property_technique}" class="details-property-label">Techniques</strong>:
<span th:each="elem, elemStat : ${obj.technique}">
<a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
</span>
</p>
</div>
Expand All @@ -447,7 +447,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_condition}" class="details-property-label">Condition</strong>:
<a th:href="${'/thesaurus/'+obj.condition.getId()}" th:text="${obj.condition.getName()}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.condition.getId()}" th:text="${obj.condition.getName()}"></a>
</p>
</div>

Expand All @@ -472,7 +472,7 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_owner}" class="details-property-label">Owner</strong>:
<a th:href="${'/thesaurus/'+obj.owner.getId()}" th:text="${obj.owner.getName()}"></a>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+obj.owner.getId()}" th:text="${obj.owner.getName()}"></a>
</p>
</div>

Expand All @@ -483,7 +483,7 @@ <h2 class="id ml-3 mt-sm-1">
<p>
<strong th:text="#{object_property_context}" class="details-property-label">Cultural context</strong>:
<span th:each="elem, elemStat : ${obj.culturalContext}">
<a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
<i class="fas fa-tag"></i> <a th:href="${'/thesaurus/'+elem.getId()}" th:text="${elem.getName()}"></a><th:block th:unless="${elemStat.last}">, </th:block>
</span>
</p>
</div>
Expand Down Expand Up @@ -513,7 +513,7 @@ <h2 class="id ml-3 mt-sm-1">
<br/>
<ul class="no-bullet-list">
<li th:each="elem, elemStat : ${obj.protocol}">
<span class="fas fa-arrow-circle-right"></span>
<!--<span class="fas fa-arrow-circle-right"></span>-->
<span th:utext="${elem}"></span>
<br th:unless="${elemStat.last}"/>
</li>
Expand Down Expand Up @@ -578,8 +578,9 @@ <h2 class="id ml-3 mt-sm-1">
<hr/>
<p>
<strong th:text="#{object_property_date}" class="details-property-label">Date</strong>:
<i class="fas fa-tag"></i>
<span th:each="date, dateStat : ${obj.date}">
<a th:href="${'/thesaurus/'+date.getId()}" th:text="${{'<shortlabel>'+date.getName()+'</shortlabel>'}}"></a> <!-- filter cuts out parts in angles ininside <label/>-->
<a th:href="${'/thesaurus/'+date.getId()}" th:text="${{'<shortlabel>'+date.getName()+'</shortlabel>'}}"></a> <!-- filter cuts out parts in angles ininside <label/>-->
<span th:unless="${dateStat.last}">&nbsp;&ndash;&nbsp;</span>
</span>
</p>
Expand Down Expand Up @@ -800,7 +801,7 @@ <h2 class="id ml-3 mt-sm-1">

<!-- Single sentence annotation -->
<p th:fragment="sentence-annotation" id="sentence-annotation">
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-tag"></i>
<span th:utext="${related.BTSAnnotation.get(relatedobj.id).name}"></span>
</p>

Expand All @@ -822,7 +823,7 @@ <h2 class="id ml-3 mt-sm-1">

<!-- Single sentence comment -->
<p th:fragment="sentence-comment" id="sentence-comment">
<span class="fas fa-arrow-circle-right"></span>
<i class="fas fa-comment-alt"></i>
<span th:utext="${related.BTSComment.get(relatedobj.id).body}"></span>
</p>

Expand Down Expand Up @@ -913,9 +914,9 @@ <h2 class="id ml-3 mt-sm-1">
<th:block th:with="label=${#messages.msgOrNull(key)}">
<span th:if="${label} != null" th:text="${label}">Type/subtype</span>
<th:block th:unless="${label} != null">
<span th:text="#{|${objectType}_type_${obj.type}|}">Type</span>
<i class="fas fa-tag"></i> <span th:text="#{|${objectType}_type_${obj.type}|}">Type</span>
<span th:if="${obj.subtype}">
(<span th:text="#{|${objectType}_subtype_${obj.subtype}|}">Subtype</span>)
(<i class="fas fa-tag"></i> <span th:text="#{|${objectType}_subtype_${obj.subtype}|}">Subtype</span>)
</span>
</th:block>
</th:block>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/fragments/search/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ <h2 class="result-list-item-element label bbaw-libertine" th:utext="${{'<shortla
th:each="termcount : ${facet.value}"
th:with="label=|field_value_label_${facet.key}_${termcount.key}|">
<div class="btn btn-inline btn-red text-left p-2">
<span class="fas fa-arrow-circle-right red"></span>
<a th:href="${urlBuilder.fromCurrentRequest().replaceQueryParam(facet.key, termcount.key).replaceQueryParam('page').toUriString()}">
<span class="fas fa-arrow-circle-right"></span>
<span th:with="label=${#messages.msgOrNull(#strings.replace(label,'.','_'))}"
th:text="${label != null ? label : termcount.key}">
term
Expand Down

0 comments on commit 7b0ee92

Please sign in to comment.