mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27: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
|
alias PhilomenaWeb.SettingView
|
||||||
|
|
||||||
def index(conn, _params) do
|
def index(conn, _params) do
|
||||||
conn
|
json(conn, SettingView.theme_paths())
|
||||||
|> put_resp_content_type("application/json")
|
|
||||||
|> send_resp(200, SettingView.theme_paths_json(conn))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -88,7 +88,7 @@ h1 Content Settings
|
||||||
= error_tag f, :theme_color
|
= error_tag f, :theme_color
|
||||||
.fieldlabel: i Color of the theme
|
.fieldlabel: i Color of the theme
|
||||||
.fieldlabel: strong Don't forget to save the settings to apply 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
|
.field
|
||||||
=> label f, :scale_large_images
|
=> label f, :scale_large_images
|
||||||
=> select f, :scale_large_images, scale_options(), class: "input"
|
=> select f, :scale_large_images, scale_options(), class: "input"
|
||||||
|
|
|
@ -15,12 +15,10 @@ defmodule PhilomenaWeb.SettingView do
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
def theme_paths_json(conn) do
|
def theme_paths do
|
||||||
User.themes()
|
Map.new(User.themes(), fn name ->
|
||||||
|> Map.new(fn name ->
|
{name, static_path(PhilomenaWeb.Endpoint, "/css/#{name}.css")}
|
||||||
{name, static_path(conn, "/css/#{name}.css")}
|
|
||||||
end)
|
end)
|
||||||
|> Jason.encode!()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def scale_options do
|
def scale_options do
|
||||||
|
|
Loading…
Reference in a new issue