Add label to cards
Also removes unused fields related to buttons and alignment
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user