app/views/dhatu/sections/_index.html.erb in dhatu-0.2.0 vs app/views/dhatu/sections/_index.html.erb in dhatu-0.2.1

- old
+ new

@@ -1,53 +1,29 @@ -<div class="table-responsive"> - <table class="table table-hover table-condensed members-table middle-align"> - <thead> - <tr> - <th style="text-align: center;width:5%">#</th> - <!-- <th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th> --> - <th style="width:50%;">Title</th> - <th style="width:100px;" class="hidden-sm hidden-xs">Status</th> - <% if display_manage_links? %> - <th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th> - <% end %> - </tr> - </thead> - <tbody> - <tr id="tr_section_0"></tr> - <% @sections.each_with_index do |section, i| %> - - <tr id="tr_section_<%= section.id %>"> +<% if @current_user.super_admin? %> + <% sections = page.sections %> +<% else %> + <% sections = page.sections.published %> +<% end %> - <th scope="row" style="text-align: center;"> - <%= serial_number(i) %> - </th> +<% sections.order("priority ASC, created_at DESC").each do |section| %> + <div id="div_section_<%= section.id %>" class="row ml-30 mb-5"> + <span class="pull-left"> + <%= link_to raw("<i class='fa-reorder mr-10'></i>#{section.name}"), section_path(section), remote: true, style: "font-size: 18px;;color:#4b4b4b;margin-right:20px;" %> + </span> + <span class="action-links"> + <%= display_manage_links(section, @current_user) %> + <%= display_publishable_links(section) if @current_user.super_admin? %> + </span> + <%= clear_tag %> + </div> +<% end %> - <!-- <td class="display-image"> - <%#= display_thumbnail(section) %> - </td> --> - - <td> - <strong><%= section.title %></strong><br> - <%= section.sub_title %><br> - </td> - - <td class="hidden-sm hidden-xs"><%= display_publishable_status(section) %></td> - - <% if display_manage_links? %> - <td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(section) %></td> - - <td class="action-links hidden-sm hidden-xs" style="width:10%"> - <%= display_manage_links(section, @current_user) %> - </td> - <% end %> - - </tr> - <% end %> - </tbody> - </table> -</div> - -<div class="row"> - <div class="col-sm-12"> - <%= paginate_kuppayam(@sections) %> - </div> -</div> +<div class="row mt-30"> + <div class="col-md-12"> + <% if page.feature %> + <%#= theme_button("Manage #{page.feature.display_name}", 'list', dhatu.new_section_path(page_id: page), classes: "btn btn-success btn-xs ml-30 mb-5", btn_type: "success") if @current_user.super_admin? %> + <p class="ml-30"> Go to <%= page.feature.display_name %> section to edit the contents on this page. </p> + <% else %> + <%= theme_button('Add a Section', 'plus', dhatu.new_section_path(page_id: page), classes: "btn btn-success btn-xs ml-30 mb-5", btn_type: "info") if @current_user.super_admin? %> + <% end %> + </div> +</div> \ No newline at end of file