|  | @@ -48,8 +48,17 @@
 | 
											
												
													
														|  |          <% end %>
 |  |          <% end %>
 | 
											
												
													
														|  |          <%= f.submit @query.persisted? ? "Update" : "Create", class: "btn btn-success" %>
 |  |          <%= f.submit @query.persisted? ? "Update" : "Create", class: "btn btn-success" %>
 | 
											
												
													
														|  |        </div>
 |  |        </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 %>
 |  |        <% end %>
 | 
											
												
													
														|  |      </div>
 |  |      </div>
 | 
											
												
													
														|  |    </div>
 |  |    </div>
 |