diff --git a/app/views/admin/layouts/themes/pure/_nav.html.erb b/app/views/admin/layouts/themes/pure/_nav.html.erb index 47b44c6b7d20a924de025698b97efec8b92d7aaf..c1cb7e5f387c137287adea20f0b1b62fc49aeebc 100644 --- a/app/views/admin/layouts/themes/pure/_nav.html.erb +++ b/app/views/admin/layouts/themes/pure/_nav.html.erb @@ -1,3 +1,6 @@ +<% +context ||= :admin +%> <nav class="navbar navbar-main navbar-light bg-transparent" aria-label="Navigation"> <div class="container-fluid"> <%= link_to admin_root_path, class: 'navbar-brand' do %> @@ -38,7 +41,7 @@ <div class="menu-content"> <div class="container-fluid"> <div class="row"> - <%= render_navigation context: :admin, renderer: Osuny::SimpleNavigationRenderer %> + <%= render_navigation context: context, renderer: Osuny::SimpleNavigationRenderer %> <div class="col-md-4 col-lg-3"> <a class="float-end" href="#"> <% if current_user.picture.attached? && current_user.picture.variable? %> diff --git a/app/views/server/dashboard/index.html.erb b/app/views/server/dashboard/index.html.erb index 255d2fd5db98527865d50d10a2ce03cfd821b21e..2bf1d4b16be5af18e58254250178a4ded07ee3a5 100644 --- a/app/views/server/dashboard/index.html.erb +++ b/app/views/server/dashboard/index.html.erb @@ -3,14 +3,9 @@ <div class="row"> <% @parts.each do |part| %> <div class="col-md-6 d-flex"> - <div class="card flex-fill"> - <div class="card-body"> - <h4 class="mb-4"><%= part[:title] %></h4> - <%= link_to 'Voir la liste', - part[:path], - class: 'btn btn-sm btn-primary stretched-link' %> - </div> - </div> + <%= osuny_panel part[:title] do %> + <%= link_to 'Voir la liste', part[:path], class: 'btn btn-sm btn-primary stretched-link' %> + <% end %> </div> <% end %> </div> diff --git a/app/views/server/layouts/application.html.erb b/app/views/server/layouts/application.html.erb index 43e0fbc22248f5581cbaa7c806f147831f5f2ede..fd3d6120b03f44e903b0d070519faffa5cdae7c9 100644 --- a/app/views/server/layouts/application.html.erb +++ b/app/views/server/layouts/application.html.erb @@ -3,49 +3,36 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - <title><%= content_for?(:title) ? raw("#{yield(:title)} ∙ Osuny") - : 'Osuny' %></title> + <title><%= content_for?(:title) ? raw("#{yield(:title)} ∙ Osuny") : 'Osuny' %></title> <%= csrf_meta_tags %> <%= csp_meta_tag %> - <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap" rel="stylesheet"> - <%= stylesheet_link_tag 'admin/appstack', media: 'all' %> + <script> + // Avoid opening menu on load + </script> + <%= stylesheet_link_tag 'admin/pure', media: 'all' %> <%= favicon_link_tag 'favicon.png' %> </head> - <body class="<%= body_classes %>" data-theme="default" data-layout="fluid" data-sidebar-position="left" data-sidebar-behavior="sticky"> - <div class="toasts-container" style="position: fixed; top: 20px; right: 20px; z-index: 100000;"> - <% unless notice.nil? %> - <div class="js-notyf-notice d-none"> - <%= notice %> - </div> - <% end %> - <% unless alert.nil? %> - <div class="js-notyf-alert d-none"> - <%= alert %> + <body class="<%= body_classes %>"> + <%= render "admin/layouts/themes/pure/nav", context: :server %> + <%= render "admin/layouts/themes/pure/hero" %> + <%= render 'admin/application/notice' %> + <main class="container-fluid"> + <% unless current_user.confirmed? %> + <div class="alert alert-warning"> + <div class="alert-message"> + <%= t('admin.users_alerts.pending_confirmation_html', duration: distance_of_time_in_words(Rails.configuration.devise.allow_unconfirmed_access_for)) %> + <br> + <%= link_to t('devise.confirmations.new.resend_confirmation_instructions'), resend_user_confirmation_path, method: :post, class: 'alert-link' %> + </div> </div> <% end %> - </div> - <div class="wrapper"> - <nav id="sidebar" class="sidebar"> - <div class="sidebar-content js-simplebar"> - <%= link_to server_root_path, class: 'sidebar-brand' do %> - <%= image_tag 'osuny-white.svg', class: 'img-fluid' %> - <% end %> - <%= render_navigation context: :server %> - </div> - </nav> - <%= render 'admin/layouts/themes/appstack/footer' %> - <div class="main"> - <%= render 'server/application/top' %> - <main class="content"> - <div class="container-fluid p-0"> - <h1><%= yield :title %></h1> - <%= yield %> - </div> - </main> + <div class="position-relative"> + <%= yield %> </div> - </div> - <%= javascript_include_tag 'admin/appstack' %> - <%= render 'gdpr/cookie_consent' %> + </main> + <%= render "admin/layouts/themes/pure/commands" %> + <%= render "admin/layouts/themes/pure/footer" %> + <%= javascript_include_tag 'admin/pure' %> <%= render 'bugsnag' %> </body> </html> diff --git a/app/views/server/universities/show.html.erb b/app/views/server/universities/show.html.erb index 10102c01c093355fc7d0fc57718d99150c128b28..50b09738e5ceef415c79565d15a14c9847745dc0 100644 --- a/app/views/server/universities/show.html.erb +++ b/app/views/server/universities/show.html.erb @@ -1,11 +1,8 @@ <% content_for :title, @university %> <div class="row"> - <div class="col-md-5"> - <div class="card"> - <div class="card-header"> - <h2 class="card-title"><%= t('admin.infos') %></h2> - </div> + <div class="col-xl-4"> + <%= osuny_panel t('admin.infos') do %> <div class="table-responsive"> <table class="<%= table_classes %>"> <tr> @@ -30,7 +27,7 @@ <% end %> </table> </div> - </div> + <% end %> </div> </div> diff --git a/app/views/server/websites/_list.html.erb b/app/views/server/websites/_list.html.erb index 683167ef8e6928655a275756d561eb50a8c28c18..061993597f07fcfbb886194a6a9e5f09f23b15b4 100644 --- a/app/views/server/websites/_list.html.erb +++ b/app/views/server/websites/_list.html.erb @@ -3,9 +3,11 @@ <thead> <tr> <th><%= Communication::Website.human_attribute_name('name') %></th> + <th><%= Communication::Website.human_attribute_name('about') %></th> <th><%= Communication::Website.human_attribute_name('url') %></th> <th><%= Communication::Website.human_attribute_name('theme_version') %></th> <th><%= University.model_name.human %></th> + <th><%= Communication::Website.human_attribute_name('created_at') %></th> <th></th> </tr> </thead> @@ -13,6 +15,7 @@ <% websites.ordered.each do |website| %> <tr> <td><%= link_to website.name, admin_communication_website_url(website, host: website.university.url), target: :_blank %></td> + <td><%= I18n.t("activerecord.attributes.communication/website.about_#{website.about_type}") %></td> <td> <%= link_to website.url, website.url, target: :_blank if website.url.present? %> <% if website.in_production %> @@ -21,6 +24,7 @@ </td> <td><%= link_to website.theme_version, website.theme_version_url, target: :_blank if website.theme_version_url.present? %></td> <td><%= link_to website.university, [:server, website.university] %></td> + <td><%= l website.created_at.to_date %></td> <td><%= link_to "Sync version", refresh_server_website_path(website), method: :post, class: button_classes if website.url.present? %></td> </tr> <% end %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 31032486bb73e8546e078cb80d062c31ad30e50a..dae2f8766da766491e3e24652a23f644273c3330 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -73,6 +73,7 @@ en: about_Research::Laboratory: Laboratory website about_type: About access_token: Access token + created_at: Creation default_language: Default language git_branch: Git branch git_endpoint: Git endpoint diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 8ec3bb621ba890817f0f26b71ea7fd76df7ca69c..5f8baf67812083cfaefefc03f7c923cea6879632 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -73,6 +73,7 @@ fr: about_Research::Laboratory: Site de laboratoire about_type: Type de site access_token: Access token + created_at: Création default_language: Langue par défaut git_branch: Branche git_endpoint: Point d'accès Git diff --git a/config/locales/en.yml b/config/locales/en.yml index cb1b1e451baa9480cace005f8c6d5c09a710a538..dba8c22cd519ed83b99f09f6f1f8cc08943b8ba1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -258,6 +258,7 @@ en: reset: Reset save: Save search: Search + server: Server select_language: Select language seo: SEO simple_form: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 2bb4c526ef30b74ab8918912293dba4239d48ca0..b4db6f3ee8fcdb9033c06790f3edc94293b68812 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -259,6 +259,7 @@ fr: save: Enregistrer search: Rechercher select_language: Sélectionnez une langue + server: Serveur seo: SEO simple_form: error_notification: diff --git a/config/server_navigation.rb b/config/server_navigation.rb index c2b389ca7198b634a413ceb00bc244ea98343f36..549117ae9eca3145a65b8c8568004bb421d90121 100644 --- a/config/server_navigation.rb +++ b/config/server_navigation.rb @@ -7,20 +7,22 @@ SimpleNavigation::Configuration.run do |navigation| primary.item :dashboard, t('dashboard'), server_root_path, - { icon: Icon::DASHBOARD, highlights_on: %r{server$} } + { kind: :header, highlights_on: %r{server$} } + primary.item :server, + t('server'), + nil, + { kind: :header } primary.item :universities, University.model_name.human(count: 2), - server_universities_path, { icon: 'university' } if can?(:read, University) + server_universities_path primary.item :websites, Communication::Website.model_name.human(count: 2), - server_websites_path, { icon: 'globe' } + server_websites_path primary.item :languages, Language.model_name.human(count: 2), - server_languages_path, - { icon: 'flag' } if can?(:read, Language) + server_languages_path primary.item :blocks, Communication::Block.model_name.human(count: 2), - server_blocks_path, - { icon: 'puzzle-piece' } if can?(:read, Communication::Block) + server_blocks_path end end