This commit is contained in:
Stephan Richter
2020-12-11 02:33:32 +01:00
parent 604b9559c4
commit 438befa969
5 changed files with 27 additions and 7 deletions

View File

@@ -242,14 +242,35 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
if (!routes.isEmpty()) {
fieldset = new Fieldset(t("Routes using this tile"));
Tag routeList = new Tag("ol");
boolean empty = true;
for (Route route : routes) {
if (route.isDisabled()) continue;
Tag li = route.link("span", route.name()+(route.isDisabled()?" ["+t("disabled")+"]" : "")+NBSP).addTo(new Tag("li").clazz("link"));
route.button(t("delete route"),Map.of(ACTION,ACTION_DROP)).addTo(li);
button(t("simplify name"), Map.of(ACTION,ACTION_AUTO,ROUTE,route.id().toString())).addTo(li);
li.addTo(routeList);
empty = false;
}
if (!empty) {
routeList.addTo(fieldset);
postForm.add(fieldset);
}
fieldset = new Fieldset(t("Disabled routes using this tile"));
routeList = new Tag("ol");
empty = true;
for (Route route : routes) {
if (!route.isDisabled()) continue;
Tag li = route.link("span", route.name()+(route.isDisabled()?" ["+t("disabled")+"]" : "")+NBSP).addTo(new Tag("li").clazz("link"));
route.button(t("delete route"),Map.of(ACTION,ACTION_DROP)).addTo(li);
button(t("simplify name"), Map.of(ACTION,ACTION_AUTO,ROUTE,route.id().toString())).addTo(li);
li.addTo(routeList);
empty = false;
}
if (!empty) {
routeList.addTo(fieldset);
postForm.add(fieldset);
}
routeList.addTo(fieldset);
postForm.add(fieldset);
}
return super.properties(preForm, formInputs, postForm);