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

Merge branch 'master' of github.com:noesya/osuny

parents 150a5119 551f7515
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,9 @@ GEM
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.9.3, < 3)
sassc-rails (>= 2.0.0)
bootstrap5-kaminari-views (0.0.1)
kaminari (>= 0.13)
rails (>= 3.1)
breadcrumbs_on_rails (4.1.0)
railties (>= 5.0)
bugsnag (6.24.0)
......@@ -370,6 +373,7 @@ DEPENDENCIES
aws-sdk-s3
bootsnap (>= 1.4.4)
bootstrap
bootstrap5-kaminari-views
breadcrumbs_on_rails
bugsnag
byebug
......
......@@ -7,3 +7,7 @@ main.content
padding: .5rem
position: fixed
right: 0
table.table-striped
tbody
background: white
......@@ -20,8 +20,8 @@ class Admin::Communication::WebsitesController < Admin::Communication::Applicati
flash[:notice] = t('communication.website.imported.launched')
end
@imported_website = @website.imported_website
@imported_pages = @imported_website.pages
@imported_posts = @imported_website.posts
@imported_pages = @imported_website.pages.page params[:pages_page]
@imported_posts = @imported_website.posts.page params[:posts_page]
breadcrumb
add_breadcrumb Communication::Website::Imported::Website.model_name.human
end
......
......@@ -50,7 +50,7 @@ module Admin::ApplicationHelper
end
def table_classes
'table table-striped'
'table table-striped table-hover'
end
def submit(form)
......
......@@ -36,6 +36,8 @@ class Communication::Website::Imported::Page < ApplicationRecord
before_validation :sync
default_scope { order(:path) }
def to_s
"#{title}"
end
......
......@@ -39,6 +39,8 @@ class Communication::Website::Imported::Post < ApplicationRecord
before_validation :sync
default_scope { order(path: :desc) }
def to_s
"#{title}"
end
......
......@@ -7,25 +7,32 @@
<% end %>
<h2><%= @imported_posts.count %> posts</h2>
<table class="table">
<table class="<%= table_classes %>">
<thead>
<tr>
<th class="ps-0"><%= Communication::Website::Imported::Post.human_attribute_name('title') %></th>
<th><%= Communication::Website::Imported::Post.human_attribute_name('title') %></th>
<th><%= Communication::Website::Imported::Post.human_attribute_name('original') %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @imported_posts.each do |post| %>
<tr>
<td class="ps-0"><%= link_to post, admin_communication_website_post_path(website_id: post.post.website.id, id: post.post.id) %></td>
<td><%= link_to post, admin_communication_website_post_path(website_id: post.post.website.id, id: post.post.id) %></td>
<td class="small"><%= link_to post.path, post.url, target: :_blank %></td>
<td>
<%= link_to t('show'),
admin_communication_website_post_path(website_id: post.post.website.id, id: post.post.id),
class: button_classes %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @imported_posts, param_name: :posts_page, theme: 'bootstrap-5' %>
<h2 class="mt-5"><%= @imported_pages.count %> pages</h2>
<table class="table">
<table class="<%= table_classes %>">
<thead>
<tr>
<th class="ps-0"><%= Communication::Website::Imported::Page.human_attribute_name('title') %></th>
......@@ -41,3 +48,4 @@
<% end %>
</tbody>
</table>
<%= paginate @imported_pages, param_name: :pages_page, theme: 'bootstrap-5' %>
......@@ -5,7 +5,11 @@
<div class="card">
<div class="card-body">
<h4>Bonjour <%= current_user.first_name %>&nbsp;!</h4>
<p><%= current_university %></p>
<% if current_university.logo.attached? %>
<%= image_tag current_university.logo, width: 120, class: 'float-end' %>
<% else %>
<p><%= current_university %></p>
<% end %>
</div>
</div>
</div>
......
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