data-theme should follow the theme

This commit is contained in:
byte[] 2019-12-15 21:35:07 -05:00
parent af1781dcd0
commit d5a7653393
2 changed files with 5 additions and 2 deletions

View file

@ -20,7 +20,7 @@ html lang="en"
= csrf_meta_tag()
script type="text/javascript" src=Routes.static_path(@conn, "/js/app.js") async="async"
= render PhilomenaWeb.LayoutView, "_opengraph.html", assigns
body data-theme="default"
body data-theme=theme_name(@current_user)
= render PhilomenaWeb.LayoutView, "_burger.html", assigns
#container class=container_class(@current_user)
= render PhilomenaWeb.LayoutView, "_header.html", assigns

View file

@ -74,6 +74,9 @@ defmodule PhilomenaWeb.LayoutView do
def stylesheet_path(conn, _user),
do: Routes.static_path(conn, "/css/default.css")
def theme_name(%{theme: theme}), do: theme
def theme_name(_user), do: "default"
def artist_tags(tags),
do: Enum.filter(tags, & &1.namespace == "artist")