Compare commits

...

4 Commits

Author SHA1 Message Date
ff702e7eed Configurable themes
Configurable in settings.php
Looks for bootswatch themes named bootstrap.[theme].min.css
Defaults to bootstrap.min.css ('materia')
Bundled additional themes 'darkly' and 'slate'
2022-06-07 00:48:53 +02:00
c60c2ba826 Fix error on deleting item with images attached 2022-06-06 19:53:23 +02:00
c0c95128b0 Added missing message on image deletion 2022-06-06 19:51:26 +02:00
9703c8f0d6 Fix language key duplicate 2022-06-06 19:30:46 +02:00
11 changed files with 44 additions and 6 deletions

View File

@ -29,7 +29,7 @@ if (!empty($_GET['page'])) {
header("Link: <static/img/logo.svg>; rel=preload; as=image", false); header("Link: <static/img/logo.svg>; rel=preload; as=image", false);
header("Link: <static/fonts/Roboto.css>; rel=preload; as=style", false); header("Link: <static/fonts/Roboto.css>; rel=preload; as=style", false);
header("Link: <static/css/bootstrap.min.css>; rel=preload; as=style", false); header("Link: <static/css/".$themefile.">; rel=preload; as=style", false);
header("Link: <static/css/material-color/material-color.min.css>; rel=preload; as=style", false); header("Link: <static/css/material-color/material-color.min.css>; rel=preload; as=style", false);
header("Link: <static/css/app.css>; rel=preload; as=style", false); header("Link: <static/css/app.css>; rel=preload; as=style", false);
if (FONTAWESOME_USEJS) { if (FONTAWESOME_USEJS) {
@ -52,7 +52,7 @@ header("Link: <static/js/bootstrap.bundle.min.js>; rel=preload; as=script", fals
<link rel="icon" href="static/img/logo.svg" type="image/svg+xml"> <link rel="icon" href="static/img/logo.svg" type="image/svg+xml">
<link href="static/css/bootstrap.min.css" rel="stylesheet"> <link href="static/css/<?php echo $themefile; ?>" rel="stylesheet">
<link href="static/css/material-color/material-color.min.css" rel="stylesheet"> <link href="static/css/material-color/material-color.min.css" rel="stylesheet">
<link href="static/css/app.css" rel="stylesheet"> <link href="static/css/app.css" rel="stylesheet">
<?php <?php

View File

@ -124,7 +124,7 @@ CREATE TABLE IF NOT EXISTS `images` (
CONSTRAINT `fk_images_items1` CONSTRAINT `fk_images_items1`
FOREIGN KEY (`itemid`) FOREIGN KEY (`itemid`)
REFERENCES `items` (`itemid`) REFERENCES `items` (`itemid`)
ON DELETE NO ACTION ON DELETE CASCADE
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
ENGINE = InnoDB; ENGINE = InnoDB;

View File

@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `images` (
CONSTRAINT `fk_images_items1` CONSTRAINT `fk_images_items1`
FOREIGN KEY (`itemid`) FOREIGN KEY (`itemid`)
REFERENCES `inventory`.`items` (`itemid`) REFERENCES `inventory`.`items` (`itemid`)
ON DELETE NO ACTION ON DELETE CASCADE
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
ENGINE = InnoDB ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8; DEFAULT CHARACTER SET = utf8;

View File

@ -36,7 +36,7 @@ function showHTML(string $title, string $button, string $url) {
<link rel="icon" href="static/img/logo.svg"> <link rel="icon" href="static/img/logo.svg">
<link href="static/css/bootstrap.min.css" rel="stylesheet"> <link href="static/css/<?php echo $themefile; ?>" rel="stylesheet">
<style nonce="<?php echo $SECURE_NONCE; ?>"> <style nonce="<?php echo $SECURE_NONCE; ?>">
.display-5 { .display-5 {
font-size: 2.5rem; font-size: 2.5rem;

View File

@ -6,7 +6,6 @@
"login server error": "The login server returned an error: {arg}", "login server error": "The login server returned an error: {arg}",
"login server user data error": "The login server refused to provide account information. Try again or contact technical support.", "login server user data error": "The login server refused to provide account information. Try again or contact technical support.",
"captcha error": "There was a problem with the CAPTCHA (robot test). Try again.", "captcha error": "There was a problem with the CAPTCHA (robot test). Try again.",
"no access permission": "You do not have permission to access this system.",
"no permission": "You do not have permission to access this system.", "no permission": "You do not have permission to access this system.",
"no edit permission": "You do not have permission to modify records." "no edit permission": "You do not have permission to modify records."
} }

View File

@ -8,5 +8,6 @@
"Delete": "Delete", "Delete": "Delete",
"Back": "Back", "Back": "Back",
"Image uploaded.": "Image uploaded.", "Image uploaded.": "Image uploaded.",
"image deleted": "Image deleted.",
"Upload finished with errors: {arg}": "Upload finished with errors: {arg}" "Upload finished with errors: {arg}": "Upload finished with errors: {arg}"
} }

View File

@ -96,5 +96,9 @@ define("MESSAGES", [
"upload_success" => [ "upload_success" => [
"string" => "Image uploaded.", "string" => "Image uploaded.",
"type" => "success" "type" => "success"
],
"image_deleted" => [
"string" => "image deleted",
"type" => "success"
] ]
]); ]);

View File

@ -94,6 +94,13 @@ function sendError($error) {
date_default_timezone_set($SETTINGS['timezone']); date_default_timezone_set($SETTINGS['timezone']);
// Set theme
if (file_exists('static/css/bootstrap.'.$SETTINGS['theme'].'.min.css')) {
$themefile = 'bootstrap.'.$SETTINGS['theme'].'.min.css';
} else {
$themefile = 'bootstrap.min.css';
}
// Database settings // Database settings
// Also inits database and stuff // Also inits database and stuff
use Medoo\Medoo; use Medoo\Medoo;

View File

@ -49,6 +49,9 @@ $SETTINGS = [
"timezone" => "America/Denver", "timezone" => "America/Denver",
// Language to use for localization. See langs folder to add a language. // Language to use for localization. See langs folder to add a language.
"language" => "en", "language" => "en",
// Theme to use. Choose between "materia" (light)(default), "slate" (dark) or "darkly" (dark).
// You can also add your own bootswatch theme (https://bootswatch.com/).
"theme" => "materia",
// Shown in the footer of all the pages. // Shown in the footer of all the pages.
"footer_text" => "", "footer_text" => "",
// Also shown in the footer, but with "Copyright <current_year>" in front. // Also shown in the footer, but with "Copyright <current_year>" in front.

12
static/css/bootstrap.darkly.min.css vendored Normal file

File diff suppressed because one or more lines are too long

12
static/css/bootstrap.slate.min.css vendored Normal file

File diff suppressed because one or more lines are too long