Skip to content
Snippets Groups Projects
Commit c555ec6f authored by Arnaud Levy's avatar Arnaud Levy
Browse files

routes

parent 43fc7fd2
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We
def show
breadcrumb
add_breadcrumb(@page, admin_communication_website_page_path(@page))
end
def static
......@@ -42,10 +43,12 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We
def new
@page.website = @website
breadcrumb
add_breadcrumb(t('create'))
end
def edit
breadcrumb
add_breadcrumb(@page, admin_communication_website_page_path(@page))
add_breadcrumb t('edit')
end
......@@ -56,6 +59,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We
redirect_to admin_communication_website_page_path(@page), notice: t('admin.successfully_created_html', model: @page.to_s)
else
breadcrumb
add_breadcrumb(t('create'))
render :new, status: :unprocessable_entity
end
end
......@@ -66,6 +70,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We
redirect_to admin_communication_website_page_path(@page), notice: t('admin.successfully_updated_html', model: @page.to_s)
else
breadcrumb
add_breadcrumb(@page, admin_communication_website_page_path(@page))
add_breadcrumb t('edit')
render :edit, status: :unprocessable_entity
end
......@@ -91,7 +96,6 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We
super
add_breadcrumb t('admin.communication.website.pages.structure'),
admin_communication_website_pages_path
breadcrumb_for @page
end
def page_params
......
<%= simple_form_for [:admin, page] do |f| %>
<%
url = page.new_record? ? admin_communication_website_pages_path
: admin_communication_website_page_path(page)
%>
<%= simple_form_for page, url: url do |f| %>
<%= f.error_notification %>
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
......
......@@ -28,8 +28,8 @@
<span class="me-3 show-on-hover"><%= t("communication.website.pages.defaults.#{page.kind}.admin_description") %></span>
<% end %>
<div class="btn-group">
<%= duplicate_link page if page.is_regular_page?%>
<%= edit_link page %>
<%= duplicate_link page if page.is_regular_page? %>
<%= link_to t('edit'), edit_admin_communication_website_page_path(page), class: button_classes %>
<%= destroy_link page, confirm_message: page.children.any? ? t('please_confirm_with_children') : t('please_confirm') if page.is_regular_page? %>
</div>
</div>
......
......@@ -15,12 +15,12 @@
admin_communication_website_page_path(website_id: @homepage.website.id, id: @homepage.id)
%>
<div class="btn-group ms-auto" role="group">
<%= edit_link @homepage %>
<%= link_to t('edit'), edit_admin_communication_website_page_path(@homepage), class: button_classes %>
</div>
</div>
<ul class="list-unstyled ms-4 treeview__children js-treeview <%= 'treeview--sortable js-treeview-sortable js-treeview-sortable-container' if can?(:reorder, @homepage) %>"
data-id="<%= @homepage.id %>"
data-sort-url="<%= reorder_admin_communication_website_pages_path %>">
data-id="<%= @homepage.id %>"
data-sort-url="<%= reorder_admin_communication_website_pages_path %>">
<%= render 'treebranch', pages: @first_level_pages %>
</ul>
</li>
......
......@@ -106,5 +106,5 @@
<% content_for :action_bar_right do %>
<%= preview_link %>
<%= edit_link @page %>
<%= link_to t('edit'), edit_admin_communication_website_page_path(@page), class: button_classes %>
<% end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment