diff --git a/app/assets/javascripts/server/websites/batch-sync-themes.js b/app/assets/javascripts/server/websites/batch-sync-themes.js index d0a0be0b948009d5a8ba817fee0f531e2c9317cb..2bf80067a258f259b8b8fea1f4f2409007eea33e 100644 --- a/app/assets/javascripts/server/websites/batch-sync-themes.js +++ b/app/assets/javascripts/server/websites/batch-sync-themes.js @@ -25,7 +25,7 @@ window.osuny.websites.batchSyncThemes = { window.addEventListener('DOMContentLoaded', function () { 'use strict'; - if (document.body.classList.contains('websites-manage_versions')) { + if (document.body.classList.contains('websites-index')) { window.osuny.websites.batchSyncThemes.init(); } }); diff --git a/app/controllers/server/blocks_controller.rb b/app/controllers/server/blocks_controller.rb index 73e7564703ce85d703a9229aa9e891fa7524688d..0b9da835e34bec01a4246fd9cdb55aceaa844e85 100644 --- a/app/controllers/server/blocks_controller.rb +++ b/app/controllers/server/blocks_controller.rb @@ -1,19 +1,21 @@ class Server::BlocksController < Server::ApplicationController + before_action :load_template, except: [:index] def index - @templates = Communication::Block.template_kinds.keys + @templates = Kaminari.paginate_array(Communication::Block.template_kinds.keys.sort_by { |k| t("enums.communication.block.template_kind.#{k}") }).page(params[:page]) breadcrumb end def show + @blocks = @blocks.page(params[:page]) breadcrumb add_breadcrumb t("enums.communication.block.template_kind.#{@template}") end def resave - @blocks.find_each &:save - redirect_to server_block_path(@template), notice: "#{@blocks.count} blocks saved" + @blocks.find_each(&:save) + redirect_back fallback_location: server_block_path(@template), notice: t('server_admin.blocks.blocks_saved', count: @blocks.count) end protected @@ -27,4 +29,5 @@ class Server::BlocksController < Server::ApplicationController super add_breadcrumb Communication::Block.model_name.human(count: 2), server_blocks_path end + end diff --git a/app/controllers/server/dashboard_controller.rb b/app/controllers/server/dashboard_controller.rb index e52c6bfa959fb7b1d2f4481956879812fd60f7ff..28f0cf40c91e620d3c1c8c5fd72df3e2d09f3c0a 100644 --- a/app/controllers/server/dashboard_controller.rb +++ b/app/controllers/server/dashboard_controller.rb @@ -1,16 +1,18 @@ class Server::DashboardController < Server::ApplicationController + def index @parts = [ { - title: "#{University.count} #{University.model_name.human(count: 2).downcase}", + title: "#{University.count} #{University.model_name.human(count: University.count).downcase}", path: server_universities_path }, { - title: "#{Communication::Website.count} #{Communication::Website.model_name.human(count: 2).downcase}", + title: "#{Communication::Website.count} #{Communication::Website.model_name.human(count: Communication::Website.count).downcase}", path: server_websites_path } ] - @websites = Communication::Website.updatable_theme.ordered + @websites = Communication::Website.for_older_theme_version(Osuny::ThemeInfo.get_current_version).ordered breadcrumb end + end diff --git a/app/controllers/server/emergency_messages_controller.rb b/app/controllers/server/emergency_messages_controller.rb index 92399350820f0d2b28e3f72d1660eadc57157d73..aa0de711bd0020264040b3edd60f457969cb5bce 100644 --- a/app/controllers/server/emergency_messages_controller.rb +++ b/app/controllers/server/emergency_messages_controller.rb @@ -1,8 +1,9 @@ class Server::EmergencyMessagesController < Server::ApplicationController + load_and_authorize_resource def index - @emergency_messages = @emergency_messages.reorder(created_at: :desc) + @emergency_messages = @emergency_messages.ordered.page(params[:page]) breadcrumb end diff --git a/app/controllers/server/languages_controller.rb b/app/controllers/server/languages_controller.rb index c1920985ee527a3979220f2ff43012a6f2e3bbd1..afe261e61c5b99879ad25779ee64c7efe72a2abb 100644 --- a/app/controllers/server/languages_controller.rb +++ b/app/controllers/server/languages_controller.rb @@ -1,7 +1,9 @@ class Server::LanguagesController < Server::ApplicationController + load_and_authorize_resource def index + @languages = @languages.ordered.page(params[:page]) breadcrumb end @@ -59,4 +61,5 @@ class Server::LanguagesController < Server::ApplicationController def language_params params.require(:language).permit(:name, :iso_code, :summernote_locale) end + end diff --git a/app/controllers/server/universities_controller.rb b/app/controllers/server/universities_controller.rb index 79433bfcda6e4cc7a36846591ef203f755f77d8a..09b66f1141ab4bf2290bd8fe3c35d8d8bf284d96 100644 --- a/app/controllers/server/universities_controller.rb +++ b/app/controllers/server/universities_controller.rb @@ -1,8 +1,9 @@ class Server::UniversitiesController < Server::ApplicationController + load_and_authorize_resource def index - @universities = @universities.ordered + @universities = @universities.ordered.page(params[:page]) breadcrumb end @@ -67,4 +68,5 @@ class Server::UniversitiesController < Server::ApplicationController :is_really_a_university ) end + end diff --git a/app/controllers/server/websites_controller.rb b/app/controllers/server/websites_controller.rb index b118fd30615549eaf23fbd4b58f922667123ff9c..5fb758131b5344869aa74edd856ea6fb70566468 100644 --- a/app/controllers/server/websites_controller.rb +++ b/app/controllers/server/websites_controller.rb @@ -1,6 +1,7 @@ class Server::WebsitesController < Server::ApplicationController - before_action :load_websites, only: [:index, :manage_versions, :clean_and_rebuild_all_websites] - before_action :load_website, except: [:index, :manage_versions, :clean_and_rebuild_all_websites] + + before_action :load_websites, only: [:index, :clean_and_rebuild_all_websites] + before_action :load_website, except: [:index, :clean_and_rebuild_all_websites] has_scope :for_theme_version has_scope :for_production @@ -9,21 +10,15 @@ class Server::WebsitesController < Server::ApplicationController has_scope :for_updatable_theme def index + @websites = @websites.ordered.page(params[:page]).per(100) breadcrumb end - def manage_versions - @websites = @websites.with_repository.with_url - load_filters - breadcrumb - add_breadcrumb "Gestion des versions" - end - def clean_and_rebuild_all_websites @websites.find_each do |website| website.clean_and_rebuild end - redirect_back(fallback_location: manage_versions_server_websites_path, notice: t('server_admin.websites.clean_and_rebuild_all_websites_notice')) + redirect_back(fallback_location: server_websites_path, notice: t('server_admin.websites.clean_and_rebuild_all_websites_notice')) end def sync_theme_version @@ -36,7 +31,11 @@ class Server::WebsitesController < Server::ApplicationController def show breadcrumb - add_breadcrumb @website + end + + def edit + breadcrumb + add_breadcrumb t('edit') end def update @@ -50,6 +49,9 @@ class Server::WebsitesController < Server::ApplicationController def breadcrumb super add_breadcrumb Communication::Website.model_name.human(count: 2), server_websites_path + if @website + add_breadcrumb @website, server_website_path(@website) + end end def load_websites @@ -59,4 +61,5 @@ class Server::WebsitesController < Server::ApplicationController def load_website @website = Communication::Website.find params[:id] end + end diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index cac6e7952aaf4f2a0fb17d4a3877f11cb0cbfb81..3e195c5de81c8576ac833a597a8f49c2949eaef6 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -88,7 +88,6 @@ class Communication::Website < ApplicationRecord scope :ordered, -> { order(:name) } scope :in_production, -> { where(in_production: true) } scope :for_production, -> (production) { where(in_production: production) } - scope :for_theme_version, -> (version) { where(theme_version: version) } scope :for_search_term, -> (term) { where(" unaccent(communication_websites.name) ILIKE unaccent(:term) OR @@ -96,15 +95,8 @@ class Communication::Website < ApplicationRecord ", term: "%#{sanitize_sql_like(term)}%") } scope :for_update, -> (autoupdate) { where(autoupdate_theme: autoupdate) } - scope :for_updatable_theme, -> (status) { updatable_theme if status == 'true' } - scope :with_repository, -> { where.not(repository: [nil, '']) } scope :with_url, -> { where.not(url: [nil, '']) } scope :with_access_token, -> { where.not(access_token: [nil, '']) } - scope :updatable_theme, -> { - with_repository. - with_url. - with_access_token - } def to_s "#{name}" diff --git a/app/models/communication/website/with_git_repository.rb b/app/models/communication/website/with_git_repository.rb index ba361574d5930e5dcd52444720e99905be620331..b384f932cc3692503288febe1b60d613ff8f2a02 100644 --- a/app/models/communication/website/with_git_repository.rb +++ b/app/models/communication/website/with_git_repository.rb @@ -7,6 +7,9 @@ module Communication::Website::WithGitRepository dependent: :destroy after_save :destroy_obsolete_git_files, if: :should_clean_on_git? + + scope :with_repository, -> { where.not(repository: [nil, '']) } + end def git_repository diff --git a/app/models/communication/website/with_theme.rb b/app/models/communication/website/with_theme.rb index 32416661a020747baa057cf300bee4bd13045382..c3748482779f8c936a4aa050a597929b940791c2 100644 --- a/app/models/communication/website/with_theme.rb +++ b/app/models/communication/website/with_theme.rb @@ -5,6 +5,11 @@ module Communication::Website::WithTheme scope :with_automatic_update, -> { where(autoupdate_theme: true) } scope :with_manual_update, -> { where(autoupdate_theme: false) } + scope :for_theme_version, -> (version) { where(theme_version: version) } + scope :for_older_theme_version, -> (version) { where.not(theme_version: version) } + scope :for_updatable_theme, -> (status) { updatable_theme if status == 'true' } + scope :updatable_theme, -> { with_repository.with_url.with_access_token } + def self.autoupdate_websites Communication::Website.with_automatic_update.find_each do |website| website.update_theme_version @@ -21,6 +26,10 @@ module Communication::Website::WithTheme "#{url}/osuny-theme-version" end + def theme_updatable? + repository.present? && url.present? && access_token.present? + end + protected def current_theme_version diff --git a/app/models/emergency_message.rb b/app/models/emergency_message.rb index 7419fb1c2733880c5490a7204cd8f9943c76cb6b..f482c6b5cab54fa28ffd0947b07537f37653eff3 100644 --- a/app/models/emergency_message.rb +++ b/app/models/emergency_message.rb @@ -28,6 +28,8 @@ class EmergencyMessage < ApplicationRecord validates :name, :subject_fr, :subject_en, :content_fr, :content_en, presence: true + scope :ordered, -> { order(created_at: :desc) } + def deliver! users_fr = target.where(language_id: Language.find_by(iso_code: 'fr').id) users_fr.each do |user| diff --git a/app/models/university/with_invoice.rb b/app/models/university/with_invoice.rb index 8b5418ccd0e1d3f6d7596bf6b1fba9f5ec51baca..d5750c89345b8138bf6fe2995989f4efdb8d818e 100644 --- a/app/models/university/with_invoice.rb +++ b/app/models/university/with_invoice.rb @@ -5,7 +5,7 @@ module University::WithInvoice before_save :denormalize_invoice_date - scope :contributing, -> { where.not(contribution_amount: [nil, 0.0]) } + scope :contributing, -> { where.not(contribution_amount: [nil, 0.0, '', 0]) } def invoice_proximity if next_invoice_in_days < 30 diff --git a/app/services/filters/server/websites.rb b/app/services/filters/server/websites.rb index ae3d8081da44a21ecbe9c7a2a597c3e9a91e836a..45062805f5ce5a1b319a5f1ad43553d0ef0086bb 100644 --- a/app/services/filters/server/websites.rb +++ b/app/services/filters/server/websites.rb @@ -3,19 +3,53 @@ module Filters def initialize(user) super add_search + add_for_theme_version + add_for_update + add_for_updatable_theme + end + + private + + def add_for_theme_version add :for_theme_version, ::Communication::Website.all.pluck(:theme_version).uniq.sort, - 'Filtrer par version du thème' - add :for_production, - [{ to_s: I18n.t('true'), id: 'true' }, { to_s: I18n.t('false'), id: 'false' }], - 'Filtrer par état de production' + I18n.t( + 'filters.attributes.element', + element: I18n.t('server_admin.websites.theme_version').downcase + ) + add :for_production, + [ + { to_s: I18n.t('true'), id: 'true' }, + { to_s: I18n.t('false'), id: 'false' } + ], + I18n.t( + 'filters.attributes.element', + element: I18n.t('server_admin.websites.production_status').downcase + ) + end + + def add_for_update add :for_update, - [{ to_s: 'Automatique', id: 'true' }, { to_s: 'Manuelle', id: 'false' }], - 'Filtrer par mode de mise à jour' - add :for_updatable_theme, - [{ to_s: 'Mise à jour automatique possible', id: 'true' }], - 'Filtrer par capacité de mise à jour automatique' + [ + { to_s: I18n.t('server_admin.websites.autoupdate_theme.true'), id: 'true' }, + { to_s: I18n.t('server_admin.websites.autoupdate_theme.false'), id: 'false' } + ], + I18n.t( + 'filters.attributes.element', + element: I18n.t('server_admin.websites.update_mode').downcase + ) + end + def add_for_updatable_theme + add :for_updatable_theme, + [ + { to_s: I18n.t('server_admin.websites.updatable_theme_filter.value'), id: 'true' } + ], + I18n.t( + 'filters.attributes.element', + element: I18n.t('server_admin.websites.updatable_theme_filter.element').downcase + ) end + end end diff --git a/app/services/git/providers/github.rb b/app/services/git/providers/github.rb index ac7e7c7e582d8b621aa053eb75923d6575e650ed..716d4885f727b85e7a2bcc5fef4dd296f881adb7 100644 --- a/app/services/git/providers/github.rb +++ b/app/services/git/providers/github.rb @@ -124,7 +124,7 @@ class Git::Providers::Github < Git::Providers::Abstract end def current_theme_sha - @current_theme_sha ||= client.branch(ENV["GITHUB_WEBSITE_THEME_REPOSITORY"], ENV["GITHUB_WEBSITE_THEME_BRANCH"])[:commit][:sha] + @current_theme_sha ||= Osuny::ThemeInfo.get_current_sha end def tree_item_at_path(path) diff --git a/app/services/osuny/theme_info.rb b/app/services/osuny/theme_info.rb new file mode 100644 index 0000000000000000000000000000000000000000..08d78d2a0eef2fd2fb731fb042ce77d06844b9c0 --- /dev/null +++ b/app/services/osuny/theme_info.rb @@ -0,0 +1,17 @@ +class Osuny::ThemeInfo + + def self.get_current_version + @last_version ||= client.releases(ENV["GITHUB_WEBSITE_THEME_REPOSITORY"]).first[:tag_name] + end + + def self.get_current_sha + @current_theme_sha ||= client.branch(ENV["GITHUB_WEBSITE_THEME_REPOSITORY"], ENV["GITHUB_WEBSITE_THEME_BRANCH"])[:commit][:sha] + end + + private + + def self.client + @client ||= Octokit::Client.new access_token: ENV["GITHUB_ACCESS_TOKEN"] + end + +end diff --git a/app/views/server/blocks/index.html.erb b/app/views/server/blocks/index.html.erb index e4c4deb8970ac3369e70e2894651bb031fefac6b..81969b96e46a805972122a76a53fb7746b03ac94 100644 --- a/app/views/server/blocks/index.html.erb +++ b/app/views/server/blocks/index.html.erb @@ -4,8 +4,8 @@ <table class="<%= table_classes %>"> <thead> <tr> - <th><%= Communication::Block.human_attribute_name('name') %></th> - <th><%= Communication::Block.human_attribute_name('quantity') %></th> + <th><%= t('server_admin.blocks.title') %></th> + <th><%= t('server_admin.blocks.quantity') %></th> </tr> </thead> <tbody> @@ -18,3 +18,5 @@ </tbody> </table> </div> + +<%= paginate @templates, theme: 'bootstrap-5' %> \ No newline at end of file diff --git a/app/views/server/blocks/show.html.erb b/app/views/server/blocks/show.html.erb index d38c9a304922a223c16099074c0b0feb60bc93bd..43dc9ba7945cf366da0dd1640335d0c452d358a4 100644 --- a/app/views/server/blocks/show.html.erb +++ b/app/views/server/blocks/show.html.erb @@ -4,43 +4,60 @@ <table class="<%= table_classes %>"> <thead> <tr> - <th><%= Communication::Block.human_attribute_name('name') %></th> - <th><%= Communication::Block.human_attribute_name('about') %></th> - <th><%= Communication::Block.human_attribute_name('data') %></th> - <th><%= Communication::Block.human_attribute_name('university') %></th> - <th><%= Communication::Block.human_attribute_name('url') %></th> + <th><%= t('server_admin.blocks.title') %></th> + <th><%= t('server_admin.blocks.about') %></th> + <th><%= t('server_admin.blocks.data') %></th> + <th><%= University.model_name.human %></th> + <th><%= t('server_admin.blocks.url') %></th> </tr> </thead> <tbody> <% @blocks.each do |block| %> - <% next if block.about.nil?%> - <% url = "#{block.about.university.url }#{edit_admin_communication_block_path(block)}" %> <tr> <td> <%= truncate "#{block}" %><br> <small><%= block.id %></small> </td> <td> - <%= truncate "#{block.about}" %> - <span class="badge bg-dark"> - <%= block.about.class.model_name.human %> - </span> + <% if block.about.present? %> + <%= truncate "#{block.about}" %> + <span class="badge bg-dark"> + <%= block.about.class.model_name.human %> + </span> + <% end %> + </td> + <td class="pe-3" width="600"> + <%= link_to t('server_admin.blocks.see'), + "#collpase-#{block.id}", + class: 'btn btn-xs btn-light', + role: 'button', + 'data-bs-toggle': 'collapse', + 'aria-expanded': 'false', + 'aria-controls': "collpase-#{block.id}" %> + <div class="collapse" id="collpase-<%= block.id %>"> + <textarea rows="10" class="form-control"><%= block.data %></textarea> + </div> + </td> + <td> + <%= link_to block.university, [:server, block.university] %> </td> <td> - <textarea rows="1" class="form-control"><%= block.data %></textarea> + <% url = "#{block.university.url }#{edit_admin_communication_block_path(block)}" %> + <%= link_to t('server_admin.blocks.open'), + url, + target: :_blank %> </td> - <td><%= block.about.university %></td> - <td><%= link_to 'Open', - url, - target: :_blank %></td> </tr> <% end %> </tbody> </table> </div> +<%= paginate @blocks, theme: 'bootstrap-5' %> + + <% content_for :action_bar_right do %> - <%= link_to t('resave'), + <%= link_to t('server_admin.blocks.resave'), resave_server_block_path(@template), method: :post, class: button_classes %> diff --git a/app/views/server/dashboard/index.html.erb b/app/views/server/dashboard/index.html.erb index d112c6976d705d97df8334fee7f4d239e61564c9..4a5643e337ed5a8027d0053da2a0a83ceb922395 100644 --- a/app/views/server/dashboard/index.html.erb +++ b/app/views/server/dashboard/index.html.erb @@ -4,12 +4,14 @@ <% @parts.each do |part| %> <div class="col-md-6 d-flex"> <%= osuny_panel part[:title] do %> - <%= link_to 'Voir la liste', part[:path], class: 'btn btn-sm btn-primary stretched-link' %> + <%= link_to t('server_admin.see_list'), part[:path], class: 'btn btn-sm btn-primary stretched-link' %> <% end %> </div> <% end %> </div> -<%= osuny_panel 'Monitoring' do %> - <%= render 'server/websites/list', websites: @websites %> -<% end %> +<% if @websites.any? %> + <%= osuny_panel t('server_admin.websites.outdated') do %> + <%= render 'server/websites/list', websites: @websites %> + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/server/emergency_messages/index.html.erb b/app/views/server/emergency_messages/index.html.erb index 7948651c2f73eca59eb2063c5a16b90537bb4e2c..7df1f29925ad5239cb2925f649f7e1b6ac292ece 100644 --- a/app/views/server/emergency_messages/index.html.erb +++ b/app/views/server/emergency_messages/index.html.erb @@ -14,15 +14,15 @@ <% @emergency_messages.each do |emergency_message| %> <tr> <td><%= link_to emergency_message, [:server, emergency_message] %></td> - <td><%= l emergency_message.delivered_at if emergency_message.delivered? %></td> + <td><%= l(emergency_message.delivered_at) if emergency_message.delivered? %></td> <td class="text-end"> <div class="btn-group" role="group"> <% unless emergency_message.delivered? %> <%= link_to t('edit'), - edit_server_emergency_message_path(emergency_message), + [:edit, :server, emergency_message], class: button_classes %> <%= link_to t('delete'), - server_emergency_message_path(emergency_message), + [:server, emergency_message], method: :delete, data: { confirm: t('please_confirm') }, class: button_classes_danger %> @@ -35,6 +35,9 @@ </table> </div> +<%= paginate @emergency_messages, theme: 'bootstrap-5' %> + + <% content_for :action_bar_right do %> <%= link_to t('create'), new_server_emergency_message_path, class: button_classes %> <% end %> diff --git a/app/views/server/emergency_messages/show.html.erb b/app/views/server/emergency_messages/show.html.erb index 8da1a471df96738939585e654a8368a093573b02..092d4cfb756f44126a8c45448b02a0e12672c340 100644 --- a/app/views/server/emergency_messages/show.html.erb +++ b/app/views/server/emergency_messages/show.html.erb @@ -46,9 +46,9 @@ <% content_for :action_bar_right do %> <% unless @emergency_message.delivered? %> - <%= link_to t('edit'), edit_server_emergency_message_path(@emergency_message), class: button_classes %> + <%= link_to t('edit'), [:edit, :server, @emergency_message], class: button_classes %> <%= link_to t('server_admin.emergency_messages.deliver'), - deliver_server_emergency_message_path(@emergency_message), + [:deliver, :server, @emergency_message], method: :post, data: { confirm: t('please_confirm') }, class: button_classes %> diff --git a/app/views/server/languages/index.html.erb b/app/views/server/languages/index.html.erb index 61989513b0621f46cefaa1342299a84221ba653b..73ef81ba0c872f040ad0132ee10ae9d6ea3485a6 100644 --- a/app/views/server/languages/index.html.erb +++ b/app/views/server/languages/index.html.erb @@ -20,10 +20,10 @@ <td class="text-end"> <div class="btn-group" role="group"> <%= link_to t('edit'), - edit_server_language_path(language), + [:edit, :server, language], class: button_classes %> <%= link_to t('delete'), - server_language_path(language), + [:server, language], method: :delete, data: { confirm: t('please_confirm') }, class: button_classes_danger %> @@ -35,6 +35,8 @@ </table> </div> +<%= paginate @languages, theme: 'bootstrap-5' %> + <% content_for :action_bar_right do %> <%= link_to t('create'), new_server_language_path, class: button_classes %> <% end %> diff --git a/app/views/server/universities/_form.html.erb b/app/views/server/universities/_form.html.erb index ddc64561c37ffff14e3b9c6e513d1a8a1405e6f1..d3232cc53f82147589ff28ca59995f68d895d6eb 100644 --- a/app/views/server/universities/_form.html.erb +++ b/app/views/server/universities/_form.html.erb @@ -51,10 +51,10 @@ </div> </div> - <h3 class="mt-5"><%= t('university.invoice_informations') %></h3> + <h3 class="mt-5"><%= t('server_admin.universities.invoice_informations') %></h3> <div class="row"> <div class="col-md-4"> - <%= f.input :invoice_date %> + <%= f.input :invoice_date, html5: true %> </div> <div class="col-md-4"> <%= f.input :contribution_amount %> diff --git a/app/views/server/universities/index.html.erb b/app/views/server/universities/index.html.erb index f87777875b5bdfc073f1b187f2a7b64bc988a0da..3321d3265b712f7475136649e3b3bdbb090f72ee 100644 --- a/app/views/server/universities/index.html.erb +++ b/app/views/server/universities/index.html.erb @@ -1,8 +1,7 @@ <% content_for :title, "#{ @universities.count} #{University.model_name.human(count: @universities.count).downcase}" %> <p> - <%= University.contributing.count %> - <%= t('university.contributing', count: University.contributing.count) %> + <%= t('server_admin.universities.contributing', count: University.contributing.count) %> </p> <div class="table-responsive"> @@ -23,14 +22,17 @@ <tr> <td><%= link_to university, [:server, university] %></td> <td><%= link_to university.url, university.url, target: :_blank %></td> - <td><%= t university.is_really_a_university %></td> - <td><%= university.private ? University.human_attribute_name('private') : University.human_attribute_name('public') %></td> - <% if university.contribution_amount.blank? %> + <td><%= t(university.is_really_a_university?) %></td> + <td> + <%= university.private ? University.human_attribute_name('private') : + University.human_attribute_name('public') %> + </td> + <% if university.contribution_amount.to_i.zero? %> <td></td> <td></td> <% else %> <td class="<%= university.invoice_proximity.blank? ? '' : "table-#{university.invoice_proximity}" %>"> - <%= l university.invoice_date, format: "%d %B" if university.invoice_date %> + <%= l(university.invoice_date, format: "%d %B") if university.invoice_date %> </td> <td class="<%= university.invoice_proximity.blank? ? '' : "table-#{university.invoice_proximity}" %>"> <%= number_to_currency university.contribution_amount, precision: 0 %> @@ -39,10 +41,10 @@ <td class="text-end"> <div class="btn-group" role="group"> <%= link_to t('edit'), - edit_server_university_path(university), + [:edit, :server, university], class: button_classes %> <%= link_to t('delete'), - server_university_path(university), + [:server, university], method: :delete, data: { confirm: t('please_confirm') }, class: button_classes_danger %> @@ -53,13 +55,15 @@ </tbody> <tfoot> <tr> - <th class="text-start" colspan="5"><%= t('university.contributions_total') %></th> + <th class="text-start" colspan="5"><%= t('server_admin.universities.contributions_total') %></th> <td class="text-start" colspan="2"><%= number_to_currency University.sum(:contribution_amount), precision: 0 %></td> </tr> </tfoot> </table> </div> +<%= paginate @universities, theme: 'bootstrap-5' %> + <% content_for :action_bar_right do %> <%= link_to t('create'), new_server_university_path, class: button_classes %> <% end %> diff --git a/app/views/server/universities/show.html.erb b/app/views/server/universities/show.html.erb index 4a8ff6ea55061013e52ff050adec40424bde47e5..c696722b59721cad1fc7d6d8301288b5bf885902 100644 --- a/app/views/server/universities/show.html.erb +++ b/app/views/server/universities/show.html.erb @@ -13,13 +13,13 @@ <td class="text-end"><%= t @university.public_send attribute %></td> </tr> <% end %> - <% unless @university.contribution_amount.blank? %> + <% unless @university.contribution_amount.to_i.zero? %> <tr class="<%= @university.invoice_proximity.blank? ? '' : "table-#{@university.invoice_proximity}" %>"> - <td><%= t('activerecord.attributes.university.invoice_date') %></td> + <td><%= University.human_attribute_name('invoice_date') %></td> <td class="text-end"><%= l @university.invoice_date, format: "%d %B" %></td> </tr> <tr class="<%= @university.invoice_proximity.blank? ? '' : "table-#{@university.invoice_proximity}" %>"> - <td><%= t('activerecord.attributes.university.contribution_amount') %></td> + <td><%= University.human_attribute_name('contribution_amount') %></td> <td class="text-end"><%= number_to_currency @university.contribution_amount, precision: 0 %></td> </tr> <% end %> @@ -41,7 +41,7 @@ </div> <h2 class="mt-5 h3"><%= Communication::Website.model_name.human(count: @university.websites.count) %></h2> -<%= render 'server/websites/list', websites: @university.websites %> +<%= render 'server/websites/list', websites: @university.websites.ordered %> <% content_for :action_bar_right do %> <%= link_to t('edit'), edit_server_university_path(@university), class: button_classes %> diff --git a/app/views/server/websites/_list.html.erb b/app/views/server/websites/_list.html.erb index a033585a978587a1c10a022ff8ce08e765a8047f..cf4be94e04616fde8fe26080b52ff0b5caa4fa6d 100644 --- a/app/views/server/websites/_list.html.erb +++ b/app/views/server/websites/_list.html.erb @@ -4,10 +4,13 @@ <tr> <th><%= Communication::Website.human_attribute_name('name') %></th> <th><%= University.model_name.human %></th> - <th>Back-office</th> - <th>Site</th> - <th colspan="2">Référentiel Git</th> - <th>Version</th> + <th><%= t('server_admin.websites.back_office') %></th> + <th><%= Communication::Website.human_attribute_name('url') %></th> + <th><%= t('server_admin.websites.git_repo.full') %></th> + <th><%= t('server_admin.websites.update_mode') %></th> + <th><%= t('server_admin.websites.git_repo.status') %></th> + <th><%= t('server_admin.websites.theme_version') %></th> + <th></th> </tr> </thead> <tbody> @@ -15,29 +18,44 @@ <tr id="website-<%= website.id %>"> <td> <%= link_to website.name, server_website_path(website) %> - <% if website.in_production %> - <span class="badge bg-success">Prod</span> + <% if website.in_production? %> + <span class="badge bg-success"><%= t('server_admin.websites.production') %></span> <% end %> </td> <td><%= link_to website.university, [:server, website.university] %></td> - <td><%= link_to 'Admin', + <td><%= link_to t('server_admin.websites.admin'), admin_communication_website_url(website, host: website.university.url), target: :_blank, class: 'btn btn-xs btn-light' %></td> - <td><%= link_to 'Site', + <td><%= link_to Communication::Website.human_attribute_name('url'), website.url, target: :_blank, class: 'btn btn-xs btn-light' if website.url.present? %></td> - <td><%= link_to 'Référentiel', + <td><%= link_to t('server_admin.websites.git_repo.short'), website.repository_url, target: :_blank, class: 'btn btn-xs btn-light' if website.repository.present? %></td> + <td><%= t("server_admin.websites.autoupdate_theme.#{website.autoupdate_theme?}") %></td> <td><%= image_tag website.deployment_status_badge, alt: '' if website.deployment_status_badge.present? %></td> - <td> + <td class="js-version"> <%= website.theme_version %> </td> + <td> + <% if website.url.present? %> + <%= link_to t('server_admin.websites.buttons.theme.sync'), + sync_theme_version_server_website_path(website), + method: :post, + remote: true, + class: "#{button_classes} js-sync-theme-version" if website.theme_updatable? %> + <%= link_to t('server_admin.websites.buttons.theme.update'), + update_theme_server_website_path(website), + method: :post, + remote: true, + class: button_classes if website.github? %> + <% end %> + </td> </tr> <% end %> </tbody> diff --git a/app/views/server/websites/edit.html.erb b/app/views/server/websites/edit.html.erb index 612786613c469d27b4e649aeaf09b022fd4bbd33..3d66bf10ac4c404cf784f93cdc7268837184352b 100644 --- a/app/views/server/websites/edit.html.erb +++ b/app/views/server/websites/edit.html.erb @@ -1,9 +1,16 @@ <% content_for :title, @website %> + <%= simple_form_for @website, url: server_website_path(@website) do |f| %> <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> - <%= f.association :university, include_blank: false %> + <div class="row"> + <div class="col-md-6"> + <%= f.association :university, + include_blank: false, + collection: University.ordered %> + </div> + </div> <% content_for :action_bar_right do %> <%= submit f %> diff --git a/app/views/server/websites/index.html.erb b/app/views/server/websites/index.html.erb index 5bed945b65946e80c99e46e793eaeaa93df62dc8..3fbe806b3df804fc6a99ecc5bda216f8d015b22f 100644 --- a/app/views/server/websites/index.html.erb +++ b/app/views/server/websites/index.html.erb @@ -1,6 +1,6 @@ <% content_for :title, "#{@websites.count} #{Communication::Website.model_name.human(count: @websites.count).downcase}" %> -<p><%= @websites.in_production.count %> en production</p> +<p><%= t('server_admin.websites.in_production', count: @websites.in_production.count) %></p> <%= render 'admin/application/filters', current_path: server_websites_path, @@ -8,8 +8,14 @@ <%= render 'server/websites/list', websites: @websites %> +<%= paginate @websites, theme: 'bootstrap-5' %> + <% content_for :action_bar_left do %> - <%= link_to "Gestion des versions", - manage_versions_server_websites_path, + <%= link_to t('server_admin.websites.update_all_themes'), + "#", + class: "#{button_classes} js-sync-all-theme-versions" %> + <%= link_to t('server_admin.websites.force_clean_and_rebuild'), + clean_and_rebuild_all_websites_server_websites_path(current_scopes), + method: :post, class: button_classes %> <% end %> \ No newline at end of file diff --git a/app/views/server/websites/manage_versions.html.erb b/app/views/server/websites/manage_versions.html.erb deleted file mode 100644 index 90eb99a75a1f4cc5ee995d789233861b4c854603..0000000000000000000000000000000000000000 --- a/app/views/server/websites/manage_versions.html.erb +++ /dev/null @@ -1,68 +0,0 @@ -<% content_for :title, "Gestion des versions" %> - -<p><%= @websites.in_production.count %> en production</p> - -<%= render 'admin/application/filters', - current_path: manage_versions_server_websites_path, - filters: @filters if @filters.any? %> - -<div class="table-responsive"> - <table class="<%= table_classes %> table-hover"> - <thead> - <tr> - <th><%= Communication::Website.human_attribute_name('name') %></th> - <th><%= University.model_name.human %></th> - <th colspan="2">Référentiel Git</th> - <th>Version</th> - <th> </th> - </tr> - </thead> - <tbody> - <% @websites.ordered.each do |website| %> - <tr id="website-<%= website.id %>"> - <td> - <%= link_to website.name, server_website_path(website) %> - <% if website.in_production %> - <span class="badge bg-success">Prod</span> - <% end %> - </td> - <td><%= link_to website.university, - [:server, website.university] %></td> - <td><%= link_to 'Référentiel', - website.repository_url, - target: :_blank, - class: 'btn btn-xs btn-light' if website.repository.present? %></td> - <td><%= image_tag website.deployment_status_badge, - alt: '' if website.deployment_status_badge.present? %></td> - <td> - <span class="js-version"> - <%= website.theme_version %> - </span> - </td> - <td> - <%= link_to t('server_admin.websites.buttons.theme.sync'), - sync_theme_version_server_website_path(website), - method: :post, - remote: true, - class: "#{button_classes} js-sync-theme-version" if website.url.present? && website.theme_version_url.present? %> - <%= link_to t('server_admin.websites.buttons.theme.update'), - update_theme_server_website_path(website), - method: :post, - remote: true, - class: button_classes if website.url.present? && website.github? %> - </td> - </tr> - <% end %> - </tbody> - </table> -</div> - -<% content_for :action_bar_left do %> - <%= link_to "Synchroniser toutes les versions de thème", - "#", - class: "#{button_classes} js-sync-all-theme-versions" %> - <%= link_to "Tout mettre à jour", - clean_and_rebuild_all_websites_server_websites_path(current_scopes), - method: :post, - class: button_classes %> -<% end %> \ No newline at end of file diff --git a/app/views/server/websites/show.html.erb b/app/views/server/websites/show.html.erb index c24a62d332f6466581eb8316d105bb753b9887bb..3c1249ee70c361c7b6d0f7dd4c51b9b36535a836 100644 --- a/app/views/server/websites/show.html.erb +++ b/app/views/server/websites/show.html.erb @@ -1,17 +1,20 @@ <% content_for :title, @website %> <p> - Université : - <%= link_to @website.university, server_university_path(@website.university) %> + <%= t('server_admin.websites.university_html', university: link_to(@website.university, server_university_path(@website.university))) %> </p> -<%= @website.pages.count %> pages<br> -<%= @website.posts.count %> actualités<br> -<%= @website.events.count %> événements<br> -<%= @website.connections.count %> connexions - (<%= link_to 'détail', admin_communication_website_connections_url(@website, host: @website.university.url), target: :_blank %>)<br> -<%= @website.recursive_dependencies.count %> dépendances - (<%= link_to 'détail', admin_communication_website_dependencies_url(@website, host: @website.university.url), target: :_blank %>)<br> +<%= t('server_admin.websites.pages_count', count: @website.pages.count) %> +<br> +<%= t('server_admin.websites.posts_count', count: @website.posts.count) %> +<br> +<%= t('server_admin.websites.events_count', count: @website.events.count) %> +<br> +<%= t('server_admin.websites.connections_count', count: @website.connections.count) %> + (<%= link_to t('server_admin.websites.details'), admin_communication_website_connections_url(@website, host: @website.university.url), target: :_blank %>) +<br> +<%= t('server_admin.websites.recursive_dependencies_count', count: @website.recursive_dependencies.count) %> + (<%= link_to t('server_admin.websites.details'), admin_communication_website_dependencies_url(@website, host: @website.university.url), target: :_blank %>) <% content_for :action_bar_right do %> <%= link_to t('edit'), edit_server_website_path(@website), class: button_classes %> diff --git a/config/application.sample.yml b/config/application.sample.yml index 5c7330196d2a66b856c799ba8ece5ca7b485683b..013ed697df723cd75aac4d7e6237dc952ed125dd 100644 --- a/config/application.sample.yml +++ b/config/application.sample.yml @@ -3,21 +3,33 @@ APPLICATION_ENV: development BUGSNAG_JAVASCRIPT_KEY: BUGSNAG_RUBY_KEY: +DEUXFLEURS_PASSWORD: +DEUXFLEURS_USER: + GITHUB_WEBSITE_THEME_BRANCH: GITHUB_WEBSITE_THEME_PATH: GITHUB_WEBSITE_THEME_REPOSITORY: GITHUB_WEBSITE_TEMPLATE_REPOSITORY: GITHUB_ACCESS_TOKEN: +KEYCDN_HOST: + +LIBRETRANSLATE_API_KEY: + MAIL_FROM_DEFAULT_ADDRESS: MAIL_FROM_DEFAULT_NAME: +MAINTENANCE: "false" + +MICROLINK_API_KEY: + +PEXELS_API_KEY: + +OSUNY_API_AUTOUPDATE_THEME_KEY: # Can be used when working on two incompatible branches (e.g. main & i18n) OSUNY_DEVELOPMENT_DBNAME: - OSUNY_STAGING_APP_NAME: OSUNY_STAGING_PG_ADDON_ID: -OSUNY_API_AUTOUPDATE_THEME_KEY: OTP_SECRET_ENCRYPTION_KEY: @@ -27,35 +39,22 @@ SCALEWAY_OS_ENDPOINT: SCALEWAY_OS_REGION: SCALEWAY_OS_SECRET_ACCESS_KEY: -KEYCDN_HOST: - SECRET_KEY_BASE: SEND_IN_BLUE_API_KEY: -SMTP_USER: SMTP_PASSWORD: - -UNSPLASH_ACCESS_KEY: -UNSPLASH_SECRET: -PEXELS_API_KEY: - -DEUXFLEURS_USER: -DEUXFLEURS_PASSWORD: - -LIBRETRANSLATE_API_KEY: - -MICROLINK_API_KEY: - -MAINTENANCE: "false" +SMTP_USER: # Pour les tests automatisés TEST_GITHUB_BRANCH: TEST_GITHUB_ENDPOINT: '' # no use for github -TEST_GITHUB_TOKEN: TEST_GITHUB_REPOSITORY: - +TEST_GITHUB_TOKEN: TEST_GITLAB_BRANCH: TEST_GITLAB_ENDPOINT: -TEST_GITLAB_TOKEN: TEST_GITLAB_REPOSITORY: +TEST_GITLAB_TOKEN: + +UNSPLASH_ACCESS_KEY: +UNSPLASH_SECRET: diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 3ad812aa10032e441bc0c29b333d7ef2138c6003..8a693bf262671721a81a7f63155fb63943ad4cc2 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -5,60 +5,6 @@ en: models: communication: Communication activerecord: - models: - communication/block: - one: Content block - other: Content blocks - communication/extranet: - one: Extranet - other: Extranets - communication/extranet/document: - one: Document - other: Documents - communication/extranet/document/category: - one: Category - other: Categories - communication/extranet/document/kind: - one: Kind - other: Kinds - communication/extranet/post: - one: Post - other: Posts - all: All posts - communication/extranet/post/category: - one: Category - other: Categories - communication/website: - one: Website - other: Websites - communication/website/agenda/category: - one: Category - other: Categories - communication/website/agenda/event: - one: Event - other: Events - communication/website/post/category: - one: Category - other: Categories - all: All categories - communication/website/connection: - one: Connection - other: Connections - communication/website/menu: - one: Menu - other: Menus - all: All menus - communication/website/menu/item: - one: Item - other: Items - communication/website/page: - one: Page - other: Pages - all: All pages - communication/website/post: - one: Post - other: Posts - all: All posts attributes: communication/block: title: Name (optional) @@ -266,6 +212,60 @@ en: too_soon: must be after "from day" to_hour: too_soon: must be after "from hour" + models: + communication/block: + one: Content block + other: Content blocks + communication/extranet: + one: Extranet + other: Extranets + communication/extranet/document: + one: Document + other: Documents + communication/extranet/document/category: + one: Category + other: Categories + communication/extranet/document/kind: + one: Kind + other: Kinds + communication/extranet/post: + one: Post + other: Posts + all: All posts + communication/extranet/post/category: + one: Category + other: Categories + communication/website: + one: Website + other: Websites + communication/website/agenda/category: + one: Category + other: Categories + communication/website/agenda/event: + one: Event + other: Events + communication/website/post/category: + one: Category + other: Categories + all: All categories + communication/website/connection: + one: Connection + other: Connections + communication/website/menu: + one: Menu + other: Menus + all: All menus + communication/website/menu/item: + one: Item + other: Items + communication/website/page: + one: Page + other: Pages + all: All pages + communication/website/post: + one: Post + other: Posts + all: All posts admin: communication: block: @@ -431,6 +431,10 @@ en: unpublished: Unpublished security: Security see_all: See the full list (%{number} elements) + curation: + error: Import error, be sure to use a valid URL + label: URL of the post to import + placeholder: https://... enums: communication: website: @@ -457,10 +461,6 @@ en: persons: Staff teachers: Educational staff url: URL - curation: - error: Import error, be sure to use a valid URL - label: URL of the post to import - placeholder: https://... simple_form: hints: communication_extranet: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 9b43c71250d4478750f6064bd1c3b78c34aa7bd8..0f07955236bb861cea520c63120a3a92e91c0213 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -5,60 +5,6 @@ fr: models: communication: Communication activerecord: - models: - communication/block: - one: Bloc de contenu - other: Blocs de contenu - communication/extranet: - one: Extranet - other: Extranets - communication/extranet/document: - one: Document - other: Documents - communication/extranet/document/category: - one: Catégorie - other: Catégories - communication/extranet/document/kind: - one: Type - other: Types - communication/extranet/post: - one: Actualité - other: Actualités - all: Toutes les actualités - communication/extranet/post/category: - one: Catégorie - other: Catégories - communication/website: - one: Site Web - other: Sites Web - communication/website/agenda/category: - one: Catégorie - other: Catégories - communication/website/agenda/event: - one: Événement - other: Événements - communication/website/post/category: - one: Catégorie - other: Catégories - all: Toutes les catégories - communication/website/connection: - one: Connexion - other: Connexions - communication/website/menu: - one: Menu - other: Menus - all: Tous les menus - communication/website/menu/item: - one: Élément - other: Éléments - communication/website/page: - one: Page - other: Pages - all: Toutes les pages - communication/website/post: - one: Actualité - other: Actualités - all: Toutes les actualités attributes: communication/block: title: Nom (facultatif) @@ -266,6 +212,60 @@ fr: too_soon: doit être après jour de début to_hour: too_soon: doit être après l'heure de début + models: + communication/block: + one: Bloc de contenu + other: Blocs de contenu + communication/extranet: + one: Extranet + other: Extranets + communication/extranet/document: + one: Document + other: Documents + communication/extranet/document/category: + one: Catégorie + other: Catégories + communication/extranet/document/kind: + one: Type + other: Types + communication/extranet/post: + one: Actualité + other: Actualités + all: Toutes les actualités + communication/extranet/post/category: + one: Catégorie + other: Catégories + communication/website: + one: Site Web + other: Sites Web + communication/website/agenda/category: + one: Catégorie + other: Catégories + communication/website/agenda/event: + one: Événement + other: Événements + communication/website/post/category: + one: Catégorie + other: Catégories + all: Toutes les catégories + communication/website/connection: + one: Connexion + other: Connexions + communication/website/menu: + one: Menu + other: Menus + all: Tous les menus + communication/website/menu/item: + one: Élément + other: Éléments + communication/website/page: + one: Page + other: Pages + all: Toutes les pages + communication/website/post: + one: Actualité + other: Actualités + all: Toutes les actualités admin: communication: block: @@ -431,6 +431,10 @@ fr: unpublished: Non publiée security: Sécurité see_all: Voir la liste complète (%{number} éléments) + curation: + error: Erreur lors de la curation, veillez à utiliser une URL valide + label: URL de l'article à importer + placeholder: https://... enums: communication: website: @@ -457,10 +461,6 @@ fr: persons: Équipe teachers: Équipe pédagogique url: URL - curation: - error: Erreur lors de la curation, veillez à utiliser une URL valide - label: URL de l'article à importer - placeholder: https://... simple_form: hints: communication_extranet: diff --git a/config/locales/en.yml b/config/locales/en.yml index 27d5ac2c388891c253198ee2ea12edb245f898f4..d529bc640981b9ae8c312d79d37fcd8b5600e56c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -70,6 +70,7 @@ en: person: Person mobile_phone: Mobile phone picture: Profile picture + picture_url: Profile picture Url programs_to_manage: Program(s) managed role: Role roles: @@ -321,27 +322,6 @@ en: save: Save search: Search select_language: Select language - server_admin: - dashboard: Server administration - emergency_messages: - all_universities: All - all_roles: All - content: Content - deliver: Send - delivered: Your message has been sent - filters: Filters - target: Target - users: - one: "%{count} user" - other: "%{count} users" - websites: - buttons: - theme: - sync: Sync version - update: Update theme - clean_and_rebuild_all_websites_notice: All themes will be updated. This can take a few minutes. - sync_theme_version_notice: The theme's version of %{website} has been synced - update_theme_notice: The theme of %{website} will be updated in a moment seo: SEO simple_form: error_notification: @@ -353,7 +333,7 @@ en: import: file: .xlsx file only language: - iso_code: ISO 639-1 code (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">WikiPedia</a>) + iso_code: ISO 639-1 code (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">Wikipedia</a>) name: Name in the language (= "Français", "Deutsch", ...) summernote_locale: 'Name of summernote locale (fr-FR / en-US). Check here and ensure locale is available: <a href="https://github.com/summernote/summernote/tree/develop/src/lang" target="_blank">summernote repo</a>' user: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 47404bef1649e36a2385180d9e2d53c83dea8ec3..d6dca3b1d6e75d169a358763739599953a1c2a4f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -70,6 +70,7 @@ fr: person: Personne mobile_phone: Téléphone portable picture: Photo de profil + picture_url: Url de la photo de profil programs_to_manage: Formation(s) gérée(s) role: Rôle roles: @@ -321,27 +322,6 @@ fr: save: Enregistrer search: Rechercher select_language: Sélectionnez une langue - server_admin: - dashboard: Administration du serveur - emergency_messages: - all_universities: Toutes - all_roles: Tous - content: Contenu - deliver: Envoyer - delivered: Votre message a bien été envoyé - filters: Filtres - target: Cible - users: - one: "%{count} utilisateur" - other: "%{count} utilisateurs" - websites: - buttons: - theme: - sync: Synchroniser la version - update: Mettre à jour le thème - clean_and_rebuild_all_websites_notice: Tous les thèmes vont être mis à jour. Cela peut prendre quelques minutes. - sync_theme_version_notice: La version du thème de %{website} a été synchronisée - update_theme_notice: Le thème de %{website} va être mis à jour dans quelques instants seo: SEO simple_form: error_notification: @@ -353,7 +333,7 @@ fr: import: file: Fichier .xlsx uniquement language: - iso_code: Code ISO 639-1 (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">WikiPedia</a>) + iso_code: Code ISO 639-1 (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">Wikipédia</a>) name: Nom dans la langue (= "Français", "Deutsch", ...) summernote_locale: 'Nom de la locale de summernote (fr-FR / en-US). Vérifier ici que la locale est disponible : <a href="https://github.com/summernote/summernote/tree/develop/src/lang" target="_blank">repo summernote</a>' user: diff --git a/config/locales/server_admin/en.yml b/config/locales/server_admin/en.yml new file mode 100644 index 0000000000000000000000000000000000000000..db130e4b1c59f91b41a02a9ab79523be9408d02f --- /dev/null +++ b/config/locales/server_admin/en.yml @@ -0,0 +1,69 @@ +en: + server_admin: + blocks: + about: About + blocks_saved: + one: "%{count} block re-saved" + other: "%{count} blocks re-saved" + data: Data + open: Open + quantity: Quantity + resave: Force those blocks re-save + see: See + title: Name + url: URL + dashboard: Server administration + emergency_messages: + all_universities: All + all_roles: All + content: Content + deliver: Send + delivered: Your message has been sent + filters: Filters + target: Target + users: + one: "%{count} user" + other: "%{count} users" + see_list: See the list + universities: + contributing: + one: "%{count} contributing university" + other: "%{count} contributing universities" + contributions_total: Contributions (total) + invoice_informations: Invoice informations + websites: + admin: Admin + autoupdate_theme: + false: Manual + true: Auto + back_office: Back office + buttons: + theme: + sync: Sync version + update: Update theme + clean_and_rebuild_all_websites_notice: All themes will be updated. This can take a few minutes. + connections_count: "%{count} connexions" + details: detail + events_count: "%{count} events" + force_clean_and_rebuild: Force clean&rebuild of every websites + git_repo: + full: Git Repository + short: Repository + status: Status + in_production: "%{count} in production" + manage_versions: Manage versions + outdated: Those websites are outdated + pages_count: "%{count} pages" + posts_count: "%{count} posts" + production: In production + production_status: Production status + recursive_dependencies_count: "%{count} dependencies" + sync_theme_version_notice: The theme's version of %{website} has been synced + theme_version: Theme version + university_html: "University: %{university}" + update_all_themes: Sync all themes versions + update_mode: Update mode + updatable_theme_filter: + element: Auto-update capability + value: Available + update_theme_notice: The theme of %{website} will be updated in a moment \ No newline at end of file diff --git a/config/locales/server_admin/fr.yml b/config/locales/server_admin/fr.yml new file mode 100644 index 0000000000000000000000000000000000000000..93392d37b171c2648257c15cdca5d17308a10f55 --- /dev/null +++ b/config/locales/server_admin/fr.yml @@ -0,0 +1,69 @@ +fr: + server_admin: + blocks: + about: Sujet + blocks_saved: + one: "%{count} bloc re-sauvé" + other: "%{count} blocs re-sauvés" + data: Données + open: Ouvrir + quantity: Quantité + resave: Forcer le save de ces blocks + see: Voir + title: Nom + url: URL + dashboard: Administration du serveur + emergency_messages: + all_universities: Toutes + all_roles: Tous + content: Contenu + deliver: Envoyer + delivered: Votre message a bien été envoyé + filters: Filtres + target: Cible + users: + one: "%{count} utilisateur" + other: "%{count} utilisateurs" + see_list: Voir la liste + universities: + contributing: + one: "%{count} université contributrice" + other: "%{count} universités contributrices" + contributions_total: Contributions (total) + invoice_informations: Données de facturation + websites: + admin: Admin + autoupdate_theme: + false: Manuelle + true: Automatique + back_office: Back office + buttons: + theme: + sync: Synchroniser la version + update: Mettre à jour le thème + clean_and_rebuild_all_websites_notice: Tous les thèmes vont être mis à jour. Cela peut prendre quelques minutes. + connections_count: "%{count} connexions" + details: détail + events_count: "%{count} événements" + force_clean_and_rebuild: Forcer le clean&rebuild de tous les sites + git_repo: + full: Référentiel Git + short: Référentiel + status: Statut + in_production: "%{count} en production" + manage_versions: Gérer les versions + outdated: Ces sites ne sont pas à jour + pages_count: "%{count} pages" + posts_count: "%{count} actualités" + production: En prod + production_status: État de production + recursive_dependencies_count: "%{count} dépendances" + sync_theme_version_notice: La version du thème de %{website} a été synchronisée + theme_version: Version du thème + university_html: "Université : %{university}" + update_all_themes: Synchroniser toutes les versions de thème + update_mode: Mode de mise à jour + updatable_theme_filter: + element: Capacité de mise à jour automatique + value: Mise à jour automatique possible + update_theme_notice: Le thème de %{website} va être mis à jour dans quelques instants \ No newline at end of file diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 0422571aae9d3b0944cdeff42a76ab93c4ba2404..b9e9e655397bf792d54ae5fae1163fe8a4eccb0a 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -213,10 +213,6 @@ en: regenerate_token: Regenerate token token_display_notice: Make sure to store your token somewhere safe. You won’t be able to see it again! token_successfully_regenerated: The token was successfully regenerated. - contributing: - one: contributing university - other: contributing universities - contributions_total: Contributions (total) description: text: A university is an institution of higher education, study and research, made up of various establishments called, depending on the tradition, "colleges", "faculties", "institutes", "departments", "centres", "sections", "units" or specific schools, but also a library or workshop, media library or museum, etc. forming a coherent administrative whole with a defined legal status, whether public, private or possibly mixed. source: Wikipedia @@ -231,7 +227,6 @@ en: description: Person using Osuny, with an authenticated account description_non_university: Person using Osuny, with an authenticated account internal_key: Internal Key - invoice_informations: Invoice informations manage_cohorts: Manage cohorts manage_experiences: Manage experiences organization: diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index f69d506386074da67aaf135af0b60f01699fc3bd..00e9227a57913a0d5115a121b13e855e1ec34feb 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -213,13 +213,9 @@ fr: regenerate_token: Regénérer le jeton token_display_notice: Assurez-vous de stocker votre jeton secret de manière sécurisée. Vous ne pourrez pas le revoir ! token_successfully_regenerated: Le jeton a bien été regénéré. - contributing: - one: université contributrice - other: universités contributrices - contributions_total: Contributions (total) description: text: Une université est une institution d'enseignement supérieur, d'étude et de recherche, constituée par la réunion de divers établissements nommés suivant les traditions “collègesâ€, “facultésâ€, “institutsâ€, “départementsâ€, “centresâ€, “sectionsâ€, “unités†ou écoles spécifiques, mais aussi bibliothèque ou atelier, médiathèque ou musée, etc. formant un ensemble administratif cohérent avec un statut de droit défini, public, privé ou éventuellement mixte. - source: Wikipedia + source: Wikipédia parts: person: description: Personne physique liée à une université, une composante, un laboratoire, etc. @@ -231,7 +227,6 @@ fr: description: Personne utilisant Osuny, dotée d'un compte authentifié description_non_university: Personne utilisant Osuny, dotée d'un compte authentifié internal_key: Clé interne - invoice_informations: Données de facturation manage_cohorts: Gérer les promotions manage_experiences: Gérer les expériences professionnelles organization: diff --git a/config/routes/server.rb b/config/routes/server.rb index daf21fe4a6077acedb4c2f115039b08af14a6c5a..95473498f380b4d333dfb3ef095b633ccdf2ba00 100644 --- a/config/routes/server.rb +++ b/config/routes/server.rb @@ -3,7 +3,6 @@ namespace :server do resources :languages resources :websites do collection do - get :manage_versions post :clean_and_rebuild_all_websites end member do diff --git a/config/server_navigation.rb b/config/server_navigation.rb index 5fb45438459d4f44f4c0bba5bd7a081dd28fcf9f..ca4a4431ae2c353d78d723b622a933d0faf57880 100644 --- a/config/server_navigation.rb +++ b/config/server_navigation.rb @@ -5,11 +5,11 @@ SimpleNavigation::Configuration.run do |navigation| navigation.selected_class = 'active' navigation.items do |primary| primary.item :dashboard, - t('dashboard'), + t('admin.dashboard'), server_root_path, { kind: :header, highlights_on: %r{server$} } primary.item :server, - t('server'), + t('menu.server_admin'), nil, { kind: :header } primary.item :universities, diff --git a/db/schema.rb b/db/schema.rb index e0fa208b2f552d6fbc1667d31dc644f13e2c07e8..5915dd513b1b224872cd3e782b104235926f5291 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,7 +16,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do enable_extension "plpgsql" enable_extension "unaccent" - create_table "action_text_rich_texts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "action_text_rich_texts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.text "body" t.string "record_type", null: false @@ -26,7 +26,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true end - create_table "active_storage_attachments", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false t.uuid "record_id", null: false @@ -36,7 +36,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end - create_table "active_storage_blobs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_blobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "key", null: false t.string "filename", null: false t.string "content_type" @@ -50,7 +50,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_active_storage_blobs_on_university_id" end - create_table "active_storage_variant_records", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_variant_records", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "blob_id", null: false t.string "variation_digest", null: false t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true @@ -90,7 +90,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["education_school_id", "administration_location_id"], name: "index_school_location" end - create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.integer "number" t.text "name" t.text "description" @@ -98,7 +98,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.datetime "updated_at", null: false end - create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "criterion_id", null: false t.integer "number" t.text "name" @@ -129,7 +129,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_block_headings_on_university_id" end - create_table "communication_blocks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_blocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "about_type" t.uuid "about_id" @@ -235,7 +235,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_extranet_posts_on_university_id" end - create_table "communication_extranets", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_extranets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.uuid "university_id", null: false t.string "host" @@ -349,7 +349,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["website_id"], name: "index_communication_website_connections_on_website_id" end - create_table "communication_website_git_files", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_git_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "previous_path" t.string "about_type", null: false t.uuid "about_id", null: false @@ -384,7 +384,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_website_localizations_on_university_id" end - create_table "communication_website_menu_items", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menu_items", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "menu_id", null: false @@ -404,7 +404,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["website_id"], name: "index_communication_website_menu_items_on_website_id" end - create_table "communication_website_menus", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menus", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -420,7 +420,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_website_menus_on_university_id" end - create_table "communication_website_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -434,10 +434,10 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.boolean "published", default: false t.string "featured_image_alt" t.text "text" - t.text "summary" t.string "breadcrumb_title" t.text "header_text" t.integer "kind" + t.text "summary" t.string "bodyclass" t.uuid "language_id", null: false t.text "featured_image_credit" @@ -454,7 +454,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_permalinks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.string "about_type", null: false @@ -468,7 +468,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["website_id"], name: "index_communication_website_permalinks_on_website_id" end - create_table "communication_website_post_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_post_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "name" @@ -495,7 +495,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_website_post_categories_on_university_id" end - create_table "communication_website_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -522,7 +522,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_communication_website_posts_on_university_id" end - create_table "communication_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "url" @@ -594,7 +594,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "education_academic_years", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_academic_years", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.integer "year" t.datetime "created_at", null: false @@ -609,7 +609,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_person_id", "education_academic_year_id"], name: "index_person_academic_year" end - create_table "education_cohorts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_cohorts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "program_id", null: false t.uuid "academic_year_id", null: false @@ -630,7 +630,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_person_id", "education_cohort_id"], name: "index_person_cohort" end - create_table "education_diplomas", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_diplomas", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "short_name" t.integer "level", default: 0 @@ -645,7 +645,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_education_diplomas_on_university_id" end - create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_programs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.integer "capacity" @@ -709,7 +709,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["education_program_id", "user_id"], name: "index_education_programs_users_on_program_id_and_user_id" end - create_table "education_schools", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_schools", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -740,7 +740,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_emergency_messages_on_university_id", where: "(university_id IS NOT NULL)" end - create_table "imports", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "imports", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.integer "number_of_lines" t.jsonb "processing_errors" t.integer "kind" @@ -753,7 +753,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["user_id"], name: "index_imports_on_user_id" end - create_table "languages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" t.datetime "created_at", null: false @@ -799,7 +799,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_research_journal_paper_kinds_on_university_id" end - create_table "research_journal_papers", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_papers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "title" t.datetime "published_at", precision: nil t.uuid "university_id", null: false @@ -837,7 +837,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["researcher_id"], name: "index_research_journal_papers_researchers_on_researcher_id" end - create_table "research_journal_volumes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_volumes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_journal_id", null: false t.string "title" @@ -858,7 +858,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_research_journal_volumes_on_university_id" end - create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journals", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "title" t.text "meta_description" @@ -869,7 +869,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_research_journals_on_university_id" end - create_table "research_laboratories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -890,7 +890,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_person_id", "research_laboratory_id"], name: "person_laboratory" end - create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratory_axes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.string "name" @@ -935,7 +935,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_person_id", "research_publication_id"], name: "index_person_publication" end - create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_theses", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.uuid "author_id", null: false @@ -953,7 +953,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_research_theses_on_university_id" end - create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" t.string "address" @@ -1000,7 +1000,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_university_organization_categories_on_university_id" end - create_table "university_organizations", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "long_name" @@ -1043,7 +1043,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["organization_id"], name: "index_university_organizations_categories_on_organization_id" end - create_table "university_people", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_people", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "user_id" t.string "last_name" @@ -1101,7 +1101,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_university_person_categories_on_university_id" end - create_table "university_person_experiences", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_experiences", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.uuid "organization_id", null: false @@ -1115,7 +1115,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_university_person_experiences_on_university_id" end - create_table "university_person_involvements", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_involvements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.integer "kind" @@ -1130,7 +1130,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["university_id"], name: "index_university_person_involvements_on_university_id" end - create_table "university_roles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_roles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "target_type" t.uuid "target_id" @@ -1152,7 +1152,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do t.index ["user_id"], name: "index_user_favorites_on_user_id" end - create_table "users", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "first_name" t.string "last_name" diff --git a/test/controllers/server/dashboard_controller_test.rb b/test/controllers/server/dashboard_controller_test.rb index 6d8882ab319a6b4aee7f23d492ed9c72d5cc2854..86a7a9932654222f0d322804d64f242958e6e33f 100644 --- a/test/controllers/server/dashboard_controller_test.rb +++ b/test/controllers/server/dashboard_controller_test.rb @@ -4,7 +4,9 @@ class Server::DashboardControllerTest < ActionDispatch::IntegrationTest include ServerSetup def test_index - get server_root_path - assert_response(:success) + VCR.use_cassette(location) do + get server_root_path + assert_response(:success) + end end end