Browse Source

Added notice for check

Andrew Kane 9 năm trước cách đây
mục cha
commit
6d1796003c
1 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 11 2
      app/views/blazer/queries/_form.html.erb

+ 11 - 2
app/views/blazer/queries/_form.html.erb

@@ -48,8 +48,17 @@
         <% end %>
         <%= f.submit @query.persisted? ? "Update" : "Create", class: "btn btn-success" %>
       </div>
-      <% if @query.persisted? && (dashboards_count = @query.dashboards.count) > 0 %>
-        <div class="alert alert-info" style="margin-top: 10px; padding: 8px 12px;">Part of <%= pluralize(dashboards_count, "dashboard") %>. Be careful when editing.</div>
+      <% if @query.persisted? %>
+        <% dashboards_count = @query.dashboards.count %>
+        <% checks_count = @query.checks.count %>
+        <% words = [] %>
+        <% words << pluralize(dashboards_count, "dashboard") if dashboards_count > 0 %>
+        <% words << pluralize(checks_count, "check") if checks_count > 0 %>
+        <% if words.any? %>
+          <div class="alert alert-info" style="margin-top: 10px; padding: 8px 12px;">
+            Part of <%= words.to_sentence %>. Be careful when editing.
+          </div>
+        <% end %>
       <% end %>
     </div>
   </div>