improvement: manually-defined actions are now preserverd when plan is analyzed for new routes

This commit is contained in:
Stephan Richter
2020-11-06 11:15:32 +01:00
parent ad8375e7f4
commit 5e088deda2
11 changed files with 78 additions and 25 deletions

View File

@@ -241,7 +241,7 @@ public abstract class Tile extends BaseClass{
Tag routeList = new Tag("ol");
for (Route route : routes) {
String json = new JSONObject(Map.of(REALM,ROUTE,ID,route.id(),ACTION,ACTION_PROPS,CONTEXT,REALM_PLAN+":"+id())).toString().replace("\"", "'");
Tag li = new Tag("span").attr("onclick","return request("+json+");").content(route.name()+NBSP).addTo(new Tag("li").clazz("link"));
Tag li = new Tag("span").attr("onclick","return request("+json+");").content(route.name()+(route.isDisabled()?" ["+t("disabled")+"]" : "")+NBSP).addTo(new Tag("li").clazz("link"));
Map<String, Object> params = Map.of(REALM,REALM_ROUTE,ID,route.id(),ACTION,ACTION_DROP,Tile.class.getSimpleName(),id());
new Button(t("delete route"),params).addTo(li);
li.addTo(routeList);