Skip to content

Commit

Permalink
refactor: update url when switch channel type
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Oct 18, 2024
1 parent 063f1ea commit 5849bbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/views/channels/_channels.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
ul.nav.nav-pills.flex-column
- @channel.scheme.channels.each do |channel|
li.nav-item
= link_to channel_platform(channel), friendly_channel_overview_path(channel), class: "nav-link nav-link-flat #{(params[:id] || params[:channel]) == channel.slug ? 'active' : ''}"
= link_to channel_platform(channel), friendly_channel_overview_path(channel), \
class: "nav-link nav-link-flat #{(params[:id] || params[:channel]) == channel.slug ? 'active' : ''}", \
data: { turbo_action: :advance }
5 changes: 3 additions & 2 deletions app/views/channels/_mobile_menu.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
scheme_link = using_friendly_channel_path(scheme, @channel)
- if scheme_link.present?
li
= link_to scheme.name, scheme_link, class: 'dropdown-item'
= link_to scheme.name, scheme_link, class: 'dropdown-item', data: { turbo_action: :advance }

.nav-item.dropdown.channels.w-50
button.btn.btn-secondary.dropdown-toggle.w-100.rounded-0.rounded-end data-bs-toggle="dropdown"
Expand All @@ -21,7 +21,8 @@
- if channels.present?
- channels.each do |channel|
li
= link_to channel_platform(channel), friendly_channel_overview_path(channel), class: 'dropdown-item'
= link_to channel_platform(channel), friendly_channel_overview_path(channel), \
class: 'dropdown-item', data: { turbo_action: :advance }
- else
li
span.text-gray.dropdown-item = t('channels.show.none')
Expand Down
5 changes: 3 additions & 2 deletions app/views/channels/_schemes.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
scheme_link = using_friendly_channel_path(scheme, @channel)
- if scheme_link.present?
li.nav-item
a.nav-link.nav-link-flat href="#{scheme_link}" class="#{@channel.scheme.name == scheme.name ? 'active' : ''}"
= scheme.name
= link_to scheme.name, scheme_link, \
class: "nav-link nav-link-flat #{@channel.scheme.name == scheme.name ? 'active' : ''}", \
data: { turbo_action: :advance }

0 comments on commit 5849bbf

Please sign in to comment.