From 084b8c728c7c86d215ec41f416f110d51db6407f Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 21 Jun 2022 09:57:48 +0200 Subject: [PATCH] FIX --- .../blocks/components/_edit.html.erb | 2 +- .../blocks/components/boolean/_edit.html.erb | 6 ++++-- .../blocks/components/layout/_edit.html.erb | 8 ++------ .../blocks/components/rich_text/_edit.html.erb | 4 +++- .../blocks/components/string/_edit.html.erb | 4 +++- .../blocks/components/text/_edit.html.erb | 4 +++- .../blocks/templates/gallery/_edit.html.erb | 2 +- .../blocks/templates/testimonials/_edit.html.erb | 2 +- lib/tasks/app.rake | 16 ++++++++-------- 9 files changed, 26 insertions(+), 22 deletions(-) diff --git a/app/views/admin/communication/blocks/components/_edit.html.erb b/app/views/admin/communication/blocks/components/_edit.html.erb index e65d331ef..cb20d4e05 100644 --- a/app/views/admin/communication/blocks/components/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/_edit.html.erb @@ -6,7 +6,7 @@ template ||= @block.template root_template = template == @block.template if root_template model = 'data' - dom_id = "#{property}" + dom_id = "'#{property}'" i18n_component = "#{i18n}.#{property}" else # Nested element diff --git a/app/views/admin/communication/blocks/components/boolean/_edit.html.erb b/app/views/admin/communication/blocks/components/boolean/_edit.html.erb index 3fddcf14c..baf464e4a 100644 --- a/app/views/admin/communication/blocks/components/boolean/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/boolean/_edit.html.erb @@ -1,9 +1,11 @@ <div class="form-check"> - <input :id="'<%= dom_id.html_safe %>'" + <input :id="<%= dom_id.html_safe %>" class="form-check-input" v-model="<%= model %>.<%= property %>" type="checkbox" /> - <label class="form-label" aria-label="<%= label %>" :for="'<%= dom_id.html_safe %>'"> + <label class="form-label" + aria-label="<%= label %>" + :for="<%= dom_id.html_safe %>"> <%= label %> </label> </div> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/components/layout/_edit.html.erb b/app/views/admin/communication/blocks/components/layout/_edit.html.erb index 78cd4b0bf..9696f5759 100644 --- a/app/views/admin/communication/blocks/components/layout/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/layout/_edit.html.erb @@ -22,13 +22,9 @@ layouts = template.class.layouts v-model="data.layout" value="<%= layout %>" id="layout-<%= layout %>"> - <h3 class="h4"> - <%= name %> - </h3> + <h3 class="h4"><%= name %></h3> </div> - <p> - <%= description %> - </p> + <p><%= description %></p> </div> </div> <div class="col-4 col-xxl-6"> diff --git a/app/views/admin/communication/blocks/components/rich_text/_edit.html.erb b/app/views/admin/communication/blocks/components/rich_text/_edit.html.erb index 14f5c00f5..a90649c19 100644 --- a/app/views/admin/communication/blocks/components/rich_text/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/rich_text/_edit.html.erb @@ -1,4 +1,6 @@ -<label class="form-label" aria-label="<%= label %>" :for="<%= dom_id.html_safe %>"> +<label class="form-label" + aria-label="<%= label %>" + :for="<%= dom_id.html_safe %>"> <%= label %> </label> <div class="summernote mb-3"> diff --git a/app/views/admin/communication/blocks/components/string/_edit.html.erb b/app/views/admin/communication/blocks/components/string/_edit.html.erb index 619fb817f..40d8d0c09 100644 --- a/app/views/admin/communication/blocks/components/string/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/string/_edit.html.erb @@ -1,4 +1,6 @@ -<label class="form-label" aria-label="<%= label %>" :for="<%= dom_id.html_safe %>"> +<label class="form-label" + aria-label="<%= label %>" + :for="<%= dom_id.html_safe %>"> <%= label%> </label> <input :id="<%= dom_id.html_safe %>" diff --git a/app/views/admin/communication/blocks/components/text/_edit.html.erb b/app/views/admin/communication/blocks/components/text/_edit.html.erb index 378a26d41..50ebcecdd 100644 --- a/app/views/admin/communication/blocks/components/text/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/text/_edit.html.erb @@ -1,6 +1,8 @@ <% rows ||= 3 %> -<label class="form-label" aria-label="<%= label %>" :for="<%= dom_id.html_safe %>"> +<label class="form-label" + aria-label="<%= label %>" + :for="<%= dom_id.html_safe %>"> <%= label %> </label> <textarea :id="<%= dom_id.html_safe %>" diff --git a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb index 369dc350c..b54404c6c 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -26,7 +26,7 @@ </div> <div class="card-body"> <div class="flex-fill"> - <div class="row"> + <div class="row mb-n3"> <div class="col-lg-6"> <%= block_component_edit :image, template: @element, diff --git a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb index a485b6458..2776eed68 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb @@ -11,7 +11,7 @@ </a> </div> <div class="flex-fill"> - <div class="row"> + <div class="row mb-n3"> <div class="col-lg-4"> <%= block_component_edit :text, template: element %> </div> diff --git a/lib/tasks/app.rake b/lib/tasks/app.rake index 1dda42bfe..aa82f358b 100644 --- a/lib/tasks/app.rake +++ b/lib/tasks/app.rake @@ -8,15 +8,15 @@ namespace :app do desc 'Fix things' task fix: :environment do - University::Person.find_each do |person| - person.is_author = person.communication_website_posts.any? - person.save - end + # University::Person.find_each do |person| + # person.is_author = person.communication_website_posts.any? + # person.save + # end - Communication::Website::Page.where("header_text ILIKE ?", "%<p>%").find_each { |page| - clean_header_text = ActionController::Base.helpers.strip_tags(page.header_text) - page.update(header_text: clean_header_text) - } + # Communication::Website::Page.where("header_text ILIKE ?", "%<p>%").find_each { |page| + # clean_header_text = ActionController::Base.helpers.strip_tags(page.header_text) + # page.update(header_text: clean_header_text) + # } BlocksMigration.cleanup end -- GitLab