diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000000000000000000000000000000000..bbce0c186a2fac24b13f6eeb0b1bef5428c223a4 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,72 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '17 6 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript', 'ruby' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„¹ï¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/Gemfile b/Gemfile index 442b685b5d0eb558da9b6b8c2eddbd4048dfcd9a..d1539e47f8a66ef86c1af790034da5d5b6ea36d5 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'bootstrap' gem 'bootstrap5-kaminari-views' gem 'breadcrumbs_on_rails' gem 'bugsnag' -gem 'cancancan' +gem 'cancancan', '3.3.0' gem 'cocoon', '~> 1.2' gem 'country_select' gem 'curation'#, path: '../../arnaudlevy/curation' diff --git a/Gemfile.lock b/Gemfile.lock index a8bf96e5dab076662f1e33cce14e63c524bf3bf4..61e390fdb9ca71933a7d2d2fe91af790abf2609c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ GIT remote: https://github.com/noesya/summernote-rails.git - revision: 9a4e669ae6c4f50f7d08cd6939cdff719d135c9d + revision: 585293f150052c8f158b1fab7d8206a94d368d4a branch: activestorage specs: - summernote-rails (0.8.20.6) + summernote-rails (0.8.20.7) nokogiri rails (>= 6.0) @@ -90,7 +90,7 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.600.0) + aws-partitions (1.601.0) aws-sdk-core (3.131.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -135,8 +135,7 @@ GEM childprocess (4.1.0) cocoon (1.2.15) concurrent-ruby (1.1.10) - countries (5.0.2) - i18n_data (~> 0.16.0) + countries (5.1.0) sixarm_ruby_unaccent (~> 1.1) country_select (7.0.0) countries (~> 5.0) @@ -240,8 +239,6 @@ GEM multi_xml (>= 0.5.2) i18n (1.10.0) concurrent-ruby (~> 1.0) - i18n_data (0.16.0) - simple_po_parser (~> 1.1) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) @@ -307,6 +304,8 @@ GEM ruby2_keywords (~> 0.0.1) nesty (1.0.2) nio4r (2.5.8) + nokogiri (1.13.6-arm64-darwin) + racc (~> 1.4) nokogiri (1.13.6-x86_64-darwin) racc (~> 1.4) nokogiri (1.13.6-x86_64-linux) @@ -333,7 +332,7 @@ GEM orm_adapter (0.5.0) parser (3.1.2.0) ast (~> 2.4.1) - pg (1.4.0) + pg (1.4.1) popper_js (2.9.3) public_suffix (4.0.7) puma (5.6.4) @@ -344,8 +343,8 @@ GEM rack (>= 1.2.0) rack-protection (2.2.0) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) + rack-test (2.0.0) + rack (>= 1.3) rails (6.1.6) actioncable (= 6.1.6) actionmailbox (= 6.1.6) @@ -410,9 +409,9 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - scout_apm (5.1.1) + scout_apm (5.2.0) parser - selenium-webdriver (4.2.1) + selenium-webdriver (4.3.0) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -432,7 +431,6 @@ GEM simple_form_password_with_hints (0.0.6) rails simple_form - simple_po_parser (1.1.6) sinatra (2.2.0) mustermann (~> 1.0) rack (~> 2.2) @@ -442,7 +440,7 @@ GEM sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) spring (4.0.0) - sprockets (4.0.3) + sprockets (4.1.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.4.2) @@ -460,7 +458,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.1.0) + unicode-display_width (2.2.0) unicode_utils (1.4.0) unsplash (2.1.0) httparty (~> 0.16) @@ -490,6 +488,7 @@ GEM zeitwerk (2.6.0) PLATFORMS + arm64-darwin-21 x86_64-darwin-21 x86_64-linux @@ -503,7 +502,7 @@ DEPENDENCIES breadcrumbs_on_rails bugsnag byebug - cancancan + cancancan (= 3.3.0) capybara (>= 3.26) cocoon (~> 1.2) country_select diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..034e848032092eaf8ef96eac731b6ed5961987f3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. diff --git a/app/assets/stylesheets/commons/_block.sass b/app/assets/stylesheets/commons/_block.sass index 6d8fcdc1a3527295cb0191346baad59bcff51963..a76ade84fea284a34a7928b7a122a6277b1338b1 100644 --- a/app/assets/stylesheets/commons/_block.sass +++ b/app/assets/stylesheets/commons/_block.sass @@ -3,4 +3,28 @@ display: none [data-v-app] .spinner-border - display: none \ No newline at end of file + display: none + +.fake-table + display: table + border-collapse: collapse + caption-side: bottom + border: 1px solid $border-color + .thead, .tbody + display: table-row-group + .tr + display: table-row + border-bottom: 1px solid $border-color + .td + display: table-cell + min-width: 120px + &:not(:first-child) + border-left: 1px solid $border-color + .thead + white-space: nowrap + .tbody + .tr + &:nth-child(even) + background: $table-striped-bg + &:hover + background: $table-hover-bg diff --git a/app/controllers/server/blocks_controller.rb b/app/controllers/server/blocks_controller.rb index 672b50b16fa45a0f422ec3bc441a5c20335f6624..73e7564703ce85d703a9229aa9e891fa7524688d 100644 --- a/app/controllers/server/blocks_controller.rb +++ b/app/controllers/server/blocks_controller.rb @@ -1,25 +1,28 @@ class Server::BlocksController < Server::ApplicationController + before_action :load_template, except: [:index] + def index @templates = Communication::Block.template_kinds.keys breadcrumb end def show - @template = params[:id] - @blocks = Communication::Block.send(@template) breadcrumb add_breadcrumb t("enums.communication.block.template_kind.#{@template}") end def resave - @template = params[:id] - @blocks = Communication::Block.send(@template) @blocks.find_each &:save redirect_to server_block_path(@template), notice: "#{@blocks.count} blocks saved" end protected + def load_template + @template = params[:id] + @blocks = Communication::Block.where(template_kind: @template) + end + def breadcrumb super add_breadcrumb Communication::Block.model_name.human(count: 2), server_blocks_path diff --git a/app/models/communication/block/template/base.rb b/app/models/communication/block/template/base.rb index e2b48458cff7c0eadaddc537c02deaf14ec2813c..f9814ae497009439efb9775213c79ca867027467 100644 --- a/app/models/communication/block/template/base.rb +++ b/app/models/communication/block/template/base.rb @@ -185,6 +185,6 @@ class Communication::Block::Template::Base end def website - block.about&.website + block.about&.try(:website) end end diff --git a/app/models/communication/block/template/key_figure.rb b/app/models/communication/block/template/key_figure.rb index a7baeb675cc09e7a48f0ff96eb567f2403c7280d..21b2cb6e5408dd44d77f6629f19fa63f4b61916b 100644 --- a/app/models/communication/block/template/key_figure.rb +++ b/app/models/communication/block/template/key_figure.rb @@ -1,5 +1,6 @@ class Communication::Block::Template::KeyFigure < Communication::Block::Template::Base has_elements + has_component :description, :rich_text end diff --git a/app/models/communication/block/template/organization_chart.rb b/app/models/communication/block/template/organization_chart.rb index 24fd903a2d6a1105180c5a1d14f34efefac72cca..334d745ed2b8280fb9618fd3c97e6a37f4edfbb9 100644 --- a/app/models/communication/block/template/organization_chart.rb +++ b/app/models/communication/block/template/organization_chart.rb @@ -3,5 +3,6 @@ class Communication::Block::Template::OrganizationChart < Communication::Block:: has_elements has_component :description, :rich_text has_component :with_link, :boolean + has_component :with_photo, :boolean end diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index badd0b135c70deec239552b2088e3382237740fd..ad4e22bd9ef15307423e01999ed6457684374a37 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -126,7 +126,7 @@ class Communication::Website::Page < ApplicationRecord dependencies += website.education_programs if kind_education_programs? dependencies += [parent] if has_parent? dependencies += [website.config_permalinks] if is_special_page? - dependencies + dependencies.flatten end def git_destroy_dependencies(website) diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 24678998b913d5362899f6247081381142d12936..922b75f3c618c3c55c817848433f0d978a47facf 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -122,6 +122,7 @@ class Communication::Website::Post < ApplicationRecord dependencies = [self] + website.menus dependencies += categories dependencies += active_storage_blobs + dependencies += git_block_dependencies if author.present? dependencies += [author, author.author] dependencies += author.active_storage_blobs diff --git a/app/services/icon.rb b/app/services/icon.rb index 33f2b76bc7066c8fab3294acbf2e2c79899fb304..54cdb9079508a4aa24d4148d461f9a03ff108a42 100644 --- a/app/services/icon.rb +++ b/app/services/icon.rb @@ -1,5 +1,7 @@ # used in menu items and in admin navigation class Icon + DASHBOARD = 'tachometer-alt' + COMMUNICATION_EXTRANET = 'project-diagram' COMMUNICATION_WEBSITE = 'sitemap' COMMUNICATION_WEBSITE_POST = 'newspaper' diff --git a/app/views/admin/application/_dependencies.html.erb b/app/views/admin/application/_dependencies.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..2247b2c3983cad8bd8fcd0f762c0b8403716acd0 --- /dev/null +++ b/app/views/admin/application/_dependencies.html.erb @@ -0,0 +1,58 @@ +<% +expanded ||= false +%> +<% if current_user.server_admin? %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <div class="card-actions float-end"> + <button class="accordion-button bg-transparent <%= 'collapsed' unless expanded %> mt-n1" + type="button" + data-bs-toggle="collapse" + data-bs-target="#dependencies" + aria-expanded="<%= expanded %>" + aria-controls="dependencies"> + </button> + </div> + <h2 class="card-title mb-0 h5">Dependencies</h2> + </div> + <div class="card-body collapse <%= 'show' if expanded %>" id="dependencies"> + <h2 class="h5">git_dependencies</h2> + <table class="table"> + <thead> + <tr> + <th>Id</th> + <th>Class</th> + <th>Name</th> + </tr> + </thead> + <tbody> + <% git_dependencies.each do |dependency| %> + <tr> + <td><%= dependency.id %></td> + <td><%= dependency.class %></td> + <td><%= dependency.to_s %></td> + </tr> + <% end %> + </tbody> + </table> + + <h2 class="h5 mt-5">active_storage_blobs</h2> + <table class="table"> + <thead> + <tr> + <th>Id</th> + <th>Filename</th> + </tr> + </thead> + <tbody> + <% active_storage_blobs.each do |blob| %> + <tr> + <td><%= blob.id %></td> + <td><%= blob.filename %></td> + </tr> + <% end %> + </tbody> + </table> + </div> + </div> +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/show.html.erb b/app/views/admin/communication/blocks/show.html.erb index 6b358527c2bc1d1de25e1741831aeae6837305ef..42dcbe027f2c599ba34cf4f1ef9cbd9d2dc5e796 100644 --- a/app/views/admin/communication/blocks/show.html.erb +++ b/app/views/admin/communication/blocks/show.html.erb @@ -1,42 +1,9 @@ <% content_for :title, @block %> -<h2>git_dependencies</h2> -<table class="table"> - <thead> - <tr> - <th>Id</th> - <th>Class</th> - <th>Name</th> - </tr> - </thead> - <tbody> - <% @block.template.git_dependencies.each do |dependency| %> - <tr> - <td><%= dependency.id %></td> - <td><%= dependency.class %></td> - <td><%= dependency.to_s %></td> - </tr> - <% end %> - </tbody> -</table> - -<h2>active_storage_blobs</h2> -<table class="table"> - <thead> - <tr> - <th>Id</th> - <th>Filename</th> - </tr> - </thead> - <tbody> - <% @block.template.active_storage_blobs.each do |blob| %> - <tr> - <td><%= blob.id %></td> - <td><%= blob.filename %></td> - </tr> - <% end %> - </tbody> -</table> +<%= render 'admin/application/dependencies', + git_dependencies: @block.template.git_dependencies, + active_storage_blobs: @block.template.active_storage_blobs, + expanded: true %> <% content_for :action_bar_right do %> <%= edit_link @block %> diff --git a/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb b/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb index 4ea5c0c1dc59bcfb05bdd17c7283b65f20d558b5..d1111ef09d4c509a0f442f2b85fa839eb31ecdce 100644 --- a/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/datatable/_edit.html.erb @@ -1,8 +1,8 @@ <div class="table-responsive mb-5"> - <table class="table table-bordered table-hover"> - <thead> - <tr> - <td v-for="(column, index) in data.columns"> + <div class="fake-table table"> + <div class="thead"> + <div class="tr"> + <div class="td" v-for="(column, index) in data.columns"> <div class="d-flex"> <input type="text" class="form-control" @@ -12,8 +12,8 @@ <i class="fas fa-times"></i> </a> </div> - </td> - <td class="text-end"> + </div> + <div class="td text-end"> <a class="btn btn-primary me-2" v-on:click="data.columns.push('')"> <i class="fas fa-plus"></i> colonne @@ -22,33 +22,31 @@ v-on:click="data.elements.push({cells: []})"> <i class="fas fa-plus"></i> ligne </a> - </td> - </tr> - </thead> - <tbody> - <draggable :list="data.elements" handle=".dragHandle"> - <tr v-for="(row, index) in data.elements"> - <td v-for="(column, columnIndex) in data.columns"> - <input type="text" - class="form-control" - v-model="row.cells[columnIndex]"> - </td> - <td class="text-end"> - <div class="d-flex"> - <a class="btn btn-danger" - v-on:click="data.elements.splice(index, 1)"> - <i class="fas fa-times"></i> - </a> + </div> + </div> + </div> + <draggable :list="data.elements" handle=".dragHandle" class="tbody"> + <div class="tr" v-for="(row, index) in data.elements"> + <div class="td" v-for="(column, columnIndex) in data.columns"> + <input type="text" + class="form-control" + v-model="row.cells[columnIndex]"> + </div> + <div class="td" class="text-end"> + <div class="d-flex"> + <a class="btn btn-danger" + v-on:click="data.elements.splice(index, 1)"> + <i class="fas fa-times"></i> + </a> - <a class="btn ms-auto dragHandle"> - <i class="fa fa-bars handle"></i> - </a> - </div> - </td> - </tr> - </draggable> - </tbody> - </table> + <a class="btn ms-auto dragHandle"> + <i class="fa fa-bars handle"></i> + </a> + </div> + </div> + </div> + </draggable> + </div> </div> <div class="row"> diff --git a/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb b/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb index d58e664b43329c05fb45dcb0dabf56f0a909621d..d9967a01c44d5d54e196e6a63e3a1f15b4e143fc 100644 --- a/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/definitions/_edit.html.erb @@ -34,24 +34,3 @@ </div> </div> </draggable> - - - - - <!-- > - <label class="form-label" - :for="'definition-' + index + '-title'"><%= t '.title_label' %></label> - <input class="form-control mb-3" - v-model="definition.title" - placeholder="<%= t '.title_placeholder' %>" - type="text" - :id="'definition-' + index + '-title'" /> - - <label class="form-label" - :for="'definition-' + index + '-text'"><%= t '.text_label' %></label> - <textarea class="form-control mb-3" - rows="3" - v-model="definition.text" - placeholder="<%= t '.text_placeholder' %>" - :id="'definition-' + index + '-text'"></textarea> - <!--> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb index b40f32f6d23a1019c7ebe22c63cae8d110618ce2..bb2013f55cef13188e48c46970514038325b9f7a 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_edit.html.erb @@ -1,4 +1,8 @@ -<% element = @block.template.default_element %> +<div class="row"> + <div class="col-xl-6"> + <%= block_component_edit :description %> + </div> +</div> <%= block_component_add_element t('.add_key') %> @@ -15,13 +19,13 @@ <div class="flex-fill"> <div class="row mb-n3"> <div class="col-lg-2"> - <%= block_component_edit :number, template: element %> + <%= block_component_edit :number, template: @element %> </div> <div class="col-lg-3"> - <%= block_component_edit :unit, template: element %> + <%= block_component_edit :unit, template: @element %> </div> <div class="col-lg-7"> - <%= block_component_edit :description, template: element, rows: 1 %> + <%= block_component_edit :description, template: @element, rows: 1 %> </div> </div> </div> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb index 8f57eb1427a1b1f540d3b6297184a9366e79146e..6a35281aab1f692963be115685ad5950d51affc4 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb @@ -1,3 +1,4 @@ +<%= block_component_preview :description %> <% @block.template.elements.each do |element| %> <p class="lead mb-0"> <b> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb index 6d16ea88e8fcfb4141b5542a508d6710911704ac..dc4978617a768da3f2e0e916a64fba4a7aeae2cf 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_static.html.erb @@ -1,3 +1,4 @@ +<%= block_component_static :description %> figures: <% block.template.elements.each do |element| %> - <%= block_component_static :number, template: element, depth: 0 %> diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb index ca3ff8574000536980a7d23fe2229024507e8765..6f6e48d65f2d8cdad385c0974cf1fae32cfc64a2 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb @@ -5,6 +5,7 @@ <div class="col-xl-6"> <label class="form-label"> </label> <%= block_component_edit :with_link %> + <%= block_component_edit :with_photo %> </div> </div> diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb index f21033a0ddd164c215adc2850f3f528f94261c48..7f29eb08dd3753d5fc93e5fc33d46b842ec8844b 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb @@ -1,5 +1,6 @@ <%= block_component_static :description %> <%= block_component_static :with_link %> +<%= block_component_static :with_photo %> persons: <% block.template.elements.each do |element| %> <% next unless element.person %> diff --git a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb index 0bf1fa482c8cecd76c4ec42e9cd29a19c607b26a..d079fb2f41b93c4be9a80fb87a02bac7e8c34a8f 100644 --- a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb @@ -32,7 +32,7 @@ </div> <div> <a class="btn btn-sm btn-danger ms-3" - v-on:click="data.elements.splice(data.elements.indexOf(partner), 1)" + v-on:click="data.elements.splice(data.elements.indexOf(element), 1)" title="<%= t '.remove_partner' %>"> <i class="fas fa-times"></i> </a> diff --git a/app/views/admin/communication/blocks/templates/timeline/_edit.html.erb b/app/views/admin/communication/blocks/templates/timeline/_edit.html.erb index 8c91bfa11ef8c0b5e599c0458476d6b7906250ed..5d3951c2f2ffa95cfb029c03173d7298ed47f93e 100644 --- a/app/views/admin/communication/blocks/templates/timeline/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/timeline/_edit.html.erb @@ -1,29 +1,31 @@ <%= block_component_edit :layout %> <%= block_component_add_element t('.add_event') %> -<draggable :list="data.elements" handle=".dragHandle" class="row"> - <div v-for="(element, index) in data.elements" class="col-lg-6 col-xl-4"> - <div class="card"> - <div class="card-body"> - <div class="d-flex"> - <div> - <a class="btn ps-0 pt-0 dragHandle"> - <i class="fa fa-bars handle"></i> - </a> - </div> - <div class="flex-fill"> +<draggable :list="data.elements" handle=".dragHandle" class="list-group"> + <div v-for="(element, index) in data.elements" class="list-group-item"> + <div class="d-flex"> + <div> + <a class="btn ps-0 pt-0 dragHandle"> + <i class="fa fa-bars handle"></i> + </a> + </div> + <div class="flex-fill"> + <div class="row mb-n3"> + <div class="col-lg-5"> <%= block_component_edit :title, template: @element %> - <%= block_component_edit :text, template: @element %> </div> - <div> - <a class="btn btn-sm btn-danger ms-3" - v-on:click="data.elements.splice(data.elements.indexOf(element), 1)" - title="<%= t '.remove_event' %>"> - <i class="fas fa-times"></i> - </a> + <div class="col-lg-7"> + <%= block_component_edit :text, template: @element %> </div> </div> </div> + <div> + <a class="btn btn-sm btn-danger ms-3" + v-on:click="data.elements.splice(data.elements.indexOf(element), 1)" + title="<%= t '.remove_event' %>"> + <i class="fas fa-times"></i> + </a> + </div> </div> </div> -</draggable> +</draggable> \ No newline at end of file diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index 8033ce53aecdb494ddc7e9e0f40951c2002a86a6..641abd9c4ab89471a2796dbaf00c701bba52a119 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -28,6 +28,9 @@ </div> </div> <%= render 'admin/communication/blocks/list', about: @page %> + <%= render 'admin/application/dependencies', + git_dependencies: @page.git_dependencies(@page.website), + active_storage_blobs: @page.active_storage_blobs %> </div> <div class="col-md-4"> <%= render 'admin/application/a11y/widget', about: @page %> diff --git a/config/admin_navigation.rb b/config/admin_navigation.rb index 93d2c39705b049c877e776b37f7982d8055e22fb..9d1b22980fff7353f26f65be9f7553a62bb76a0f 100644 --- a/config/admin_navigation.rb +++ b/config/admin_navigation.rb @@ -4,7 +4,9 @@ SimpleNavigation::Configuration.run do |navigation| navigation.highlight_on_subpath = true navigation.selected_class = 'active' navigation.items do |primary| - primary.item :dashboard, t('admin.dashboard'), admin_root_path, { icon: 'tachometer-alt', highlights_on: /admin$/ } + primary.item :dashboard, t('admin.dashboard'), + admin_root_path, + { icon: Icon::DASHBOARD, highlights_on: /admin$/ } if can?(:read, University::Person) || can?(:read, University::Organization) primary.item :university, diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 1d1f2a9ef263f3eb80c6b9fd839a650babdf7553..4715f3fe53e92842188d755e94bfd56a2d1f731b 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -283,6 +283,8 @@ en: label: Description with_link: label: With clickable links to the person's page? + with_photo: + label: With a portrait for each person? element: person: label: Person diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 81ffb0272231bd4c6b2feff5e2e5c410a113bdb8..964ed1199f6693b7fead83cd574d39699b08519c 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -282,7 +282,9 @@ fr: drag_title: Glisser-déposer pour organiser les personnes delete_title: Enlever la personne with_link: - label: Avec des liens cliquables vers les pages des personnes ? + label: Avec des liens cliquables vers les pages des personnes ? + with_photo: + label: Avec un portrait de chaque personne ? description: label: Description element: diff --git a/config/server_navigation.rb b/config/server_navigation.rb index 06113b460e72c3a4dde82d910699efd74c738de9..5aca9b137d03c975282fb8a5b124076821bfb20f 100644 --- a/config/server_navigation.rb +++ b/config/server_navigation.rb @@ -7,7 +7,7 @@ SimpleNavigation::Configuration.run do |navigation| primary.item :dashboard, t('dashboard'), server_root_path, - { icon: 'tachometer-alt', highlights_on: %r{server$} } + { icon: Icon::DASHBOARD, highlights_on: %r{server$} } primary.item :universities, University.model_name.human(count: 2), server_universities_path, { icon: 'university' } if can?(:read, University)