+
+ + <% if rule.conditions.first.compound? %> + <%= rule.conditions.first.sub_conditions.first.filter.label %> <%= rule.conditions.first.sub_conditions.first.operator %> <%= rule.conditions.first.sub_conditions.first.value_display %> + <% else %> + <%= rule.conditions.first.filter.label %> <%= rule.conditions.first.operator %> <%= rule.conditions.first.value_display %> + <% end %> + + <% if rule.conditions.count > 1 %> + and <%= rule.conditions.count - 1 %> more <%= rule.conditions.count - 1 == 1 ? "condition" : "conditions" %> + <% end %> +
+- <%= rule.primary_condition_title %> + <% if rule.actions.first.value && rule.actions.first.options %> + <%= rule.actions.first.executor.label %> to <%= rule.actions.first.value_display %> + <% else %> + <%= rule.actions.first.executor.label %> + <% end %> - - <% if rule.conditions.count > 1 %> - and <%= rule.conditions.count - 1 %> more <%= rule.conditions.count - 1 == 1 ? "condition" : "conditions" %> + <% if rule.actions.count > 1 %> + and <%= rule.actions.count - 1 %> more <%= rule.actions.count - 1 == 1 ? "action" : "actions" %> <% end %>
- <% end %> - -- - <% if rule.actions.first.value && rule.actions.first.options %> - <%= rule.actions.first.executor.label %> to <%= rule.actions.first.value_display %> - <% else %> - <%= rule.actions.first.executor.label %> - <% end %> - - - <% if rule.actions.count > 1 %> - and <%= rule.actions.count - 1 %> more <%= rule.actions.count - 1 == 1 ? "action" : "actions" %> - <% end %> -
- -- <% if rule.effective_date.nil? %> - To all past and future <%= rule.resource_type.pluralize %> - <% else %> - To all <%= rule.resource_type.pluralize %> on or after <%= rule.effective_date %> - <% end %> -
++ + <% if rule.effective_date.nil? %> + All past and future <%= rule.resource_type.pluralize %> + <% else %> + <%= rule.resource_type.pluralize %> on or after <%= rule.effective_date.strftime('%b %-d, %Y') %> + <% end %> + +
+
You are about to apply this rule to
diff --git a/app/views/rules/edit.html.erb b/app/views/rules/edit.html.erb
index 6693ac5e..f73edc90 100644
--- a/app/views/rules/edit.html.erb
+++ b/app/views/rules/edit.html.erb
@@ -1,7 +1,15 @@
<%= link_to "Back to rules", rules_path %>
<%= render DialogComponent.new do |dialog| %>
- <% dialog.with_header(title: "Edit #{@rule.resource_type} rule") %>
+ <%
+ title = if @rule.name.present?
+ "Edit #{@rule.resource_type} rule \"#{@rule.name}\""
+ else
+ "Edit #{@rule.resource_type} rule"
+ end
+ %>
+ <% dialog.with_header(title: title) %>
+
<% dialog.with_body do %>
<%= render "rules/form", rule: @rule %>
<% end %>
diff --git a/app/views/rules/index.html.erb b/app/views/rules/index.html.erb
index 2c3040a1..d549e0f8 100644
--- a/app/views/rules/index.html.erb
+++ b/app/views/rules/index.html.erb
@@ -1,6 +1,5 @@
Rules
-
Rules
- · -<%= @rules.count %>
+Rules
+ · +<%= @rules.count %>
+