diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7141c4e9..4d08e633 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -77,4 +77,12 @@ def shelf_grid_tag(**options, &block) tag.div(**tag_options, &block) end + + def page_title_tag(title) + content_for :title, title + end + + def turbo_native? + request.user_agent.to_s.match?(/Turbo Native/) + end end diff --git a/app/views/albums/index.html.erb b/app/views/albums/index.html.erb index cead22cc..a8876f5d 100644 --- a/app/views/albums/index.html.erb +++ b/app/views/albums/index.html.erb @@ -1,3 +1,5 @@ +<% page_title_tag t('label.albums') %> + <% if @albums.empty? %>
<%= empty_alert_tag has_icon: true, has_overlay: false %> diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb index 2300db56..fcca3aef 100644 --- a/app/views/artists/index.html.erb +++ b/app/views/artists/index.html.erb @@ -1,3 +1,5 @@ +<% page_title_tag t('label.artists') %> + <% if @artists.empty? %>
<%= empty_alert_tag has_icon: true, has_overlay: false %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 376c15e8..f1680f37 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,31 +1,40 @@ <% content_for :body do %> -
- -
-
-
-
- <%= render 'shared/flash' %> -
- <%= render 'shared/search_bar' %> - <%= render 'shared/nav_bar' %> -
-
- <%= yield %> -
-
- <%= render 'shared/mini_player' %> -
+ <% if turbo_native? %> +
+ <%= render 'shared/flash' %> +
+
+ <%= yield %> +
+ <% else %> +
+ +
+
+
+
+ <%= render 'shared/flash' %> +
+ <%= render 'shared/search_bar' %> + <%= render 'shared/nav_bar' %> +
+
+ <%= yield %> +
+
+ <%= render 'shared/mini_player' %> +
+
-
+ <% end %>
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 3206d3ef..ddeed282 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -3,14 +3,14 @@ - Black Candy + <%= content_for?(:title) ? yield(:title) : "Black Candy" %> <%= csrf_meta_tags %> <%= favicon_link_tag 'link_icon.png', type: 'image/png' %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> - + <%= content_for?(:body) ? yield(:body) : yield %> <%= render 'shared/icons' %> diff --git a/app/views/settings/show.html.erb b/app/views/settings/show.html.erb index 925d7914..c969f012 100644 --- a/app/views/settings/show.html.erb +++ b/app/views/settings/show.html.erb @@ -1,3 +1,5 @@ +<% page_title_tag t('label.settings') %> +
<%= render partial: 'users/settings/form', locals: { user: @user } %> <% if is_admin? %> diff --git a/app/views/songs/index.html.erb b/app/views/songs/index.html.erb index a697e18e..50d7c72d 100644 --- a/app/views/songs/index.html.erb +++ b/app/views/songs/index.html.erb @@ -1,3 +1,5 @@ +<% page_title_tag t('label.songs') %> + <% if @songs.empty? %>
<%= empty_alert_tag has_icon: true, has_overlay: false %>