diff --git a/app/assets/stylesheets/extranet/_default/components/_buttons.sass b/app/assets/stylesheets/extranet/_default/components/_buttons.sass new file mode 100644 index 0000000000000000000000000000000000000000..bda00e3c7dd0fa97b7c7561237e2c47aa5405114 --- /dev/null +++ b/app/assets/stylesheets/extranet/_default/components/_buttons.sass @@ -0,0 +1,4 @@ +.btn-secondary + border: 1px solid black + background: transparent + color: black \ No newline at end of file diff --git a/app/views/extranet/account/show.html.erb b/app/views/extranet/account/show.html.erb index f0cee236908e924aa597d514185435ebfe62767f..511cbd41b3952adc82833f0ae10f5a58f0d54989 100644 --- a/app/views/extranet/account/show.html.erb +++ b/app/views/extranet/account/show.html.erb @@ -2,19 +2,17 @@ <%= render 'extranet/persons/header', person: @person unless @person.nil? %> -<%= link_to t('extranet.account.edit'), edit_account_path, class: 'btn btn-primary' %> -<%= link_to t('extranet.account.logout'), destroy_user_session_path, method: :delete, class: 'btn text-danger' %> - <div class="row"> <div class="col-md-9"> <div class="biography"> <p><%= @person.biography %></p> </div> <div class="experiences"> - <p class="mb-4">Parcours professionel</p> <%= link_to University::Person::Experience.human_attribute_name('new'), new_experience_path, - class: 'btn btn-sm btn-primary mb-4' %> + class: 'btn btn-sm btn-secondary float-end mb-4' %> + <p class="mb-4">Parcours professionel</p> + <br> <% if @person.experiences.any? %> <ul> <% @person.experiences.ordered.each do |experience| %> @@ -25,6 +23,10 @@ </div> </div> <div class="col-md-3"> + <div class="mb-4"> + <%= link_to t('extranet.account.edit'), edit_account_path, class: 'btn btn-primary' %> + <%= link_to t('extranet.account.logout'), destroy_user_session_path, method: :delete, class: 'btn text-danger' %> + </div> <%= render 'extranet/persons/details', person: @person unless @person.nil? %> </div> </div> \ No newline at end of file diff --git a/app/views/extranet/experiences/_experience.html.erb b/app/views/extranet/experiences/_experience.html.erb index 73a8f1e6795519b88e5c62b67ce6ba6e11862a84..d2d10a82eb74f7cbe92af9988d419dfafa9d4781 100644 --- a/app/views/extranet/experiences/_experience.html.erb +++ b/app/views/extranet/experiences/_experience.html.erb @@ -8,9 +8,6 @@ edit ||= false <%= "#{experience.from_year} —" if experience.from_year %> <%= experience.to_year || t('today') %> </p> - <%= link_to University::Person::Experience.human_attribute_name('edit'), - edit_experience_path(experience), - class: 'btn btn-sm btn-primary mt-2' if edit %> </div> <div> <% if experience.organization.present? %> @@ -28,5 +25,8 @@ edit ||= false <% end %> <% end %> <% end %> + <%= link_to University::Person::Experience.human_attribute_name('edit'), + edit_experience_path(experience), + class: 'btn btn-sm btn-secondary float-end mt-2' if edit %> </div> </li> diff --git a/app/views/extranet/experiences/_form.html.erb b/app/views/extranet/experiences/_form.html.erb index 32e17ddcb92b0ec4841f2ed9f7debabb56b422c7..1c90372f669d745c6eab6da415be9e77eeec0736 100644 --- a/app/views/extranet/experiences/_form.html.erb +++ b/app/views/extranet/experiences/_form.html.erb @@ -1,7 +1,20 @@ <%= simple_form_for experience, url: experience.persisted? ? experience_path(experience) : experiences_path do |f| %> - <%= f.association :organization %> - <%= f.input :description %> - <%= f.input :from_year %> - <%= f.input :to_year %> + <div class="row"> + <div class="col-lg-6"> + <%= f.input :description, as: :string %> + <div class="row"> + <div class="col-6"> + <%= f.input :from_year %> + </div> + <div class="col-6"> + <%= f.input :to_year %> + </div> + </div> + </div> + <div class="col-lg-6"> + <%= f.association :organization, include_blank: false %> + <%= link_to 'Créer une nouvelle organisation', '', class: 'btn btn-sm btn-secondary mb-4' %> + </div> + </div> <%= submit f %> <% end %> \ No newline at end of file diff --git a/app/views/extranet/persons/_header.html.erb b/app/views/extranet/persons/_header.html.erb index b0a32dd5861eb8a417a4ce0f794caef326b4e95e..1f10fd55f651d71dce5e4522fc74aa853e73fb64 100644 --- a/app/views/extranet/persons/_header.html.erb +++ b/app/views/extranet/persons/_header.html.erb @@ -5,8 +5,8 @@ </header> </div> <div class="col-md-3"> - <% if person.picture.attached? %> - <%= kamifusen_tag person.picture, width: 400, class: 'img-fluid' %> + <% if person.best_picture.attached? %> + <%= kamifusen_tag person.best_picture, width: 400, class: 'img-fluid' %> <% else %> <%= image_tag 'extranet/avatar.png', width: 400, class: 'img-fluid' %> <% end %> diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 9baf021dc21cc4c260d8cce2f59bf39dd50a52d9..cd6cb5d0f7e218a0081d425a6e5816b1ef2e97a5 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -142,6 +142,11 @@ en: linkedin: "Example: https://www.linkedin.com/in/osuny" tenure: "To differ from temporary lecturer." twitter: "Example: osuny" + university_person_experience: + organization: "Choose the organization if it exists, otherwise create it with the button below" + description: "Ex: Project manager, Communication assistant, Journalist..." + from_year: "In charge since..." + to_year: "Leave blank if you are still in charge" include_blanks: defaults: organization: Select organization diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 6ce31cfefe91ca626136e7b49e30fab0e00a4096..56e74a01c67aebb9453548d0306d7b58c3cf4b1d 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -143,6 +143,11 @@ fr: linkedin: "Exemple : https://www.linkedin.com/in/osuny" tenure: "À différencier d'une personne vacataire." twitter: "Exemple : osuny" + university_person_experience: + organization: "Choisissez l'organisation si elle existe. Si elle n'existe pas encore, créez-là ci-dessous." + description: "Ex: Chargée de projet, Assistant communication, Journaliste..." + from_year: "En poste depuis..." + to_year: "Si vous êtes toujours à ce poste, laissez vide" include_blanks: defaults: organization: Sélectionnez une organisation