diff --git a/app/assets/javascripts/initializers/initScrolling.js b/app/assets/javascripts/initializers/initScrolling.js index c70dbf0cd..51e9131d0 100644 --- a/app/assets/javascripts/initializers/initScrolling.js +++ b/app/assets/javascripts/initializers/initScrolling.js @@ -288,10 +288,6 @@ function insertArticles(articles) { } } -function fetchNextPodcastPage(el) { - fetchNext(el, '/api/podcast_episodes', insertArticles); -} - function paginate(tag, params, requiresApproval) { const searchHash = { ...{ per_page: 15, page: nextPage }, @@ -367,12 +363,7 @@ function fetchNextPageIfNearBottom() { var fetchCallback; var scrollableElem; - if (indexWhich === 'podcast-episodes') { - scrollableElem = document.getElementById('main-content'); - fetchCallback = function fetch() { - fetchNextPodcastPage(indexContainer); - }; - } else if (indexWhich === 'videos') { + if (indexWhich === 'videos') { scrollableElem = document.getElementById('main-content'); fetchCallback = function fetch() { fetchNextVideoPage(indexContainer); diff --git a/app/assets/stylesheets/podcast-episodes-show.scss b/app/assets/stylesheets/podcast-episodes-show.scss index 9ff9d59f2..8eda9e91a 100644 --- a/app/assets/stylesheets/podcast-episodes-show.scss +++ b/app/assets/stylesheets/podcast-episodes-show.scss @@ -4,6 +4,21 @@ --podcast-spinning-animation: spin 20s linear infinite; } +.podcast-index { + img { + border-radius: var(--radius); + } + .crayons-card img { + border-radius: 0px; + border-top-left-radius: var(--radius); + border-top-right-radius: var(--radius); + } + .podcasts-browse-more img { + width:50px; + vertical-align: -17px; + } +} + .podcast-episode-container { .hero { padding-bottom: 30px; diff --git a/app/assets/stylesheets/user-profile-header.scss b/app/assets/stylesheets/user-profile-header.scss index a0e4551bf..11eb8e7e4 100644 --- a/app/assets/stylesheets/user-profile-header.scss +++ b/app/assets/stylesheets/user-profile-header.scss @@ -6,14 +6,8 @@ font-family: var(--ff-sans-serif); position: relative; overflow: hidden; - width: 1216px; - max-width: 92%; - margin: 24px auto; background: var(--card-bg); border-radius: 3px; - @media screen and (min-width: 950px) { - max-width: 98%; - } @media screen and (min-width: 1100px) { padding: 25px 0px 11px; } @@ -104,89 +98,6 @@ } } } - .profile-details { - float: left; - width: calc(100% - (13vw + 95px)); - padding-top: calc(2px + 2.7vw); - @media screen and (min-width: 1100px) { - min-height: 270px; - } - h1 { - margin: 5px auto 1vw; - font-weight: bold; - font-size: 25px; - padding: 0; - padding-right: 15px; - line-height: 1.1em; - @media screen and (min-width: 430px) { - font-size: calc(4.5vw + 10px); - } - @media screen and (min-width: 950px) { - font-size: 60px; - margin-top: 0px; - } - > span:nth-child(1) { - word-break: break-word; - display: block; - } - } - p.profile-description { - padding: 0px 0px; - margin: 0; - font-style: italic; - color: var(--card-color-tertiary); - width: 94%; - font-size: 0.9em; - margin-top: 12px; - max-width: 550px; - @media screen and (min-width: 430px) { - font-size: 0.97em; - margin-top: 0px; - } - } - } - .social { - font-size: 15px; - max-width: 100%; - margin: 10px 0px 10px; - z-index: 3; - position: relative; - a { - margin-right: 5px; - display: inline-block; - margin-bottom: 0px; - margin-top: 0px; - padding: 3px; - .icon-img { - vertical-align: -6px; - opacity: 1; - padding: 3px; - width: 23px; - height: 23px; - margin: 0px 0px; - filter: none; - @media screen and (min-width: 580px) { - margin: 3px; - width: 28px; - height: 28px; - margin-right: 8px; - } - @media screen and (min-width: 1100px) { - margin: 1px; - margin-right: 5px; - width: 30px; - height: 30px; - margin-bottom: 40px; - } - } - } - } - } - .user-profile-header-container { - @media screen and (min-width: 1100px) { - width: calc(100% - 420px); - margin-left: 6%; - } } .user-metadata-details { width: 97%; @@ -231,30 +142,4 @@ } } } - .tag-action-buttons { - height: 30px; - margin-top: calc(0.5vw + 6px); - margin-bottom: 8px; - margin-left: 1%; - text-align: center; - @media screen and (min-width: 430px) { - margin-bottom: 20px; - } - @media screen and (min-width: 800px) { - margin-bottom: 25px; - } - @media screen and (min-width: 850px) { - margin-bottom: 10px; - } - @media screen and (min-width: 950px) { - margin-left: calc(0.2vw + 320px); - text-align: left; - } - } - .user-profile-follow-button-wrapper { - position: relative; - z-index: 5; - display: inline-block; - margin-left: 5px; - } } diff --git a/app/controllers/admin/podcasts_controller.rb b/app/controllers/admin/podcasts_controller.rb index 32c2eb6ea..30567c657 100644 --- a/app/controllers/admin/podcasts_controller.rb +++ b/app/controllers/admin/podcasts_controller.rb @@ -17,6 +17,7 @@ module Admin main_color_hex slug image + featured reachable published ].freeze diff --git a/app/controllers/podcast_episodes_controller.rb b/app/controllers/podcast_episodes_controller.rb index 0f4c40671..07f4b5c62 100644 --- a/app/controllers/podcast_episodes_controller.rb +++ b/app/controllers/podcast_episodes_controller.rb @@ -5,20 +5,16 @@ class PodcastEpisodesController < ApplicationController def index @podcast_index = true - @podcasts = Podcast.available.order(title: :asc) + @featured_podcasts = Podcast.available.featured.order(title: :asc).limit(4) + @more_podcasts = Podcast.available.order(title: :asc) @podcast_episodes = PodcastEpisodeDecorator.decorate_collection(PodcastEpisode .available - .includes(:podcast).order(published_at: :desc).first(20)) + .includes(:podcast).order(published_at: :desc).limit(6)) if params[:q].blank? surrogate_keys = ["podcast_episodes_all"] + @podcast_episodes.map(&:record_key) set_surrogate_key_header(surrogate_keys) end - - @featured_story = Article.new - @article_index = true - @list_of = "podcast-episodes" - render template: "podcast_episodes/index" end end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 01b1c1e1b..ab7b70eaa 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -155,7 +155,7 @@ class StoriesController < ApplicationController @podcast_index = true @list_of = "podcast-episodes" @podcast_episodes = @podcast.podcast_episodes - .reachable.order(published_at: :desc).limit(30).decorate + .reachable.order(published_at: :desc).page(params[:page]).per(30) set_surrogate_key_header "podcast_episodes" render template: "podcast_episodes/index" end diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb index 8c0a110ef..3a551ce14 100644 --- a/app/decorators/application_decorator.rb +++ b/app/decorators/application_decorator.rb @@ -5,7 +5,9 @@ class ApplicationDecorator delegate_missing_to :@object # ActiveModel compatibility - delegate :to_param, :to_partial_path, to: :@object + delegate :to_param, :to_partial_path, :current_page, :total_pages, + :limit_value, :total_count, :entry_name, :offset_value, + :last_page?, to: :@object attr_reader :object diff --git a/app/models/podcast.rb b/app/models/podcast.rb index 9e4363ed0..9e445049c 100644 --- a/app/models/podcast.rb +++ b/app/models/podcast.rb @@ -25,6 +25,7 @@ class Podcast < ApplicationRecord after_save :bust_cache scope :reachable, -> { where(id: PodcastEpisode.reachable.select(:podcast_id)) } + scope :featured, -> { where(featured: true) } scope :published, -> { where(published: true) } scope :available, -> { reachable.published } scope :eager_load_serialized_data, -> { includes(:user, :podcast, :tags) } diff --git a/app/views/admin/podcasts/edit.html.erb b/app/views/admin/podcasts/edit.html.erb index b714e57ae..c6f40228f 100644 --- a/app/views/admin/podcasts/edit.html.erb +++ b/app/views/admin/podcasts/edit.html.erb @@ -93,10 +93,6 @@ <%= f.label :twitter_username, for: "twitter_username" %> <%= f.text_field :twitter_username, class: "form-control" %> -