mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 14:17:59 +01:00
fixup
This commit is contained in:
parent
d5cf9aeb9d
commit
0d21e49fff
3 changed files with 5 additions and 9 deletions
|
@ -4,8 +4,6 @@ defmodule PhilomenaWeb.Api.Json.ThemeController do
|
|||
alias PhilomenaWeb.SettingView
|
||||
|
||||
def index(conn, _params) do
|
||||
conn
|
||||
|> put_resp_content_type("application/json")
|
||||
|> send_resp(200, SettingView.theme_paths_json(conn))
|
||||
json(conn, SettingView.theme_paths())
|
||||
end
|
||||
end
|
||||
|
|
|
@ -88,7 +88,7 @@ h1 Content Settings
|
|||
= error_tag f, :theme_color
|
||||
.fieldlabel: i Color of the theme
|
||||
.fieldlabel: strong Don't forget to save the settings to apply the theme!
|
||||
.hidden#js-theme-paths data-theme-paths=theme_paths_json(@conn)
|
||||
.hidden#js-theme-paths data-theme-paths=Jason.encode!(theme_paths())
|
||||
.field
|
||||
=> label f, :scale_large_images
|
||||
=> select f, :scale_large_images, scale_options(), class: "input"
|
||||
|
|
|
@ -15,12 +15,10 @@ defmodule PhilomenaWeb.SettingView do
|
|||
end)
|
||||
end
|
||||
|
||||
def theme_paths_json(conn) do
|
||||
User.themes()
|
||||
|> Map.new(fn name ->
|
||||
{name, static_path(conn, "/css/#{name}.css")}
|
||||
def theme_paths do
|
||||
Map.new(User.themes(), fn name ->
|
||||
{name, static_path(PhilomenaWeb.Endpoint, "/css/#{name}.css")}
|
||||
end)
|
||||
|> Jason.encode!()
|
||||
end
|
||||
|
||||
def scale_options do
|
||||
|
|
Loading…
Reference in a new issue