luizpicolo/rails_admin_featured_content

View on GitHub
app/views/rails_admin/main/featured_content.html.erb

Summary

Maintainability
Test Coverage
<%= stylesheet_link_tag 'rails_admin/featured_content' %>
<%= javascript_include_tag 'rails_admin/featured_content'  %>

<div class="fc-snippet">
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '1'} do %>
    <%= image_tag 'fc-snippet-highlight.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.targe') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '2'} do %>
    <%= image_tag 'fc-snippet-text.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.title_large') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '3'} do %>
    <%= image_tag 'fc-snippet-slide.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.slide') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '4'} do %>
    <%= image_tag 'fc-snippet-one.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.one') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '5'} do %>
    <%= image_tag 'fc-snippet-two.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_two') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '6'} do %>
    <%= image_tag 'fc-snippet-three.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_three') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '7'} do %>
    <%= image_tag 'fc-snippet-four.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_four') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '8'} do %>
    <%= image_tag 'fc-snippet-float-one.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.float_one') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '9'} do %>
    <%= image_tag 'fc-snippet-float-two.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_float_two') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '10'} do %>
    <%= image_tag 'fc-snippet-float-three.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_float_three') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '11'} do %>
    <%= image_tag 'fc-snippet-text-one.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.text_one') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '12'} do %>
    <%= image_tag 'fc-snippet-text-two.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_text_two') %>
    </span>
  <% end %>

  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '13'} do %>
    <%= image_tag 'fc-snippet-text-three.jpg', class: 'fc-snippet__image' %>
    <span class="fc-snippet__caption">
      <%= t('admin.actions.featured_content.snippet.list_text_three') %>
    </span>
  <% end %>
</div>

<%= simple_form_for rails_admin.featured_content_url(@abstract_model.to_param, id: @object.id), html: { class: 'fc-form' }, remote: false do |f| %>
  <div class="fc-controls">
    <%= f.button :submit, "Salvar", name: 'save', class: 'btn btn-block btn-primary btn-right' %>
    <% if @object.status %>
      <%= f.button :submit, "Despublicar", name: 'unpublish', class: 'btn btn-block btn-danger btn-left' %>
    <% else %>
      <%= f.button :submit, "Publicar", name: 'publish', class: 'btn btn-block btn-success btn-left' %>
    <% end %>
  </div>

  <div class="fc-container">
    <%= @object.content.try(:html_safe) %>
  </div>

  <%= f.input :id, as: :hidden, :input_html => { :name => "id", :value => @object.id } %>
  <%= f.input :content, as: :hidden, :input_html => { :name => "content", :id => "content", :value => @object.content } %>
<% end %>