diff --git a/.rubocop.yml b/.rubocop.yml index 23e84d29b..89b46f29e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,6 +15,7 @@ RSpec/DescribeClass: - spec/requests/* RSpec/ExampleLength: + Max: 10 Exclude: - spec/features/**/* diff --git a/app/controllers/podcast_episodes_controller.rb b/app/controllers/podcast_episodes_controller.rb index da15d96be..5623138d6 100644 --- a/app/controllers/podcast_episodes_controller.rb +++ b/app/controllers/podcast_episodes_controller.rb @@ -11,10 +11,9 @@ class PodcastEpisodesController < ApplicationController @podcast_episodes.map { |e| e["record_key"] }) end @featured_story = Article.new - @podcast_index = true @article_index = true @list_of = "podcast-episodes" - render template: "articles/index" + render template: "podcast_episodes/index" end private diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 3d5f6f197..a26ccfcbc 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -15,7 +15,7 @@ class StoriesController < ApplicationController @featured_story = Article.new @article_index = true set_surrogate_key_header "articles-page-with-query" - render template: "articles/index" + render template: "articles/search" end def show @@ -101,7 +101,7 @@ class StoriesController < ApplicationController @article_index = true set_surrogate_key_header "articles-#{@tag}", @stories.map(&:record_key) response.headers["Surrogate-Control"] = "max-age=600, stale-while-revalidate=30, stale-if-error=86400" - render template: "articles/index" + render template: "articles/tag_index" end def handle_base_index @@ -155,7 +155,7 @@ class StoriesController < ApplicationController @list_of = "podcast-episodes" @podcast_episodes = @podcast.podcast_episodes.order("published_at DESC").limit(30) set_surrogate_key_header "podcast_episodes", (@podcast_episodes.map { |e| e["record_key"] }) - render template: "articles/index" + render template: "podcast_episodes/index" end def handle_organization_index @@ -169,7 +169,7 @@ class StoriesController < ApplicationController @article_index = true @organization_article_index = true set_surrogate_key_header "articles-org-#{@organization.id}", @stories.map(&:record_key) - render template: "articles/index" + render template: "organizations/show" end def handle_user_index @@ -189,7 +189,7 @@ class StoriesController < ApplicationController redirect_if_view_param return if performed? set_surrogate_key_header "articles-user-#{@user.id}", @stories.map(&:record_key) - render template: "articles/index" + render template: "users/show" end def handle_podcast_show diff --git a/app/views/articles/_sidebar.html.erb b/app/views/articles/_sidebar.html.erb index 82f375383..21d6fbac1 100644 --- a/app/views/articles/_sidebar.html.erb +++ b/app/views/articles/_sidebar.html.erb @@ -1,265 +1,82 @@
- <%= @user.summary.present? ? @user.summary : ["404 bio not found"].sample %> -
- -- <% if @user.twitter_username.present? %> - - <%= inline_svg("twitter-logo.svg", class:"icon-img") %> - - <% end %> - <% if @user.github_username.present? %> - - <%= inline_svg("github-logo.svg", class:"icon-img") %> - - <% end %> - <% if @user.class.name == "User" %> - <% if @user.mastodon_url.present? %> - - <%= inline_svg("mastodon-logo.svg", class:"icon-img") %> - - <% end %> - <% if @user.facebook_url.present? %> - - <%= inline_svg("facebook-logo.svg", class:"icon-img") %> - - <% end %> - <% if @user.linkedin_url.present? %> - - <%= inline_svg("linkedin_icon.svg", class:"icon-img") %> - - <% end %> - <% if @user.behance_url.present? %> - - <%= inline_svg("behance_icon.svg", class:"icon-img") %> - - <% end %> - <% if @user.stackoverflow_url.present? %> - - <%= inline_svg("stackoverflow-logo.svg", class:"icon-img") %> - - <% end %> - <% if @user.dribbble_url.present? %> - - <%= inline_svg("dribbble_icon.svg", class:"icon-img") %> - - <% end %> - <% if @user.medium_url.present? %> - - <%= inline_svg("medium_icon.svg", class:"icon-img") %> - - <% end %> - <% if @user.gitlab_url.present? %> - - <%= inline_svg("gitlab.svg", class:"icon-img") %> - - <% end %> - <% if @user.website_url.present? %> - - <%= inline_svg("external-link-logo.svg", class:"icon-img") %> - - <% end %> - <% end %> - -
-+ <%= @user.summary.present? ? @user.summary : ["404 bio not found"].sample %> +
+ ++ <% if @user.twitter_username.present? %> + + <%= inline_svg("twitter-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.github_username.present? %> + + <%= inline_svg("github-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.class.name == "User" %> + <% if @user.mastodon_url.present? %> + + <%= inline_svg("mastodon-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.facebook_url.present? %> + + <%= inline_svg("facebook-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.linkedin_url.present? %> + + <%= inline_svg("linkedin_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.behance_url.present? %> + + <%= inline_svg("behance_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.stackoverflow_url.present? %> + + <%= inline_svg("stackoverflow-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.dribbble_url.present? %> + + <%= inline_svg("dribbble_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.medium_url.present? %> + + <%= inline_svg("medium_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.gitlab_url.present? %> + + <%= inline_svg("gitlab.svg", class:"icon-img") %> + + <% end %> + <% if @user.website_url.present? %> + + <%= inline_svg("external-link-logo.svg", class:"icon-img") %> + + <% end %> + <% end %> +
++ <%= @user.summary.presence || ["404 bio not found"].sample %> +
+ ++ <% if @user.twitter_username? %> + + <%= inline_svg("twitter-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.github_username? %> + + <%= inline_svg("github-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.mastodon_url? %> + + <%= inline_svg("mastodon-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.facebook_url? %> + + <%= inline_svg("facebook-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.linkedin_url? %> + + <%= inline_svg("linkedin_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.behance_url? %> + + <%= inline_svg("behance_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.stackoverflow_url? %> + + <%= inline_svg("stackoverflow-logo.svg", class:"icon-img") %> + + <% end %> + <% if @user.dribbble_url? %> + + <%= inline_svg("dribbble_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.medium_url? %> + + <%= inline_svg("medium_icon.svg", class:"icon-img") %> + + <% end %> + <% if @user.gitlab_url? %> + + <%= inline_svg("gitlab.svg", class:"icon-img") %> + + <% end %> + <% if @user.website_url? %> + + <%= inline_svg("external-link-logo.svg", class:"icon-img") %> + + <% end %> +
+