From 490645ea928ac71cbcd97f9f8fc44ccc0ee98e4a Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Mon, 1 Apr 2019 18:24:47 -0400 Subject: [PATCH] Add sponsors to sponsors page and add sponsor order field (#2284) * Add sponsorship page * Fix schema * dev => DEV --- app/views/articles/_sidebar.html.erb | 10 ++++++- app/views/pages/sponsors.html.erb | 29 +++++-------------- ..._add_sponsorship_order_to_organizations.rb | 5 ++++ db/schema.rb | 3 +- 4 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 db/migrate/20190401213605_add_sponsorship_order_to_organizations.rb diff --git a/app/views/articles/_sidebar.html.erb b/app/views/articles/_sidebar.html.erb index 60e6d1dfe..62f41a82b 100644 --- a/app/views/articles/_sidebar.html.erb +++ b/app/views/articles/_sidebar.html.erb @@ -10,7 +10,7 @@ " alt="emoji heart" /> - <% @sponsors = Organization.where(is_gold_sponsor: true) %> + <% @sponsors = Organization.where(is_gold_sponsor: true).order("sponsorship_featured_number ASC") %> <% if @sponsors.any? %>
<% @sponsors.each do |organization| %> @@ -26,6 +26,14 @@
<% end %> +
+ We are grateful for wonderful sponsors who help sustain the DEV community. +
+ <% end %> diff --git a/app/views/pages/sponsors.html.erb b/app/views/pages/sponsors.html.erb index 5248a222e..b5f370e5e 100644 --- a/app/views/pages/sponsors.html.erb +++ b/app/views/pages/sponsors.html.erb @@ -30,30 +30,15 @@ ">Gold Sponsors">
- "> + <% Organization.where(is_gold_sponsor: true).order("sponsorship_featured_number ASC").each do |organization| %> + -

- Digital Ocean is a much-loved cloud computing platform. I'm always impressed by how well-built - and well-documented the Digital Ocean core products are. It's easier said than done, and they've been able to stay ahead of the curve. -

+

+ <%= organization.sponsorship_blurb_html.html_safe %> +

-
- - " /> - -

- Triplebyte allows developers to take one quiz and immediately get into the interview process with top tech companies if you qualify. It should be a part of any developer's job search process. -

- -
- - " /> - -

- GoCD is a continuous delivery tool built by Thoughtworks, one of the most reputable software development firms we've ever dealt with. This is a feature-rich tool with some really fabulous visualization. Definitely worth considering for your organization or project. -

- -
+
+ <% end %>
Interested in sponsoring dev.to? Email peter@dev.to
diff --git a/db/migrate/20190401213605_add_sponsorship_order_to_organizations.rb b/db/migrate/20190401213605_add_sponsorship_order_to_organizations.rb new file mode 100644 index 000000000..4c813f475 --- /dev/null +++ b/db/migrate/20190401213605_add_sponsorship_order_to_organizations.rb @@ -0,0 +1,5 @@ +class AddSponsorshipOrderToOrganizations < ActiveRecord::Migration[5.1] + def change + add_column :organizations, :sponsorship_featured_number, :integer, default: 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index b7c10e9cb..d01d32d2d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190401193017) do +ActiveRecord::Schema.define(version: 20190401213605) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -516,6 +516,7 @@ ActiveRecord::Schema.define(version: 20190401193017) do t.string "secret" t.string "slug" t.text "sponsorship_blurb_html" + t.integer "sponsorship_featured_number", default: 0 t.string "sponsorship_tagline" t.string "sponsorship_url" t.string "state"