From 3a7e358fc9c4c0c00d0d1de3cf4fcc679746b093 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Tue, 25 Mar 2014 15:54:48 +0100 Subject: [PATCH] [UPDATE] some style changes, design switcher for own designs --- public/include/autoloader.inc.php | 2 +- public/include/bootstrap.php | 2 +- public/include/classes/template.class.php | 17 +++ public/include/config/admin_settings.inc.php | 8 ++ public/include/smarty_globals.inc.php | 1 + .../site_assets/bootstrap/css/design/dark.css | 121 ++++++++++++++++++ public/site_assets/bootstrap/css/mpos.css | 15 ++- .../templates/bootstrap/dashboard/default.tpl | 2 +- public/templates/bootstrap/login/default.tpl | 6 +- public/templates/bootstrap/master.tpl | 1 + .../templates/bootstrap/register/default.tpl | 65 +++++----- 11 files changed, 197 insertions(+), 43 deletions(-) create mode 100644 public/site_assets/bootstrap/css/design/dark.css diff --git a/public/include/autoloader.inc.php b/public/include/autoloader.inc.php index 3091035c..48cef000 100644 --- a/public/include/autoloader.inc.php +++ b/public/include/autoloader.inc.php @@ -70,4 +70,4 @@ require_once(CLASS_DIR . '/api.class.php'); require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php'); require_once(INCLUDE_DIR . '/lib/scrypt.php'); -?> +?> \ No newline at end of file diff --git a/public/include/bootstrap.php b/public/include/bootstrap.php index 1ecaca1a..fe6a9d02 100644 --- a/public/include/bootstrap.php +++ b/public/include/bootstrap.php @@ -36,4 +36,4 @@ $master_template = 'master.tpl'; // We include all needed files here, even though our templates could load them themself require_once(INCLUDE_DIR . '/autoloader.inc.php'); -?> +?> \ No newline at end of file diff --git a/public/include/classes/template.class.php b/public/include/classes/template.class.php index b297c528..fd0eea58 100644 --- a/public/include/classes/template.class.php +++ b/public/include/classes/template.class.php @@ -31,6 +31,23 @@ class Template extends Base { return $aThemes; } + /** + * Get all available designs + * Read css files from css/design folder + * + * @return array - list of available designs + */ + public function getDesigns() { + $this->debug->append("STA " . __METHOD__, 4); + $aTmpDesigns = glob(BASEPATH . 'site_assets/' . THEME . '/css/design/*.css'); + $aDesigns = array(); + $aDesigns['default'] = 'default'; + foreach ($aTmpDesigns as $filename) { + if (basename($filename) != '.' && basename($filename) != '..') $aDesigns[basename($filename, ".css")] = basename($filename, ".css"); + } + return $aDesigns; + } + /** * Cached getActiveTemplates method * diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 08ee646f..b48a6be6 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -2,6 +2,7 @@ $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1; $aThemes = $template->getThemes(); +$aDesigns = $template->getDesigns(); // Load the settings available in this system $aSettings['website'][] = array( @@ -53,6 +54,13 @@ $aSettings['website'][] = array( 'name' => 'website_theme', 'value' => $setting->getValue('website_theme'), 'tooltip' => 'The default theme used on your pool.' ); +$aSettings['website'][] = array( + 'display' => 'Website Design', 'type' => 'select', + 'options' => $aDesigns, + 'default' => 'default', + 'name' => 'website_design', 'value' => $setting->getValue('website_design'), + 'tooltip' => 'The default design used on your pool.' +); $aSettings['website'][] = array( 'display' => 'Website News Style', 'type' => 'select', 'options' => array( 0 => 'Show all news in one Page', 1 => 'Show Responsive News Table' ), diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 105d00f4..bd5df5db 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -65,6 +65,7 @@ $aGlobal = array( 'twofactor' => $config['twofactor'], 'csrf' => $config['csrf'], 'config' => array( + 'website_design' => $setting->getValue('website_design'), 'poolnav_enabled' => $setting->getValue('poolnav_enabled'), 'poolnav_pools' => $setting->getValue('poolnav_pools'), 'recaptcha_enabled' => $setting->getValue('recaptcha_enabled'), diff --git a/public/site_assets/bootstrap/css/design/dark.css b/public/site_assets/bootstrap/css/design/dark.css new file mode 100644 index 00000000..6ba59bf3 --- /dev/null +++ b/public/site_assets/bootstrap/css/design/dark.css @@ -0,0 +1,121 @@ +/* overwrite style infos */ + +/* ------------------------------- */ + +body { + background-color: #222222; + font-size: 12px; +} + +p { + font-size: 12px; +} + +#page-wrapper { + background-color: #222222; +} + +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + background-color: #ffffff; + padding: 4px 4px 4px 4px; + font-size: 12px; + color: #555555; + border: 1px solid #ccc; +} + +@media(min-width:768px) { + #page-wrapper { + border-left: 1px solid #222222; + } +} + +.navbar-static-side ul li { + border-bottom: 1px solid #222222; +} + +.navbar, .navbar-static-side, .navbar-default { + background-color: #222222; +} + +a { + color: #999999; +} +a:hover, +a:focus { + color: #FFFFFF; +} + +.panel-body { + color: #333; + background-color: #FFFFFF; + border-color: #222222; +} + +.lightblue { + background-color: #222222; +} + +.footer { + color: #FFFFFF; +} + +.navbar .brand, .navbar .nav > li > a:hover { + color: #FFFFFF; + background-color: #000000; +} + +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + background-color: #FF0000; + color: #FFFFFF; +} + + +.table tbody tr:hover td, .table tbody tr:hover th { + background-color: #999999; +} + + +.nav > li > a:hover, +.nav > li > a:focus { + background-color: #000000; + color: #FFFFFF; +} + +.nav .nav-second-level > li > a:hover, +.nav .nav-second-level > li > a:focus { + background-color: #000000; + color: #FFFFFF; +} + + + +/* Tables */ + +.panel-footer { + color: #000; + background-color: #BDBFBF; +} + +.panel-body { + color: #000; + background-color: #BDBFBF; +} + diff --git a/public/site_assets/bootstrap/css/mpos.css b/public/site_assets/bootstrap/css/mpos.css index 5c81d381..ea1c8060 100644 --- a/public/site_assets/bootstrap/css/mpos.css +++ b/public/site_assets/bootstrap/css/mpos.css @@ -2,12 +2,17 @@ /* ------------------------------- */ - body { +body { background-color: #f8f8f8; min-width: 350px; + font-size: 12px; /* Design constraint */ } +p { + font-size: 12px; +} + /* Wrappers */ /* ------------------------------- */ @@ -20,6 +25,7 @@ padding: 0 15px; min-height: 568px; background-color: #fff; + font-size: 12px; } @media(min-width:768px) { @@ -29,6 +35,7 @@ padding: 0 30px; min-height: 1300px; border-left: 1px solid #e7e7e7; + font-size: 12px; } } @@ -226,13 +233,13 @@ /* Login Page */ - .login-panel { +.login-panel { margin-top: 25%; } /* Flot Chart Containers */ - .flot-chart { +.flot-chart { display: block; height: 400px; } @@ -244,7 +251,7 @@ /* DataTables Overrides */ - table.dataTable thead .sorting, +table.dataTable thead .sorting, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc, table.dataTable thead .sorting_asc_disabled, diff --git a/public/templates/bootstrap/dashboard/default.tpl b/public/templates/bootstrap/dashboard/default.tpl index 1bb1993d..88aa24c9 100644 --- a/public/templates/bootstrap/dashboard/default.tpl +++ b/public/templates/bootstrap/dashboard/default.tpl @@ -17,7 +17,7 @@ - diff --git a/public/templates/bootstrap/login/default.tpl b/public/templates/bootstrap/login/default.tpl index 9392711a..7aa1f6c0 100644 --- a/public/templates/bootstrap/login/default.tpl +++ b/public/templates/bootstrap/login/default.tpl @@ -6,7 +6,7 @@

Login with existing account

-
+
@@ -15,10 +15,10 @@
-
+
{nocache}{$RECAPTCHA|default:"" nofilter}{/nocache}
-