Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
901f972
Bump nokogiri in the bundler group across 1 directory
dependabot[bot] Apr 22, 2025
596005a
Merge pull request #115 from lsa-mis/dependabot/bundler/bundler-8bcba…
rsmoke Apr 22, 2025
28f4805
Add U-M logo SVG asset to application
rsmoke Apr 22, 2025
7ac9bd7
Enhance mailer layout with U-M branding and structured content
rsmoke Apr 22, 2025
afc12fc
Update ApplicationMailer to include U-M branding and inline logo atta…
rsmoke Apr 22, 2025
316ce7d
Add mailer previews for CustomDeviseMailer, ResultsMailer, and TestMa…
rsmoke Apr 22, 2025
5fc7872
Update entry evaluation notification email template for improved cont…
rsmoke Apr 22, 2025
80024eb
Merge branch 'staging' of github.com:lsa-mis/lsa_evaluate into staging
rsmoke Apr 22, 2025
478d16f
Update container detail view to clarify action label
rsmoke Apr 22, 2025
54c130a
Refactor contest descriptions table layout for improved action link p…
rsmoke Apr 22, 2025
4f34339
Update permission section header in container detail view for improve…
rsmoke Apr 22, 2025
44c9891
Update judging results view for improved button styling and email cou…
rsmoke Apr 22, 2025
4ccd247
Refactor contest instances index view for improved button styling and…
rsmoke Apr 22, 2025
6ac5a48
Update edit button label in contest instance view for improved clarity
rsmoke Apr 22, 2025
cf9073d
Add judge interface information to comment requirements in edit and n…
rsmoke Apr 22, 2025
719eb99
Merge pull request #116 from lsa-mis/update_container_show
rsmoke Apr 22, 2025
4236d57
Refactor comment requirements section in edit and new views to use re…
rsmoke Apr 28, 2025
992fdcd
Add instructions for comment interface behavior in seed data
rsmoke Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/assets/images/U-M_Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -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 <lsa-evaluate-support@umich.edu>'

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
2 changes: 1 addition & 1 deletion app/views/containers/_container_detail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="container-actions">
<%= link_to edit_container_path(@container),
class: "btn btn-sm btn-outline-primary me-2" do %>
<i class="bi bi-pencil-square me-1"></i> Edit
<i class="bi bi-pencil-square me-1"></i> Edit Collection
<% end %>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/containers/_contest_descriptions_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
</td>
<td><%= boolean_to_yes_no(description.active) %></td>
<td class="text-center">
<div class="d-flex flex-column">
<div class="d-flex flex-row">
<% 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 %>
<i class="bi bi-<%= config[:icon] %>" style="font-size: 1.5rem;" aria-hidden="true"></i>
<i class="bi bi-<%= config[:icon] %> fs-4 text-um-blue" aria-hidden="true"></i>
<span class="visually-hidden"><%= config[:title] %></span>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/containers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<%= render partial: "containers/assignments_table", locals: { container: @container, assignments: @assignments } %>
<% end %>

<h3 class="mt-4">Add New Permission</h3>
<h4 class="mt-4">Add New Permission</h4>
<%= turbo_frame_tag "new_assignment" do %>
<%= render partial: 'containers/assignment_form', locals: { container: @container, assignment: @assignment } %>
<% end %>
6 changes: 3 additions & 3 deletions app/views/contest_instances/_judging_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
<i class="bi bi-envelope text-white"></i>
<i class="bi bi-envelope text-um-blue"></i>
Email round <%= round.round_number %> results
<% end %>
</div>
Expand All @@ -28,7 +28,7 @@
data-bs-placement="top"
title="Number of times emails have been sent for this round">
<i class="bi bi-envelope-check me-1"></i>
Emails sent: <%= round.emails_sent_count %> time<%= 's' if round.emails_sent_count > 1 %>
Emails sent: <%= pluralize(round.emails_sent_count, 'time') %>
</span>
<% end %>
</div>
Expand Down
11 changes: 6 additions & 5 deletions app/views/contest_instances/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
<%= @contest_description.notes %>
</div>
<div>
<%= 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 %>
<i class="bi bi-pencil-square me-1"></i> Edit Contest
<% end %>
</div>
<hr>
<h2><%= "#{pluralize(@contest_instances.count, "instance")} of this contest" %></h2>
Expand Down Expand Up @@ -110,21 +111,21 @@
<td><%= contest_instance.require_campus_employment_info %></td>
<td><%= contest_instance.require_finaid_info %></td>
<td class="text-center">
<div class="d-flex flex-column">
<div class="d-flex flex-row">
<%= 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 %>
<i class="bi bi-eye" style="font-size: 1.5rem;" aria-hidden="true"></i>
<i class="bi bi-eye fs-4 text-um-blue" aria-hidden="true"></i>
<span class="visually-hidden">View instance</span>
<% end %>
<%= link_to edit_container_contest_description_contest_instance_path(@container, @contest_description, contest_instance),
class: 'd-block',
data: { 'bs-toggle': 'tooltip' },
title: 'Edit instance',
aria: { label: 'Edit instance' } do %>
<i class="bi bi-pencil" style="font-size: 1.5rem;" aria-hidden="true"></i>
<i class="bi bi-pencil fs-4 text-um-blue" aria-hidden="true"></i>
<span class="visually-hidden">Edit instance</span>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/contest_instances/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="mb-2">
<%= link_to edit_container_contest_description_contest_instance_path(@container, @contest_description, @contest_instance),
class: "btn btn-sm btn-outline-primary me-2" do %>
<i class="bi bi-pencil-square me-1"></i> Edit
<i class="bi bi-pencil-square me-1"></i> Edit Instance
<% end %>
</div>
<% end %>
Expand Down
7 changes: 7 additions & 0 deletions app/views/judging_rounds/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
</div>

<h3 class="mt-4">Comment Requirements</h3>
<div class="card mb-4">
<div class="card-body">
<% if (content = render_editable_content('judging_rounds', 'comment_interface_behavior')) %>
<%= content %>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
Expand Down
7 changes: 7 additions & 0 deletions app/views/judging_rounds/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
</div>

<h3 class="mt-4">Comment Requirements</h3>
<div class="card mb-4">
<div class="card-body">
<% if (content = render_editable_content('judging_rounds', 'comment_interface_behavior')) %>
<%= content %>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
Expand Down
18 changes: 17 additions & 1 deletion app/views/layouts/mailer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
}
.logo {
max-width: 150px;
width: 100px;
height: auto;
margin-bottom: 15px;
}
h1, h2, h3 {
color: #1a5a96;
Expand Down Expand Up @@ -72,6 +75,19 @@
</head>

<body>
<%= yield %>
<div class="container">
<div class="header">
<h1 style="display: flex; align-items: center;"><%= image_tag attachments['U-M_Logo.svg'].url, alt: "University of Michigan Logo", class: "logo" %><span style="margin-left: 20px;">LSA Evaluate</span></h1>
</div>

<div class="content">
<%= yield %>
</div>

<div class="footer">
<p>This is an automated email. Please do not reply to this message.</p>
<p>&copy; <%= Time.now.year %> | <%= link_to 'The Regents of the University of Michigan', 'https://regents.umich.edu' %></p>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="container">
<div>
<div class="header">
<h1><%= @contest_description.name %></h1>
</div>
Expand Down Expand Up @@ -62,11 +62,6 @@
<p>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.</p>

<% if @contact_email.present? %>
<p>If you have any questions about the judging process or results, please contact <%= @contact_email %>.</p>
<p>If you have any questions about the judging process or results, please contact <%= mail_to @contact_email, @contact_email %>.</p>
<% end %>

<div class="footer">
<p>This is an automated email. Please do not reply to this message.</p>
<p>&copy; <%= Time.now.year %> <%= @container.name %> | All Rights Reserved</p>
</div>
</div>
4 changes: 3 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions test/mailers/previews/custom_devise_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -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
60 changes: 60 additions & 0 deletions test/mailers/previews/results_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions test/mailers/previews/test_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class TestMailerPreview < ActionMailer::Preview
def test_email
TestMailer.test_email('test@example.com')
end
end