Skip to content

Commit

Permalink
Merge branch 'podcasts'
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Jul 1, 2024
2 parents df49512 + 6eb7fef commit 6943d40
Show file tree
Hide file tree
Showing 22 changed files with 823 additions and 14 deletions.
2 changes: 2 additions & 0 deletions app/controllers/podcasts_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class PodcastsController < ApplicationController
end
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def playlists

def artists
@label = User.where(role: ["artist", "admin"], label: true).find_by(username: params[:user_id])
@collection = @label.child_accounts.page(params[:page]).per(5) # connected_accounts.page(params[:page]).per(5)
@collection = @label.child_accounts.page(params[:page]).per(50) # connected_accounts.page(params[:page]).per(5)
@as = :artist
@section = "label_artists/artist"
@title = "Artists"
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/podcasts_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PodcastsHelper
end
3 changes: 3 additions & 0 deletions app/models/podcaster_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class PodcasterInfo < ApplicationRecord
belongs_to :user
end
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class User < ApplicationRecord
has_many :hosted_events, through: :event_hosts
has_many :purchases
has_many :comments
has_one :podcaster_info


has_many :connected_accounts, foreign_key: :parent_id
Expand Down
2 changes: 2 additions & 0 deletions app/services/dante/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def convert_node_to_element(node)
create_element("p", "graf graf--p", traverse_nodes(node[:content]))
when "bulletList"
create_element("ul", "graf graf--ul", traverse_nodes(node[:content]))
when "orderedList"
create_element("ol", "graf graf--ol", traverse_nodes(node[:content]))
when "listItem"
create_element("li", "graf graf--li", traverse_nodes(node[:content]))
when "codeBlock"
Expand Down
2 changes: 1 addition & 1 deletion app/views/account_connections/_new_user.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div>
<%= form_with model: @user,
url: account_connections_path(kind: "new"), local: true do |f| %>
url: account_connections_path(kind: "new"), local: true, data: {turbo_frame: "_top"} do |f| %>

<h2 class="mx-0 mt-0 mb-4 font-sans text-2xl font-bold leading-none">
<%= t("New user") %>
Expand Down
4 changes: 4 additions & 0 deletions app/views/articles/_article_highlights.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@




<div class="py-8 sm:py-24- lg:max-w-7xl lg:mx-auto lg:py-32- lg:px-8">
<% if posts.any? %>
<div class="relative max-w-lg mx-auto divide-y-2 divide-gray-200 dark:divide-gray-100 lg:max-w-7xl">
Expand Down
3 changes: 2 additions & 1 deletion app/views/articles/update.turbo_stream.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
class="inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20">
Saved
</div>
<% end %>
<% end %>
<%= flash_stream %>
2 changes: 1 addition & 1 deletion app/views/home/_playlist_section.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
<div class="relative">
<div class="overflow-auto no-scrollbar relative" data-scroll-target="scrollContainer">
<div class="grid grid-cols-1- grid-flow-col grid-rows-1- sm:gap-x-2 md:grid-cols-4- md:gap-y-0- lg:gap-x-8">
<div class="grid grid-cols-4 grid-flow-col grid-rows-1- sm:gap-x-2 md:grid-cols-4- md:gap-y-0- lg:gap-x-8">
<% Playlist.published.latests.where(playlist_type: playlist_type).limit(limit).each do |playlist| %>
<div class="w-64 m-4">
<%= link_to playlist_path(playlist) do %>
Expand Down
77 changes: 68 additions & 9 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,75 @@
</div>
<% end %>

<%= render "articles/article_highlights",
posts: Post.published
.with_attached_cover
.includes(user: { avatar_attachment: :blob })
.order("id desc").limit(3)



<div class="bg-gray-100 min-h-screen-">
<div class="container- mx-auto- px-4- py-8- flex md:flex-row flex-col">
<!-- Main Feature Section -->

<%
Post.published
.with_attached_cover
.includes(user: { avatar_attachment: :blob })
.order("id desc").limit(1).each do |post|
%>

<div class="flex-grow bg-pink-600 text-white p-4- rounded-lg- mb-4- relative h-screen md:h-auto">
<%= image_tag(post.cover_url(:large), class: "absolute inset-0 w-full h-full object-cover opacity-50 hover:opacity-100 rounded-lg transition ease-in-out delay-150") %>
<div class="relative- z-10 flex flex-col md:flex-row items-center md:items-start absolute bottom-0">
<%= link_to article_path(post) do %>
<div class="w-full md:w-2/3 p-4">
<h1 class="text-4xl font-bold mb-4"><%= post.title %></h1>
<p class="text-lg mb-4 hidden">...</p>
<!--<a href="#" class="bg-white text-purple-600 font-semibold py-2 px-4 rounded-lg">
Read more
</a>-->
</div>
<% end %>
</div>
</div>

<% end %>

<!-- Smaller Feature Sections -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 gap-0 md:w-2/5 w-full">

<!-- Feature 1 -->
<% Post.published
.with_attached_cover
.includes(user: { avatar_attachment: :blob })
.order("id desc").limit(3).offset(1).each do |post| %>
<div class="bg-white shadow-md rounded-lg- overflow-hidden relative">

<%= image_tag(post.cover_url(:large),
class: "w-full h-48 object-cover grayscale filter"
) %>

<div class="p-4 absolute bottom-0">
<h2 class="text-xl font-bold mb-2 bg-default p-1">
<%= link_to post.title, article_path(post) %>
</h2>
<p class="text-muted font-bold">
<%= t("articles.by") %> <%= link_to post.user.username, user_path(post.user.username), class: "link" %> · <%= l post.created_at, format: :long_with_day %>.
</p>
</div>
</div>
<% end %>
</div>
</div>
</div>


<%
## render "articles/article_highlights",
# posts: Post.published
# .with_attached_cover
# .includes(user: { avatar_attachment: :blob })
# .order("id desc").limit(3)
%>



<!-- Trending products -->
<section aria-labelledby="trending-heading" class="bg-default">

Expand Down Expand Up @@ -96,21 +158,18 @@

</section>


<%= render "home/playlist_section",
playlist_type: ["ep", "album"],
limit: 10,
title: "EP & Album Releases"
%>
<%= render "home/playlist_section",
playlist_type: ["playlist"],
limit: 10,
title: "Playlists"
%>


<section aria-labelledby="collections-heading" class="bg-gray-100 dark:bg-black">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16 sm:pb-24 lg:pb-32 lg:pt-6 pt-4">
<div class="max-w-2xl mx-auto lg:max-w-none">
Expand Down
Loading

0 comments on commit 6943d40

Please sign in to comment.