Parcourir la source

Hide chart list if no charts

Andrew Kane il y a 8 ans
Parent
commit
20858e2c74
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      app/views/blazer/dashboards/_form.html.erb

+ 2 - 2
app/views/blazer/dashboards/_form.html.erb

@@ -7,7 +7,7 @@
     <%= f.label :name %>
     <%= f.label :name %>
     <%= f.text_field :name, class: "form-control" %>
     <%= f.text_field :name, class: "form-control" %>
   </div>
   </div>
-  <div class="form-group">
+  <div class="form-group" v-if="queries.length">
     <%= f.label :charts %>
     <%= f.label :charts %>
     <ul id="queries" class="list-group">
     <ul id="queries" class="list-group">
       <li class="list-group-item" v-for="(query, index) in queries" :key="query.id" v-cloak>
       <li class="list-group-item" v-for="(query, index) in queries" :key="query.id" v-cloak>
@@ -21,7 +21,7 @@
     <%= f.label :query_id, "Add Chart" %>
     <%= f.label :query_id, "Add Chart" %>
     <%= select_tag :query_id, nil, {include_blank: true, placeholder: "Select chart"} %>
     <%= select_tag :query_id, nil, {include_blank: true, placeholder: "Select chart"} %>
   </div>
   </div>
-  <p style="padding-bottom: 140px;">
+  <p style="padding-bottom: 140px;" v-cloak>
     <% if @dashboard.persisted? %>
     <% if @dashboard.persisted? %>
       <%= link_to "Delete", dashboard_path(@dashboard), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger"%>
       <%= link_to "Delete", dashboard_path(@dashboard), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger"%>
     <% end %>
     <% end %>