Skip to content

Commit

Permalink
playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Oct 17, 2023
1 parent adfd7fd commit 20d8028
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def albums
.page(params[:page]).per(5)
@as = :playlist
@section = "playlists/playlist_item"
binding.pry
render "show"
end

Expand Down
41 changes: 39 additions & 2 deletions app/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ def self.genres
"Trance",
"Trap",
"Triphop",
"World"
"World",
"UwUaracha",
"Trap",
"Latin Tecno",
"Latin Core",
"Dark Disco",
"FootWork",
""
]
end

Expand Down Expand Up @@ -95,6 +102,18 @@ def self.all
"Europop"
]
},
{
"genre": "Electronic Dance Music",
"subgenres": [
"House",
"Techno",
"Drum and Bass",
"Dubstep",
"Ambient",
"Trance",
"Footwork",
]
},
{
"genre" => "Drum & Bass",
"subgenres" => [
Expand Down Expand Up @@ -142,7 +161,8 @@ def self.all
"Minimal Techno",
"Schranz",
"Hard Techno",
"Trance Techno"
"Trance Techno",
"Dark Disco"
]
},
{
Expand All @@ -154,6 +174,7 @@ def self.all
"Hard Trance",
"Progressive Trance",
"Uplifting Trance"

]
},
{
Expand Down Expand Up @@ -233,6 +254,22 @@ def self.all
"Post-Metal",
"Sludge Metal"
]
},
{
"genre": "Latin Electronica",
"subgenres": [
"Latin House",
"Reggaeton",
"Moombahton",
"Cumbiaton",
"UwUaracha",
"Tribal Guarachero (or 3Ball)",
"Electrocumbia",
"Latin Trap",
"Digital Cumbia",
"Bachata Electronica",
"Latin Trance or Latin Progressive House"
]
}
]
end
Expand Down
13 changes: 13 additions & 0 deletions app/models/playlist.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
class Playlist < ApplicationRecord

class Types
def self.plain
[
"Playlist",
"Album",
"EP",
"Single",
"Compilation"
]
end
end

extend FriendlyId
friendly_id :title, use: :slugged

Expand Down
2 changes: 1 addition & 1 deletion app/views/playlists/_basic_info_tab.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<div class="sm:col-span-4">
<%= form.label :playlist_type %>
<%= form.select :playlist_type, Category::Genres.plain, label: "Playlist type" %>
<%= form.select :playlist_type, Playlist::Types.plain, label: "Playlist type" %>
</div>

<div class="sm:col-span-2">
Expand Down
14 changes: 12 additions & 2 deletions app/views/playlists/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@
<%= form.text_field :title, label: gettext("Playlist title") %>
</div>
</div>

<div class="sm:col-span-4">
<%= form.label :playlist_type %>
<%= form.select :playlist_type, Playlist::Types.plain, label: "Playlist type" %>
</div>

<div class="flex items-center">
<%= form.label "Privacy" %>

<div class="sm:col-span-4">

<div class="flex items-center">
<%= form.label "Privacy" %>
</div>

</div>

<div class="flex items-start space-x-2 sm:col-span-6">
Expand Down

0 comments on commit 20d8028

Please sign in to comment.