diff --git a/djangorota/djangorota/templates/rota/rota_detail.html b/djangorota/djangorota/templates/rota/rota_detail.html index d52e5d6..c02092f 100644 --- a/djangorota/djangorota/templates/rota/rota_detail.html +++ b/djangorota/djangorota/templates/rota/rota_detail.html @@ -42,7 +42,19 @@ {% for key, info in configured_constraints.items %} {{ key }} -
{{ info.pretty }}
+ + {% if info.typed and info.default is not None %} + {% if info.value == info.default %} +
{{ info.pretty }}
+ default + {% else %} +
{{ info.pretty }}
+
Default: {{ info.default }}
+ {% endif %} + {% else %} +
{{ info.pretty }}
+ {% endif %} + Edit
diff --git a/djangorota/rota/views.py b/djangorota/rota/views.py index 19afde7..29df807 100644 --- a/djangorota/rota/views.py +++ b/djangorota/rota/views.py @@ -176,7 +176,14 @@ def rota_detail(request, rota_id): desc = available_constraints_rich.get(k, {}).get("description") except Exception: desc = None - configured_constraints[k] = {"value": v, "pretty": pretty, "typed": (k in available_constraints_rich), "description": desc} + default_val = available_constraints_rich.get(k, {}).get("default") + configured_constraints[k] = { + "value": v, + "pretty": pretty, + "typed": (k in available_constraints_rich), + "description": desc, + "default": default_val, + } except Exception: configured_constraints = {}