add: better checkboxes
This commit is contained in:
parent
0ae64de989
commit
5fbf454b52
5 changed files with 45 additions and 2 deletions
|
@ -155,7 +155,7 @@ pub(crate) async fn pull_icon(icon: &str, icons_dir: &str) {
|
||||||
"https://raw.githubusercontent.com/lucide-icons/lucide/refs/heads/main/icons/{icon}.svg"
|
"https://raw.githubusercontent.com/lucide-icons/lucide/refs/heads/main/icons/{icon}.svg"
|
||||||
);
|
);
|
||||||
|
|
||||||
let file_path = PathBufD::current().extend(&[icons_dir, icon]);
|
let file_path = PathBufD::current().extend(&[icons_dir, &format!("{icon}.svg")]);
|
||||||
|
|
||||||
if exists(&file_path).unwrap() {
|
if exists(&file_path).unwrap() {
|
||||||
writer.insert(icon.to_string(), read_to_string(&file_path).unwrap());
|
writer.insert(icon.to_string(), read_to_string(&file_path).unwrap());
|
||||||
|
|
|
@ -413,6 +413,43 @@ select:focus {
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
--color: #c9b1bc;
|
||||||
|
appearance: none;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
transition:
|
||||||
|
box-shadow 0.15s,
|
||||||
|
background 0.15s;
|
||||||
|
background-color: var(--color-super-raised);
|
||||||
|
background-position: center;
|
||||||
|
background-origin: padding-box;
|
||||||
|
background-size: 14px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 1em !important;
|
||||||
|
height: 1em;
|
||||||
|
outline: none;
|
||||||
|
border: solid 1px var(--color-super-lowered);
|
||||||
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--color-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:hover {
|
||||||
|
box-shadow: var(--shadow-x-offset) var(--shadow-y-offset) var(--shadow-size)
|
||||||
|
var(--color-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:focus {
|
||||||
|
outline: solid 2px var(--color);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked {
|
||||||
|
border-color: var(--color);
|
||||||
|
background-color: var(--color);
|
||||||
|
background-image: url("/icons/check.svg");
|
||||||
|
}
|
||||||
|
|
||||||
/* pillmenu */
|
/* pillmenu */
|
||||||
.pillmenu {
|
.pillmenu {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -919,7 +919,7 @@ media_theme_pref();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option.input_element_type === "checkbox") {
|
if (option.input_element_type === "checkbox") {
|
||||||
into_element.innerHTML += `<div class="card flex gap-2">
|
into_element.innerHTML += `<div class="card flex items-center gap-2">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
onchange="window.set_setting_field${id_key}('${option.key}', event.target.checked)"
|
onchange="window.set_setting_field${id_key}('${option.key}', event.target.checked)"
|
||||||
|
|
|
@ -24,6 +24,10 @@ pub fn routes(config: &Config) -> Router {
|
||||||
"/public",
|
"/public",
|
||||||
get_service(tower_http::services::ServeDir::new(&config.dirs.assets)),
|
get_service(tower_http::services::ServeDir::new(&config.dirs.assets)),
|
||||||
)
|
)
|
||||||
|
.nest_service(
|
||||||
|
"/icons",
|
||||||
|
get_service(tower_http::services::ServeDir::new(&config.dirs.icons)),
|
||||||
|
)
|
||||||
.nest_service(
|
.nest_service(
|
||||||
"/reference",
|
"/reference",
|
||||||
get_service(tower_http::services::ServeDir::new(&config.dirs.rustdoc)),
|
get_service(tower_http::services::ServeDir::new(&config.dirs.rustdoc)),
|
||||||
|
|
2
sql_changes/users_secondary_permissions.sql
Normal file
2
sql_changes/users_secondary_permissions.sql
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE users
|
||||||
|
ADD COLUMN secondary_permissions INT NOT NULL DEFAULT 1;
|
Loading…
Add table
Add a link
Reference in a new issue