diff --git a/.erb_lint.yml b/.erb_lint.yml new file mode 100644 index 0000000000..38a4938bd4 --- /dev/null +++ b/.erb_lint.yml @@ -0,0 +1,68 @@ +--- +# ERB Lint — fills the gap RuboCop leaves: RuboCop only parses .rb, so nothing +# checked the Ruby inside <% %> tags or our ERB/HTML conventions. Follows the +# gem's recommended setup (https://github.com/Shopify/erb_lint): default linters +# stay on, and the Rubocop linter inherits our .rubocop.yml so the Ruby in tags +# is held to the same omakase style as our .rb files — no rules duplicated here. +EnableDefaultLinters: true +# --lint-all globs every *.html.erb under the repo. In CI, `bundler-cache` +# installs gems into vendor/bundle, so without this exclude erb_lint would lint +# third-party gem templates. (RuboCop excludes vendor by default; erb_lint does +# not.) Paths are matched from the repo root. +exclude: + - vendor/**/* + - node_modules/**/* + - tmp/**/* +linters: + # Adding an autocomplete token to each input is a per-field autofill/UX + # decision, not a mechanical fix, so enforcing it across the existing forms is + # out of scope here. Left off deliberately; could be revisited on its own. + RequireInputAutocomplete: + enabled: false + # \ No newline at end of file + diff --git a/app/views/layouts/action_text/contents/_content.html.erb b/app/views/layouts/action_text/contents/_content.html.erb index e6a7b6310d..b379ea31f2 100644 --- a/app/views/layouts/action_text/contents/_content.html.erb +++ b/app/views/layouts/action_text/contents/_content.html.erb @@ -6,7 +6,6 @@ [&_td]:align-top [&_th]:align-top " data-controller="print-options" - data-print-options-images-value="true" -> + data-print-options-images-value="true"> <%= yield %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 61419b6bbd..297a1fd61f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -47,9 +47,9 @@
-
+
<%= "pt-3" unless controller_name == "home" %>"> <%# TODO handle printable area %> -
+
"> <%= render "shared/flash_messages" %> <%= yield %>
@@ -57,7 +57,7 @@
- + <%= render "shared/footer_nav" %> diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index 752966aea9..292939714f 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -5,8 +5,8 @@ xmlns:o="urn:schemas-microsoft-com:office:office"> - - + +
@@ -34,17 +34,17 @@ <% if not @workshop_log_summary_page %>
- <%= f.label 'Reporting for the month of' %> + <%= f.label "Reporting for the month of" %> <%= f.date_select :date, - { discard_day: true, selected: Date.new( @year.to_i, @month.to_i ), use_hidden: true }, + { discard_day: true, selected: Date.new(@year.to_i, @month.to_i), use_hidden: true }, onchange: 'window.location = window.location.toString().split("&month=")[0 + "&month=" + $("#report_date_2i").val() + "&year=" + $("#report_date_1i").val()' %> - <%= f.select(:date, {}, {:include_blank => false}, {:class => "form-control form-control-custom"}) %> + <%= f.select(:date, {}, { include_blank: false }, { class: "form-control form-control-custom" }) %> - <%= render 'workshop_log_summary', f: f, workshop_logs: @workshop_logs %> + <%= render "workshop_log_summary", f: f, workshop_logs: @workshop_logs %> - <%= render 'combined_workshop_log_summary', f: f, workshop_logs: @combined_workshop_logs %> -
+ <%= render "combined_workshop_log_summary", f: f, workshop_logs: @combined_workshop_logs %> +
<% end %>
@@ -57,7 +57,7 @@
<%= f.label "Person" %> - <%= f.text_field :user, disabled: false, value: current_user.name, class:"form-control" %> + <%= f.text_field :user, disabled: false, value: current_user.name, class: "form-control" %> <%= f.hidden_field :created_by_id, value: current_user.id %> <%= f.hidden_field :type %> <%= f.hidden_field :windows_type_id, value: @report.windows_type_id %> @@ -67,13 +67,13 @@
- <%= f.label 'Agency' %> + <%= f.label "Agency" %>
Please contact AWBW if your agency is not listed.
<% agency = @agencies.find_by(windows_type_id: f.object.windows_type.id) %> <%= f.collection_select :organization_id, @agencies, :id, :name, - { selected: agency ? agency.id : nil,class: 'js-agency-select' }, - class:"selectpicker form-control form-control-custom", onchange: "window.location = $.replaceUrlParam(window.location.toString(),'agency_id',$(this).val() )" %> + { selected: agency ? agency.id : nil, class: "js-agency-select" }, + class: "selectpicker form-control form-control-custom", onchange: "window.location = $.replaceUrlParam(window.location.toString(),'agency_id',$(this).val() )" %>
<%= f.hidden_field :owner_id, value: @form_builder.id %> @@ -83,7 +83,7 @@ <% if params[:form_builder_id].to_i == 7 %>
-
@@ -106,12 +105,12 @@ <% end %> - <%= render 'sectorable_items' %> + <%= render "sectorable_items" %>
- +
@@ -120,11 +119,11 @@
<% @report.log_fields.each do |field| %> - <%= render 'shared/form_field', :field => field, :report => @report %> + <%= render "shared/form_field", field: field, report: @report %> <% if field.name == 'Share challenges for this month' || (field.name == 'Anything we can do to help you?' and params[:form_builder_id].to_i == 2) %> -
+
@@ -132,18 +131,18 @@
<% if !@report.quotes.empty? %> <% @report.quotes.each_with_index do |q, i| %> - <%= render 'quote', q: q, index: i %> + <%= render "quote", q: q, index: i %> <% end %> <% else %> - <%= render 'quote', index: 0, q: Quote.new %> + <%= render "quote", index: 0, q: Quote.new %> <% end %>
-
+
<% end %> @@ -164,10 +163,10 @@
<%= f.fields_for :media_files do |files_form| %> - <%= render 'media_file', :f => files_form %> + <%= render "media_file", f: files_form %> <% end %>
@@ -219,7 +218,7 @@ function addQuote() { window.quotesIndex += 1; - $("#quotes").append('<%= j render 'quote', :index => "last-quotes",:q => Quote.new %>'); + $("#quotes").append('<%= j render "quote", index: "last-quotes", q: Quote.new %>'); contentQuotes = document.getElementById("quote-last-quotes").innerHTML.replace(/last-quotes/g, window.quotesIndex); document.getElementById("quote-last-quotes").innerHTML = contentQuotes; @@ -256,9 +255,8 @@ } }); - if ($.urlParam('agency_id') != null){ - $("#report_organization_id").val("<%=params[:agency_id] %>"); + $("#report_organization_id").val("<%= params[:agency_id] %>"); } function validateOptions(event, div_id, input_type) { diff --git a/app/views/monthly_reports/_media_file.html.erb b/app/views/monthly_reports/_media_file.html.erb index 019f5f80e3..e68b18d829 100644 --- a/app/views/monthly_reports/_media_file.html.erb +++ b/app/views/monthly_reports/_media_file.html.erb @@ -1,5 +1,5 @@
-
+
<%= f.label "Upload images and/or media releases" %> @@ -7,7 +7,7 @@
<%= f.label :file, class: "btn btn-primary btn--small" do %> - <%= f.file_field :file, class: ''%> + <%= f.file_field :file, class: "" %> Choose File <% end %> @@ -21,6 +21,6 @@
- <%= link_to_remove_association "Remove Media File", f , class:"btn-underline"%> + <%= link_to_remove_association "Remove Media File", f, class: "btn-underline" %>
diff --git a/app/views/monthly_reports/_monthly_reports_results.html.erb b/app/views/monthly_reports/_monthly_reports_results.html.erb index c5dca513cc..3b60809286 100644 --- a/app/views/monthly_reports/_monthly_reports_results.html.erb +++ b/app/views/monthly_reports/_monthly_reports_results.html.erb @@ -1,6 +1,6 @@ <%= turbo_stream.replace("monthly_reports_count", partial: "monthly_reports_count") %> -
+
"> diff --git a/app/views/monthly_reports/_quote.html.erb b/app/views/monthly_reports/_quote.html.erb index 77e3873348..486e6e7c90 100644 --- a/app/views/monthly_reports/_quote.html.erb +++ b/app/views/monthly_reports/_quote.html.erb @@ -4,7 +4,7 @@
Please write quote in first person Please - consider the safety of participant when disclosing name.
+ consider the safety of participant when disclosing name.
Using a pseudonym or false protective name chosen by participant is a possible option.
@@ -17,7 +17,7 @@
> + <%= "checked" if q.gender == "m" %>>
-
+
<% end %> @@ -96,7 +96,7 @@
-
+
<%= f.label "Upload Images" %> ***If any image includes clients or client artwork, download @@ -106,7 +106,7 @@
<%= f.label :image, class: "btn btn-primary btn--small" do %> - + Choose File <% end %> @@ -121,13 +121,13 @@
-
+
<%= f.label "Upload Form Files" %>
<%= f.label :form_file, class: "btn btn-primary btn--small" do %> - <%= f.file_field :form_file, class: '', id: 'report_form_file'%> + <%= f.file_field :form_file, class: "", id: "report_form_file" %> Choose File <% end %> @@ -151,14 +151,14 @@ <%= f.button :submit, class: "btn btn-primary btn-blue btn-filled" %>
- + <%= render "shared/audit_info", resource: @report %> <% end %> - diff --git a/app/views/resources/_categorizable_item_fields.html.erb b/app/views/resources/_categorizable_item_fields.html.erb index d299bca9bf..cd9c83a0ed 100644 --- a/app/views/resources/_categorizable_item_fields.html.erb +++ b/app/views/resources/_categorizable_item_fields.html.erb @@ -1,3 +1,3 @@ <%= f.check_box :_create %> <%= f.hidden_field :category_id %> -<%= f.label f.object.category.name, class: 'inline' %> \ No newline at end of file +<%= f.label f.object.category.name, class: "inline" %> diff --git a/app/views/resources/_form.html.erb b/app/views/resources/_form.html.erb index ee21d2d789..ef5a793c6b 100644 --- a/app/views/resources/_form.html.erb +++ b/app/views/resources/_form.html.erb @@ -62,7 +62,7 @@
<%= f.input :author_id, as: :select, - collection: f.object.author_person.present? ? [[ f.object.author_person.remote_search_label[:label], f.object.author_person.id ]] : [], + collection: f.object.author_person.present? ? [ [ f.object.author_person.remote_search_label[:label], f.object.author_person.id ] ] : [], selected: f.object.author_person&.id || current_user.person_id, include_blank: "Select an author", label: (f.object.author ? ( @@ -92,7 +92,7 @@
-
+
"> <%= rhino_editor(f, :body, label: "Description") %> <% if f.object.errors[:rhino_body].present? %> @@ -126,8 +126,7 @@ + clip-rule="evenodd"> diff --git a/app/views/resources/_resource_card.html.erb b/app/views/resources/_resource_card.html.erb index 901581b377..bfcdd80646 100644 --- a/app/views/resources/_resource_card.html.erb +++ b/app/views/resources/_resource_card.html.erb @@ -9,8 +9,7 @@ flex flex-row flex-wrap bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md transition-all overflow-hidden - " - > + ">
+ ">
<%= link_to resource_path(resource), @@ -70,7 +68,7 @@ content_tag(:span, "", class: "far fa-edit"), edit_resource_path(resource.object), class: "admin-only bg-blue-100 btn btn-secondary-outline", - data: {turbo_frame: "_top", turbo_prefetch: false } + data: { turbo_frame: "_top", turbo_prefetch: false } ) %> <% end %>
diff --git a/app/views/resources/_resource_icon.html.erb b/app/views/resources/_resource_icon.html.erb index 1fbd0ca394..d236775e39 100644 --- a/app/views/resources/_resource_icon.html.erb +++ b/app/views/resources/_resource_icon.html.erb @@ -7,7 +7,7 @@ sizes = { hero: "w-#{width || "32"} h-#{height || "32"} text-gray-300", gallery: "w-#{width || "18"} h-#{height || "18"} text-gray-300", - index: "w-#{width} h-#{height} shrink-0 overflow-hidden rounded border border-gray-300", + index: "w-#{width} h-#{height} shrink-0 overflow-hidden rounded border border-gray-300" }.fetch(variant) %> @@ -17,109 +17,93 @@ class="<%= sizes %>" fill="none" stroke="currentColor" - viewBox="0 0 24 24" - > + viewBox="0 0 24 24"> + d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.746 0 3.332.477 4.5 1.253v13C19.832 18.477 18.246 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" /> <% when "Template" %> + viewBox="0 0 24 24"> + d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> <% when "Handout" %> + viewBox="0 0 24 24"> + d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> <% when "Scholarship" %> + viewBox="0 0 24 24"> + d="M12 14l9-5-9-5-9 5 9 5z" /> + d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z" /> <% when "Toolkit" %> + viewBox="0 0 24 24"> + d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /> + d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <% when "Form" %> + viewBox="0 0 24 24"> + d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> <% else %> + viewBox="0 0 24 24"> + d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> <% end %> diff --git a/app/views/resources/_search_boxes.html.erb b/app/views/resources/_search_boxes.html.erb index bf24111d7b..85be03b266 100644 --- a/app/views/resources/_search_boxes.html.erb +++ b/app/views/resources/_search_boxes.html.erb @@ -5,7 +5,7 @@ #{ DomainTheme.bg_class_for(:resources, intensity: 700, hover: true) } shadow-md ring-2 ring-indigo-300" %> <%= form_tag resources_path, method: :get, - data: {controller: "collection share-url", + data: { controller: "collection share-url", collection_unselected_class: default_btn, collection_selected_class: selected_btn, turbo_frame: "resources_results" }, diff --git a/app/views/resources/_search_boxes_kinds.html.erb b/app/views/resources/_search_boxes_kinds.html.erb index 9e2e0fbed4..d314626271 100644 --- a/app/views/resources/_search_boxes_kinds.html.erb +++ b/app/views/resources/_search_boxes_kinds.html.erb @@ -14,8 +14,7 @@ px-4 py-2 rounded-lg font-medium text-sm transition-all duration-150 <%= default_btn %> - " - > + "> <%= check_box_tag("kinds[]", name, Array(params[:kinds]).include?(name), id: "kind_#{name}", class: "hidden") %> diff --git a/app/views/resources/editor_lazy.html.erb b/app/views/resources/editor_lazy.html.erb index 214d9d04d8..feaa3c1411 100644 --- a/app/views/resources/editor_lazy.html.erb +++ b/app/views/resources/editor_lazy.html.erb @@ -1,3 +1,3 @@ <%= turbo_frame_tag "editor_assets_lazy" do %> - <%= render 'rich_text_assets/editor', owner: @resource %> + <%= render "rich_text_assets/editor", owner: @resource %> <% end %> diff --git a/app/views/resources/index.html.erb b/app/views/resources/index.html.erb index e944f77863..ecf2a16034 100644 --- a/app/views/resources/index.html.erb +++ b/app/views/resources/index.html.erb @@ -30,7 +30,7 @@ <% result_src = resources_path + "?" + request.query_string %> - <%= turbo_frame_tag :resources_results, src: result_src, autoscroll: "start", data: {turbo: "temporary"} do %> + <%= turbo_frame_tag :resources_results, src: result_src, autoscroll: "start", data: { turbo: "temporary" } do %> <%= render "results_skeleton" %> <% end %>
diff --git a/app/views/resources/latest_news.html.erb b/app/views/resources/latest_news.html.erb index ff036d6764..34cf6f0954 100644 --- a/app/views/resources/latest_news.html.erb +++ b/app/views/resources/latest_news.html.erb @@ -4,7 +4,7 @@
<% if params[:kind] != "Scholarship" %>
Filter By:
- <%= render 'shared/sortable_fields_btn', sortable_fields: @sortable_fields %> + <%= render "shared/sortable_fields_btn", sortable_fields: @sortable_fields %> <% end %>
@@ -18,7 +18,7 @@
-
+
<% if @stories.any? %>
@@ -29,7 +29,7 @@ <% @stories.each do |r| %> - <%= render 'resource', resource: r %> + <%= render "resource", resource: r %> <% end %>
@@ -56,4 +56,4 @@

LALALALA

-
+
diff --git a/app/views/resources/new.html.erb b/app/views/resources/new.html.erb index 334914d043..f370abd794 100644 --- a/app/views/resources/new.html.erb +++ b/app/views/resources/new.html.erb @@ -10,4 +10,4 @@ <%= render "form" %>
-
\ No newline at end of file +
diff --git a/app/views/rich_text_assets/_editor.html.erb b/app/views/rich_text_assets/_editor.html.erb index 8e946258a1..c06450a74f 100644 --- a/app/views/rich_text_assets/_editor.html.erb +++ b/app/views/rich_text_assets/_editor.html.erb @@ -1 +1 @@ -<%= render 'rich_text_assets/form', owner: owner %> +<%= render "rich_text_assets/form", owner: owner %> diff --git a/app/views/rich_text_assets/_form.html.erb b/app/views/rich_text_assets/_form.html.erb index c3ac163e4c..8be6b1c613 100644 --- a/app/views/rich_text_assets/_form.html.erb +++ b/app/views/rich_text_assets/_form.html.erb @@ -7,7 +7,7 @@
<%= render "active_storage/blobs/blob_thumbnail", asset: asset %> - <%= form_with model: asset, data: {turbo_frame: dom_id(asset, "title")} do %> + <%= form_with model: asset, data: { turbo_frame: dom_id(asset, "title") } do %> <%= render "rich_text_assets/title", asset: asset %> <% end %>
diff --git a/app/views/rich_text_assets/_title.html.erb b/app/views/rich_text_assets/_title.html.erb index 16a300d027..41ee70bbe4 100644 --- a/app/views/rich_text_assets/_title.html.erb +++ b/app/views/rich_text_assets/_title.html.erb @@ -1,9 +1,9 @@ -<%= turbo_frame_tag dom_id(asset, "title") do %> +<%= turbo_frame_tag dom_id(asset, "title") do %> <% title = asset.title.present? ? asset.title : "Add title" %> <% classes = asset.title.present? ? "text-white bg-gray-700" : "text-gray-100 bg-gray-500" %> <%= link_to title, edit_rich_text_asset_path(asset), - class:" #{classes} + class: " #{classes} mt-1 block w-24 text-xs rounded px-1.5 py-0.5 text-center truncate diff --git a/app/views/rich_text_assets/edit.html.erb b/app/views/rich_text_assets/edit.html.erb index ece1c5ffa1..43584181ae 100644 --- a/app/views/rich_text_assets/edit.html.erb +++ b/app/views/rich_text_assets/edit.html.erb @@ -3,7 +3,7 @@ <%= turbo_frame_tag dom_id(form.object, "title")do %> <%= form.text_field :title, class: "border border-gray-200 mt-1 p-1 rounded-md w-28", - onblur:"this.form.requestSubmit()", + onblur: "this.form.requestSubmit()", autofocus: true %> <% end %> <% end %> diff --git a/app/views/scholarships/_form.html.erb b/app/views/scholarships/_form.html.erb index 660d2249eb..d41fe08c2a 100644 --- a/app/views/scholarships/_form.html.erb +++ b/app/views/scholarships/_form.html.erb @@ -227,8 +227,7 @@
-
\ No newline at end of file + diff --git a/app/views/shared/_affiliation_organization_buttons.html.erb b/app/views/shared/_affiliation_organization_buttons.html.erb index c6f79a829c..3ecdd695fd 100644 --- a/app/views/shared/_affiliation_organization_buttons.html.erb +++ b/app/views/shared/_affiliation_organization_buttons.html.erb @@ -18,7 +18,7 @@
<% if show_subtitle %> <% titles = org_affiliations.filter_map { |a| a.title.presence }.uniq %> - <% titles = titles.sort_by { |t| [t.downcase.include?("facilitator") ? 0 : 1, t.downcase] } %> + <% titles = titles.sort_by { |t| [ t.downcase.include?("facilitator") ? 0 : 1, t.downcase ] } %> <%= organization_profile_button(organization, subtitle: titles.any? ? titles.join(", ") : nil, data: button_data) %> <% else %> <%= organization_profile_button(organization, data: button_data) %> @@ -29,7 +29,7 @@
<% if show_subtitle %> <% titles = org_affiliations.filter_map { |a| a.title.presence }.uniq %> - <% titles = titles.sort_by { |t| [t.downcase.include?("facilitator") ? 0 : 1, t.downcase] } %> + <% titles = titles.sort_by { |t| [ t.downcase.include?("facilitator") ? 0 : 1, t.downcase ] } %> <%= organization_profile_button(organization, subtitle: titles.any? ? titles.join(", ") : nil, data: button_data, inactive: true) %> <% else %> <%= organization_profile_button(organization, data: button_data, inactive: true) %> diff --git a/app/views/shared/_affiliation_person_buttons.html.erb b/app/views/shared/_affiliation_person_buttons.html.erb index 2942b1a72a..dce0fcc20b 100644 --- a/app/views/shared/_affiliation_person_buttons.html.erb +++ b/app/views/shared/_affiliation_person_buttons.html.erb @@ -6,9 +6,9 @@ <% all_affiliations = affiliations.select { |a| a.person.present? } %> <% active_affiliations = all_affiliations .select { |a| !a.inactive? && (a.end_date.nil? || a.end_date >= Date.current) } - .sort_by { |a| [a.person.first_name.to_s.downcase, a.person.last_name.to_s.downcase] } %> + .sort_by { |a| [ a.person.first_name.to_s.downcase, a.person.last_name.to_s.downcase ] } %> <% inactive_affiliations = include_inactive ? - (all_affiliations - active_affiliations).sort_by { |a| [a.person.first_name.to_s.downcase, a.person.last_name.to_s.downcase] } : [] %> + (all_affiliations - active_affiliations).sort_by { |a| [ a.person.first_name.to_s.downcase, a.person.last_name.to_s.downcase ] } : [] %> <% active_grouped = active_affiliations.group_by(&:person) %> <% inactive_grouped = inactive_affiliations.group_by(&:person) %> <% if active_grouped.any? || inactive_grouped.any? %> @@ -18,7 +18,7 @@
<% if show_subtitle %> <% titles = person_affiliations.filter_map { |a| a.title.presence }.uniq %> - <% titles = titles.sort_by { |t| [t.downcase.include?("facilitator") ? 0 : 1, t.downcase] } %> + <% titles = titles.sort_by { |t| [ t.downcase.include?("facilitator") ? 0 : 1, t.downcase ] } %> <%= person_profile_button(person, subtitle: titles.any? ? titles.join(", ") : nil, data: button_data) %> <% else %> <%= person_profile_button(person, data: button_data) %> @@ -29,7 +29,7 @@
<% if show_subtitle %> <% titles = person_affiliations.filter_map { |a| a.title.presence }.uniq %> - <% titles = titles.sort_by { |t| [t.downcase.include?("facilitator") ? 0 : 1, t.downcase] } %> + <% titles = titles.sort_by { |t| [ t.downcase.include?("facilitator") ? 0 : 1, t.downcase ] } %> <%= person_profile_button(person, subtitle: titles.any? ? titles.join(", ") : nil, data: button_data, inactive: true) %> <% else %> <%= person_profile_button(person, data: button_data, inactive: true) %> diff --git a/app/views/shared/_banner.html.erb b/app/views/shared/_banner.html.erb index d0ec569082..5b251cab0b 100644 --- a/app/views/shared/_banner.html.erb +++ b/app/views/shared/_banner.html.erb @@ -1,2 +1 @@ <%= display_banner %> - diff --git a/app/views/shared/_copy_url.html.erb b/app/views/shared/_copy_url.html.erb index 65ac0f220f..aefd9342ac 100644 --- a/app/views/shared/_copy_url.html.erb +++ b/app/views/shared/_copy_url.html.erb @@ -9,6 +9,5 @@ class=" hidden w-full max-w-md px-3 bg-gray-100 border border-gray-300 rounded font-mono text-sm overflow-x-auto whitespace-nowrap cursor-text - " - > + ">
diff --git a/app/views/shared/_flash_messages.html.erb b/app/views/shared/_flash_messages.html.erb index 71de190fd2..54f90cbd2a 100644 --- a/app/views/shared/_flash_messages.html.erb +++ b/app/views/shared/_flash_messages.html.erb @@ -2,7 +2,7 @@ <%# === Collect manual messages from params === %> <% manual_messages = [] %> <% { notice: params[:notice], alert: params[:alert], info: params[:info], warning: params[:warning], error: params[:error] }.each do |type, msg| %> - <% manual_messages << [type, msg] if msg.present? %> + <% manual_messages << [ type, msg ] if msg.present? %> <% end %> <%# === Collect flash messages === %> @@ -33,7 +33,7 @@ <%# === Detect reset-password–style messages === %> <% persistent = msg.to_s.match?(/reset your password|password instructions|set your password|registration is not complete/i) %> <% timeout = persistent ? 30000 : 4000 %> - <% disable_outside_click = ["alert", "error"].include?(type.to_s) %> + <% disable_outside_click = [ "alert", "error" ].include?(type.to_s) %>
Ruby for Good

- \ No newline at end of file + diff --git a/app/views/shared/_footer_nav.html.erb b/app/views/shared/_footer_nav.html.erb index b8de09b3a3..2d6f4ee007 100644 --- a/app/views/shared/_footer_nav.html.erb +++ b/app/views/shared/_footer_nav.html.erb @@ -5,13 +5,12 @@ - - diff --git a/app/views/shared/_form_field.html.erb b/app/views/shared/_form_field.html.erb index 32be16840e..4ebc3cf46c 100644 --- a/app/views/shared/_form_field.html.erb +++ b/app/views/shared/_form_field.html.erb @@ -28,12 +28,12 @@ " - <%= 'required' if f.required %> + <%= "required" if f.required %> oninvalid="scroll_here(this);" - value="<%= f.answer( report ) %>" + value="<%= f.answer(report) %>" onkeyup="setNumberParticipantsLeft(this);" onmouseover="showToolTip(this);" - data-toggle="tooltip" data-placement="top"/> + data-toggle="tooltip" data-placement="top">
<% end %> @@ -50,9 +50,9 @@ - oninvalid="scroll_here(this);" value="<%= field.answer( report ) %>" - id="<%= field.name.tr(" ", "-").tr("#","") %>"/> + <%= "required" if field.required %> + oninvalid="scroll_here(this);" value="<%= field.answer(report) %>" + id="<%= field.name.tr(" ", "-").tr("#", "") %>">
<% when :textarea %> @@ -63,15 +63,15 @@
<%= field.subtitle %>
- + -<% when :checkbox, :radio %> -
+<% when :checkbox, :radio %> +
" id="<%= field.html_id %>">
- <%= "
".html_safe if field.html_id == 'children_s_ages' && field.form.display_name.include?('Family Workshop Log') %> + <%= "
".html_safe if field.html_id == "children_s_ages" && field.form.display_name.include?("Family Workshop Log") %> <% end %> diff --git a/app/views/shared/_form_image_field.html.erb b/app/views/shared/_form_image_field.html.erb index e9bb300a0e..8fdb84bed4 100644 --- a/app/views/shared/_form_image_field.html.erb +++ b/app/views/shared/_form_image_field.html.erb @@ -27,8 +27,7 @@ file elsif asset.respond_to?(field_name) asset.public_send(field_name) - end -%> + end %> <% blob = file&.attached? ? file.blob : nil %> <% is_image = blob&.image? %> <% is_pdf = blob&.content_type == "application/pdf" %> @@ -56,7 +55,7 @@ <%# ---------- PDF PREVIEW ---------- %> <% elsif is_pdf && file.previewable? %> - <%= image_tag file.preview(resize_to_limit: [300, 300]), + <%= image_tag file.preview(resize_to_limit: [ 300, 300 ]), id: image_dom_id, alt: "#{label} PDF preview", data: { file_preview_target: "preview" }, @@ -83,8 +82,7 @@ link_to(blob.filename.to_s, url_for(file), class: "underline") else "No file selected" - end - %> + end %>
<% end %> diff --git a/app/views/shared/_form_image_fields.html.erb b/app/views/shared/_form_image_fields.html.erb index a5e6b74b86..ad2b998bfd 100644 --- a/app/views/shared/_form_image_fields.html.erb +++ b/app/views/shared/_form_image_fields.html.erb @@ -36,7 +36,6 @@ data-association-insertion-node="this" data-association-insertion-method="append"> - <%# ---- MAIN IMAGE ---- %> <% if include_primary_asset %> <%= f.fields_for :primary_asset do |img| %> @@ -84,7 +83,7 @@ render_options: { locals: { label: "Additional #{gallery_title}", - resource: f.object.gallery_assets.build, + resource: f.object.gallery_assets.build } }, class: "text-blue-600 hover:text-blue-800 font-medium text-sm pr-2 pb-6" %> diff --git a/app/views/shared/_hidden_tag_icon.html.erb b/app/views/shared/_hidden_tag_icon.html.erb index 063fee484e..1265261caa 100644 --- a/app/views/shared/_hidden_tag_icon.html.erb +++ b/app/views/shared/_hidden_tag_icon.html.erb @@ -1,4 +1,4 @@ <%# Closed-eye icon — the same "hidden" glyph used by the password-visibility toggle on the login pages — flagging a tag that's hidden from the public and visible only to admins. %> - + diff --git a/app/views/shared/_loading.html.erb b/app/views/shared/_loading.html.erb index 8bd4ff827d..6370e5d265 100644 --- a/app/views/shared/_loading.html.erb +++ b/app/views/shared/_loading.html.erb @@ -1,3 +1,3 @@
-
\ No newline at end of file +
diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb index a63ecf3142..3d51898084 100644 --- a/app/views/shared/_navbar.html.erb +++ b/app/views/shared/_navbar.html.erb @@ -11,8 +11,7 @@ focus:outline-indigo-500 " data-action="dropdown#toggle" - data-dropdown-payload-param='[{"mobile-menu":"hidden block"}]' - > + data-dropdown-payload-param='[{"mobile-menu":"hidden block"}]'> Open main menu @@ -23,8 +22,7 @@ stroke-width="1.5" data-slot="icon" aria-hidden="true" - class="size-6 in-aria-expanded:hidden" - > + class="size-6 in-aria-expanded:hidden"> @@ -35,8 +33,7 @@ stroke-width="1.5" data-slot="icon" aria-hidden="true" - class="size-6 not-in-aria-expanded:hidden" - > + class="size-6 not-in-aria-expanded:hidden"> @@ -60,8 +57,8 @@ <% unless user_signed_in? %> - <%= link_to "Log In", - new_user_session_path, + <%= link_to "Log In", + new_user_session_path, class: "justify-self-end btn btn-primary-outline bg-white hover:bg-primary hover:border-white" %> <% end %> diff --git a/app/views/shared/_navbar_menu_mobile.html.erb b/app/views/shared/_navbar_menu_mobile.html.erb index abf4f09430..177d6f4f01 100644 --- a/app/views/shared/_navbar_menu_mobile.html.erb +++ b/app/views/shared/_navbar_menu_mobile.html.erb @@ -37,8 +37,7 @@ diff --git a/app/views/shared/_navbar_new_button.html.erb b/app/views/shared/_navbar_new_button.html.erb index 4bd685da6c..77ac4ad3cc 100644 --- a/app/views/shared/_navbar_new_button.html.erb +++ b/app/views/shared/_navbar_new_button.html.erb @@ -9,8 +9,7 @@ focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition cursor-pointer" data-action="dropdown#toggle" - data-dropdown-payload-param='[{"workshop-dropdown":"hidden"}]' - > + data-dropdown-payload-param='[{"workshop-dropdown":"hidden"}]'> + New diff --git a/app/views/shared/_organization_footer.html.erb b/app/views/shared/_organization_footer.html.erb index 63dc37c77e..999acb5315 100644 --- a/app/views/shared/_organization_footer.html.erb +++ b/app/views/shared/_organization_footer.html.erb @@ -2,4 +2,4 @@ A leader in creativity and mental wellness, <%= ENV["ORGANIZATION_NAME"] %> (AWB direct service organizations across the country to incorporate creative expression into their work with trauma survivors. AWBW’s training in facilitating art as a tool for transformation and healing, along with our library of curriculum and ongoing support, strengthens our program partners’ ability to -assist the individuals and communities they serve. \ No newline at end of file +assist the individuals and communities they serve. diff --git a/app/views/shared/_report_form_field_answers.html.erb b/app/views/shared/_report_form_field_answers.html.erb index 80dc6379da..f5ef30ab48 100644 --- a/app/views/shared/_report_form_field_answers.html.erb +++ b/app/views/shared/_report_form_field_answers.html.erb @@ -26,11 +26,11 @@ <% log_field.answer_options.each do |answer_option| %> <% next if answers.include?("#{answer_option.id}-#{log_field.id}") %> <% answers.push("#{answer_option.id}-#{log_field.id}") %> - <%= form.send(log_field.form_helper_type, :_create, 1, onclick: 'deselectCheckboxesIfSelected($(this));', class: "js-answer-button-radio-#{log_field.id}", id: "js-answer-button-radio-#{answer_option.id}", data: { log_field_id: log_field.id }, checked: log_field.checked(@old_report, answer_option.name)) %> + <%= form.send(log_field.form_helper_type, :_create, 1, onclick: "deselectCheckboxesIfSelected($(this));", class: "js-answer-button-radio-#{log_field.id}", id: "js-answer-button-radio-#{answer_option.id}", data: { log_field_id: log_field.id }, checked: log_field.checked(@old_report, answer_option.name)) %> <%= hidden_field({}, :answer_option_id, value: answer_option.id) %> <% label_txt = answer_option.name.titleize %> - <% style = 'text-transform: uppercase;' if label_txt.downcase == 'lgbtqia' %> - <%= form.label label_txt, class: 'inline', style: style unless answer_option.name.empty? %> + <% style = "text-transform: uppercase;" if label_txt.downcase == "lgbtqia" %> + <%= form.label label_txt, class: "inline", style: style unless answer_option.name.empty? %> <% end %> <% else %> @@ -52,7 +52,7 @@ <% if log_field.name == 'Share challenges for this month' || (log_field.name == 'Anything we can do to help you?' and params[:form_builder_id].to_i == 2) %> -
+
@@ -60,20 +60,20 @@
<% if !@report.quotes.empty? %> <% @report.quotes.each_with_index do |q, i| %> - <%= render 'quote', q: q, index: i %> + <%= render "quote", q: q, index: i %> <% end %> <% else %> - <%= render 'quote', index: 0, q: Quote.new %> + <%= render "quote", index: 0, q: Quote.new %> <% end %>
Add another Quote
-
+
- <%= render 'sectorable_items' %> + <%= render "sectorable_items" %> <% end %> <% end %> @@ -103,7 +103,6 @@ } } - $(function() { if(window.location.pathname.includes('workshop_log') == false && window.location.search.includes('form_builder_id=5') == false) { $( "input[class*=on-going]" ).val(<%= @total_ongoing %>).prop('readonly', true) @@ -114,11 +113,10 @@ //]]> -