Multiple fixes
This commit is contained in:
parent
aa1ad66525
commit
8dbf25ec8f
6 changed files with 664 additions and 24 deletions
|
|
@ -98,7 +98,8 @@ def get_menu(modules_admin):
|
|||
|
||||
if len(menu[mod[2]])<4:
|
||||
menu[mod[2]].append('<i class="fa fa-circle-o" aria-hidden="true"></i>')
|
||||
|
||||
else:
|
||||
menu[mod[2]][3]='<i class="fa {}" aria-hidden="true"></i>'.format(menu[mod[2]][3])
|
||||
else:
|
||||
|
||||
menu[mod[2]]=mod[0]
|
||||
|
|
@ -114,6 +115,8 @@ def get_menu(modules_admin):
|
|||
|
||||
if len(menu[submod[2]])<4:
|
||||
menu[submod[2]].append('<i class="fa fa-circle-o" aria-hidden="true"></i>')
|
||||
else:
|
||||
menu[submod[2]][3]='<i class="fa {}" aria-hidden="true"></i>'.format(menu[submod[2]][3])
|
||||
|
||||
return menu
|
||||
|
||||
|
|
|
|||
|
|
@ -477,4 +477,20 @@ def check_code_token():
|
|||
|
||||
return {'token': 'Error: token is not valid', 'error': 1, 'csrf_token': s['csrf_token']}
|
||||
|
||||
@admin_app.get('/change_theme')
|
||||
def change_theme():
|
||||
|
||||
theme_selected=str(request.query.get('theme', '0'))
|
||||
|
||||
s=get_session()
|
||||
|
||||
s['theme']=theme_selected
|
||||
|
||||
s.save()
|
||||
|
||||
error=0
|
||||
|
||||
return {'error': error}
|
||||
|
||||
|
||||
app.mount('/'+config.admin_folder+'/', admin_app)
|
||||
|
|
|
|||
|
|
@ -1,28 +1,54 @@
|
|||
|
||||
/** {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}*/
|
||||
|
||||
body
|
||||
{
|
||||
|
||||
margin:0px;
|
||||
background-color:#f7f6f1;
|
||||
background-color:#f4f6f9;
|
||||
font-family: "Roboto", sans, sans-serif, serif;
|
||||
font-size: 16px;
|
||||
/*-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
transition-property: background-color, color;*/
|
||||
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
body.dark {
|
||||
background-color: #232834;
|
||||
|
||||
color: #fbfbfb;
|
||||
/*-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
transition-property: background-color, color;*/
|
||||
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
color: #1c6280;
|
||||
|
||||
}
|
||||
|
||||
a:hover
|
||||
{
|
||||
a:hover {
|
||||
|
||||
color: #d54e21;
|
||||
|
||||
}
|
||||
|
||||
.dark a {
|
||||
|
||||
color: #5fa6c4;
|
||||
|
||||
}
|
||||
|
||||
#header
|
||||
{
|
||||
|
||||
|
|
@ -39,6 +65,14 @@ a:hover
|
|||
|
||||
}
|
||||
|
||||
.dark #header {
|
||||
|
||||
|
||||
|
||||
background-color:#1e1412;
|
||||
|
||||
}
|
||||
|
||||
#title_phango
|
||||
{
|
||||
font-size:28px;
|
||||
|
|
@ -99,6 +133,20 @@ h1 {
|
|||
|
||||
}
|
||||
|
||||
.dark h1 {
|
||||
|
||||
background-color:#000a22;
|
||||
color: #fbfbfb;
|
||||
border-color: #000;
|
||||
|
||||
}
|
||||
|
||||
.dark h2 {
|
||||
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
p {
|
||||
|
||||
border: solid #cbcbcb;
|
||||
|
|
@ -134,7 +182,7 @@ p {
|
|||
{
|
||||
|
||||
float:left;
|
||||
width:20%;
|
||||
width:18%;
|
||||
margin-right:0px;
|
||||
position:relative;
|
||||
/* border:solid #cccccc;
|
||||
|
|
@ -142,6 +190,16 @@ p {
|
|||
box-sizing: border-box;
|
||||
/* padding-bottom: 100px;*/
|
||||
overflow:hidden;
|
||||
height:100%;
|
||||
-webkit-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
-moz-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
}
|
||||
|
||||
.dark #menu {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#menu a
|
||||
|
|
@ -161,7 +219,7 @@ p {
|
|||
background: transparent;
|
||||
}
|
||||
|
||||
#menu a:hover
|
||||
#menu a:hover, #menu a.selected_menu
|
||||
{
|
||||
|
||||
text-decoration:underline;
|
||||
|
|
@ -240,13 +298,13 @@ p {
|
|||
|
||||
margin:auto;
|
||||
background: rgba(18,47,59,1);
|
||||
background: -moz-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
/*background: -moz-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(18,47,59,1)), color-stop(51%, rgba(18,47,59,1)), color-stop(74%, rgba(18,47,59,1)), color-stop(100%, rgba(8,59,77,1)));
|
||||
background: -webkit-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
background: -o-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);*/
|
||||
background: linear-gradient(to right, rgba(18,47,59,1) 0%, rgba(18,47,59,1) 51%, rgba(18,47,59,1) 74%, rgba(8,59,77,1) 100%);
|
||||
background-size: 20% 100%;
|
||||
background-size: 18% 100%;
|
||||
background-repeat:no-repeat;
|
||||
padding:0px;
|
||||
border:solid #bcbcbc;
|
||||
|
|
@ -257,8 +315,23 @@ p {
|
|||
border: solid #cbcbcb;
|
||||
border-width: 0px 0px 1px 0px;
|
||||
min-height: 90vh;
|
||||
/*-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
.dark .content_admin {
|
||||
|
||||
background-color: #1e202a;
|
||||
/*-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;*/
|
||||
border: solid #323232;
|
||||
border-width: 0px 0px 1px 0px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.content_admin i {
|
||||
|
||||
margin-right: 10px;
|
||||
|
|
@ -268,11 +341,13 @@ p {
|
|||
.contents
|
||||
{
|
||||
float:right;
|
||||
width:80%;
|
||||
width:82%;
|
||||
padding:0px 0px 0px 0px;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.content
|
||||
{
|
||||
padding:0px 10px 5px 10px;
|
||||
|
|
@ -313,6 +388,17 @@ p {
|
|||
padding:10px;
|
||||
margin:10px 0px 10px 0px;
|
||||
border-radius:5px;
|
||||
background: #fbfbfb;
|
||||
-webkit-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
-moz-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
|
||||
}
|
||||
|
||||
.dark .form {
|
||||
|
||||
background-color: #1e202a;
|
||||
border-color: #323232;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -386,6 +472,14 @@ margin-right:auto;
|
|||
|
||||
}
|
||||
|
||||
table {
|
||||
|
||||
-webkit-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
-moz-box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75);
|
||||
|
||||
}
|
||||
|
||||
.table_list {
|
||||
|
||||
width:100%;
|
||||
|
|
@ -396,6 +490,12 @@ margin-right:auto;
|
|||
|
||||
}
|
||||
|
||||
.dark .table_list {
|
||||
|
||||
border: solid #323232 1px;
|
||||
|
||||
}
|
||||
|
||||
.title_list td, .fields_span_title {
|
||||
|
||||
margin:0px;
|
||||
|
|
@ -411,6 +511,13 @@ margin-right:auto;
|
|||
|
||||
}
|
||||
|
||||
.dark .title_list td {
|
||||
|
||||
background-color:#000a22;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.fields_span_title, div.options_td , div.fields_span_table_data {
|
||||
|
||||
box-sizing: border-box;
|
||||
|
|
@ -433,6 +540,14 @@ margin-right:auto;
|
|||
/*border:solid #cccccc;
|
||||
border-width:1px;*/
|
||||
padding:4px;
|
||||
background: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
.dark .row_list td {
|
||||
|
||||
background-color: #2d313b;
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -459,6 +574,13 @@ div.fields_span_table_data {
|
|||
|
||||
}
|
||||
|
||||
.dark .cont_text, .dark .cont {
|
||||
|
||||
background-color: #2d313b;
|
||||
border-color: #343434;
|
||||
|
||||
}
|
||||
|
||||
.cont_top {
|
||||
|
||||
border-width: 1px 1px 1px 1px;
|
||||
|
|
@ -505,6 +627,12 @@ div.fields_span_table_data {
|
|||
|
||||
}
|
||||
|
||||
.dark .error {
|
||||
|
||||
color: #ff3232;
|
||||
|
||||
}
|
||||
|
||||
.hidden_form
|
||||
{
|
||||
|
||||
|
|
@ -564,9 +692,11 @@ a:hover.no_choose_flag
|
|||
#center_body input {
|
||||
|
||||
border: solid #bcbcbc;
|
||||
border-width:1px;
|
||||
border-width:2px;
|
||||
border-radius:5px;
|
||||
background: #eeeeee;
|
||||
padding: 2px 4px;
|
||||
font-size:16px;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -576,7 +706,14 @@ a:hover.no_choose_flag
|
|||
|
||||
}
|
||||
|
||||
#center_body input[type="submit"], #center_body input[type="button"]
|
||||
.dark #center_body input {
|
||||
|
||||
background-color: #2d313b;
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
#center_body input[type="submit"], #center_body input[type="button"], #center_body input[type="button"].button_blue
|
||||
{
|
||||
|
||||
font-family: helvetica, arial,sans;
|
||||
|
|
@ -598,7 +735,13 @@ a:hover.no_choose_flag
|
|||
|
||||
}
|
||||
|
||||
#center_body input:hover[type="submit"]
|
||||
.dark #center_body input[type="button"] {
|
||||
|
||||
background: #d08b2c;
|
||||
|
||||
}
|
||||
|
||||
#center_body input:hover[type="submit"], #center_body input[type="button"].button_blue
|
||||
{
|
||||
|
||||
background: #104070;
|
||||
|
|
@ -614,10 +757,19 @@ a:hover.no_choose_flag
|
|||
|
||||
}
|
||||
|
||||
#center_body input[type="text"]
|
||||
#center_body input:hover[type="button"].button_blue
|
||||
{
|
||||
|
||||
width:500px;
|
||||
background: #215181;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#center_body input[type="text"], #center_body input[type="password"]
|
||||
{
|
||||
|
||||
min-width:500px;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -634,6 +786,16 @@ a:hover.no_choose_flag
|
|||
border: solid #bcbcbc;
|
||||
border-width:1px;
|
||||
border-radius:5px;
|
||||
padding: 2px 5px;
|
||||
border: solid #cbcbcb 2px;
|
||||
font-size: 16px;
|
||||
|
||||
}
|
||||
|
||||
.dark #center_body select {
|
||||
|
||||
background-color: #2d313b;
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -801,6 +963,341 @@ a.form_button_tab:hover
|
|||
|
||||
}
|
||||
|
||||
/* Loading */
|
||||
/* <div class="lds-dual-ring"></div> */
|
||||
|
||||
.lds-dual-ring {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.lds-dual-ring:after {
|
||||
content: " ";
|
||||
display: block;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin: 8px;
|
||||
border-radius: 50%;
|
||||
border: 6px solid #000;
|
||||
border-color: #000 transparent #000 transparent;
|
||||
animation: lds-dual-ring 1.2s linear infinite;
|
||||
}
|
||||
@keyframes lds-dual-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Block screen while loading */
|
||||
|
||||
#layer_loading {
|
||||
|
||||
z-index:50000;
|
||||
/*background-color:rgba(0,0,0,0.4);*/
|
||||
/*opacity:0.5;*/
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
overflow:auto;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#container_loading {
|
||||
|
||||
z-index:50001;
|
||||
overflow:auto;
|
||||
/* border: solid #fbfbfb 4px;*/
|
||||
position:absolute;
|
||||
overflow:visible;
|
||||
width:100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
/* Simple grid */
|
||||
|
||||
.row_4x {
|
||||
|
||||
width: 32%;
|
||||
box-sizing: border-box;
|
||||
/* border: solid #fff 1px;*/
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
.row_5x {
|
||||
|
||||
width: 44%;
|
||||
box-sizing: border-box;
|
||||
/* border: solid #fff 1px;*/
|
||||
float:left;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.row_7x {
|
||||
|
||||
width: 56%;
|
||||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
float:left;
|
||||
|
||||
}
|
||||
|
||||
.row_8x {
|
||||
|
||||
width: 68%;
|
||||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
float:left;
|
||||
|
||||
}
|
||||
|
||||
.row_margin_left {
|
||||
|
||||
padding-left: 20px;
|
||||
padding-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
.row_margin_right {
|
||||
|
||||
padding-left: 10px;
|
||||
padding-right: 20px;
|
||||
|
||||
}
|
||||
|
||||
.row_margin_right_left {
|
||||
|
||||
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
/* special boxes */
|
||||
|
||||
.container_block {
|
||||
|
||||
padding-top:0px;
|
||||
padding-bottom:10px;
|
||||
|
||||
}
|
||||
|
||||
.container_block_no_padding {
|
||||
|
||||
padding-bottom:0px;
|
||||
|
||||
}
|
||||
|
||||
.container_warning {
|
||||
|
||||
}
|
||||
|
||||
h2.title_container {
|
||||
|
||||
display:block;
|
||||
padding: 10px 15px 10px 15px;
|
||||
font-size:1.2rem;
|
||||
margin:0px;
|
||||
font-weight:400;
|
||||
color:#fbfbfb;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
border: solid #dfe1e4 1px;
|
||||
border-width: 1px 1px 0px 1px;
|
||||
position:relative;
|
||||
/*-webkit-box-shadow: 3px 0px 2px -1px rgba(0,0,0,0.20);
|
||||
box-shadow: 3px 0px 2px -1px rgba(0,0,0,0.20);*/
|
||||
|
||||
}
|
||||
|
||||
.dark h2.title_container {
|
||||
|
||||
background-color: #2d313b;
|
||||
border-color: #343434;
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
.container_warning h2.title_container {
|
||||
|
||||
background:#dc3545;
|
||||
|
||||
}
|
||||
|
||||
.container_info h2.title_container {
|
||||
|
||||
background: #000458;
|
||||
|
||||
}
|
||||
|
||||
.container_soft h2.title_container {
|
||||
|
||||
background: #0faa32;
|
||||
|
||||
}
|
||||
|
||||
.container_content {
|
||||
|
||||
display:block;
|
||||
background:#fbfbfb;
|
||||
padding: 10px 15px 10px 15px;
|
||||
color:#212529;
|
||||
border-radius: 0px 0px 5px 5px;
|
||||
/*-webkit-box-shadow: 3px 2px 1px -1px rgba(0,0,0,0.20);
|
||||
box-shadow: 3px 2px 1px -1px rgba(0,0,0,0.20);*/
|
||||
border: solid #dfe1e4 1px;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
.dark .container_content {
|
||||
|
||||
background-color: #2d313b;
|
||||
border-color: #343434;
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
/* Switch for dark mode */
|
||||
|
||||
/* switches css */
|
||||
|
||||
/* The switch - the box around the slider */
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 16px;
|
||||
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {display:none;}
|
||||
|
||||
/* The slider */
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
height: 16px;
|
||||
width:38px;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing:border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* before is the checkbox */
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
left: -1px;
|
||||
top: -3px;
|
||||
background-color: #fbfbfb;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #447211;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #447211;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
-webkit-transform: translateX(21px);
|
||||
-ms-transform: translateX(21px);
|
||||
transform: translateX(21px);
|
||||
background-color: #7ed321;
|
||||
}
|
||||
|
||||
input:checked + .slider_grey {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
input:focus + .slider_grey {
|
||||
box-shadow: 0 0 1px #ccc;
|
||||
}
|
||||
|
||||
input:checked + .slider_grey:before {
|
||||
-webkit-transform: translateX(21px);
|
||||
-ms-transform: translateX(21px);
|
||||
transform: translateX(21px);
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
|
||||
/* Rounded sliders */
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.container_switch {
|
||||
|
||||
margin-top:6px;
|
||||
display:inline-block;
|
||||
float:right;
|
||||
|
||||
}
|
||||
|
||||
.switch-btn {
|
||||
|
||||
position:absolute;
|
||||
/*border: solid #f00 1px;*/
|
||||
right:4px;
|
||||
top:8px;
|
||||
z-index:9999;
|
||||
|
||||
}
|
||||
|
||||
.switch-slider {
|
||||
|
||||
text-align:center;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
|
||||
.switch-text {
|
||||
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
position:relative;
|
||||
top: -4px;
|
||||
left:-2px;
|
||||
color: #000;
|
||||
|
||||
}
|
||||
|
||||
.dark .switch-text {
|
||||
|
||||
color: #fbfbfb;
|
||||
|
||||
}
|
||||
|
||||
/* Media queries */
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
|
|
@ -868,7 +1365,7 @@ a.form_button_tab:hover
|
|||
|
||||
}
|
||||
|
||||
.ip_td {
|
||||
/*.ip_td {
|
||||
|
||||
display:none;
|
||||
|
||||
|
|
@ -878,7 +1375,7 @@ a.form_button_tab:hover
|
|||
|
||||
display:none;
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
.first_canvas {
|
||||
|
||||
|
|
@ -895,5 +1392,44 @@ a.form_button_tab:hover
|
|||
|
||||
}
|
||||
|
||||
/*Grid 100% */
|
||||
|
||||
.row_4x {
|
||||
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/* border: solid #fff 1px;*/
|
||||
float:auto;
|
||||
|
||||
}
|
||||
|
||||
.row_5x {
|
||||
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/* border: solid #fff 1px;*/
|
||||
float:auto;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.row_7x {
|
||||
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
float:auto;
|
||||
|
||||
}
|
||||
|
||||
.row_8x {
|
||||
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
float:auto;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
<%
|
||||
|
||||
from paramecio.citoplasma.sessions import get_session
|
||||
|
||||
s=get_session()
|
||||
|
||||
dark_checked=""
|
||||
dark_css=""
|
||||
|
||||
if s.get('theme', '0')=='1':
|
||||
dark_checked='checked'
|
||||
dark_css='dark'
|
||||
|
||||
%>
|
||||
<%def name="check_menu(module)">\
|
||||
% if module[:1]=='/':
|
||||
${make_url(module[1:])}\
|
||||
|
|
@ -9,7 +23,7 @@ ${make_url('admin/'+module)}\
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<title>${title}</title>
|
||||
<link href="${make_media_url('css/admin.css', 'admin')}" rel="stylesheet" />
|
||||
<link href="${make_media_url('css/font-awesome.min.css', 'admin')}" rel="stylesheet" />
|
||||
|
|
@ -29,7 +43,8 @@ ${HeaderHTML.header_home()|n}
|
|||
<%block name="extra_header">
|
||||
</%block>
|
||||
</head>
|
||||
<body>
|
||||
<body class="${dark_css}">
|
||||
<div id="layer_loading"><div id="container_loading"><div class="lds-dual-ring"></div></div></div>
|
||||
<div id="languages_general">
|
||||
</div>
|
||||
<div id="logout">
|
||||
|
|
@ -78,6 +93,17 @@ ${HeaderHTML.header_home()|n}
|
|||
</nav>
|
||||
<div class="contents">
|
||||
<h1>${title}</h1>
|
||||
<div class="switch-btn">
|
||||
<div class="switch-text">
|
||||
${_('Dark theme')}
|
||||
</div>
|
||||
<div class="switch-slider">
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="theme" value="1" id="theme" ${dark_checked}/>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
${show_flash_message()|n}
|
||||
<%block name="content">
|
||||
|
|
@ -96,6 +122,65 @@ ${HeaderHTML.header_home()|n}
|
|||
trigger: 'click'
|
||||
});
|
||||
|
||||
const slider = document.querySelector('input[name="theme"]');
|
||||
|
||||
slider.addEventListener("change", function () {
|
||||
|
||||
//Block button while send to ajax.
|
||||
|
||||
$(this).prop("disabled",true);
|
||||
|
||||
var dark='';
|
||||
|
||||
if (this.checked) {
|
||||
document.body.classList.add("dark");
|
||||
|
||||
dark='1';
|
||||
|
||||
} else {
|
||||
document.body.classList.remove("dark");
|
||||
|
||||
dark='0';
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "${make_admin_url('change_theme')}?theme="+dark,
|
||||
type: 'GET',
|
||||
data: {},
|
||||
success: function (data) {
|
||||
|
||||
if(!data.error) {
|
||||
|
||||
console.log('Changed to dark in all pages');
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
console.log('Cannot set dark theme in all pages!');
|
||||
|
||||
}
|
||||
|
||||
$(slider).prop("disabled",false);
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
alert('Error: '+data.status+' '+data.statusText);
|
||||
|
||||
$(slider).prop("disabled", false);
|
||||
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#layer_loading').hide();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<%block name="jscript_block">
|
||||
</%block>
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
if(data.error==0)
|
||||
{
|
||||
|
||||
//window.location.href="${make_url('admin')}";
|
||||
location.reload()
|
||||
window.location.href="${make_url('admin')}";
|
||||
//location.reload()
|
||||
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from importlib import import_module
|
|||
|
||||
load_lang('paramecio.modules', 'admin')
|
||||
|
||||
modules_admin=[[I18n.lang('admin', 'users_admin', 'User\'s Admin'), 'paramecio.modules.admin.admin.ausers', 'ausers']]
|
||||
modules_admin=[[I18n.lang('admin', 'users_admin', 'User\'s Admin'), 'paramecio.modules.admin.admin.ausers', 'ausers', 'fa-user']]
|
||||
|
||||
for module in config.modules:
|
||||
module+='.settings.config_admin'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue