add form content
This commit is contained in:
parent
cb84b704f6
commit
c476669262
File diff suppressed because one or more lines are too long
@ -78,7 +78,6 @@
|
||||
background-position: 0 0;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.explr-toggler {
|
||||
@ -89,7 +88,6 @@
|
||||
margin-top: 2px;
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/*.explr-plus { background-image: url("../../img/explr/plus.png"); }*/
|
||||
|
||||
@ -16,6 +16,7 @@ jQuery(document).ready(function ($) {
|
||||
const inputTypeUpdate = function () {
|
||||
const $el = $('#content-add-type');
|
||||
const value = $el.val();
|
||||
const $selectedOption = $('#content-add-type option[value='+value+']');
|
||||
const inputType = $el.find('option').filter(function (i, el) {
|
||||
return $(el).val() === value;
|
||||
}).data('input');
|
||||
@ -27,6 +28,8 @@ jQuery(document).ready(function ($) {
|
||||
.removeClass('hidden')
|
||||
.prop('disabled', false)
|
||||
;
|
||||
|
||||
$('.object-label-add').html($selectedOption.get(0).attributes['data-object-label'].value);
|
||||
};
|
||||
|
||||
const initExplr = function () {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
* {
|
||||
font-family: 'Work Sans', 'Roboto', 'Arial', 'sans-serif';
|
||||
font-family: 'Roboto', 'Arial', 'sans-serif';
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
@ -19,6 +19,15 @@ body, html {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.horizontal {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
flex: 1;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -79,11 +88,24 @@ main {
|
||||
.page-content {
|
||||
flex: 2;
|
||||
overflow-y: auto;
|
||||
padding: 20px;
|
||||
background: rgba($layoutBackground, .9);
|
||||
align-self: stretch;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
background: rgba(0,0,0,.8);
|
||||
padding: 5px;
|
||||
|
||||
.inner {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
padding: 0 10px 40px 10px;
|
||||
background: $layoutBackground;
|
||||
align-self: stretch;
|
||||
}
|
||||
}
|
||||
|
||||
.page-panel {
|
||||
@ -96,6 +118,15 @@ main {
|
||||
&.left-panel {
|
||||
border-right: $layoutBorder;
|
||||
border-left: none;
|
||||
|
||||
&.explr-explorer {
|
||||
flex: 0.5;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
background: $layoutBackground;
|
||||
box-shadow: 1px 1px .5px .5px inset rgba(0, 0, 0, 0.2);
|
||||
max-width: 250px;
|
||||
}
|
||||
}
|
||||
|
||||
&.right-panel {
|
||||
@ -104,8 +135,6 @@ main {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
border-bottom: $layoutBorder;
|
||||
background: transparent;
|
||||
padding: 10px;
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
.icon-right {
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
.icon-left {
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
@ -1,49 +1,46 @@
|
||||
.modals {
|
||||
position: fixed;
|
||||
background: rgba($black, 0.4);
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
position: fixed;
|
||||
background: rgba($black, 0.4);
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 10000;
|
||||
|
||||
.modals-outer {
|
||||
min-width: 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
}
|
||||
.modals-outer {
|
||||
min-width: 464px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
padding-bottom: 2px;
|
||||
|
||||
.modals-outer .modal-close {
|
||||
color: $white;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.modals-inner {
|
||||
background: $layoutBackground;
|
||||
border-radius: 10px;
|
||||
color: lighten($black, 20%);
|
||||
padding: 40px;
|
||||
box-shadow: 0 2px #222;
|
||||
border: 1px solid #222;
|
||||
|
||||
.modals-inner {
|
||||
background: $white;
|
||||
border-radius: 10px;
|
||||
color: lighten($black, 20%);
|
||||
}
|
||||
.modal {
|
||||
h2 {
|
||||
padding: 0;
|
||||
margin: 0 0 40px 0;
|
||||
font-weight: normal;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.modals-inner .modal h2 {
|
||||
border-bottom: 1px solid $lightGrey;
|
||||
padding: 15px 15px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modals-inner .modal h3 {
|
||||
align-self: stretch;
|
||||
border-bottom: 1px solid $lightGrey;
|
||||
padding: 15px 15px;
|
||||
margin: 0;
|
||||
h3 {
|
||||
align-self: stretch;
|
||||
border-bottom: 1px solid $lightGrey;
|
||||
padding: 15px 15px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,91 +1,118 @@
|
||||
.form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
padding: 20px;
|
||||
.form-holder {
|
||||
min-width: 686px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-self: stretch;
|
||||
|
||||
form {
|
||||
max-width: 434px;
|
||||
}
|
||||
}
|
||||
|
||||
.form .form-group {
|
||||
margin: 10px 20px 5px 20px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
flex: 1;
|
||||
}
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-self: stretch;
|
||||
|
||||
.form .form-group label {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
text-align: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-self: stretch;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.form .form-group .widget {
|
||||
flex: 3;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.form .form-group input,
|
||||
.form .form-group select,
|
||||
.form .form-group textarea {
|
||||
flex: 1;
|
||||
padding: 10px 5px 10px 5px;
|
||||
border: 1px solid darken($white, 10%);
|
||||
border-radius: 4px;
|
||||
width: auto;
|
||||
}
|
||||
label {
|
||||
flex: 1;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.form .form-group input[type=checkbox] {
|
||||
flex: 0;
|
||||
}
|
||||
.widget {
|
||||
margin-top: 10px;
|
||||
align-self: stretch;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.form .form-group .trigger {
|
||||
margin-right: 10px;
|
||||
}
|
||||
select,
|
||||
input,
|
||||
textarea {
|
||||
outline: none;
|
||||
padding: 8px 0 5px 8px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgba($white, .05);
|
||||
flex: 1;
|
||||
background: #555;
|
||||
box-shadow: 0 2px 1px #444, 0 4px 2px #333 inset;
|
||||
color: #DDD;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.form .form-group select.trigger {
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
.form .form-group span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
&.tab-select {
|
||||
border-bottom: 1px solid #444;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
height: 48px;
|
||||
padding: 48px 0 0 0;
|
||||
flex: 0;
|
||||
|
||||
.form .actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
align-self: stretch;
|
||||
}
|
||||
.widget {
|
||||
height: 49px;
|
||||
margin-top: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba($seaBlue, .05);
|
||||
border-bottom: 2px solid $seaBlue;
|
||||
|
||||
.form .actions button.green,
|
||||
.form .actions button {
|
||||
font-size: 18px;
|
||||
}
|
||||
select {
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
padding: 10px 10px 10px 10px;
|
||||
margin: 0;
|
||||
appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
text-align: left;
|
||||
color: $seaBlue;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.form .actions button.green:hover {
|
||||
background: white;
|
||||
color: $limeGreen;
|
||||
border-color: $limeGreen;
|
||||
}
|
||||
|
||||
.form .actions button.btn-normal {
|
||||
color: $lightGrey;
|
||||
border-color: $lightGrey;
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form .actions button.btn-normal:hover {
|
||||
color: $neutralGrey;
|
||||
border-color: $neutralGrey;
|
||||
i {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
color: $seaBlue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,34 +5,32 @@
|
||||
// Import base styles
|
||||
@import 'base/fonts';
|
||||
@import 'base/html';
|
||||
@import 'base/menu';
|
||||
@import 'base/context';
|
||||
@import 'base/tachyons';
|
||||
|
||||
// Import layout styles
|
||||
//@import 'layout/header';
|
||||
//@import 'layout/footer';
|
||||
//@import 'layout/container';
|
||||
@import 'base/context';
|
||||
@import 'base/menu';
|
||||
|
||||
// Import component styles
|
||||
@import 'components/dropdown';
|
||||
@import 'components/keyframes';
|
||||
@import 'components/buttons';
|
||||
@import 'components/alerts';
|
||||
//@import 'components/modals';
|
||||
@import 'components/explorer';
|
||||
@import 'components/pills';
|
||||
@import 'components/breadcrumb';
|
||||
|
||||
// Legacy
|
||||
//@import 'components/toolbar';
|
||||
@import 'components/modals';
|
||||
//@import 'components/panels';
|
||||
//@import 'components/switches';
|
||||
//@import 'components/cards';
|
||||
//@import 'components/empty';
|
||||
//@import 'components/badges';
|
||||
@import 'components/explorer';
|
||||
@import 'components/pills';
|
||||
@import 'components/breadcrumb';
|
||||
//@import 'components/toolbar';
|
||||
//@import 'components/icons';
|
||||
|
||||
// Import form styles
|
||||
//@import 'forms/forms';
|
||||
@import 'forms/forms';
|
||||
|
||||
// Import pages styles
|
||||
@import 'pages/content';
|
||||
|
||||
@ -1,32 +1,7 @@
|
||||
|
||||
.view-content-list main .main-container {
|
||||
|
||||
.left-panel {
|
||||
flex: 0.5;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
background: $layoutBackground;
|
||||
box-shadow: 1px 1px .5px .5px inset rgba(0, 0, 0, 0.2);
|
||||
max-width: 250px;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
background: rgba(0,0,0,.8);
|
||||
padding: 5px;
|
||||
|
||||
.dirview {
|
||||
flex: 1;
|
||||
padding: 0 10px 40px 10px;
|
||||
background: $layoutBackground;
|
||||
align-self: stretch;
|
||||
border: 1px solid #222;
|
||||
height: 100vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
15
lang/en.json
15
lang/en.json
@ -58,7 +58,7 @@
|
||||
"slideshow_content_form_add_submit": "Add",
|
||||
"slideshow_content_form_edit_title": "Edit Content",
|
||||
"slideshow_content_form_edit_submit": "Save",
|
||||
"slideshow_content_form_label_name": "Name",
|
||||
"slideshow_content_form_label_name": "Name your content",
|
||||
"slideshow_content_form_label_location": "Location",
|
||||
"slideshow_content_form_label_type": "Type",
|
||||
"slideshow_content_form_label_object": "Object",
|
||||
@ -216,6 +216,13 @@
|
||||
"common_empty": "[Empty]",
|
||||
"common_are_you_sure": "Are you sure?",
|
||||
"common_enable_plugin": "Enable this plugin",
|
||||
"common_save": "Save",
|
||||
"common_cancel": "Cancel",
|
||||
"common_close": "Close",
|
||||
"common_confirm": "Confirm",
|
||||
"common_submit": "Submit",
|
||||
"common_validate": "Validate",
|
||||
"common_apply": "Apply",
|
||||
"logout": "Logout",
|
||||
"login_error_not_found": "Bad credentials",
|
||||
"login_error_bad_credentials": "Bad credentials",
|
||||
@ -247,9 +254,13 @@
|
||||
"enum_application_language_italian": "Italian",
|
||||
"enum_application_language_spanish": "Spanish",
|
||||
"enum_content_type_url": "URL",
|
||||
"enum_content_type_video": "Video (MP4 only)",
|
||||
"enum_content_type_video": "Video",
|
||||
"enum_content_type_picture": "Picture",
|
||||
"enum_content_type_youtube": "Youtube",
|
||||
"enum_content_type_url_object_label": "Enter URL link",
|
||||
"enum_content_type_video_object_label": "Upload your video (MP4 only)",
|
||||
"enum_content_type_picture_object_label": "Upload your image",
|
||||
"enum_content_type_youtube_object_label": "Enter Youtube video URL",
|
||||
|
||||
"sysinfo_rpi_model": "Raspberry Pi Model",
|
||||
"sysinfo_rpi_model_unknown": "Not a Raspberry Pi or model information not available",
|
||||
|
||||
13
lang/es.json
13
lang/es.json
@ -216,6 +216,13 @@
|
||||
"common_empty": "[Vacío]",
|
||||
"common_are_you_sure": "¿Estás seguro?",
|
||||
"common_enable_plugin": "Habilitar este plugin",
|
||||
"common_save": "Guardar",
|
||||
"common_cancel": "Cancelar",
|
||||
"common_close": "Cerrar",
|
||||
"common_confirm": "Confirmar",
|
||||
"common_submit": "Enviar",
|
||||
"common_validate": "Validar",
|
||||
"common_apply": "Aplicar",
|
||||
"logout": "Cerrar sesión",
|
||||
"login_error_not_found": "Credenciales incorrectas",
|
||||
"login_error_bad_credentials": "Credenciales incorrectas",
|
||||
@ -247,9 +254,13 @@
|
||||
"enum_application_language_italian": "Italiano",
|
||||
"enum_application_language_spanish": "Español",
|
||||
"enum_content_type_url": "URL",
|
||||
"enum_content_type_video": "Video (solo MP4)",
|
||||
"enum_content_type_video": "Video",
|
||||
"enum_content_type_picture": "Imagen",
|
||||
"enum_content_type_youtube": "Youtube",
|
||||
"enum_content_type_url_object_label": "Ingrese el enlace URL",
|
||||
"enum_content_type_video_object_label": "Sube tu vídeo (solo MP4)",
|
||||
"enum_content_type_picture_object_label": "Sube tu imagen",
|
||||
"enum_content_type_youtube_object_label": "Ingrese la URL del vídeo de Youtube",
|
||||
|
||||
"sysinfo_rpi_model": "Modelo de Raspberry Pi",
|
||||
"sysinfo_rpi_model_unknown": "No es una Raspberry Pi o la información del modelo no está disponible",
|
||||
|
||||
15
lang/fr.json
15
lang/fr.json
@ -58,7 +58,7 @@
|
||||
"slideshow_content_form_add_submit": "Ajouter",
|
||||
"slideshow_content_form_edit_title": "Modification d'un contenu",
|
||||
"slideshow_content_form_edit_submit": "Enregistrer",
|
||||
"slideshow_content_form_label_name": "Nom",
|
||||
"slideshow_content_form_label_name": "Nom de l'élément",
|
||||
"slideshow_content_form_label_location": "Chemin",
|
||||
"slideshow_content_form_label_type": "Type",
|
||||
"slideshow_content_form_label_object": "Objet",
|
||||
@ -216,6 +216,13 @@
|
||||
"common_empty": "[Vide]",
|
||||
"common_are_you_sure": "Êtes-vous sûr ?",
|
||||
"common_enable_plugin": "Activer ce plugin",
|
||||
"common_save": "Enregistrer",
|
||||
"common_cancel": "Annuler",
|
||||
"common_close": "Fermer",
|
||||
"common_confirm": "Confirmer",
|
||||
"common_submit": "Envoyer",
|
||||
"common_validate": "Valider",
|
||||
"common_apply": "Appliquer",
|
||||
"logout": "Déconnexion",
|
||||
"login_error_not_found": "Identifiants invalides",
|
||||
"login_error_bad_credentials": "Identifiants invalides",
|
||||
@ -247,9 +254,13 @@
|
||||
"enum_application_language_italian": "Italien",
|
||||
"enum_application_language_spanish": "Espagnol",
|
||||
"enum_content_type_url": "URL",
|
||||
"enum_content_type_video": "Vidéo (MP4 seulement)",
|
||||
"enum_content_type_video": "Vidéo",
|
||||
"enum_content_type_picture": "Image",
|
||||
"enum_content_type_youtube": "Youtube",
|
||||
"enum_content_type_url_object_label": "Entrez l'URL de la page",
|
||||
"enum_content_type_video_object_label": "Uploadez votre vidéo (MP4 seulement)",
|
||||
"enum_content_type_picture_object_label": "Uploadez votre image",
|
||||
"enum_content_type_youtube_object_label": "Enrez l'URL de la vidéo Youtube",
|
||||
|
||||
"sysinfo_rpi_model": "Modèle du Raspberry Pi",
|
||||
"sysinfo_rpi_model_unknown": "Le modèle n'est pas un Raspberry Pi",
|
||||
|
||||
13
lang/it.json
13
lang/it.json
@ -216,6 +216,13 @@
|
||||
"common_empty": "[Empty]",
|
||||
"common_are_you_sure": "Sei sicuro?",
|
||||
"common_enable_plugin": "Attiva questo plugin",
|
||||
"common_save": "Salva",
|
||||
"common_cancel": "Annulla",
|
||||
"common_close": "Chiudi",
|
||||
"common_confirm": "Conferma",
|
||||
"common_submit": "Invia",
|
||||
"common_validate": "Convalida",
|
||||
"common_apply": "Applica",
|
||||
"logout": "Logout",
|
||||
"login_error_not_found": "Credenziali errate",
|
||||
"login_error_bad_credentials": "Credenziali errate",
|
||||
@ -247,9 +254,13 @@
|
||||
"enum_application_language_italian": "Italiano",
|
||||
"enum_application_language_spanish": "Spagnolo",
|
||||
"enum_content_type_url": "URL",
|
||||
"enum_content_type_video": "Video (MP4)",
|
||||
"enum_content_type_video": "Video",
|
||||
"enum_content_type_picture": "Immagine",
|
||||
"enum_content_type_youtube": "Youtube",
|
||||
"enum_content_type_url_object_label": "Inserisci il collegamento URL",
|
||||
"enum_content_type_video_object_label": "Carica il tuo video (solo MP4)",
|
||||
"enum_content_type_picture_object_label": "Carica la tua immagine",
|
||||
"enum_content_type_youtube_object_label": "Inserisci l'URL del video Youtube",
|
||||
|
||||
"sysinfo_rpi_model": "Raspberry Pi Model",
|
||||
"sysinfo_rpi_model_unknown": "Informazioni Raspberry Pi non disponibili",
|
||||
|
||||
@ -22,8 +22,9 @@ class ContentController(ObController):
|
||||
self._app.add_url_rule('/slideshow/content/move-folder', 'slideshow_content_folder_move', self._auth(self.slideshow_content_folder_move), methods=['POST'])
|
||||
self._app.add_url_rule('/slideshow/content/rename-folder', 'slideshow_content_folder_rename', self._auth(self.slideshow_content_folder_rename), methods=['POST'])
|
||||
self._app.add_url_rule('/slideshow/content/delete-folder', 'slideshow_content_folder_delete', self._auth(self.slideshow_content_folder_delete), methods=['GET'])
|
||||
self._app.add_url_rule('/slideshow/content/add', 'slideshow_content_add', self._auth(self.slideshow_content_add), methods=['POST'])
|
||||
self._app.add_url_rule('/slideshow/content/edit', 'slideshow_content_edit', self._auth(self.slideshow_content_edit), methods=['POST'])
|
||||
self._app.add_url_rule('/slideshow/content/add', 'slideshow_content_add', self._auth(self.slideshow_content_add), methods=['GET', 'POST'])
|
||||
self._app.add_url_rule('/slideshow/content/edit/<content_id>', 'slideshow_content_edit', self._auth(self.slideshow_content_edit), methods=['GET'])
|
||||
self._app.add_url_rule('/slideshow/content/save', 'slideshow_content_save', self._auth(self.slideshow_content_save), methods=['POST'])
|
||||
self._app.add_url_rule('/slideshow/content/delete', 'slideshow_content_delete', self._auth(self.slideshow_content_delete), methods=['GET'])
|
||||
self._app.add_url_rule('/slideshow/content/show/<content_id>', 'slideshow_content_show', self._auth(self.slideshow_content_show), methods=['GET'])
|
||||
self._app.add_url_rule('/slideshow/content/cd', 'slideshow_content_cd', self._auth(self.slideshow_content_cd), methods=['GET'])
|
||||
@ -95,7 +96,19 @@ class ContentController(ObController):
|
||||
|
||||
return redirect(url_for('slideshow_content_list'))
|
||||
|
||||
def slideshow_content_edit(self):
|
||||
def slideshow_content_edit(self, content_id: int = 0):
|
||||
working_folder_path = self._model_store.variable().get_one_by_name('last_folder_content').as_string()
|
||||
working_folder = self._model_store.folder().get_one_by_path(path=working_folder_path, entity=FolderEntity.CONTENT)
|
||||
return render_template(
|
||||
'slideshow/contents/edit.jinja.html',
|
||||
working_folder_path=working_folder_path,
|
||||
working_folder=working_folder,
|
||||
working_folder_children=self._model_store.folder().get_children(working_folder),
|
||||
enum_content_type=ContentType,
|
||||
enum_folder_entity=FolderEntity,
|
||||
)
|
||||
|
||||
def slideshow_content_save(self):
|
||||
self._model_store.content().update_form(
|
||||
id=request.form['id'],
|
||||
name=request.form['name'],
|
||||
|
||||
@ -31,3 +31,16 @@ class ContentType(Enum):
|
||||
return ContentInputType.TEXT
|
||||
elif value == ContentType.URL:
|
||||
return ContentInputType.TEXT
|
||||
|
||||
@staticmethod
|
||||
def get_fa_icon(value: Enum) -> ContentInputType:
|
||||
if value == ContentType.PICTURE:
|
||||
return 'fa-regular fa-image'
|
||||
elif value == ContentType.VIDEO:
|
||||
return 'fa-video-camera'
|
||||
elif value == ContentType.YOUTUBE:
|
||||
return 'fa-brands fa-youtube'
|
||||
elif value == ContentType.URL:
|
||||
return 'fa-link'
|
||||
|
||||
return 'fa-file'
|
||||
|
||||
@ -10,42 +10,61 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<div class="toolbar">
|
||||
<h2><i class="fa fa-cogs icon-left"></i>{{ l.settings_page_title }}</h2>
|
||||
<div class="top-content">
|
||||
<h1>
|
||||
{{ l.settings_page_title }}
|
||||
</h1>
|
||||
|
||||
<div class="top-actions">
|
||||
<button class="folder-add btn-success-alt">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ l.common_save }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if request.args.get('error') %}
|
||||
<div class="alert alert-error">{{ request.args.get('error') }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<h3>{{ l.settings_variable_panel_system_variables }}</h3>
|
||||
<div class="bottom-content">
|
||||
<div class="page-content">
|
||||
<div class="inner">
|
||||
|
||||
{% with variables=system_variables %}
|
||||
{% include 'settings/component/table.jinja.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-inactive">
|
||||
<div class="panel-body">
|
||||
<h3>{{ l.settings_variable_panel_plugin_variables }}</h3>
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<h3>{{ l.settings_variable_panel_system_variables }}</h3>
|
||||
|
||||
{% with variables=plugin_variables %}
|
||||
{% include 'settings/component/table.jinja.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% with variables=system_variables %}
|
||||
{% include 'settings/component/table.jinja.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modals hidden">
|
||||
<div class="modals-outer">
|
||||
<a href="javascript:void(0);" class="modal-close">
|
||||
<i class="fa fa-close"></i>
|
||||
</a>
|
||||
<div class="modals-inner">
|
||||
{% include 'settings/modal/edit.jinja.html' %}
|
||||
<div class="panel panel-inactive">
|
||||
<div class="panel-body">
|
||||
<h3>{{ l.settings_variable_panel_plugin_variables }}</h3>
|
||||
|
||||
{% with variables=plugin_variables %}
|
||||
{% include 'settings/component/table.jinja.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modals hidden">
|
||||
<div class="modals-outer">
|
||||
<a href="javascript:void(0);" class="modal-close">
|
||||
<i class="fa fa-close"></i>
|
||||
</a>
|
||||
<div class="modals-inner">
|
||||
{% include 'settings/modal/edit.jinja.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
112
views/slideshow/contents/edit.jinja.html
Normal file
112
views/slideshow/contents/edit.jinja.html
Normal file
@ -0,0 +1,112 @@
|
||||
{% extends 'base.jinja.html' %}
|
||||
|
||||
{% block page_title %}
|
||||
{{ l.slideshow_content_page_title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block add_css %}
|
||||
<link rel="stylesheet" href="{{ STATIC_PREFIX }}css/lib/flatpickr.min.css"/>
|
||||
<link rel="stylesheet" href="{{ STATIC_PREFIX }}css/lib/jquery-explr-1.4.css"/>
|
||||
{{ HOOK(H_SLIDESHOW_CONTENT_CSS) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block add_js %}
|
||||
<script src="{{ STATIC_PREFIX }}js/lib/jquery-explr-1.4.js"></script>
|
||||
<script src="{{ STATIC_PREFIX }}js/slideshow/contents.js"></script>
|
||||
|
||||
{{ HOOK(H_SLIDESHOW_CONTENT_JAVASCRIPT) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_class %}view-content-list{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<div class="top-content">
|
||||
<h1>
|
||||
{{ l.slideshow_content_form_edit_title }}
|
||||
</h1>
|
||||
|
||||
<div class="top-actions">
|
||||
<button class="folder-edit btn-success-alt">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ l.common_save }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-content">
|
||||
<div class="page-content">
|
||||
<div class="inner dirview">
|
||||
<div class="breadcrumb-container">
|
||||
<ul class="breadcrumb">
|
||||
{% set ns = namespace(breadpath='') %}
|
||||
{% for dir in working_folder_path[1:].split('/') %}
|
||||
{% set ns.breadpath = ns.breadpath ~ '/' ~ dir %}
|
||||
<li>
|
||||
<a href="{{ url_for('slideshow_content_cd', path=ns.breadpath) }}">
|
||||
<i class="explr-icon explr-icon-folder"></i>
|
||||
{{ truncate(dir, 25, '...') }}
|
||||
</a>
|
||||
</li>
|
||||
{% if not loop.last %}
|
||||
<li class="divider">
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="horizontal">
|
||||
<div class="form-holder">
|
||||
<form class="form" action="{{ url_for('slideshow_content_save') }}" method="POST">
|
||||
|
||||
<input type="hidden" name="id" id="content-edit-id" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content-edit-name">{{ l.slideshow_content_form_label_name }}</label>
|
||||
<div class="widget">
|
||||
<input type="text" name="name" id="content-edit-name" required="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content-edit-type">{{ l.slideshow_content_form_label_type }}</label>
|
||||
<div class="widget">
|
||||
<select id="content-edit-type" name="type" disabled="disabled">
|
||||
{% for type in enum_content_type %}
|
||||
<option value="{{ type.value }}" data-input="{% if type.value == 'url' or type.value == 'youtube' %}text{% else %}upload{% endif %}">
|
||||
{{ t(type) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content-edit-location">{{ l.slideshow_content_form_label_location }}</label>
|
||||
<div class="widget">
|
||||
<input type="text" name="location" id="content-edit-location" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="actions">
|
||||
<button type="button" class="btn-normal modal-close">
|
||||
{{ l.slideshow_content_form_button_cancel }}
|
||||
</button>
|
||||
<button type="submit" class="green">
|
||||
<i class="fa fa-save icon-left"></i>{{ l.slideshow_content_form_edit_submit }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="preview-holder">
|
||||
Hi
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@ -33,12 +33,12 @@
|
||||
<button class="explr-item-delete btn-danger-alt" data-folder-route="{{ url_for('slideshow_content_folder_delete') }}" data-content-route="{{ url_for('slideshow_content_delete') }}">
|
||||
<i class="fa fa-trash-alt"></i>
|
||||
</button>
|
||||
<button class="explr-item-edit btn-info">
|
||||
<button class="explr-item-edit btn-info" data-content-route="{{ url_for('slideshow_content_edit', content_id='!c!') }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="content-add item-add">
|
||||
<button class="btn btn-info content-add item-add">
|
||||
<i class="fa fa-file-circle-plus icon-left"></i>
|
||||
{{ l.slideshow_content_button_add }}
|
||||
</button>
|
||||
@ -66,7 +66,7 @@
|
||||
|
||||
|
||||
<div class="bottom-content">
|
||||
<div class="page-panel left-panel">
|
||||
<div class="page-panel left-panel explr-explorer">
|
||||
|
||||
{% macro render_folder(folder) %}
|
||||
<li class="icon-folder">
|
||||
@ -115,7 +115,7 @@
|
||||
</form>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="dirview">
|
||||
<div class="inner dirview">
|
||||
<div class="breadcrumb-container">
|
||||
<ul class="breadcrumb">
|
||||
{% set ns = namespace(breadpath='') %}
|
||||
@ -179,15 +179,16 @@
|
||||
|
||||
|
||||
{% for content in contents[working_folder.id|default(None)]|default([]) %}
|
||||
{% set icon = 'fa-file' %}
|
||||
{% set icon = enum_content_type.get_fa_icon(content.type) %}
|
||||
|
||||
{% if content.type.value == 'picture' %}
|
||||
{% set icon = 'fa-regular fa-image info' %}
|
||||
{% set icon = icon ~ ' info' %}
|
||||
{% elif content.type.value == 'video' %}
|
||||
{% set icon = 'fa-video-camera success' %}
|
||||
{% set icon = icon ~ ' success' %}
|
||||
{% elif content.type.value == 'url' %}
|
||||
{% set icon = 'fa-link danger' %}
|
||||
{% set icon = icon ~ ' danger' %}
|
||||
{% elif content.type.value == 'youtube' %}
|
||||
{% set icon = 'fa-brands fa-youtube youtube' %}
|
||||
{% set icon = icon ~ ' youtube' %}
|
||||
{% endif %}
|
||||
|
||||
<li class="draggable" data-path="{{ working_folder_path }}" data-id="{{ content.id }}" data-folder="0">
|
||||
@ -196,16 +197,12 @@
|
||||
{{ truncate(content.name, 25, '...') }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="modals hidden">
|
||||
<div class="modals-outer">
|
||||
<a href="javascript:void(0);" class="modal-close">
|
||||
<i class="fa fa-close"></i>
|
||||
</a>
|
||||
<div class="modals-inner">
|
||||
{% include 'slideshow/contents/modal/add.jinja.html' %}
|
||||
{% include 'slideshow/contents/modal/edit.jinja.html' %}
|
||||
|
||||
@ -3,47 +3,45 @@
|
||||
{{ l.slideshow_content_form_add_title }}
|
||||
</h2>
|
||||
|
||||
<form class="form" action="/slideshow/content/add" method="POST" enctype="multipart/form-data">
|
||||
|
||||
{% if current_playlist %}
|
||||
<input name="playlist_id" type="hidden" id="content-add-playlist-id" value="{{ current_playlist.id }}">
|
||||
{% endif %}
|
||||
<form class="form" action="{{ url_for('slideshow_content_add') }}" method="POST" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content-add-name">{{ l.slideshow_content_form_label_name }}</label>
|
||||
<div class="widget">
|
||||
<input name="name" type="text" id="content-add-name" required="required" />
|
||||
<input name="name" type="text" id="content-add-name" required="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content-add-type">{{ l.slideshow_content_form_label_type }}</label>
|
||||
|
||||
|
||||
<div class="form-group tab-select">
|
||||
<div class="widget">
|
||||
<select name="type" id="content-add-type">
|
||||
{% for type in enum_content_type %}
|
||||
{% set input_type = enum_content_type.get_input(type) %}
|
||||
<option value="{{ type.value }}" data-input="{{ input_type.value }}">
|
||||
<option value="{{ type.value }}" data-input="{{ input_type.value }}" data-object-label="{{ t('enum_content_type_'~type.value~'_object_label') }}" data-icon="{{ enum_content_type.get_fa_icon(type) }}">
|
||||
{{ t(type) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<i class="fa fa-get-pocket object-icon-add"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group object-input">
|
||||
<label for="">{{ l.slideshow_content_form_label_object }}</label>
|
||||
<label for="" class="object-label-add">{{ l.slideshow_content_form_label_object }}</label>
|
||||
<div class="widget">
|
||||
<input type="text" name="object" id="content-add-object-input-text" class="content-add-object-input" />
|
||||
<input type="file" name="object" id="content-add-object-input-upload" class="content-add-object-input hidden" disabled="disabled" />
|
||||
<input type="text" name="object" id="content-add-object-input-text" class="content-add-object-input"/>
|
||||
<input type="file" name="object" id="content-add-object-input-upload" class="content-add-object-input hidden" disabled="disabled"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button type="button" class="btn-normal modal-close">
|
||||
{{ l.slideshow_content_form_button_cancel }}
|
||||
</button>
|
||||
<button type="submit" class="green">
|
||||
<i class="fa fa-save icon-left"></i>{{ l.slideshow_content_form_add_submit }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{# <div class="actions">#}
|
||||
{# <button type="button" class="btn-normal modal-close">#}
|
||||
{# {{ l.slideshow_content_form_button_cancel }}#}
|
||||
{# </button>#}
|
||||
{# <button type="submit" class="green">#}
|
||||
{# <i class="fa fa-save icon-left"></i>{{ l.slideshow_content_form_add_submit }}#}
|
||||
{# </button>#}
|
||||
{# </div>#}
|
||||
</form>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user