From 01e14a45d8e15065b7c4266cb43e6cd7ec51717d Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Tue, 24 Jun 2025 09:58:19 -0400 Subject: [PATCH 1/2] Update eligibility rules truncation length in containers helper for improved clarity - Adjusted the truncation length of eligibility rules from 100 to 60 characters to enhance readability in the user interface. - Modified the link text to include a space before '...more', improving visual separation and overall presentation of the content. --- app/helpers/containers_helper.rb | 2 +- spec/helpers/containers_helper_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/containers_helper.rb b/app/helpers/containers_helper.rb index ed112856..73e33691 100644 --- a/app/helpers/containers_helper.rb +++ b/app/helpers/containers_helper.rb @@ -16,7 +16,7 @@ def contest_description_action_links(container, description) def render_eligibility_rules(description) eligibility_plain = description.eligibility_rules.to_plain_text - if eligibility_plain.length > 100 + if eligibility_plain.length > 60 content_tag(:div) do truncate(eligibility_plain, length: 60, omission: '') + link_to(' ...more', '#', diff --git a/spec/helpers/containers_helper_spec.rb b/spec/helpers/containers_helper_spec.rb index 45f7ecc0..cff1112a 100644 --- a/spec/helpers/containers_helper_spec.rb +++ b/spec/helpers/containers_helper_spec.rb @@ -48,8 +48,8 @@ end describe "#render_eligibility_rules" do - context "when eligibility rules are longer than 100 characters" do - let(:long_text) { "These are very long eligibility rules that will definitely exceed the 100 character limit and therefore trigger the modal functionality." } + context "when eligibility rules are longer than 60 characters" do + let(:long_text) { "These are very long eligibility rules that will definitely exceed the 60 character limit and therefore trigger the modal functionality." } let(:rich_text) { instance_double(ActionText::RichText, to_plain_text: long_text) } before do @@ -66,10 +66,10 @@ expect(link['data-action']).to eq('click->modal#open') expect(link['data-modal-title']).to eq('Eligibility Rules') expect(link['href']).to eq('#') - expect(link.text).to eq('...more') + expect(link.text).to eq(' ...more') # Check truncated text - expect(parsed_result.text).to include(long_text[0..99]) + expect(parsed_result.text).to include(long_text[0..59]) end end From 7ac215c0b88939c5f0d7104a15608c638f434198 Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Tue, 24 Jun 2025 10:03:32 -0400 Subject: [PATCH 2/2] Update entries summary header for improved clarity - Changed the header text in the entries summary partial to specify "Total Entries in all Active Instances of Active Contests," enhancing clarity and context for users. - This update improves the user interface by providing a more accurate description of the displayed data. --- app/views/containers/_entries_summary.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/containers/_entries_summary.html.erb b/app/views/containers/_entries_summary.html.erb index e11a9b50..77bc2705 100644 --- a/app/views/containers/_entries_summary.html.erb +++ b/app/views/containers/_entries_summary.html.erb @@ -11,7 +11,7 @@
-
Total Entries in all Active Contests: <%= container.total_active_entries %>
+
Total Entries in all Active Instances of Active Contests: <%= container.total_active_entries %>
<% if container.entries_summary.any? %>
Entries by Campus: