diff --git a/app/views/admin/application/_filters.html.erb b/app/views/admin/application/_filters.html.erb index baf3ddc0700ecdb16809352f74726028a153e7b2..bb28a2cdfb7408bd76a4b92af1db1f8c0751c3f7 100644 --- a/app/views/admin/application/_filters.html.erb +++ b/app/views/admin/application/_filters.html.erb @@ -3,45 +3,50 @@ collapsable = true if collapsable.nil? # not ||= because collapsable can be "fal should_be_open = false filters.each { |filter| should_be_open = true if params.has_key?(filter[:scope_name]) } %> -<div class="row"> - <% if collapsable %> - <div class="col-md-2"> - <a class="btn btn-primary" - data-bs-toggle="collapse" - href="#collapseFilters" - role="button" - aria-expanded="false" - aria-controls="collapseFilters"> - <%= t('filters.buttons.expand') %> - </a> - </div> - <% end %> - <div class="col-md-<%= collapsable ? '10' : '12' %>"> - <div class="collapse <%= (!collapsable || should_be_open) ? 'show' : '' %>" id="collapseFilters"> - <%= form_tag current_path, method: :get, class: 'do-not-unlock' do |f| %> - <div class="row"> - <div class="col-md-4"> - <% filters.each do |filter| %> - <% if filter[:scope_name] == :for_search_term %> - <%= text_field_tag filter[:scope_name], params[filter[:scope_name]], placeholder: filter[:label], class: 'form-control mb-1 filter' %> - <% else %> - <% if filter[:tree] %> - <% choices = collection_tree(filter[:choices]).map { |elmt| [elmt[:label].html_safe, elmt[:id]] } %> - <% else %> - <% choices = filter[:choices].map { |elmt| elmt.is_a?(String) ? [elmt, elmt] : [elmt.is_a?(Hash) ? elmt[:to_s] : elmt.to_s, elmt[:id]] } %> - <% end %> - <% field_name = filter[:multiple] ? "#{filter[:scope_name]}[]" : filter[:scope_name] %> - <%= select_tag field_name, options_for_select(choices, params[filter[:scope_name]]), include_blank: filter[:label], class: 'form-select mb-1 filter' %> - <% end %> + +<% if collapsable %> + <div class="text-end mt-n5"> + <a class="btn btn-light btn-sm" + data-bs-toggle="collapse" + href="#collapseFilters" + role="button" + aria-expanded="false" + aria-controls="collapseFilters"> + <i class="fas fa-filter"></i> + <%= t('filters.buttons.expand') %> + </a> + </div> +<% end %> +<div class="mt-4 mb-n3 collapse <%= (!collapsable || should_be_open) ? 'show' : '' %>" id="collapseFilters"> + <%= form_tag current_path, method: :get, class: 'do-not-unlock' do |f| %> + <div class="row"> + <% filters.each do |filter| %> + <div class="col-md-4"> + <% if filter[:scope_name] == :for_search_term %> + <%= text_field_tag filter[:scope_name], + params[filter[:scope_name]], + placeholder: filter[:label], + class: 'form-control mb-3 filter' %> + <% else %> + <% if filter[:tree] %> + <% choices = collection_tree(filter[:choices]).map { |elmt| [elmt[:label].html_safe, elmt[:id]] } %> + <% else %> + <% choices = filter[:choices].map { |elmt| elmt.is_a?(String) ? [elmt, elmt] : [elmt.is_a?(Hash) ? elmt[:to_s] : elmt.to_s, elmt[:id]] } %> <% end %> - </div> - <div class="col-md-3"> - <%= submit_tag t('filters.buttons.submit'), class: 'btn btn-primary btn-submit' %> - <%= link_to t('reset'), current_path, class: 'btn btn-warning' %> - </div> + <% field_name = filter[:multiple] ? "#{filter[:scope_name]}[]" : filter[:scope_name] %> + <%= select_tag field_name, + options_for_select(choices, params[filter[:scope_name]]), + include_blank: filter[:label], + class: 'form-select mb-3 filter' %> + <% end %> </div> - <% end %> + <% end %> + <div class="col-md-4"> + <%= submit_tag t('filters.buttons.submit'), class: 'btn btn-primary btn-submit' %> + <%= link_to t('reset'), current_path, class: 'btn btn-secondary' %> + </div> </div> - </div> + <% end %> </div> + <br> diff --git a/app/views/admin/communication/website/posts/_list.html.erb b/app/views/admin/communication/website/posts/_list.html.erb index 8ebc3a67791990b8cd12e8238044fc6772047791..5fbf2c99b59aab4d456a1f2279dbb01bb8ae0457 100644 --- a/app/views/admin/communication/website/posts/_list.html.erb +++ b/app/views/admin/communication/website/posts/_list.html.erb @@ -19,7 +19,6 @@ <% unless hide_category %> <th><%= Communication::Website::Post.human_attribute_name('categories') %></th> <% end %> - <th><%= Communication::Website::Post.human_attribute_name('pinned') %></th> <th colspan="2"><%= Communication::Website::Post.human_attribute_name('published_at') %></th> </tr> </thead> @@ -48,8 +47,12 @@ </ul> </td> <% end %> - <td><small><%= t post.pinned %></small></td> - <td><small><%= l post.published_at, format: :date_with_explicit_month if post.published_at %></small></td> + <td> + <%= l post.published_at, format: :date_with_explicit_month if post.published_at %> + <% if post.pinned %> + <span class="badge bg-success"><%= Communication::Website::Post.human_attribute_name('pinned') %></span> + <% end %> + </td> <td class="text-end"> <div class="btn-group" role="group"> <%= link_to t('edit'), diff --git a/app/views/admin/communication/website/posts/index.html.erb b/app/views/admin/communication/website/posts/index.html.erb index 4f011815081f5353f7876ababafcc276271a5f2a..0d31752811adb28052b6ad4260de7a73ba7021f5 100644 --- a/app/views/admin/communication/website/posts/index.html.erb +++ b/app/views/admin/communication/website/posts/index.html.erb @@ -30,6 +30,7 @@ </div> <% end %> </div> + <% end %> <% content_for :action_bar_left do %> diff --git a/app/views/admin/communication/websites/_sidebar.html.erb b/app/views/admin/communication/websites/_sidebar.html.erb index e3517b64da5784b7a0bd543f27be18b4325e0938..130b9144f3e67f3a9cf8cd17a4d1e808d3e9c2c2 100644 --- a/app/views/admin/communication/websites/_sidebar.html.erb +++ b/app/views/admin/communication/websites/_sidebar.html.erb @@ -1,5 +1,5 @@ <div class="row mt-2"> - <div class="col-md-3 col-lg-2"> + <div class="col-lg-3 col-xl-2"> <div class="card"> <div class="list-group list-group-flush" role="tablist"> <% @@ -45,7 +45,7 @@ </div> </div> </div> - <div class="col-md-9 col-lg-10"> + <div class="col-lg-9 col-xl-10"> <%= yield %> </div> </div> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index aab9134eaf37d8d7a9cedc9c3c4cbb3d906071cc..f016a7e5a170ef9d7e69d110f0fbd3ab6558abf0 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -111,8 +111,8 @@ en: description_short: Lead text featured_image: Featured image featured_image_alt: Alt text - pinned: Pinned? - published: Published? + pinned: Pinned + published: Published published_at: Publication date slug: Slug text: Text diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index a6b2b329173a4da7013f694dc108acf4b517d652..b600e2889c4190d3a1102f5208cf276f3fed8c03 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -111,8 +111,8 @@ fr: description_short: Chapô featured_image: Image à la une featured_image_alt: Texte alternatif - pinned: Mis en avant ? - published: Publié ? + pinned: Mis en avant + published: Publié published_at: Date de publication slug: Slug text: Texte diff --git a/db/schema.rb b/db/schema.rb index 6ee0922f1926973e5077de47fb68c3e289d2734e..ea5716f23f3fec32251d4bdaeb38cd419a1188cc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -319,10 +319,10 @@ ActiveRecord::Schema.define(version: 2022_04_28_171541) do t.uuid "related_category_id" t.string "featured_image_alt" t.text "text" + t.text "description_short" t.string "breadcrumb_title" t.text "header_text" t.integer "kind" - t.text "description_short" t.string "bodyclass" t.uuid "language_id" t.index ["communication_website_id"], name: "index_communication_website_pages_on_communication_website_id" @@ -503,6 +503,23 @@ ActiveRecord::Schema.define(version: 2022_04_28_171541) do t.index ["university_id"], name: "index_education_schools_on_university_id" end + create_table "external_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.string "title" + t.text "description" + t.string "address" + t.string "zipcode" + t.string "city" + t.string "country" + t.string "website" + t.string "phone" + t.string "mail" + t.boolean "active" + t.string "sirene" + t.integer "kind" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" @@ -692,8 +709,8 @@ ActiveRecord::Schema.define(version: 2022_04_28_171541) do t.string "linkedin" t.boolean "is_alumnus", default: false t.text "description_short" - t.boolean "is_author" t.string "name" + t.boolean "is_author" t.index ["university_id"], name: "index_university_people_on_university_id" t.index ["user_id"], name: "index_university_people_on_user_id" end