diff --git a/app/assets/stylesheets/admin/pure/style.sass b/app/assets/stylesheets/admin/pure/style.sass index 56a5bb8430d8fda60bff19db0db7916eba4ec917..a42e0634516fda077b0a54c1dbe7a51820acb970 100644 --- a/app/assets/stylesheets/admin/pure/style.sass +++ b/app/assets/stylesheets/admin/pure/style.sass @@ -62,6 +62,7 @@ main min-height: 70vh position: relative + padding-bottom: px2rem(100) .container-fluid padding-right: var(--bs-gutter-x) @@ -127,7 +128,7 @@ a .commands background: $color-background-alt - position: fixed + position: sticky bottom: 0 left: 0 right: 0 diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index 976bd721d258bf514b36e017f3dbc8fa983b8d05..4bcd24318316ac4a833b36cad683a868a088166c 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -45,7 +45,7 @@ module Admin::ApplicationHelper aria-controls=\"preview\">#{ t 'preview.button'}</button>" end - def panel(title: nil, subtitle: nil, action: nil, &block) + def osuny_panel(title: nil, subtitle: nil, action: nil, &block) render layout: "admin/layouts/themes/#{current_admin_theme}/panel", locals: { title: title, @@ -55,6 +55,10 @@ module Admin::ApplicationHelper capture(&block) end end + + def osuny_label(title) + raw "<label class=\"form-label\">#{title}</label>" + end def duplicate_link(object) return unless can?(:update, object) diff --git a/app/views/admin/layouts/themes/pure/_footer.html.erb b/app/views/admin/layouts/themes/pure/_footer.html.erb index 155c826c4dbf0599650dd265435d1157348dbfcc..299eb85d8c436d33f078f2cc774db5a5ced73cb3 100644 --- a/app/views/admin/layouts/themes/pure/_footer.html.erb +++ b/app/views/admin/layouts/themes/pure/_footer.html.erb @@ -1,4 +1,4 @@ -<footer class="bg-black py-5 mt-5"> +<footer class="bg-black py-5"> <div class="container-fluid"> <div class="row"> <div class="col-md-3"> diff --git a/app/views/admin/university/alumni/show.html.erb b/app/views/admin/university/alumni/show.html.erb index f7d6edd11c540b8e6bb64eb64f1bb46fe2b47187..951bcd33518d561b1a81849a324d4f0930656786 100644 --- a/app/views/admin/university/alumni/show.html.erb +++ b/app/views/admin/university/alumni/show.html.erb @@ -2,52 +2,26 @@ <%= render 'admin/university/people/main_infos', person: @alumnus %> -<% if @alumnus.cohorts.any? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= Education::Cohort.model_name.human(count: @alumnus.cohorts.count) %></h2> - </div> - <%= render 'admin/education/cohorts/list', cohorts: @alumnus.cohorts.ordered %> - </div> +<% +action = '' +action += link_to t('university.manage_cohorts'), + cohorts_admin_university_alumnus_path(@alumnus), + class: button_classes if can?(:update, @alumnus) +%> +<%= osuny_panel title:Education::Cohort.model_name.human(count: 2), action: action do %> + <%= render 'admin/education/cohorts/list', cohorts: @alumnus.cohorts.ordered %> <% end %> -<% if @alumnus.experiences.any? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= University::Person::Experience.model_name.human(count: @alumnus.experiences.count) %></h2> - </div> - <div class="table-responsive"> - <table class="<%= table_classes %>"> - <thead> - <tr> - <th><%= University::Person::Experience.human_attribute_name('description') %></th> - <th><%= University::Person::Experience.human_attribute_name('organization') %></th> - <th><%= University::Person::Experience.human_attribute_name('from_year') %></th> - <th><%= University::Person::Experience.human_attribute_name('to_year') %></th> - </tr> - </thead> - <tbody> - <% @alumnus.experiences.ordered.each do |experience| %> - <% organization = experience.organization %> - <tr> - <td><%= experience.description %></td> - <td><%= link_to_if can?(:read, organization), organization, [:admin, organization] %></td> - <td><%= experience.from_year %></td> - <td><%= experience.to_year %></td> - </tr> - <% end %> - </tbody> - </table> - </div> - </div> +<% +action = '' +action += link_to t('university.manage_experiences'), + experiences_admin_university_alumnus_path(@alumnus), + class: button_classes if can?(:update, @alumnus) +%> +<%= osuny_panel title:University::Person::Experience.model_name.human(count: 2), action: action do %> + <%= render 'admin/university/people/experiences/list', experiences: @alumnus.experiences.ordered %> <% end %> - <% content_for :action_bar_right do %> <%= edit_link @alumnus %> - <%= link_to t('university.manage_cohorts'), - cohorts_admin_university_alumnus_path(@alumnus), - class: button_classes if can?(:update, @alumnus) %> - <%= link_to t('university.manage_experiences'), experiences_admin_university_alumnus_path(@alumnus), - class: button_classes if can?(:update, @alumnus) %> <% end %> diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb index 3bb0d28adcdaea22ba3b28566c283f7790b0510f..ffe5bcb1e5cd233fce1bf985509724b4df3285f7 100644 --- a/app/views/admin/university/organizations/show.html.erb +++ b/app/views/admin/university/organizations/show.html.erb @@ -2,118 +2,90 @@ <div class="row"> <div class="col-md-8"> <%= render 'admin/application/summary/show', about: @organization %> - <% if strip_tags(@organization.text.to_html).present? %> - <div class="card"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= University::Organization.human_attribute_name(:text) %></h5> - </div> - <div class="card-body"> - <%= @organization.text.to_s.html_safe %> - </div> - </div> - <% end %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"> - <%= University::Organization.human_attribute_name('contact') %> - </h5> - </div> - <div class="card-body"> - <div class="row"> - <div class="col-md-6"> - <% [ - :address, - :zipcode, - :city, - :country - ].each do |property| %> - <% value = @organization.send property %> - <% next if value.blank? %> - <h3 class="h5"> - <%= University::Organization.human_attribute_name(property) %> - </h3> - <p><%= value %></p> - <% end %> - </div> - <div class="col-md-6"> - <% unless @organization.url.blank? %> - <h3 class="h5"> - <%= University::Organization.human_attribute_name(:url) %> - </h3> - <p><%= link_to @organization.url, - @organization.url, - target: :_blank %></p> - <% end %> - <% [ - :phone, - :email, - :linkedin, - :twitter, - :mastodon - ].each do |property| %> - <% value = @organization.send property %> - <% next if value.blank? %> - <h3 class="h5"> - <%= University::Organization.human_attribute_name(property) %> - </h3> - <p><%= value %></p> - <% end %> + + <%= osuny_panel title: University::Organization.human_attribute_name('text') do %> + <%= @organization.text.to_s.html_safe %> + <% end if strip_tags(@organization.text.to_html).present? %> + + <%= osuny_panel title: University::Organization.human_attribute_name('contact') do %> + <div class="row pure__row--small"> + <% [ + :address, + :zipcode, + :city, + :country + ].each do |property| %> + <% value = @organization.send property %> + <% next if value.blank? %> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name(property) %> + <p><%= value %></p> </div> - </div> - </div> - </div> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"> - <%= University::Organization.human_attribute_name('legal') %> - </h5> - </div> - <div class="card-body"> - <div class="row"> - <div class="col-md-6"> - <h3 class="h5"><%= University::Organization.human_attribute_name(:long_name) %></h3> - <p><%= @organization.long_name %></p> + <% end %> + <% unless @organization.url.blank? %> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name('url') %> + <p><%= link_to @organization.url, + @organization.url, + target: :_blank %></p> </div> - <div class="col-md-6"> - <h3 class="h5"><%= University::Organization.human_attribute_name(:kind) %></h3> - <p><%= @organization.kind_i18n %></p> - <h3 class="h5"><%= University::Organization.human_attribute_name(:siren) %></h3> - <p><%= @organization.siren %></p> + <% end %> + <% [ + :phone, + :email, + :linkedin, + :twitter, + :mastodon + ].each do |property| %> + <% value = @organization.send property %> + <% next if value.blank? %> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name(property) %> + <p><%= value %></p> </div> + <% end %> + </div> + <% end %> + + <%= osuny_panel title: University::Organization.human_attribute_name('legal') do %> + <div class="row pure__row--small"> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name('long_name') %> + <p><%= @organization.long_name %></p> + </div> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name('kind') %> + <p><%= @organization.kind_i18n %></p> + </div> + <div class="col-xxl-6"> + <%= osuny_label University::Organization.human_attribute_name('siren') %> + <p><%= @organization.siren %></p> </div> </div> - </div> + <% end %> + <%= render 'admin/communication/blocks/list', about: @organization %> </div> + <div class="col-md-4"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('informations') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= University::Organization.human_attribute_name(:slug) %></h3> - <p><%= @organization.slug %></p> - <h3 class="h5"><%= University::Organization.human_attribute_name(:active) %></h3> - <%= @organization.active %> - </div> - </div> - <% if @organization.logo.attached? || @organization.logo_on_dark_background.attached? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t 'university.organization.logo' %></h5> - </div> - <div class="card-body"> - <% if @organization.logo.attached? %> - <label class="form-label"><%= University::Organization.human_attribute_name('logo') %></label> - <%= kamifusen_tag @organization.logo, class: 'img-fluid img-fill bg-light img-thumbnail p-5' %> - <% end %> - <% if @organization.logo_on_dark_background.attached? %> - <label class="form-label mt-4"><%= University::Organization.human_attribute_name('logo_on_dark_background') %></label> - <%= kamifusen_tag @organization.logo_on_dark_background, class: 'img-fluid img-fill bg-dark img-thumbnail p-5' %> - <% end %> - </div> - </div> + <%= osuny_panel title: t('informations') do %> + <%= osuny_label University::Organization.human_attribute_name('slug') %> + <p><%= @organization.slug %></p> + <%= osuny_label University::Organization.human_attribute_name('active') %> + <p><%= t @organization.active %></> <% end %> + + <%= osuny_panel title: t('university.organization.logo') do %> + <% if @organization.logo.attached? %> + <%= osuny_label University::Organization.human_attribute_name('logo') %> + <%= kamifusen_tag @organization.logo, class: 'img-fluid img-fill bg-light img-thumbnail p-5 mb-3' %> + <% end %> + <% if @organization.logo_on_dark_background.attached? %> + <%= osuny_label University::Organization.human_attribute_name('logo_on_dark_background') %> + <%= kamifusen_tag @organization.logo_on_dark_background, class: 'img-fluid img-fill bg-dark img-thumbnail p-5' %> + <% end %> + <% end if @organization.logo.attached? || @organization.logo_on_dark_background.attached? %> + <%= render 'admin/application/meta_description/show', about: @organization %> </div> </div> diff --git a/app/views/admin/university/people/experiences/_list.html.erb b/app/views/admin/university/people/experiences/_list.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..bffbc586788d4f25ecd95ddbac6a013123fa1be1 --- /dev/null +++ b/app/views/admin/university/people/experiences/_list.html.erb @@ -0,0 +1,23 @@ +<div class="table-responsive"> + <table class="<%= table_classes %>"> + <thead> + <tr> + <th><%= University::Person::Experience.human_attribute_name('description') %></th> + <th><%= University::Person::Experience.human_attribute_name('organization') %></th> + <th><%= University::Person::Experience.human_attribute_name('from_year') %></th> + <th><%= University::Person::Experience.human_attribute_name('to_year') %></th> + </tr> + </thead> + <tbody> + <% experiences.each do |experience| %> + <% organization = experience.organization %> + <tr> + <td><%= experience.description %></td> + <td><%= link_to_if can?(:read, organization), organization, [:admin, organization] %></td> + <td><%= experience.from_year %></td> + <td><%= experience.to_year %></td> + </tr> + <% end %> + </tbody> + </table> +</div> \ No newline at end of file diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 26b3b5f3f001c52891015bb2006371164f17e6bb..5cc0997b8023cfd1f049992035d8caf9b54d68d3 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -181,7 +181,7 @@ fr: manage_cohorts: Gérer les promotions manage_experiences: Gérer les expériences professionnelles organization: - employees: Employés·es + employees: Employé·e·s import_hint_html: "Les valeurs possibles pour <i>kind</i> sont : company, non_profit, government.<br>Les champs <i>siren</i>, <i>nic</i>, <i>zipcode</i> et <i>phone</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)" logo: Logo person: