diff --git a/app/assets/stylesheets/articles.scss b/app/assets/stylesheets/articles.scss index c7707ea01..28678aabf 100644 --- a/app/assets/stylesheets/articles.scss +++ b/app/assets/stylesheets/articles.scss @@ -1325,9 +1325,6 @@ width: 98%; min-height: 35px; border-radius: 8px; - &.partner-image-dark-mode { - display: none; - } } .sponsor-tagline { margin: 10px auto; diff --git a/app/assets/stylesheets/variables.scss b/app/assets/stylesheets/variables.scss index 918967215..bb1adcdc7 100644 --- a/app/assets/stylesheets/variables.scss +++ b/app/assets/stylesheets/variables.scss @@ -35,6 +35,10 @@ $bold-shadow: 1px 1px 0px darken($light-medium-gray, 10%); $ease-in-cubic : cubic-bezier(0.55, 0.055, 0.675, 0.19); $ease-out-cubic : cubic-bezier(0.215, 0.61, 0.355, 1); +.partner-image-dark-mode { + display: none !important; +} + body.night-theme { .on-page-nav-butt img, .icon-img, .dropdown-icon, .reaction-button:not(.reacted) img, .image-upload-button button, .icon-image, .dev-badge, .chatchannels__config img, .external-link-img, .group-img { diff --git a/app/controllers/partnerships_controller.rb b/app/controllers/partnerships_controller.rb index fc559963b..039d523b0 100644 --- a/app/controllers/partnerships_controller.rb +++ b/app/controllers/partnerships_controller.rb @@ -60,7 +60,10 @@ class PartnershipsController < ApplicationController status: :pending, expires_at: expires_at } - create_params[:sponsorable] = sponsorable if sponsorable + if sponsorable + create_params[:sponsorable] = sponsorable + create_params[:expires_at] = 1.month.from_now + end if sponsorship_params[:instructions] create_params[:instructions] = sponsorship_params[:instructions] diff --git a/app/views/articles/_single_sponsor.html.erb b/app/views/articles/_single_sponsor.html.erb index 45a454a5a..3f94bc316 100644 --- a/app/views/articles/_single_sponsor.html.erb +++ b/app/views/articles/_single_sponsor.html.erb @@ -5,7 +5,7 @@ <%= organization.name %> logo <% end %> - <% if @tag_model.sponsorship && @tag_model.sponsorship.status == "live" %> + <% if @tag_model.sponsorship && @tag_model.sponsorship.status == "live" && @tag_model.sponsorship.expires_at > Time.current %>

<%= @tag %> is sponsored by

diff --git a/app/views/pages/_sponsor_image.html.erb b/app/views/pages/_sponsor_image.html.erb new file mode 100644 index 000000000..6dc250347 --- /dev/null +++ b/app/views/pages/_sponsor_image.html.erb @@ -0,0 +1,2 @@ +<%= sponsorship.organization.name %> logo +<%= sponsorship.organization.name %> logo diff --git a/app/views/pages/sponsors.html.erb b/app/views/pages/sponsors.html.erb index 176c4b206..74deb8010 100644 --- a/app/views/pages/sponsors.html.erb +++ b/app/views/pages/sponsors.html.erb @@ -35,8 +35,8 @@ " alt="golden badge">
- <% Sponsorship.gold.includes(:organization).order(featured_number: :asc).each do |sponsorship| %> - + <% Sponsorship.gold.live.includes(:organization).order(featured_number: :asc).each do |sponsorship| %> + <%= render "sponsor_image", sponsorship: sponsorship %>

<%= sponsorship.blurb_html&.html_safe %>

@@ -50,8 +50,8 @@ " alt="silver badge">
- <% Sponsorship.silver.includes(:organization).order(featured_number: :asc).each do |sponsorship| %> - + <% Sponsorship.where(status: "live", level: "silver").where("expires_at > ?", Time.current).includes(:organization).order(featured_number: :asc).each do |sponsorship| %> + <%= render "sponsor_image", sponsorship: sponsorship %>

<%= sponsorship.blurb_html&.html_safe %>

@@ -65,8 +65,8 @@ " alt="bronze badge">
- <% Sponsorship.bronze.includes(:organization).order(featured_number: :asc).find_each do |sponsorship| %> - + <% Sponsorship.bronze.live.where("expires_at > ?", Time.current).includes(:organization).order(featured_number: :asc).find_each do |sponsorship| %> + <%= render "sponsor_image", sponsorship: sponsorship %>
<% end %>
diff --git a/app/views/partnerships/_tag_sponsor_copy.html.erb b/app/views/partnerships/_tag_sponsor_copy.html.erb index 975f77240..08cc6b971 100644 --- a/app/views/partnerships/_tag_sponsor_copy.html.erb +++ b/app/views/partnerships/_tag_sponsor_copy.html.erb @@ -6,10 +6,10 @@ Target your messaging with a tag sponsorship. This is a great way to increase y Logo + dedicated information area on the tag sidebar

- Each tag features a dedicated sidebar, listing the section’s submission guidelines, rules, key information, and tag moderators. As a tag sponsor, you will receive prominent logo placement directly in that sidebar, along with a call-to-action to follow your organization’s profile. + Each tag features a dedicated sidebar, listing the section’s submission guidelines, rules, key information, and tag moderators. As a tag sponsor, you will receive prominent logo placement directly in that sidebar.

- You’ll also receive access to a dedicated content box directly in that sidebar, where you’ll be able to offer a short blurb about your company or service. This combo provides contextual exposure, and long-lasting value as more fans of the tag engage with and follow your company. + You’ll also receive access to a dedicated content box directly in that sidebar, where you’ll be able to offer a short blurb about your company or service. This combo provides contextual exposure, and long-lasting value as more fans of the tag engage with your company.

Placement on our tag overview page diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 492cd6e7c..fbb388206 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -33,7 +33,7 @@
;">

#<%= tag.name %>

- <% if tag.sponsorship && tag.sponsorship.status == "live" %> + <% if tag.sponsorship && tag.sponsorship.status == "live" && tag.sponsorship.expires_at > Time.current %>

Sponsored by <%= tag.sponsorship.organization.name %> ❤️

<% end %>
diff --git a/spec/requests/partnerships_spec.rb b/spec/requests/partnerships_spec.rb index 22569a76d..1bb13fac7 100644 --- a/spec/requests/partnerships_spec.rb +++ b/spec/requests/partnerships_spec.rb @@ -244,7 +244,7 @@ RSpec.describe "Pages", type: :request do post "/partnerships", params: params sponsorship = org.sponsorships.tag.last expect(sponsorship.status).to eq("pending") - expect(sponsorship.expires_at).to be(nil) + expect(sponsorship.expires_at.to_i).to eq(1.month.from_now.to_i) expect(sponsorship.sponsorable).not_to be(nil) expect(sponsorship.instructions).to be_blank expect(sponsorship.instructions_updated_at).to be(nil) diff --git a/spec/requests/stories_index_spec.rb b/spec/requests/stories_index_spec.rb index dbdc78b42..8414b74ce 100644 --- a/spec/requests/stories_index_spec.rb +++ b/spec/requests/stories_index_spec.rb @@ -122,11 +122,10 @@ RSpec.describe "StoriesIndex", type: :request do it "renders live sponsor" do org = create(:organization) - sponsorship = create(:sponsorship, level: :tag, tagline: "Oh Yeah!!!", status: "live", organization: org, sponsorable: tag) - + sponsorship = create(:sponsorship, level: :tag, blurb_html: "

Oh Yeah!!!

", status: "live", organization: org, sponsorable: tag, expires_at: 30.days.from_now) get "/t/#{tag.name}" expect(response.body).to include("is sponsored by") - expect(response.body).to include(sponsorship.tagline) + expect(response.body).to include(sponsorship.blurb_html) end end end