diff --git a/paramecio/citoplasma/adminutils.py b/paramecio/citoplasma/adminutils.py index c890ab4..323e1d0 100644 --- a/paramecio/citoplasma/adminutils.py +++ b/paramecio/citoplasma/adminutils.py @@ -98,7 +98,8 @@ def get_menu(modules_admin): if len(menu[mod[2]])<4: menu[mod[2]].append('') - + else: + menu[mod[2]][3]=''.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('') + else: + menu[submod[2]][3]=''.format(menu[submod[2]][3]) return menu diff --git a/paramecio/modules/admin/index.py b/paramecio/modules/admin/index.py index 0fae535..b869d65 100644 --- a/paramecio/modules/admin/index.py +++ b/paramecio/modules/admin/index.py @@ -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) diff --git a/paramecio/modules/admin/media/css/admin.css b/paramecio/modules/admin/media/css/admin.css index f741fa6..e18ddee 100644 --- a/paramecio/modules/admin/media/css/admin.css +++ b/paramecio/modules/admin/media/css/admin.css @@ -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,9 +388,20 @@ 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; + +} + .form textarea { width:100%; @@ -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 +{ + + background: #215181; + cursor: pointer; + +} + + +#center_body input[type="text"], #center_body input[type="password"] { - width:500px; + 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 */ +/*
*/ + +.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; + + } + } diff --git a/paramecio/modules/admin/templates/admin/home.html b/paramecio/modules/admin/templates/admin/home.html index 4922219..54de43c 100644 --- a/paramecio/modules/admin/templates/admin/home.html +++ b/paramecio/modules/admin/templates/admin/home.html @@ -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)}\ - +