Skip to content
Snippets Groups Projects
Commit d8d4f769 authored by pabois's avatar pabois
Browse files

affichage

parent dc8446f4
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,7 @@ class Communication::Website::Page < ApplicationRecord
website.pages.where.not(id: id).root.ordered.each do |page|
pages.concat(page.self_and_children(0))
end
pages.reject! { |p| p[:id] == id }
pages
end
......
......@@ -11,7 +11,7 @@
# text :text
# title :string
# created_at :datetime not null
# updated_at :date not null
# updated_at :datetime not null
# research_journal_id :uuid not null
# research_journal_volume_id :uuid
# university_id :uuid not null
......
<% content_for :title, Communication::Website::Page.model_name.human(count: 2) %>
<% content_for :title, "#{Communication::Website::Page.model_name.human(count: 2)} (#{@website.pages.count})" %>
<ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container" data-id="" data-sort-url="<%= reorder_admin_communication_website_pages_path %>">
<%= render 'treebranch', pages: @root_pages %>
......
<% content_for :title, Communication::Website::Post.model_name.human(count: 2) %>
<% content_for :title, "#{Communication::Website::Post.model_name.human(count: 2)} (#{@posts.total_count})" %>
<%= render 'admin/communication/website/posts/list', posts: @posts %>
<%= paginate @posts, theme: 'bootstrap-5' %>
......
......@@ -13,13 +13,20 @@
<div class="card mt-5">
<div class="card-header">
<div class="float-end">
<%= link_to t('create'),
<%= link_to_if can?(:create, Communication::Website::Post),
t('create'),
new_admin_communication_website_post_path(website_id: @website),
class: button_classes %>
</div>
<h2 class="card-title">
<%= link_to Communication::Website::Post.model_name.human(count: 2),
admin_communication_website_posts_path(website_id: @website) %></h2>
<%= link_to admin_communication_website_posts_path(website_id: @website) do %>
<%= t('communication.website.last_posts') %>
<small>
-
<%= t('communication.website.see_all', number: @website.posts.count) %>
</small>
<% end %>
</h2>
</div>
<%= render 'admin/communication/website/posts/list', posts: @website.posts.recent %>
</div>
......@@ -31,8 +38,13 @@
class: button_classes %>
</div>
<h2 class="card-title">
<%= link_to Communication::Website::Page.model_name.human(count: 2),
admin_communication_website_pages_path(website_id: @website) %>
<%= link_to admin_communication_website_pages_path(website_id: @website) do %>
<%= t('communication.website.last_pages') %>
<small>
-
<%= t('communication.website.see_all', number: @website.pages.count) %>
</small>
<% end %>
</h2>
</div>
<%= render 'admin/communication/website/pages/list', pages: @website.pages.recent %>
......
......@@ -13,7 +13,10 @@ en:
refresh: Refresh import
show: Show import
pending: Import in progress
last_pages: Last pages
last_posts: Last posts
metadata: Metadata
see_all: See the full list (%{number} elements)
activemodel:
models:
communication: Communication
......
......@@ -13,7 +13,10 @@ fr:
refresh: Relancer l'import
show: Voir l'import
pending: Import en cours
last_pages: Dernières pages
last_posts: Dernières actualités
metadata: Informations
see_all: Voir la liste complète (%{number} éléments)
activemodel:
models:
communication: Communication
......
......@@ -267,7 +267,7 @@ ActiveRecord::Schema.define(version: 2021_10_26_035253) do
t.uuid "research_journal_id", null: false
t.uuid "research_journal_volume_id"
t.datetime "created_at", precision: 6, null: false
t.date "updated_at", null: false
t.datetime "updated_at", precision: 6, null: false
t.uuid "updated_by_id"
t.text "abstract"
t.text "references"
......
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