diff --git a/app/controllers/admin/communication/websites/connections_controller.rb b/app/controllers/admin/communication/websites/connections_controller.rb index f23a5927a0dd7ca42e832f4874658a085cbadc19..0c0da98dfa2d29911d289f95a625915a06b358f7 100644 --- a/app/controllers/admin/communication/websites/connections_controller.rb +++ b/app/controllers/admin/communication/websites/connections_controller.rb @@ -3,6 +3,7 @@ class Admin::Communication::Websites::ConnectionsController < Admin::Communicati def index @connections = @website.connections.page params[:page] + breadcrumb end def create @@ -22,4 +23,9 @@ class Admin::Communication::Websites::ConnectionsController < Admin::Communicati object_id = params[:object_id] @object = object_type.constantize.find object_id end + + def breadcrumb + super + add_breadcrumb Communication::Website::Connection.model_name.human(count: 2) + end end \ No newline at end of file diff --git a/app/views/admin/communication/websites/connections/index.html.erb b/app/views/admin/communication/websites/connections/index.html.erb index 02ab3d6a9effbda769464bf2853aa4b3239155b5..ee5c0b6540022a19196679a99573a5ea9fdf86ce 100644 --- a/app/views/admin/communication/websites/connections/index.html.erb +++ b/app/views/admin/communication/websites/connections/index.html.erb @@ -1 +1,28 @@ <% content_for :title, Communication::Website::Connection.model_name.human(count: 2) %> + +<div class="table-responsive"> + <table class="<%= table_classes %>"> + <thead> + <tr> + <th><%= Communication::Website::Connection.human_attribute_name('object') %></th> + <th><%= Communication::Website::Connection.human_attribute_name('object_type') %></th> + <th><%= Communication::Website::Connection.human_attribute_name('source') %></th> + <th><%= Communication::Website::Connection.human_attribute_name('source_type') %></th> + <th><%= Communication::Website::Connection.human_attribute_name('updated_at') %></th> + </tr> + </thead> + <tbody> + <% @connections.each do |connection| %> + <tr> + <td><%= link_to connection.object, [:admin, connection.object] %></td> + <td><%= connection.object_type %></td> + <td><%= link_to connection.source, [:admin, connection.source] if connection.source %></td> + <td><%= connection.source_type %></td> + <td><%= l connection.updated_at %></td> + </tr> + <% end %> + </tbody> + </table> +</div> + +<%= paginate @connections, theme: 'bootstrap-5' %> \ No newline at end of file diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index db55b72350b224452bfbc183c5e738891507d6bf..e693618ce85ed9a4fd22a644d733906bc649784d 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -17,6 +17,9 @@ en: one: Category other: Categories all: All categories + communication/website/connection: + one: Connection + other: Connections communication/website/imported/website: one: Imported website other: Imported websites diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 827b5f231f299cb081e470dc4055329de9e73113..272029c49276f344567c8ce8597be249cbc57189 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -17,6 +17,9 @@ fr: one: Catégorie other: Catégories all: Toutes les catégories + communication/website/connection: + one: Connexion + other: Connexions communication/website/imported/website: one: Site importé other: Sites importés