From: wbudic Date: Fri, 3 Sep 2021 03:24:00 +0000 (+1000) Subject: New Theme settings implemented. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=9862d1dcc69cd9b314202b55f866ff90e91d6104;p=LifeLog.git New Theme settings implemented. --- diff --git a/Current Development Check List.md b/Current Development Check List.md index 9eb5e39..ea566c4 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -6,6 +6,9 @@ ### New Development v.2.3+ +* ✔ Setting should provide page color defaults in form of an hash. + * These should/can change based on selected theme. That possibly in future can be changed via config. + * colBG,colFG, colSHDW, etc... * ✔ Printout page to include Amount column if category of items has valued asset, expense or income set. Providing also totals. Of Assets, and total on income and expense. * Introduce Currency setting, to replace amount '#'. Even though it could be number of, something not currency related. * ✔ Interaction - When editing an existing log entry, it needs confirmation, if it isn't a copy (now button wasn't pressed), before overwriting. diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index e1ece41..e72a00b 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -68,7 +68,7 @@ cats(); processSubmit(); ############### Settings::setupTheme(); -Settings::session()->param("theme", Settings::css()); +Settings::session()->param("theme", Settings::theme('css')); Settings::session()->param("bgcolor", Settings::bgcol()); getHeader(); @@ -83,11 +83,11 @@ print qq(
-
+
@@ -506,21 +507,21 @@ exit; sub getHeader { print $cgi->header(-expires=>"+6s", -charset=>"UTF-8"); -print $cgi->start_html(-title => "Personal Log", -BGCOLOR=>&Settings::bgcol, +print $cgi->start_html(-title => "Personal Log", -BGCOLOR=>Settings::theme('colBG'), -onload => "onBodyLoadGeneric();", - -style => [ + -style => [ { -type => 'text/css', -src => 'wsrc/jquery-ui.css' }, { -type => 'text/css', -src => 'wsrc/jquery-ui.theme.css' }, { - -type => 'text/css', - -src => 'wsrc/jquery-ui-timepicker-addon.css' + -type => 'text/css', + -src => 'wsrc/jquery-ui-timepicker-addon.css' }, { -type => 'text/css', -src => 'wsrc/tip-skyblue/tip-skyblue.css' }, { - -type => 'text/css', - -src => 'wsrc/tip-yellowsimple/tip-yellowsimple.css' + -type => 'text/css', + -src => 'wsrc/tip-yellowsimple/tip-yellowsimple.css' }, - { -type => 'text/css', -src => "wsrc/".&Settings::css }, + { -type => 'text/css', -src => Settings::theme('css') }, ], -script => [ { -type => 'text/javascript', -src => 'wsrc/main.js' }, diff --git a/htdocs/cgi-bin/data.cgi b/htdocs/cgi-bin/data.cgi index a8da082..180994d 100755 --- a/htdocs/cgi-bin/data.cgi +++ b/htdocs/cgi-bin/data.cgi @@ -136,17 +136,17 @@ try{ sub printHeader { my $title = shift; +&Settings::setupTheme; print $cgi->header(-expires=>"+6os"); -print $cgi->start_html(-title => $title, -BGCOLOR => &Settings::bgcol, +print $cgi->start_html(-title => $title, -BGCOLOR => Settings::theme('colBG'), -script=> [ {-type => 'text/javascript', -src => 'wsrc/jquery.js'}, {-type => 'text/javascript', -src => 'wsrc/jquery-ui.js'}, {-type => 'text/javascript', -src => 'wsrc/main.js'} ], - -style => [{-type => 'text/css', -src => "wsrc/".&Settings::css}, {-type => 'text/css', -src => "wsrc/print.css"}, + -style => [ {-type => 'text/css', -src => Settings::theme('css')}, {-type => 'text/css', -src => 'wsrc/jquery-ui.css'}, {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}, - {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}, - { -type => 'text/css', -src => "wsrc/".&Settings::css } + {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'} ], -onload => "onBodyLoadGeneric()"); @@ -224,7 +224,7 @@ try{
'; - print "
\n$tbl\n
"; + print qq(
$tbl
); print $cgi->end_html(); } diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 8e4a761..481bdc1 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -12,6 +12,16 @@ use CGI::Session '-ip_match'; use DBI; use lib "system/modules"; require Settings; +use CGI::Carp qw(fatalsToBrowser set_message); +BEGIN { + sub handle_errors { + my $msg = shift; + print "

LifeLog Server Error

"; + print "
@[$ENV{PWD}].Error: $msg
"; + + } + set_message(\&handle_errors); +} my $cgi = CGI->new(); my $session = new CGI::Session("driver:File",$cgi, {Directory=>&Settings::logPath, SameSite=>'Lax'}); @@ -19,11 +29,11 @@ my $sssCreatedDB = $session->param("cdb"); my $sid=$session->id(); my $cookie = $cgi->cookie(CGISESSID => $sid); -my $db; +my ($db,$DB_NAME,$PAGE_EXCLUDES, $DBG, $frm)=""; my $alias = $cgi->param('alias'); my $passw = $cgi->param('passw'); my $pass; -my ($DBG,$frm) = ""; + #Codebase release version. Release in the created db or existing one can be different, through time. my $SCRIPT_RELEASE = Settings::release(); @@ -31,7 +41,6 @@ my $SCRIPT_RELEASE = Settings::release(); my $BACKUP_ENABLED = 0; my $AUTO_SET_TIMEZONE = 0; my $TIME_ZONE_MAP = 0; -my ($DB_NAME,$PAGE_EXCLUDES); my $VW_OVR_SYSLOGS=0; my $VW_OVR_WHERE=""; my $LOGOUT_RELOGIN_TXT='No, no, NO! Log me In Again.'; @@ -43,15 +52,16 @@ my $LOGOUT_IFRAME = qq| try{ checkAutologinSet(); logout() if($cgi->param('logout')); - if(processSubmit()==0){ + if(processSubmit()==0){ + my ($css,$colBG,$colSHDW) = (Settings::theme('css'),Settings::theme('colBG'),Settings::theme('colSHDW')); print $cgi->header(-expires=>"0s", -charset=>"UTF-8", -cookie=>$cookie); print $cgi->start_html( -title => "Personal Log Login", - -BGCOLOR => &Settings::bgcol, + # -BGCOLOR => $colBG, -script=> [{-type => 'text/javascript', -src => 'wsrc/main.js'}, {-type => 'text/javascript', -src => 'wsrc/jquery.js'}, {-type => 'text/javascript', -src => 'wsrc/jquery-ui.js'}], - -style => [{-type => 'text/css', -src => "wsrc/".&Settings::css}, + -style => [ {-type => 'text/css', -src => $css}, {-type => 'text/css', -src => 'wsrc/jquery-ui.css'}, {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}, {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}], @@ -62,33 +72,37 @@ try{ my $hst = ""; $hst = `hostname` . "($ht[0])" if (@ht); - $frm = qq( + $frm = < + style="opacity: 1; box-sizing: border-box; margin-bottom: 5px; box-shadow: 5px 5px 5px $colSHDW;"> - + - + - -

Welcome to Life Log

Alias:
Password:
NOTICE!   - Alias will create a new database if it doesn't exist. Note down your password. + + NOTICE!   + The Alias entry is used for the database name here, + a new database will be created for you if it doesn't exist. + Make sure you note down your password.
Host -> $hst
); + +HTML print qq(

-
+