From 456931f208eafb1a1b73d26dc2df326fbd9ed981 Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Sun, 16 Jun 2019 00:59:11 -0400 Subject: [PATCH] Further generalize pages and site Twitter handle (#3177) * Further generalize pages and site Twitter handle * Add footer mod change * Remove giveaways dead code --- Envfile | 1 + .../initializers/initializeFooterMod.js | 2 +- app/controllers/giveaways_controller.rb | 23 - app/controllers/internal/pages_controller.rb | 2 +- app/controllers/stories_controller.rb | 13 +- app/helpers/application_helper.rb | 6 +- app/models/organization.rb | 2 +- app/models/page.rb | 9 + app/models/podcast.rb | 2 +- app/models/user.rb | 2 +- app/views/articles/_sidebar.html.erb | 10 +- app/views/articles/index.html.erb | 2 +- app/views/articles/manage.html.erb | 4 +- app/views/articles/search/_meta.html.erb | 2 +- app/views/articles/show.html.erb | 2 +- app/views/articles/tags/_meta.html.erb | 2 +- app/views/classified_listings/index.html.erb | 2 +- app/views/comments/index.html.erb | 2 +- app/views/events/index.html.erb | 2 +- app/views/events/show.html.erb | 2 +- app/views/giveaways/_form.html.erb | 405 ------------------ app/views/giveaways/edit.html.erb | 47 -- app/views/giveaways/new.html.erb | 2 +- .../articles/_individual_article.html.erb | 2 +- app/views/internal/pages/_form.html.erb | 4 + app/views/notifications/index.html.erb | 2 +- app/views/pages/about.html.erb | 2 +- app/views/pages/api.html.erb | 2 +- app/views/pages/badges.html.erb | 2 +- app/views/pages/bounty.html.erb | 2 +- app/views/pages/code_of_conduct.html.erb | 2 +- app/views/pages/community_moderation.html.erb | 69 --- app/views/pages/contact.html.erb | 4 +- app/views/pages/show.html.erb | 4 +- app/views/pages/tag_moderation.html.erb | 80 ---- config/routes.rb | 6 - ...16024727_add_is_top_level_path_to_pages.rb | 6 + db/schema.rb | 7 +- spec/models/organization_spec.rb | 7 + spec/models/page_spec.rb | 23 + spec/models/podcast_spec.rb | 7 + spec/models/user_spec.rb | 7 + spec/requests/pages_spec.rb | 11 +- .../user_fills_out_givaway_form_spec.rb | 52 --- 44 files changed, 127 insertions(+), 720 deletions(-) delete mode 100644 app/views/giveaways/_form.html.erb delete mode 100644 app/views/giveaways/edit.html.erb delete mode 100644 app/views/pages/community_moderation.html.erb delete mode 100644 app/views/pages/tag_moderation.html.erb create mode 100644 db/migrate/20190616024727_add_is_top_level_path_to_pages.rb delete mode 100644 spec/system/user_fills_out_givaway_form_spec.rb diff --git a/Envfile b/Envfile index 74c81c86a..b91e2edd9 100644 --- a/Envfile +++ b/Envfile @@ -12,6 +12,7 @@ variable :APP_DOMAIN, :String, default: "localhost:3000" variable :APP_PROTOCOL, :String, default: "http://" variable :COMMUNITY_NAME, :String, default: "DEV(local)" variable :MAIN_SOCIAL_IMAGE, :String, default: "https://thepracticaldev.s3.amazonaws.com/i/6hqmcjaxbgbon8ydw93z.png" +variable :SITE_TWITTER_HANDLE, :String, default: "tbd" # Logo variable :LOGO_SVG, :String, default: "" diff --git a/app/assets/javascripts/initializers/initializeFooterMod.js b/app/assets/javascripts/initializers/initializeFooterMod.js index 2875376b0..788fc85cb 100644 --- a/app/assets/javascripts/initializers/initializeFooterMod.js +++ b/app/assets/javascripts/initializers/initializeFooterMod.js @@ -1,7 +1,7 @@ function initializeFooterMod() { var footerContainer = document.getElementById("footer-container"); if ( - footerContainer && document.getElementById('page-content').className.indexOf('stories-show') > -1 + footerContainer && document.getElementById('page-content').className.indexOf('stories-show') > -1 && !document.getElementById('IS_CENTERED_PAGE') ) { document .getElementById('footer-container') diff --git a/app/controllers/giveaways_controller.rb b/app/controllers/giveaways_controller.rb index 2507bcac1..d408a6cad 100644 --- a/app/controllers/giveaways_controller.rb +++ b/app/controllers/giveaways_controller.rb @@ -4,29 +4,6 @@ class GiveawaysController < ApplicationController @errors = [] end - def edit - @user = current_user - @errors = [] - end - - # POST /giveaways - # POST /giveaways.json - # def create - # @user = User.new(giveaway_params) - # - # respond_to do |format| - # if @user.save - # format.html { redirect_to @user, notice: 'Giveaway was successfully created.' } - # format.json { render :show, status: :created, location: @user } - # else - # format.html { render :new } - # format.json { render json: @user.errors, status: :unprocessable_entity } - # end - # end - # end - - # PATCH/PUT /giveaways/1 - # PATCH/PUT /giveaways/1.json def update prevent_request_if_requested_twice @user = current_user diff --git a/app/controllers/internal/pages_controller.rb b/app/controllers/internal/pages_controller.rb index 3b789fd89..77842ea15 100644 --- a/app/controllers/internal/pages_controller.rb +++ b/app/controllers/internal/pages_controller.rb @@ -34,7 +34,7 @@ class Internal::PagesController < Internal::ApplicationController private def page_params - allowed_params = %i[title slug body_markdown body_html description template] + allowed_params = %i[title slug body_markdown body_html description template is_top_level_path] params.require(:page).permit(allowed_params) end end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index fa604ec17..615e31701 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -3,7 +3,7 @@ class StoriesController < ApplicationController before_action :set_cache_control_headers, only: %i[index search show] def index - return handle_user_or_organization_or_podcast_index if params[:username] + return handle_user_or_organization_or_podcast_or_page_index if params[:username] return handle_tag_index if params[:tag] handle_base_index @@ -63,13 +63,16 @@ class StoriesController < ApplicationController not_found end - def handle_user_or_organization_or_podcast_index + def handle_user_or_organization_or_podcast_or_page_index @podcast = Podcast.find_by(slug: params[:username].downcase) @organization = Organization.find_by(slug: params[:username].downcase) + @page = Page.find_by(slug: params[:username].downcase, is_top_level_path: true) if @podcast handle_podcast_index elsif @organization handle_organization_index + elsif @page + handle_page_display else handle_user_index end @@ -98,6 +101,12 @@ class StoriesController < ApplicationController render template: "articles/tag_index" end + def handle_page_display + @story_show = true + set_surrogate_key_header "show-page-#{params[:username]}" + render template: "pages/show" + end + def handle_base_index @home_page = true @page = (params[:page] || 1).to_i diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 238d0ec50..f6d21de5f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,7 +8,11 @@ module ApplicationHelper end def view_class - "#{controller_name} #{controller_name}-#{controller.action_name}" + if @story_show #custom due to edge cases + "stories stories-show" + else + "#{controller_name} #{controller_name}-#{controller.action_name}" + end end def core_pages? diff --git a/app/models/organization.rb b/app/models/organization.rb index a7a6fbf73..8f006f561 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -132,6 +132,6 @@ class Organization < ApplicationRecord handle_asynchronously :bust_cache def unique_slug_including_users_and_podcasts - errors.add(:slug, "is taken.") if User.find_by(username: slug) || Podcast.find_by(slug: slug) + errors.add(:slug, "is taken.") if User.find_by(username: slug) || Podcast.find_by(slug: slug) || Page.find_by(slug: slug) end end diff --git a/app/models/page.rb b/app/models/page.rb index b859baad6..6e58bfa59 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -4,6 +4,7 @@ class Page < ApplicationRecord validates :slug, presence: true, format: /\A[0-9a-z\-_]*\z/ validates :template, inclusion: { in: %w[contained full_within_layout full_page] } validate :body_present + validate :unique_slug_including_users_and_orgs, if: :slug_changed? before_save :evaluate_markdown after_save :bust_cache @@ -11,6 +12,10 @@ class Page < ApplicationRecord mount_uploader :social_image, ProfileImageUploader + def path + is_top_level_path ? "/#{slug}" : "/page/#{slug}" + end + private def evaluate_markdown @@ -30,6 +35,10 @@ class Page < ApplicationRecord errors.add(:body_markdown, "must exist if body_html doesn't exist.") if body_markdown.blank? && body_html.blank? end + def unique_slug_including_users_and_orgs + errors.add(:slug, "is taken.") if User.find_by(username: slug) || Organization.find_by(slug: slug) || Podcast.find_by(slug: slug) + end + def bust_cache CacheBuster.new.bust "/page/#{slug}" CacheBuster.new.bust "/page/#{slug}?i=i" diff --git a/app/models/podcast.rb b/app/models/podcast.rb index 509478998..4648dbb3e 100644 --- a/app/models/podcast.rb +++ b/app/models/podcast.rb @@ -22,7 +22,7 @@ class Podcast < ApplicationRecord private def unique_slug_including_users_and_orgs - errors.add(:slug, "is taken.") if User.find_by(username: slug) || Organization.find_by(slug: slug) + errors.add(:slug, "is taken.") if User.find_by(username: slug) || Organization.find_by(slug: slug) || Page.find_by(slug: slug) end def bust_cache diff --git a/app/models/user.rb b/app/models/user.rb index bb686ac7e..2c786d5dc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -378,7 +378,7 @@ class User < ApplicationRecord end def unique_including_orgs_and_podcasts - errors.add(:username, "is taken.") if Organization.find_by(slug: username) || Podcast.find_by(slug: username) + errors.add(:username, "is taken.") if Organization.find_by(slug: username) || Podcast.find_by(slug: username) || Page.find_by(slug: username) end def subscribe_to_mailchimp_newsletter_without_delay diff --git a/app/views/articles/_sidebar.html.erb b/app/views/articles/_sidebar.html.erb index 655f7097c..b0cfed846 100644 --- a/app/views/articles/_sidebar.html.erb +++ b/app/views/articles/_sidebar.html.erb @@ -43,11 +43,11 @@

key links

- " alt="Twitter logo" class="social-icon" /> - " alt="GitHub logo" class="social-icon" /> - " alt="Instagram logo" class="social-icon" /> - " alt="Facebook logo" class="social-icon" /> - " alt="Twitch logo" class="social-icon" /> + " target="_blank" rel="noopener">" alt="Twitter logo" class="social-icon" /> + " target="_blank" rel="noopener">" alt="GitHub logo" class="social-icon" /> + " target="_blank" rel="noopener">" alt="Instagram logo" class="social-icon" /> + " target="_blank" rel="noopener">" alt="Facebook logo" class="social-icon" /> + " target="_blank" rel="noopener">" alt="Twitch logo" class="social-icon" />

Tools:

-

Suggest a Tweet: Help get your post in front of more developers by suggesting a tweet that @ThePracticalDev editors can use. +

Suggest a Tweet: Help get your post in front of more developers by suggesting a tweet that ">@<%= ApplicationConfig["SITE_TWITTER_HANDLE"] %> editors can use.

Experience Level of Post: The best target dev experience level— a gentle indicator to help show the post to the people who will benefit the most.

Tips:

  1. - Make your own tweet about the post, describing personally why you wrote it or why people might find it useful. @ThePracticalDev may retweet you. + Make your own tweet about the post, describing personally why you wrote it or why people might find it useful. ">@<%= ApplicationConfig["SITE_TWITTER_HANDLE"] %> may retweet you.
  2. Share to link aggregators such as Reddit. Try to choose the most topic-specific subreddits, such as /r/javascript instead of /r/programming. Warning: jerks and trolls may be lurking. diff --git a/app/views/articles/search/_meta.html.erb b/app/views/articles/search/_meta.html.erb index b543273a5..27b0fbe39 100644 --- a/app/views/articles/search/_meta.html.erb +++ b/app/views/articles/search/_meta.html.erb @@ -10,7 +10,7 @@ - +"> "> diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index d065ffab2..26fba1d99 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -49,7 +49,7 @@ " /> - + "> "> diff --git a/app/views/articles/tags/_meta.html.erb b/app/views/articles/tags/_meta.html.erb index 6ea491d1d..1a62c6969 100644 --- a/app/views/articles/tags/_meta.html.erb +++ b/app/views/articles/tags/_meta.html.erb @@ -13,7 +13,7 @@ - +"> diff --git a/app/views/classified_listings/index.html.erb b/app/views/classified_listings/index.html.erb index 665990486..d26005320 100644 --- a/app/views/classified_listings/index.html.erb +++ b/app/views/classified_listings/index.html.erb @@ -22,7 +22,7 @@ <% end %> - + "> <% end %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index c970adff4..14ed792af 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -12,7 +12,7 @@ " /> - + "> "> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 91d4914cb..826ad172c 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -10,7 +10,7 @@ - + "> diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index bd3e8d7a9..88b8e5376 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -16,7 +16,7 @@ - + "> <% if @event.cover_image.present? %> diff --git a/app/views/giveaways/_form.html.erb b/app/views/giveaways/_form.html.erb deleted file mode 100644 index bc72f9552..000000000 --- a/app/views/giveaways/_form.html.erb +++ /dev/null @@ -1,405 +0,0 @@ - - - - -<%= form_for(@user, url: "/giveaways/freestickers") do |f| %> - <% if @errors.any? %> -
    -

    <%= pluralize(@errors.size, "issue") %> prohibited your form from being submitted:

    - -
      - <% @errors.each do |message| %> -
    • <%= message %>
    • - <% end %> -
    -
    - <% end %> -

    Shipping Information

    - <% if @user.email.blank? %> -
    - <%= f.label :email, "Email" %>
    - <%= f.text_field :email %> -
    - <% end %> -
    - <%= f.label :shipping_name, "Name (for shipping)" %>
    - <%= f.text_field :shipping_name %> -
    -
    - <%= f.label :shipping_company, "Company (for shipping if applicable)" %>
    - <%= f.text_field :shipping_company %> -
    -
    - <%= f.label :shipping_address, "Address" %>
    - <%= f.text_field :shipping_address %> -
    -
    - <%= f.label :shipping_address_line_2, "Address Line 2" %>
    - <%= f.text_field :shipping_address_line_2 %> -
    -
    - <%= f.label :shipping_city, "City" %>
    - <%= f.text_field :shipping_city %> -
    -
    - <%= f.label :shipping_state, "State/Province" %>
    - <%= f.text_field :shipping_state %> -
    -
    - <%= f.label :shipping_country, "Country" %>
    - <%= f.select :shipping_country, - options_for_select( - [["United States", "US"], - ["-----", ""], - %w[Afghanistan AF], - ["Åland Islands", "AX"], - %w[Albania AL], - %w[Algeria DZ], - ["American Samoa", "AS"], - %w[Andorra AD], - %w[Angola AO], - %w[Anguilla AI], - %w[Antarctica AQ], - ["Antigua and Barbuda", "AG"], - %w[Argentina AR], - %w[Armenia AM], - %w[Aruba AW], - %w[Australia AU], - %w[Austria AT], - %w[Azerbaijan AZ], - %w[Bahamas BS], - %w[Bahrain BH], - %w[Bangladesh BD], - %w[Barbados BB], - %w[Belarus BY], - %w[Belgium BE], - %w[Belize BZ], - %w[Benin BJ], - %w[Bermuda BM], - %w[Bhutan BT], - %w[Bolivia BO], - %w[Bonaire BQ], - ["Bosnia and Herzegovina", "BA"], - %w[Botswana BW], - ["Bouvet Island", "BV"], - %w[Brazil BR], - ["BIO Territory", "IO"], - ["Brunei Darussalam", "BN"], - %w[Bulgaria BG], - ["Burkina Faso", "BF"], - %w[Burundi BI], - %w[Cambodia KH], - %w[Cameroon CM], - %w[Canada CA], - ["Cape Verde", "CV"], - ["Cayman Islands", "KY"], - ["Central African Republic", "CF"], - %w[Chad TD], - %w[Chile CL], - %w[China CN], - ["Christmas Island", "CX"], - ["Cocos (Keeling) Islands", "CC"], - %w[Colombia CO], - %w[Comoros KM], - %w[Congo CG], - %w[Congo CD], - ["Cook Islands", "CK"], - ["Costa Rica", "CR"], - ["Côte d'Ivoire", "CI"], - %w[Croatia HR], - %w[Cuba CU], - %w[Curaçao CW], - %w[Cyprus CY], - ["Czech Republic", "CZ"], - %w[Denmark DK], - %w[Djibouti DJ], - %w[Dominica DM], - ["Dominican Republic", "DO"], - %w[Ecuador EC], - %w[Egypt EG], - ["El Salvador", "SV"], - ["Equatorial Guinea", "GQ"], - %w[Eritrea ER], - %w[Estonia EE], - %w[Ethiopia ET], - ["Falkland Islands", "FK"], - ["Faroe Islands", "FO"], - %w[Fiji FJ], - %w[Finland FI], - %w[France FR], - ["French Guiana", "GF"], - ["French Polynesia", "PF"], - ["French S Territories", "TF"], - %w[Gabon GA], - %w[Gambia GM], - %w[Georgia GE], - %w[Germany DE], - %w[Ghana GH], - %w[Gibraltar GI], - %w[Greece GR], - %w[Greenland GL], - %w[Grenada GD], - %w[Guadeloupe GP], - %w[Guam GU], - %w[Guatemala GT], - %w[Guernsey GG], - %w[Guinea GN], - ["Guinea-Bissau", "GW"], - %w[Guyana GY], - %w[Haiti HT], - ["Heard McDonald Islands", "HM"], - ["Holy See", "VA"], - %w[Honduras HN], - ["Hong Kong", "HK"], - %w[Hungary HU], - %w[Iceland IS], - %w[India IN], - %w[Indonesia ID], - %w[Iran IR], - %w[Iraq IQ], - %w[Ireland IE], - ["Isle of Man", "IM"], - %w[Israel IL], - %w[Italy IT], - %w[Jamaica JM], - %w[Japan JP], - %w[Jersey JE], - %w[Jordan JO], - %w[Kazakhstan KZ], - %w[Kenya KE], - %w[Kiribati KI], - ["Korea, People's Republic", "KP"], - ["Korea, Republic of", "KR"], - %w[Kuwait KW], - %w[Kyrgyzstan KG], - %w[Lao LA], - %w[Latvia LV], - %w[Lebanon LB], - %w[Lesotho LS], - %w[Liberia LR], - %w[Libya LY], - %w[Liechtenstein LI], - %w[Lithuania LT], - %w[Luxembourg LU], - %w[Macao MO], - %w[Macedonia MK], - %w[Madagascar MG], - %w[Malawi MW], - %w[Malaysia MY], - %w[Maldives MV], - %w[Mali ML], - %w[Malta MT], - ["Marshall Islands", "MH"], - %w[Martinique MQ], - %w[Mauritania MR], - %w[Mauritius MU], - %w[Mayotte YT], - %w[Mexico MX], - %w[Micronesia FM], - ["Moldova, Republic of", "MD"], - %w[Monaco MC], - %w[Mongolia MN], - %w[Montenegro ME], - %w[Montserrat MS], - %w[Morocco MA], - %w[Mozambique MZ], - %w[Myanmar MM], - %w[Namibia NA], - %w[Nauru NR], - %w[Nepal NP], - %w[Netherlands NL], - ["New Caledonia", "NC"], - ["New Zealand", "NZ"], - %w[Nicaragua NI], - %w[Niger NE], - %w[Nigeria NG], - %w[Niue NU], - ["Norfolk Island", "NF"], - ["Northern Mariana Islands", "MP"], - %w[Norway NO], - %w[Oman OM], - %w[Pakistan PK], - %w[Palau PW], - ["Palestinian Territory", "PS"], - %w[Panama PA], - ["Papua New Guinea", "PG"], - %w[Paraguay PY], - %w[Peru PE], - %w[Philippines PH], - %w[Pitcairn PN], - %w[Poland PL], - %w[Portugal PT], - ["Puerto Rico", "PR"], - %w[Qatar QA], - %w[Réunion RE], - %w[Romania RO], - ["Russian Federation", "RU"], - %w[Rwanda RW], - ["Saint Barthélemy", "BL"], - ["Saint Helena", "SH"], - ["Saint Kitts and Nevis", "KN"], - ["Saint Lucia", "LC"], - ["Saint Martin (French part)", "MF"], - ["Saint Pierre and Miquelon", "PM"], - ["Saint Vincent, Grenadines", "VC"], - %w[Samoa WS], - ["San Marino", "SM"], - ["Sao Tome and Principe", "ST"], - ["Saudi Arabia", "SA"], - %w[Senegal SN], - %w[Serbia RS], - %w[Seychelles SC], - ["Sierra Leone", "SL"], - %w[Singapore SG], - ["Sint Maarten (Dutch part)", "SX"], - %w[Slovakia SK], - %w[Slovenia SI], - ["Solomon Islands", "SB"], - %w[Somalia SO], - ["South Africa", "ZA"], - ["South Georgia", "GS"], - ["South Sudan", "SS"], - %w[Spain ES], - ["Sri Lanka", "LK"], - %w[Sudan SD], - %w[Suriname SR], - ["Svalbard and Jan Mayen", "SJ"], - %w[Swaziland SZ], - %w[Sweden SE], - %w[Switzerland CH], - ["Syrian Arab Republic", "SY"], - ["Taiwan, Province of China", "TW"], - %w[Tajikistan TJ], - %w[Tanzania TZ], - %w[Thailand TH], - ["Timor-Leste", "TL"], - %w[Togo TG], - %w[Tokelau TK], - %w[Tonga TO], - ["Trinidad and Tobago", "TT"], - %w[Tunisia TN], - %w[Turkey TR], - %w[Turkmenistan TM], - ["Turks and Caicos Isl", "TC"], - %w[Tuvalu TV], - %w[Uganda UG], - %w[Ukraine UA], - ["United Arab Emirates", "AE"], - ["United Kingdom", "GB"], - ["United States", "US"], - ["United States Minor", "UM"], - %w[Uruguay UY], - %w[Uzbekistan UZ], - %w[Vanuatu VU], - %w[Venezuela VE], - ["Viet Nam", "VN"], - ["Virgin Islands, British", "VG"], - ["Virgin Islands, U.S.", "VI"], - ["Wallis and Futuna", "WF"], - ["Western Sahara", "EH"], - %w[Yemen YE], - %w[Zambia ZM], - %w[Zimbabwe ZW]], - @user.shipping_country, - ) %> -
    -
    - <%= f.label :shipping_postal_code, "Zip Number/Postal Code" %>
    - <%= f.text_field :shipping_postal_code %> -
    -
    - <%= f.label :shipping_validated, "validate" %> - <%= f.check_box :shipping_validated %> -
    -

    T-shirt size

    -
    - <%= f.label :shirt_gender, "Style" %>
    - <%= f.select :shirt_gender, - options_for_select( - [%w[Unisex unisex], - ["Women's", "womens"]], - @user.shirt_gender, - ) %> -
    -
    - <%= f.label :shirt_size, "Size" %>
    - <%= f.select :shirt_size, - options_for_select( - [%w[Small s], - %w[Medium m], - %w[Large l], - ["Extra Large", "xl"], - %w[2XL 2xl], - %w[3XL 3xl]], - @user.shirt_size, - ) %> -
    -

    A bit about you

    -

    (This is sort of our "I'm not a robot" test)

    -
    - <%= f.label :top_languages, "Favorite programming languages" %>
    - <%= f.text_field :top_languages %> -
    -
    - <%= f.label :specialty, "Specialty (web development, sysadmin, etc.)" %>
    - <%= f.text_field :specialty %> -
    -
    - <%= f.label :experience_level, "Programming Experience Level" %>
    - <%= f.select :experience_level, - options_for_select( - [["0 (Complete Newbie)", "0"], - %w[1 1], - %w[2 2], - ["3 (Junior Developer)", "3"], - %w[4 4], - %w[5 5], - %w[6 6], - ["7 (Experienced Developer)", "7"], - %w[8 8], - %w[9 9], - ["10 (Senior Developer)", "10"]], - @user.experience_level, - ) %> -
    -
    - <%= f.label :tabs_or_spaces, "Tabs or spaces" %>
    - <%= f.select :tabs_or_spaces, - options_for_select( - [%w[Tabs tabs], - %w[Spaces spaces]], - @user.tabs_or_spaces, - ) %> - -
    -
    - <%= f.submit "Submit" %> -
    -

    - All dev.to users who submit this form will receive a "welcome package" -- there is no element of chance or skill in this promotion. Additionally, there is no purchase necessary, and this offer is void if/where prohibited. Please note that there is a limit of 1 per person, and all entrants will go through a spam filtration procedure. Contact yo@dev.to with any questions, or to inquire about an alternative means of entry for this promotion. -

    -<% end %> diff --git a/app/views/giveaways/edit.html.erb b/app/views/giveaways/edit.html.erb deleted file mode 100644 index 5212647eb..000000000 --- a/app/views/giveaways/edit.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -

    Editing Giveaway

    - -
    -
    - -
    - <% if !current_user %> -
    -

    * * *

    -

    Please sign in

    -
    - <%= ApplicationConfig["APP_DOMAIN"] %>/users/auth/twitter/callback" class="sign-up-link" data-no-instant> -

    or

    - -
    - <% elsif current_user.onboarding_package_requested == false %> -
    -

    * * *

    -

    - It seems you've never requested stickers.
    - Rest assured, we will have events and giveaways in the future for you look forward to. -

    -

    - ❤️
    - Ben & Jess -

    -
    - <% elsif current_user.onboarding_package_requested_again == false %> - <%= render "form" %> - <% else %> -
    -

    * * *

    - -

    - Thank you for the support. -

    -

    - Your stickers should arrive soon. -

    - -

    - ❤️
    - Ben & Jess -

    -
    - <% end %> -
    diff --git a/app/views/giveaways/new.html.erb b/app/views/giveaways/new.html.erb index 999d66cee..b45b6dfd7 100644 --- a/app/views/giveaways/new.html.erb +++ b/app/views/giveaways/new.html.erb @@ -11,7 +11,7 @@ - + "> diff --git a/app/views/internal/articles/_individual_article.html.erb b/app/views/internal/articles/_individual_article.html.erb index dd049cca9..253210718 100644 --- a/app/views/internal/articles/_individual_article.html.erb +++ b/app/views/internal/articles/_individual_article.html.erb @@ -133,7 +133,7 @@ { author: @<%= article.user.twitter_username %> } #DEVCommunity <% end %> - + <% end %> <% if (article.decorate.cached_tag_list_array & Tag.bufferized_tags).any? %> <%= form_tag "/internal/buffer_updates" do %> diff --git a/app/views/internal/pages/_form.html.erb b/app/views/internal/pages/_form.html.erb index 7e2b3a87d..79e531ec2 100644 --- a/app/views/internal/pages/_form.html.erb +++ b/app/views/internal/pages/_form.html.erb @@ -19,6 +19,10 @@
    <%= form.text_field :description %>
    + <%= form.label :is_top_level_path %> (Determines if it is accessible by /page-slug vs /page/page-slug) Be careful! ⚠️ +
    + <%= form.check_box :is_top_level_path %> +
    <%= form.submit %>
    diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index 160cb595c..81c09168f 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -12,7 +12,7 @@ - + "> <% end %> diff --git a/app/views/pages/about.html.erb b/app/views/pages/about.html.erb index 6b0dde308..0d6213acd 100644 --- a/app/views/pages/about.html.erb +++ b/app/views/pages/about.html.erb @@ -13,7 +13,7 @@ " /> - + "> "> is great!"> diff --git a/app/views/pages/api.html.erb b/app/views/pages/api.html.erb index 754838771..ce00574e8 100644 --- a/app/views/pages/api.html.erb +++ b/app/views/pages/api.html.erb @@ -10,7 +10,7 @@ API" /> - + "> API">