review fixes

This commit is contained in:
Luna D. 2024-12-17 19:35:47 +01:00
parent 6ca1c4bb74
commit 16540f57f0
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
35 changed files with 103 additions and 112 deletions

View file

@ -6,6 +6,10 @@ $max-limited-desktop-width: 1150px;
$min-desktop-width: 800px; $min-desktop-width: 800px;
$limited-layout-width: 980px; $limited-layout-width: 980px;
$min-desktop-thumb-width: 700px; $min-desktop-thumb-width: 700px;
$image-tiny-size: 64px;
$image-small-size: 128px;
$image-medium-size: 256px;
$image-large-size: 512px;
:root { :root {
--medium-layout-width: $medium-layout-width; --medium-layout-width: $medium-layout-width;
@ -22,10 +26,10 @@ $min-desktop-thumb-width: 700px;
--padding-normal: 1em; --padding-normal: 1em;
--centered-margin: 24px; --centered-margin: 24px;
--normal-margin: 12px; --normal-margin: 12px;
--image-tiny-size: 64px; --image-tiny-size: $image-tiny-size;
--image-small-size: 128px; --image-small-size: $image-small-size;
--image-medium-size: 256px; --image-medium-size: $image-medium-size;
--image-large-size: 512px; --image-large-size: $image-large-size;
--header-height: 36px; --header-height: 36px;
--header-field-height: 28px; --header-field-height: 28px;
--header-sub-height: 32px; --header-sub-height: 32px;

View file

@ -1,8 +1,8 @@
@define-mixin image-alt-size $name, $size { @define-mixin image-alt-size $name, $size {
@media (min-width: $(size)) { @media (min-width: $size) {
img[alt="$(name)"] { img[alt="$(name)"] {
max-height: $(size) !important; max-height: $size !important;
max-width: $(size) !important; max-width: $size !important;
} }
} }
} }
@ -67,7 +67,7 @@
background: $(color); background: $(color);
} }
/* 16x16 checkerboard */ /* 16x16 checkerboard */
@define-mixin img-checkerboard-background { @define-mixin img-checkerboard-background {
img { img {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAGUlEQVR42mP474AKGdDhCFGALoChYWQoAACpW7+B5lv5BwAAAABJRU5ErkJggg=="); background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAGUlEQVR42mP474AKGdDhCFGALoChYWQoAACpW7+B5lv5BwAAAABJRU5ErkJggg==");

View file

@ -47,7 +47,7 @@ h4 {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
/* Slightly dirty, no clean way to strip top margins off headers though */ /* Slightly dirty, no clean way to strip top margins off headers though */
.remove-top-margin { .remove-top-margin {
margin-top: 0; margin-top: 0;
} }
@ -201,7 +201,7 @@ hr {
background: var(--danger-light-color); background: var(--danger-light-color);
border-color: var(--danger-color); border-color: var(--danger-color);
} }
/* Make HTML lists with multi-line text readable */ /* Make HTML lists with multi-line text readable */
.rule ul { .rule ul {
margin: 0; margin: 0;
padding: 5px 20px; padding: 5px 20px;
@ -237,7 +237,7 @@ hr {
} }
} }
/* Text Editor */ /* Text Editor */
blockquote { blockquote {
margin: 1em 2em; margin: 1em 2em;
border: 1px dotted var(--foreground-color); border: 1px dotted var(--foreground-color);
@ -253,13 +253,13 @@ blockquote .paragraph:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
/* Prevent blockquote from gaining far too much indentation and breaking. */ /* Prevent blockquote from gaining far too much indentation and breaking. */
blockquote blockquote blockquote blockquote blockquote blockquote { blockquote blockquote blockquote blockquote blockquote blockquote {
margin: 1em 0; margin: 1em 0;
padding: 1em 2px; padding: 1em 2px;
} }
/* Horizontal space is at a high premium on mobile. */ /* Horizontal space is at a high premium on mobile. */
@media (max-width: $min-desktop-width) { @media (max-width: $min-desktop-width) {
blockquote { blockquote {
margin: 1em 4px; margin: 1em 4px;
@ -329,10 +329,12 @@ blockquote blockquote blockquote blockquote blockquote blockquote {
margin-bottom: 6px; margin-bottom: 6px;
} }
@mixin image-alt-size tiny, var(--image-tiny-size); /* We need to use $variables here because @media tags
@mixin image-alt-size small, var(--image-small-size); * do not work with CSS3 custom properties (variables) */
@mixin image-alt-size medium, var(--image-medium-size); @mixin image-alt-size tiny, $image-tiny-size;
@mixin image-alt-size large, var(--image-large-size); @mixin image-alt-size small, $image-small-size;
@mixin image-alt-size medium, $image-medium-size;
@mixin image-alt-size large, $image-large-size;
/* code styling */ /* code styling */
/* You might be asking what's up with this silly mixin /* You might be asking what's up with this silly mixin
@ -443,7 +445,7 @@ i.favicon-home {
display: inline-block; display: inline-block;
} }
/* changelog */ /* changelog */
.commit-sha { .commit-sha {
background: var(--assistant-color); background: var(--assistant-color);
border: 1px solid var(--assistant-border-color); border: 1px solid var(--assistant-border-color);

View file

@ -8,7 +8,7 @@
display: none; display: none;
} }
/* content sliding open */ /* content sliding open */
#container.open { #container.open {
@mixin transform-n-animation open, 0.4s, translate(210px, 0); @mixin transform-n-animation open, 0.4s, translate(210px, 0);
} }
@ -23,7 +23,7 @@
} }
} }
/* content closing */ /* content closing */
#container.close { #container.close {
animation: close 0.3s ease-in-out; animation: close 0.3s ease-in-out;
} }

View file

@ -18,7 +18,7 @@
color: var(--unread-message-color); color: var(--unread-message-color);
} }
/* For text preceded by an icon */ /* For text preceded by an icon */
.fa__text { .fa__text {
padding-left: 6px; padding-left: 6px;
} }
@ -98,7 +98,7 @@ select.header__input:focus optgroup {
.header__search__button, .header__search__button,
.header__search__button:visited { .header__search__button:visited {
border: none; border: none;
/* Chrome loves extra padding for some reason */ /* Chrome loves extra padding for some reason */
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
line-height: var(--header-field-height); line-height: var(--header-field-height);

View file

@ -125,7 +125,7 @@ nav {
} }
/* Use the following two classes to center content when user has layout centering enabled: */ /* Use the following two classes to center content when user has layout centering enabled: */
/* TODO replace this bullshit naming, this is not actually BEM at all and makes no sense */ /* TODO replace this bullshit naming, this is not actually BEM at all and makes no sense */
#container.layout--center-aligned .center--layout { #container.layout--center-aligned .center--layout {
justify-content: center; justify-content: center;
margin-left: auto; margin-left: auto;
@ -188,7 +188,7 @@ nav {
justify-content: center; justify-content: center;
} }
/* Mostly for the header */ /* Mostly for the header */
.flex--start-bunched { .flex--start-bunched {
justify-content: flex-start; justify-content: flex-start;
} }

View file

@ -62,7 +62,7 @@ a.media-box__header--link:hover {
background-color: var(--success-color); background-color: var(--success-color);
} }
/* TODO: properly fix this */ /* TODO: properly fix this */
.media-box__content .image-container { .media-box__content .image-container {
width: 100%; width: 100%;
height: 100%; height: 100%;

View file

@ -1,5 +1,5 @@
/* For more shame related to this, see the <style> element inside app/views/adverts/index.html.slim */ /* For more shame related to this, see the <style> element inside app/views/adverts/index.html.slim */
/* Until HTML/CSS includes a native way to resize iframes based on their content, we do this approximation with viewport units. */ /* Until HTML/CSS includes a native way to resize iframes based on their content, we do this approximation with viewport units. */
.ad-sandbox { .ad-sandbox {
height: 18vw; height: 18vw;
max-height: 113px; max-height: 113px;

View file

@ -65,7 +65,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -65,7 +65,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -66,7 +66,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -64,7 +64,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -48,7 +48,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -46,7 +46,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -45,7 +45,7 @@ $image-overlay-background-color: #000000;
/* Put any color variable overrides here. /* Put any color variable overrides here.
* *
* Note: due to (probably unintentional) behavior of Vite, * Note: due to (intentional and bad) behavior of Vite,
* this needs to contain something unique that the other * this needs to contain something unique that the other
* themes do not have, as Vite does not compile what it considers * themes do not have, as Vite does not compile what it considers
* "inputs with identical contents", and it does not seem to care * "inputs with identical contents", and it does not seem to care

View file

@ -1,4 +1,4 @@
/* Category Tag */ /* Category Tag */
.commission__category { .commission__category {
border: 1px solid; border: 1px solid;
display: inline-block; display: inline-block;

View file

@ -1,4 +1,4 @@
/* Post diffs */ /* Post diffs */
del.differ { del.differ {
width: 670px; width: 670px;
background: var(--danger-light-color); background: var(--danger-light-color);

View file

@ -8,11 +8,11 @@
} }
.profile-top__name-and-links { .profile-top__name-and-links {
/* Allow options extra space on high width even when name is short */ /* Allow options extra space on high width even when name is short */
flex: 1 1 0%; flex: 1 1 0%;
} }
/* Lessen h1's margins because it's not butting up against text */ /* Lessen h1's margins because it's not butting up against text */
h1.profile-top__name-header { h1.profile-top__name-header {
margin-top: 10px; margin-top: 10px;
margin-bottom: 0; margin-bottom: 0;
@ -47,7 +47,7 @@ td.table--stats__sparkline {
.profile-top__options__column { .profile-top__options__column {
flex: 0 0 auto; flex: 0 0 auto;
/* Override terrible browser styling */ /* Override terrible browser styling */
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0.5em 2em 0.5em 0; margin: 0.5em 2em 0.5em 0;

View file

@ -1,4 +1,4 @@
/* Tagsinput */ /* Tagsinput */
.tagsinput { .tagsinput {
display: block; display: block;
background: var(--background-color); background: var(--background-color);
@ -23,7 +23,7 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
/* Autocomplete */ /* Autocomplete */
.autocomplete__list { .autocomplete__list {
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
@ -47,7 +47,7 @@
color: var(--base-color); color: var(--base-color);
} }
/* Tags */ /* Tags */
.tag { .tag {
border: 1px solid; border: 1px solid;
display: inline-table; display: inline-table;
@ -123,7 +123,7 @@
margin-left: 5px; margin-left: 5px;
} }
/* Quick Tag Table */ /* Quick Tag Table */
.quick-tag-table__tab > div { .quick-tag-table__tab > div {
display: inline-block; display: inline-block;
padding: 0 6px; padding: 0 6px;

View file

@ -347,10 +347,7 @@ defmodule Philomena.Users.User do
:show_sidebar_and_watched_images :show_sidebar_and_watched_images
]) ])
|> TagList.propagate_tag_list(:watched_tag_list, :watched_tag_ids) |> TagList.propagate_tag_list(:watched_tag_list, :watched_tag_ids)
|> validate_inclusion( |> validate_inclusion(:theme, themes())
:theme,
~W(dark-red dark-orange dark-yellow dark-blue dark-green dark-purple dark-cyan dark-pink dark-silver light-red light-orange light-yellow light-blue light-green light-purple light-cyan light-pink light-silver)
)
|> validate_inclusion(:images_per_page, 1..50) |> validate_inclusion(:images_per_page, 1..50)
|> validate_inclusion(:comments_per_page, 1..100) |> validate_inclusion(:comments_per_page, 1..100)
|> validate_inclusion(:scale_large_images, ["false", "partscaled", "true"]) |> validate_inclusion(:scale_large_images, ["false", "partscaled", "true"])
@ -606,4 +603,18 @@ defmodule Philomena.Users.User do
defp remove_backup_code(user, token), defp remove_backup_code(user, token),
do: user.otp_backup_codes |> Enum.reject(&Password.verify_pass(token, &1)) do: user.otp_backup_codes |> Enum.reject(&Password.verify_pass(token, &1))
def theme_colors do
~W(red orange yellow blue green purple cyan pink silver)
end
def theme_names do
~W(dark light)
end
def themes do
for name <- theme_names(), color <- theme_colors() do
"#{name}-#{color}"
end
end
end end

View file

@ -86,8 +86,9 @@ h1 Content Settings
label> Theme color label> Theme color
=> select f, :theme_color, theme_colors(), class: "input" => select f, :theme_color, theme_colors(), class: "input"
= error_tag f, :theme_color = error_tag f, :theme_color
.fieldlabel: i Color of the theme, don't forget to save settings to apply the theme .fieldlabel: i Color of the theme
.hidden#js-theme-paths data-theme-paths=theme_paths_json() .fieldlabel: strong Don't forget to save the settings to apply the theme!
.hidden#js-theme-paths data-theme-paths=theme_paths_json(@conn)
.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"

View file

@ -4,8 +4,11 @@ defmodule PhilomenaWeb.LayoutView do
import PhilomenaWeb.Config import PhilomenaWeb.Config
alias PhilomenaWeb.ImageView alias PhilomenaWeb.ImageView
alias Philomena.Config alias Philomena.Config
alias Philomena.Users.User
alias Plug.Conn alias Plug.Conn
@themes User.themes()
def layout_class(conn) do def layout_class(conn) do
conn.assigns[:layout_class] || "layout--narrow" conn.assigns[:layout_class] || "layout--narrow"
end end
@ -70,26 +73,7 @@ defmodule PhilomenaWeb.LayoutView do
end end
def stylesheet_path(conn, %{theme: theme}) def stylesheet_path(conn, %{theme: theme})
when theme in [ when theme in @themes,
"dark-red",
"dark-orange",
"dark-yellow",
"dark-blue",
"dark-green",
"dark-purple",
"dark-cyan",
"dark-pink",
"dark-silver",
"light-red",
"light-orange",
"light-yellow",
"light-blue",
"light-green",
"light-purple",
"light-cyan",
"light-pink",
"light-silver"
],
do: static_path(conn, "/css/#{theme}.css") do: static_path(conn, "/css/#{theme}.css")
def stylesheet_path(_conn, _user), def stylesheet_path(_conn, _user),

View file

@ -1,5 +1,6 @@
defmodule PhilomenaWeb.SettingView do defmodule PhilomenaWeb.SettingView do
use PhilomenaWeb, :view use PhilomenaWeb, :view
alias Philomena.Users.User
def themes do def themes do
[ [
@ -9,40 +10,20 @@ defmodule PhilomenaWeb.SettingView do
end end
def theme_colors do def theme_colors do
[ Enum.map(User.theme_colors(), fn name ->
Red: "red", case name do
Orange: "orange", "silver" -> {"Silver/Charcoal", name}
Yellow: "yellow", _ -> {String.capitalize(name), name}
Green: "green", end
Blue: "blue", end)
Purple: "purple",
Cyan: "cyan",
Pink: "pink",
"Silver/Charcoal": "silver"
]
end end
def theme_paths_json do def theme_paths_json(conn) do
Jason.encode!(%{ User.themes()
"dark-red": ~p"/css/dark-red.css", |> Map.new(fn name ->
"dark-orange": ~p"/css/dark-orange.css", {name, static_path(conn, "/css/#{name}.css")}
"dark-yellow": ~p"/css/dark-yellow.css", end)
"dark-blue": ~p"/css/dark-blue.css", |> Jason.encode!()
"dark-green": ~p"/css/dark-green.css",
"dark-purple": ~p"/css/dark-purple.css",
"dark-cyan": ~p"/css/dark-cyan.css",
"dark-pink": ~p"/css/dark-pink.css",
"dark-silver": ~p"/css/dark-silver.css",
"light-red": ~p"/css/light-red.css",
"light-orange": ~p"/css/light-orange.css",
"light-yellow": ~p"/css/light-yellow.css",
"light-blue": ~p"/css/light-blue.css",
"light-green": ~p"/css/light-green.css",
"light-purple": ~p"/css/light-purple.css",
"light-cyan": ~p"/css/light-cyan.css",
"light-pink": ~p"/css/light-pink.css",
"light-silver": ~p"/css/light-silver.css"
})
end end
def scale_options do def scale_options do

View file

@ -5,11 +5,19 @@ defmodule Philomena.Repo.Migrations.ConvertUserThemes do
execute("update users set theme = 'light-blue' where theme = 'default';") execute("update users set theme = 'light-blue' where theme = 'default';")
execute("update users set theme = 'dark-blue' where theme = 'dark';") execute("update users set theme = 'dark-blue' where theme = 'dark';")
execute("update users set theme = 'dark-red' where theme = 'red';") execute("update users set theme = 'dark-red' where theme = 'red';")
alter table("users") do
modify :theme, :varchar, default: "dark-blue"
end
end end
def down do def down do
execute("update users set theme = 'default' where theme like 'light%';") execute("update users set theme = 'default' where theme like 'light%';")
execute("update users set theme = 'red' where theme = 'dark-red';") execute("update users set theme = 'red' where theme = 'dark-red';")
execute("update users set theme = 'dark' where theme like 'dark%';") execute("update users set theme = 'dark' where theme like 'dark%';")
alter table("users") do
modify :theme, :varchar, default: "default"
end
end end
end end