diff --git a/app/controllers/admin/communication/website/pages_controller.rb b/app/controllers/admin/communication/website/pages_controller.rb index fc0e9fe7fcb9fcf84c2ef31b7134afcd33c0b142..d3a2194cfbb1bbdfc79992edff916ac25da96406 100644 --- a/app/controllers/admin/communication/website/pages_controller.rb +++ b/app/controllers/admin/communication/website/pages_controller.rb @@ -2,7 +2,7 @@ class Admin::Communication::Website::PagesController < Admin::Communication::Web load_and_authorize_resource class: Communication::Website::Page def index - @pages = @website.pages.ordered + @pages = @website.pages.ordered.page params[:page] breadcrumb end @@ -11,6 +11,7 @@ class Admin::Communication::Website::PagesController < Admin::Communication::Web end def new + @page.website = @website breadcrumb end diff --git a/app/controllers/admin/communication/website/posts_controller.rb b/app/controllers/admin/communication/website/posts_controller.rb index d6a49f8ead9fac4f08109ecdc8b6d8ad35e33bad..69fe0c76000521e6fd13ffd4f7b8c181f7224a6c 100644 --- a/app/controllers/admin/communication/website/posts_controller.rb +++ b/app/controllers/admin/communication/website/posts_controller.rb @@ -2,7 +2,7 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web load_and_authorize_resource class: Communication::Website::Post def index - @posts = @website.posts.ordered + @posts = @website.posts.ordered.page params[:page] breadcrumb end @@ -11,6 +11,7 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web end def new + @post.website = @website breadcrumb end diff --git a/app/views/admin/communication/website/pages/_form.html.erb b/app/views/admin/communication/website/pages/_form.html.erb index 15edf3743eb5bd8e6375f308aa683ae97628bcb0..f1b31c1165b73ae5883d61e58d7d8f4659a50fe6 100644 --- a/app/views/admin/communication/website/pages/_form.html.erb +++ b/app/views/admin/communication/website/pages/_form.html.erb @@ -1,31 +1,31 @@ <%= simple_form_for [:admin, page] do |f| %> -<div class="row"> - <div class="col-md-8"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0">Content</h5> - </div> - <div class="card-body"> - <%= f.input :title %> - <%= f.input :description %> - <%= f.input :text, input_html: { rows: 20 } %> + <div class="row"> + <div class="col-md-8"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title">Content</h5> + </div> + <div class="card-body"> + <%= f.input :title %> + <%= f.input :description %> + <%= f.input :text, input_html: { rows: 20 } %> + </div> </div> </div> - </div> - <div class="col-md-4"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0">Metadata</h5> - </div> - <div class="card-body"> - <%= f.input :slug %> - <%= f.input :published %> - <%= f.association :parent, collection: page.website.pages.where.not(id: page) %> + <div class="col-md-4"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title">Metadata</h5> + </div> + <div class="card-body"> + <%= f.input :slug %> + <%= f.input :published %> + <%= f.association :parent, collection: page.website.pages.where.not(id: page) %> + </div> </div> </div> </div> -</div> -<% content_for :buttons do %> - <%= submit f %> -<% end %> + <% content_for :buttons do %> + <%= submit f %> + <% end %> <% end %> diff --git a/app/views/admin/communication/website/pages/_list.html.erb b/app/views/admin/communication/website/pages/_list.html.erb index dba9d2fd4f51a2b50e5ee877f75ed98e2b43f6eb..7b063331d557c8e05837d9a9b595f648a70056d3 100644 --- a/app/views/admin/communication/website/pages/_list.html.erb +++ b/app/views/admin/communication/website/pages/_list.html.erb @@ -1,7 +1,7 @@ <table class="table"> <thead> <tr> - <th class="ps-0"><%= Communication::Website::Page.human_attribute_name('title') %></th> + <th><%= Communication::Website::Page.human_attribute_name('title') %></th> <th><%= Communication::Website::Page.human_attribute_name('path') %></th> <th width="150"></th> </tr> @@ -9,9 +9,9 @@ <tbody> <% pages.each do |page| %> <tr> - <td class="ps-0"><%= link_to page, admin_communication_website_page_path(website_id: page.website.id, id: page.id) %></td> + <td><%= link_to page, admin_communication_website_page_path(website_id: page.website.id, id: page.id) %></td> <td><%= page.path %></td> - <td class="text-end pe-0"> + <td class="text-end"> <%= link_to t('edit'), edit_admin_communication_website_page_path(website_id: page.website.id, id: page.id), class: button_classes %> diff --git a/app/views/admin/communication/website/pages/index.html.erb b/app/views/admin/communication/website/pages/index.html.erb index 157e08e9dc5aa647152f7ba1711596363a702057..a35c92fecd52f4eeb15a548129de9839eecb3500 100644 --- a/app/views/admin/communication/website/pages/index.html.erb +++ b/app/views/admin/communication/website/pages/index.html.erb @@ -1,6 +1,11 @@ <% content_for :title, Communication::Website::Page.model_name.human(count: 2) %> -<%= render 'admin/communication/website/pages/list', pages: @pages %> +<div class="card"> + <%= render 'admin/communication/website/pages/list', pages: @pages %> + <div class="card-footer"> + <%= paginate @pages, theme: 'bootstrap-5' %> + </div> +</div> <% content_for :buttons do %> <%= create_link Communication::Website::Page %> diff --git a/app/views/admin/communication/website/posts/_list.html.erb b/app/views/admin/communication/website/posts/_list.html.erb index 6dae7e87f343a108c46aab30a3b1db9e2725fae0..05c71ee324f41247afca6eef8474906b5adc9b8e 100644 --- a/app/views/admin/communication/website/posts/_list.html.erb +++ b/app/views/admin/communication/website/posts/_list.html.erb @@ -1,7 +1,7 @@ <table class="table"> <thead> <tr> - <th class="ps-0"><%= Communication::Website::Post.human_attribute_name('title') %></th> + <th><%= Communication::Website::Post.human_attribute_name('title') %></th> <th><%= Communication::Website::Post.human_attribute_name('published_at') %></th> <th width="150"></th> </tr> @@ -9,9 +9,9 @@ <tbody> <% posts.each do |post| %> <tr> - <td class="ps-0"><%= link_to post, admin_communication_website_post_path(website_id: post.website.id, id: post.id) %></td> + <td><%= link_to post, admin_communication_website_post_path(website_id: post.website.id, id: post.id) %></td> <td><%= l post.published_at, format: :long if post.published_at %></td> - <td class="text-end pe-0"> + <td class="text-end"> <%= link_to t('edit'), edit_admin_communication_website_post_path(website_id: post.website.id, id: post.id), class: button_classes %> diff --git a/app/views/admin/communication/website/posts/index.html.erb b/app/views/admin/communication/website/posts/index.html.erb index 395eec23b8745384f8fc77806f78f55a4afcfd69..e8af860df21f3edf2f2e51885c787c772a52e832 100644 --- a/app/views/admin/communication/website/posts/index.html.erb +++ b/app/views/admin/communication/website/posts/index.html.erb @@ -1,6 +1,11 @@ <% content_for :title, Communication::Website::Post.model_name.human(count: 2) %> -<%= render 'admin/communication/website/posts/list', posts: @posts %> +<div class="card"> + <%= render 'admin/communication/website/posts/list', posts: @posts %> + <div class="card-footer"> + <%= paginate @posts, theme: 'bootstrap-5' %> + </div> +</div> <% content_for :buttons do %> <%= create_link Communication::Website::Post %> diff --git a/app/views/admin/communication/websites/show.html.erb b/app/views/admin/communication/websites/show.html.erb index c80c33b936d5f9579047fce5f6ba14091e73bb05..9901b49a7ff76dc9f346794e124f1452d6f68faa 100644 --- a/app/views/admin/communication/websites/show.html.erb +++ b/app/views/admin/communication/websites/show.html.erb @@ -9,22 +9,35 @@ <%= link_to @website.about, [:admin, @website.about] unless @website.about.nil? %> </p> -<h2 class="mt-5"><%= Communication::Website::Post.model_name.human(count: 2) %></h2> -<%= link_to t('create'), - new_admin_communication_website_post_path(website_id: @website), - class: button_classes('me-3') %> -<%= link_to t('activerecord.models.communication/website/post.all'), - admin_communication_website_posts_path(website_id: @website) %> -<%= render 'admin/communication/website/posts/list', posts: @website.posts.recent %> +<div class="card mt-5"> + <div class="card-header"> + <div class="float-end"> + <%= link_to t('activerecord.models.communication/website/post.all'), + admin_communication_website_posts_path(website_id: @website), + class: 'me-3' %> + <%= link_to t('create'), + new_admin_communication_website_post_path(website_id: @website), + class: button_classes %> + </div> + <h2 class="card-title"><%= Communication::Website::Post.model_name.human(count: 2) %></h2> + </div> + <%= render 'admin/communication/website/posts/list', posts: @website.posts.recent %> +</div> +<div class="card mt-5"> + <div class="card-header"> + <div class="float-end"> + <%= link_to t('activerecord.models.communication/website/page.all'), + admin_communication_website_pages_path(website_id: @website), + class: 'me-3' %> + <%= link_to t('create'), + new_admin_communication_website_page_path(website_id: @website), + class: button_classes %> + </div> + <h2 class="card-title"><%= Communication::Website::Page.model_name.human(count: 2) %></h2> + </div> + <%= render 'admin/communication/website/pages/list', pages: @website.pages.recent %> +</div> -<h2 class="mt-5"><%= Communication::Website::Page.model_name.human(count: 2) %></h2> - -<%= link_to t('create'), - new_admin_communication_website_page_path(website_id: @website), - class: button_classes('me-3') %> -<%= link_to t('activerecord.models.communication/website/page.all'), - admin_communication_website_pages_path(website_id: @website) %> -<%= render 'admin/communication/website/pages/list', pages: @website.pages.recent %> <% content_for :buttons do %> <% if @website.imported? %>