Skip to content

Commit

Permalink
Add config option to show Wikidata reload link in UI
Browse files Browse the repository at this point in the history
See #547
  • Loading branch information
fsteeg committed May 19, 2020
1 parent 8247096 commit c73225d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion app/controllers/nwbib/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ public static Result classification(final String t) {
if (t.equals("WikidataImport")) {
File data = WikidataLocations.wikidataFile();
boolean deleteSuccess = data.delete();
Cache.remove("classification.Raumsystematik");
Logger.debug("Deleting local data: {}, success: {}", data, deleteSuccess);
return redirect(routes.Application.classification("Wikidata"));
return redirect(routes.Application.spatial("classification"));
}
Result cachedResult = (Result) Cache.get("classification." + t);
if (cachedResult != null)
Expand Down
20 changes: 9 additions & 11 deletions app/views/browse_classification.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
<div class="alert alert-warning text-center" role="alert">Dies ist eine Administrationsoberfläche zur Aktualisierung der Raumsystematik aus Wikidata</div>
}
@tags.browse_list(tops, subs, t, placeholder)
@if(t=="Wikidata"){
<p style="margin-top:10px">@(subs.values.flatMap((vals: List[JsonNode]) => vals).size + Json.parse(tops).asOpt[Seq[JsValue]].getOrElse(Seq()).size - 1) Orte |
<a href='@nwbib.routes.Application.classification("WikidataImport")'>aus Wikidata aktualisieren
<span class="glyphicon glyphicon-repeat"></span></a>
</p>
} else {
<p>
<a href="@if(t=="Raumsystematik"){@nwbib.routes.Application.spatial("register")}else{@nwbib.routes.Application.subjects("register")}"><span class="glyphicon glyphicon-sort-by-alphabet"></span> A-Z Register</a> |
<a href="@if(t=="Raumsystematik"){@nwbib.routes.Application.spatialTtl()}else{@nwbib.routes.Application.subjectsTtl()}"><span class="glyphicon glyphicon-download-alt"></span> SKOS-Datei</a>
</p>
}
<p>
@if(controllers.nwbib.Application.CONFIG.getBoolean("index.reload_ui_enabled")){
@(subs.values.flatMap((vals: List[JsonNode]) => vals).size + Json.parse(tops).asOpt[Seq[JsValue]].getOrElse(Seq()).size - 1) Orte |
<a href='@nwbib.routes.Application.classification("WikidataImport")'>aus Wikidata aktualisieren
<span class="glyphicon glyphicon-repeat"></span></a> |
}
<a href="@if(t=="Raumsystematik"){@nwbib.routes.Application.spatial("register")}else{@nwbib.routes.Application.subjects("register")}"><span class="glyphicon glyphicon-sort-by-alphabet"></span> A-Z Register</a> |
<a href="@if(t=="Raumsystematik"){@nwbib.routes.Application.spatialTtl()}else{@nwbib.routes.Application.subjectsTtl()}"><span class="glyphicon glyphicon-download-alt"></span> SKOS-Datei</a>
</p>
}
1 change: 1 addition & 0 deletions conf/nwbib.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ index {
# data.nwbibspatial="file:///<absolute-path-to>/git/nwbib/conf/nwbib-spatial-conf.ttl"
data.nwbibspatial="https://raw.githubusercontent.com/hbz/nwbib/master/conf/nwbib-spatial-conf.ttl"
nwbibspatial.enrich=true
reload_ui_enabled=false
}

type.labels={
Expand Down

0 comments on commit c73225d

Please sign in to comment.