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

wip

parent fe1a7ab7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
<%= 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 %>
<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 %>
......
<% 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 %>
......
<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 %>
......
<% 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 %>
......
......@@ -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? %>
......
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