Sha256: 22ea334b8b8099a3c22913ea8c6de963c4e27878b1adee8d3e13dd07c523666b
Contents?: true
Size: 1.89 KB
Versions: 1
Compression:
Stored size: 1.89 KB
Contents
<div class="grid"> <div class="col-1-2"> <h1><%= @section.name %></h1> </div> <div class="col-1-2 section-options"> <% if Cas::SectionConfig.new(@section).form_has_field?(:category) %> <%= link_to "Categorias", section_categories_path(@section), id: 'manage-categories' %> <% end %> </div> </div> <%= link_to 'Novo conteúdo', new_section_content_path(@section.id), id: 'new-content' %> <br /> <br /> <table> <thead> <tr> <th colspan="<%= Cas::SectionConfig.new(@section).list_fields.count %>">Título</th> <th></th> </tr> </thead> <tbody> <% @contents.each do |content| %> <tr id="content-<%= content.id %>"> <% column_no = 1 %> <% Cas::SectionConfig.new(@section).list_fields.each do |field| %> <td> <% if field == 'created_at' %> <% value = l(content.created_at, format: :short) %> <% elsif field == 'date_year' %> <% value = content.date.year %> <% elsif field == 'date' %> <% value = content.date.strftime("%d/%m/%Y") %> <% elsif field == 'date_time' %> <% if content.date.present? %> <% value = l(content.date, format: :short) %> <% end %> <% else %> <% value = content.public_send(field) %> <% end %> <% if column_no == 1 %> <%= link_to value, edit_section_content_path(@section.id, content), id: "edit-content-#{content.id}" %> <% else %> <%= value %> <% end %> <% column_no += 1 %> </td> <% end %> <td> <%= link_to 'Excluir', section_content_path(@section.id, content), method: :delete, data: { confirm: 'Tem certeza?' }, id: "delete-content-#{content.id}" %> </td> </tr> <% end %> </tbody> </table> <br> <%= paginate @contents %>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cas-cms-0.1.0 | app/views/cas/sections/contents/index.html.erb |