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

- old
+ new

@@ -15,15 +15,29 @@ </span> <%= clear_tag %> </div> <% end %> -<div class="row mt-30"> +<div class="row mt-10"> <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 %> + <% if page.sections.empty? %> + <p id="p_section_empty_message_for_page_<%= page.id %>" class="ml-30"> You have not added any sections for this page. Click on the below button to add one. </p> + <% end %> <%= 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 %> + + <% if page.feature %> + <% + begin + url = url_for(page.feature.name.constantize) + rescue + url = nil + end + %> + <% if page.sections.any? %> + <p class="mt-60 ml-30"> Go to <%= page.feature.display_name %> section to edit rest of the contents on this page. </p> + <% else %> + <p class="mt-60 ml-30"> Go to <%= page.feature.display_name %> section to edit the contents on this page. </p> + <% end %> + <%= theme_button("Click Here to go to 'Manage #{page.feature.display_name}'", 'list', url, classes: "btn btn-primary btn-xs ml-30 mb-5", btn_type: "default", remote: false) if url %> + <% end %> </div> </div> \ No newline at end of file