Add label to cards

Also removes unused fields related to buttons and alignment
This commit is contained in:
rgarcia
2018-05-24 18:38:32 +02:00
committed by decabeza
parent eaebf349df
commit ad181b0e10
10 changed files with 44 additions and 29 deletions

View File

@@ -39,7 +39,7 @@ class Admin::Widget::CardsController < Admin::BaseController
private
def card_params
params.require(:widget_card).permit(:title, :description, :link_text, :link_url,
params.require(:widget_card).permit(:label, :title, :description, :link_text, :link_url,
:button_text, :button_url, :alignment, :header,
image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy])
end

View File

@@ -1,5 +1,8 @@
<tr id="<%= dom_id(card) %>" class="card">
<td><%= card.title %></td>
<td>
<%= card.label %><br>
<%= card.title %>
</td>
<td><%= card.description %></td>
<td>
<%= card.link_text %><br>

View File

@@ -1,4 +1,8 @@
<%= form_for [:admin, @card] do |f| %>
<div class="small-12 medium-6">
<%= f.text_field :label %>
</div>
<%= f.text_field :title %>
<%= f.text_area :description, rows: 5 %>

View File

@@ -5,7 +5,7 @@
<%= image_tag(card.image_url(:large), alt: card.image.title) %>
<% end %>
<figcaption>
<span>LABEL</span><br>
<span><%= card.label %></span><br>
<h3><%= card.title %></h3>
</figcaption>
</figure>