Skip to content

Commit

Permalink
Correct Display and Funcionality of Text/Sentences Buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
cvertan committed Sep 13, 2023
1 parent fbff462 commit a6e4dec
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/tla/web/config/ObjectDetailsProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public class ObjectDetailsProperties {
private Map<String, List<String>> hideable1LemmaProperties;
private Map<String, List<String>> showableProperties;
private Map<String, List<String>> hideable2LemmaProperties;
private Map<String, List<String>> hideablesTextsentencesProperties;
private Map<String, List<String>> hideableTextsentencesProperties;
}
2 changes: 1 addition & 1 deletion src/main/java/tla/web/config/SearchProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class SearchProperties {
private Map<String, List<String>> hideable1LemmaProperties;
private Map<String, List<String>> showableProperties;
private Map<String, List<String>> hideable2LemmaProperties;
private Map<String, List<String>> hideablesTextsentencesProperties;
private Map<String, List<String>> hideableTextsentencesProperties;
/**
* Sort orders to be made available on search results page
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tla/web/mvc/ObjectController.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ protected Model addHideablesTextsentencesProperties(Model model) {
if (searchProperties != null) {
model.addAttribute(
"hideablesTextsentencesProperties",
searchProperties.getHideablesTextsentencesProperties()
searchProperties.getHideableTextsentencesProperties()
);

}
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/tla/web/mvc/TextObjectController.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ public String getTextSentencesSearchResultsPage(
)
)
);
var searchProperties = sentenceService.getSearchProperties();
if (searchProperties != null) {
model.addAttribute(
"hideableTextsentencesProperties",
searchProperties.getHideableTextsentencesProperties()
);

}
// DW: die folgenden werden durch ObjectController ererbet? Hier nochmal nötig?
this.addHideableProperties(model);
this.addHideablesTextsentencesProperties(model);
this.addShowableProperties(model);
this.addHideable1LemmaProperties(model);
this.addHideable2LemmaProperties(model);

model.addAttribute("objectType", "sentence");
model.addAttribute("searchResults", results.getObjects());
if(results.getQuery().getSort()==null ) results.getQuery().setSort("sortKey_asc");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ search:
dating: []
texteditor: []

hideables-textsentences-properties:
hideable-textsentences-properties:
hieroglyphs: []
switchannotation:
- wordclass
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/templates/fragments/search/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,8 @@ <h2 class="result-list-item-element label bbaw-libertine" th:utext="${{'<shortla

<div th:fragment="hideTextsentences-properties-buttons" class="hideTextsentences-properties-buttons">
<!-- <input type="num_text" id="result" /> -->
<span> Hier Buttons</span>

<th:block th:each="e : ${hideablesTextsentencesProperties}" th:with="property=${e.key}">
<span> B</span>
<th:block th:each="e : ${hideableTextsentencesProperties}" th:with="property=${e.key}">
<div th:replace=" :: hideTextsentences-property-button(${property}, null)"/>
<th:block th:with="subProperties=${e.value}">
<div th:unless="${#lists.isEmpty(subProperties)}"
Expand Down

0 comments on commit a6e4dec

Please sign in to comment.