-
Notifications
You must be signed in to change notification settings - Fork 0
solution: day 1 - task 3 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: day-1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,7 @@ | |
| .artist-meta { | ||
| @apply mt-2; | ||
| } | ||
|
|
||
| .artist--section-link { | ||
| @apply icon-btn text-small float-right; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <%# locals: (artist:) -%> | ||
| <div class="artist-header"> | ||
| <div class="artist-image"> | ||
| <% if artist.cover.attached? %> | ||
| <%= image_tag artist.cover %> | ||
| <% end %> | ||
| </div> | ||
| <div class="artist-info"> | ||
| <div class="flex items-center"> | ||
| <h1 class="text-header-2"><%= artist.name %></h1> | ||
| </div> | ||
| <div> | ||
| <% artist.tags.each do |tag| %> | ||
| <span class="meta"><%= tag %></span> | ||
| <% end %> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <hr class="my-4"> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <%# locals: (artist:, tracks:, page: params[:page].to_i) -%> | ||
| <%= turbo_frame_tag dom_id(artist, :tracks) do %> | ||
| <% if tracks.any? %> | ||
| <ul class="tracks"> | ||
| <%= render tracks, enqueueble: true, offset: page * 10 %> | ||
| </ul> | ||
| <%= turbo_frame_tag dom_id(artist, :tracks), target: "_self", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Интересная идея с
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Дааа. из-за target-ов глючит нещадно! Действительно, клики... Попробую на досуге доработать, кажется, что тут еще надо подумать, как упаковать фреймы. |
||
| loading: :lazy, src: tracks_artist_path(artist, page: page + 1) do %> | ||
| loading tracks... | ||
| <% end %> | ||
| <% end %> | ||
| <% end %> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <%= render partial: "header", locals: {artist:} %> | ||
|
|
||
| <h2 class="mt-4 mb-2 text-header-2">Tracks</h2> | ||
|
|
||
| <%= render "tracks", artist:, tracks:, page: 0 %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| <%# locals: (track:, track_counter: nil, track_iteration: nil, deletable: false, enqueueble: false) -%> | ||
| <%# locals: (track:, track_counter: nil, track_iteration: nil, deletable: false, enqueueble: false, offset: 0) -%> | ||
| <li class="track"> | ||
| <span class="track--number"> | ||
| <% if track.id == current_track&.id %> | ||
| <span class="track--number--text track--playing-indicator"></span> | ||
| <% else %> | ||
| <%= track_counter + 1 %> | ||
| <%= offset + track_counter + 1 %> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| <% end %> | ||
| </span> | ||
| <% if current_user&.live_station&.live? %> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, тут не хватает
target— что будет с кликом по треку?