diff --git a/Gemfile.lock b/Gemfile.lock index af067243..c88c0ad5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -273,9 +273,9 @@ GEM net-protocol net-ssh (7.2.3) nio4r (2.7.3) - nokogiri (1.18.4-arm64-darwin) + nokogiri (1.18.8-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.4-x86_64-linux-gnu) + nokogiri (1.18.8-x86_64-linux-gnu) racc (~> 1.4) omniauth (2.1.3) hashie (>= 3.4.6) diff --git a/app/assets/images/U-M_Logo.svg b/app/assets/images/U-M_Logo.svg new file mode 100644 index 00000000..23e07342 --- /dev/null +++ b/app/assets/images/U-M_Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index a0ef06f5..096baaa8 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,8 +1,16 @@ # frozen_string_literal: true class ApplicationMailer < ActionMailer::Base - prepend_view_path 'app/views/mailers' - default from: Rails.application.credentials.dig(:sendgrid, :mailer_sender), - reply_to: 'lsa-evaluate-support@umich.edu' + default from: "University of Michigan - LSA Evaluate <#{Rails.application.credentials.dig(:sendgrid, :mailer_sender)}>", + reply_to: 'LSA Evaluate Support ' + layout 'mailer' + + before_action :attach_logo + + private + + def attach_logo + attachments.inline['U-M_Logo.svg'] = File.read(Rails.root.join('app/assets/images/U-M_Logo.svg')) + end end diff --git a/app/views/containers/_container_detail.html.erb b/app/views/containers/_container_detail.html.erb index 952d0387..5698d7c3 100644 --- a/app/views/containers/_container_detail.html.erb +++ b/app/views/containers/_container_detail.html.erb @@ -9,7 +9,7 @@
<%= link_to edit_container_path(@container), class: "btn btn-sm btn-outline-primary me-2" do %> - Edit + Edit Collection <% end %>
<% end %> diff --git a/app/views/containers/_contest_descriptions_table.html.erb b/app/views/containers/_contest_descriptions_table.html.erb index 8e93b434..69cb9ca0 100644 --- a/app/views/containers/_contest_descriptions_table.html.erb +++ b/app/views/containers/_contest_descriptions_table.html.erb @@ -28,14 +28,14 @@ <%= boolean_to_yes_no(description.active) %> -
+
<% contest_description_action_links(container, description).each do |action, config| %> <%= link_to config[:path], class: 'd-block', data: config[:data]&.merge('bs-toggle': 'tooltip'), title: config[:title], aria: { label: config[:title] } do %> - + <%= config[:title] %> <% end %> <% end %> diff --git a/app/views/containers/show.html.erb b/app/views/containers/show.html.erb index 49c06f62..fc499a13 100644 --- a/app/views/containers/show.html.erb +++ b/app/views/containers/show.html.erb @@ -25,7 +25,7 @@ <%= render partial: "containers/assignments_table", locals: { container: @container, assignments: @assignments } %> <% end %> -

Add New Permission

+

Add New Permission

<%= turbo_frame_tag "new_assignment" do %> <%= render partial: 'containers/assignment_form', locals: { container: @container, assignment: @assignment } %> <% end %> diff --git a/app/views/contest_instances/_judging_results.html.erb b/app/views/contest_instances/_judging_results.html.erb index 28331c5d..61d17f0e 100644 --- a/app/views/contest_instances/_judging_results.html.erb +++ b/app/views/contest_instances/_judging_results.html.erb @@ -15,9 +15,9 @@ @contest_instance, round_id: round.id ), - class: "btn btn-sm btn-info me-3", + class: "btn btn-sm btn-outline-primary me-3", disabled: !round.complete? do %> - + Email round <%= round.round_number %> results <% end %>
@@ -28,7 +28,7 @@ data-bs-placement="top" title="Number of times emails have been sent for this round"> - Emails sent: <%= round.emails_sent_count %> time<%= 's' if round.emails_sent_count > 1 %> + Emails sent: <%= pluralize(round.emails_sent_count, 'time') %> <% end %>
diff --git a/app/views/contest_instances/index.html.erb b/app/views/contest_instances/index.html.erb index 7cf60b20..274efe7b 100644 --- a/app/views/contest_instances/index.html.erb +++ b/app/views/contest_instances/index.html.erb @@ -27,8 +27,9 @@ <%= @contest_description.notes %>
- <%= link_to "Edit", edit_container_contest_description_path(@container, @contest_description), class: "btn btn-sm btn-primary" %> - <%= link_to "Archive", container_contest_description_path(@container, @contest_description), data: { controller: 'confirm', confirm_message_value: 'Are you sure you want to archive this?' } %> + <%= link_to edit_container_contest_description_path(@container, @contest_description), class: "btn btn-sm btn-outline-primary me-2" do %> + Edit Contest + <% end %>

<%= "#{pluralize(@contest_instances.count, "instance")} of this contest" %>

@@ -110,13 +111,13 @@ <%= contest_instance.require_campus_employment_info %> <%= contest_instance.require_finaid_info %> -
+
<%= link_to container_contest_description_contest_instance_path(@container, @contest_description, contest_instance), class: 'd-block', data: { 'bs-toggle': 'tooltip' }, title: 'View instance', aria: { label: 'View instance' } do %> - + View instance <% end %> <%= link_to edit_container_contest_description_contest_instance_path(@container, @contest_description, contest_instance), @@ -124,7 +125,7 @@ data: { 'bs-toggle': 'tooltip' }, title: 'Edit instance', aria: { label: 'Edit instance' } do %> - + Edit instance <% end %> diff --git a/app/views/contest_instances/show.html.erb b/app/views/contest_instances/show.html.erb index 8c9b7879..de8302ea 100644 --- a/app/views/contest_instances/show.html.erb +++ b/app/views/contest_instances/show.html.erb @@ -21,7 +21,7 @@
<%= link_to edit_container_contest_description_contest_instance_path(@container, @contest_description, @contest_instance), class: "btn btn-sm btn-outline-primary me-2" do %> - Edit + Edit Instance <% end %>
<% end %> diff --git a/app/views/judging_rounds/edit.html.erb b/app/views/judging_rounds/edit.html.erb index 55c602d0..89ba2331 100644 --- a/app/views/judging_rounds/edit.html.erb +++ b/app/views/judging_rounds/edit.html.erb @@ -70,6 +70,13 @@

Comment Requirements

+
+
+ <% if (content = render_editable_content('judging_rounds', 'comment_interface_behavior')) %> + <%= content %> + <% end %> +
+
diff --git a/app/views/judging_rounds/new.html.erb b/app/views/judging_rounds/new.html.erb index 94ec7136..3aa32f13 100644 --- a/app/views/judging_rounds/new.html.erb +++ b/app/views/judging_rounds/new.html.erb @@ -52,6 +52,13 @@

Comment Requirements

+
+
+ <% if (content = render_editable_content('judging_rounds', 'comment_interface_behavior')) %> + <%= content %> + <% end %> +
+
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index b77e8118..fe526d4b 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -20,6 +20,9 @@ } .logo { max-width: 150px; + width: 100px; + height: auto; + margin-bottom: 15px; } h1, h2, h3 { color: #1a5a96; @@ -72,6 +75,19 @@ - <%= yield %> +
+
+

<%= image_tag attachments['U-M_Logo.svg'].url, alt: "University of Michigan Logo", class: "logo" %>LSA Evaluate

+
+ +
+ <%= yield %> +
+ + +
diff --git a/app/views/results_mailer/entry_evaluation_notification.html.erb b/app/views/results_mailer/entry_evaluation_notification.html.erb index b7b7eaaa..c636964c 100644 --- a/app/views/results_mailer/entry_evaluation_notification.html.erb +++ b/app/views/results_mailer/entry_evaluation_notification.html.erb @@ -1,4 +1,4 @@ -
+

<%= @contest_description.name %>

@@ -62,11 +62,6 @@

We value your creativity and hope you found this competition to be a rewarding experience. Your participation contributes to the vibrant artistic and academic community at our university.

<% if @contact_email.present? %> -

If you have any questions about the judging process or results, please contact <%= @contact_email %>.

+

If you have any questions about the judging process or results, please contact <%= mail_to @contact_email, @contact_email %>.

<% end %> - -
diff --git a/db/seeds.rb b/db/seeds.rb index 9c189f99..4cd72164 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -61,7 +61,9 @@ { page: "round_judge_assignments", section: "instructions", content: ActionText::RichText.new(body: "Instructions for the round_judge_assignments") }, { page: "judging_assignments", section: "round_specific_instructions", - content: ActionText::RichText.new(body: "Instructions for the round_specific_instructions") } + content: ActionText::RichText.new(body: "Instructions for the round_specific_instructions") }, + { page: "judging_rounds", section: "comment_interface_behavior", + content: ActionText::RichText.new(body: "Instructions for the comment_interface_behavior") } ]) # Seed data for School diff --git a/test/mailers/previews/custom_devise_mailer_preview.rb b/test/mailers/previews/custom_devise_mailer_preview.rb new file mode 100644 index 00000000..1789ecc0 --- /dev/null +++ b/test/mailers/previews/custom_devise_mailer_preview.rb @@ -0,0 +1,11 @@ +class CustomDeviseMailerPreview < ActionMailer::Preview + def password_change + user = User.first || User.create!( + email: 'test@example.com', + password: 'password123', + first_name: 'Test', + last_name: 'User' + ) + CustomDeviseMailer.password_change(user) + end +end diff --git a/test/mailers/previews/results_mailer_preview.rb b/test/mailers/previews/results_mailer_preview.rb new file mode 100644 index 00000000..754c3da6 --- /dev/null +++ b/test/mailers/previews/results_mailer_preview.rb @@ -0,0 +1,60 @@ +class ResultsMailerPreview < ActionMailer::Preview + def entry_evaluation_notification + # Create sample data for preview + entry = Entry.first || create_sample_entry + round = JudgingRound.first || create_sample_round + + ResultsMailer.entry_evaluation_notification(entry, round) + end + + private + + def create_sample_entry + Entry.create!( + title: "Sample Entry", + profile: Profile.first || create_sample_profile, + contest_instance: ContestInstance.first || create_sample_contest_instance + ) + end + + def create_sample_profile + Profile.create!( + user: User.first || create_sample_user + ) + end + + def create_sample_user + User.create!( + email: "sample@example.com", + password: "password123", + first_name: "Sample", + last_name: "User" + ) + end + + def create_sample_contest_instance + ContestInstance.create!( + contest_description: ContestDescription.first || create_sample_contest_description + ) + end + + def create_sample_contest_description + ContestDescription.create!( + name: "Sample Contest", + container: Container.first || create_sample_container + ) + end + + def create_sample_container + Container.create!( + name: "Sample Container", + contact_email: "contests@example.com" + ) + end + + def create_sample_round + JudgingRound.create!( + name: "Sample Round" + ) + end +end diff --git a/test/mailers/previews/test_mailer_preview.rb b/test/mailers/previews/test_mailer_preview.rb new file mode 100644 index 00000000..f3d26401 --- /dev/null +++ b/test/mailers/previews/test_mailer_preview.rb @@ -0,0 +1,5 @@ +class TestMailerPreview < ActionMailer::Preview + def test_email + TestMailer.test_email('test@example.com') + end +end