From 5d324d68092c6ad111dce9bbb5b7ac9f04b29c2d Mon Sep 17 00:00:00 2001 From: Christine Slotty Date: Mon, 8 Jun 2020 19:04:40 +0200 Subject: [PATCH] WIP --- src/Controller/ServerUsersController.php | 3 +- src/Controller/StateErrorsController.php | 25 +++++++--- src/Template/Dashboard/index.ctp | 10 +--- src/Template/Dashboard/server_index.ctp | 40 ++++++++------- src/Template/Element/navi.ctp | 2 - src/Template/Element/navi_header.ctp | 42 ++++++++-------- src/Template/Layout/default.ctp | 40 ++++++--------- src/Template/Layout/frontend.ctp | 4 +- src/Template/ServerUsers/login.ctp | 21 ++++---- src/Template/StateBalances/overview.ctp | 32 ++++++------ src/Template/StateErrors/show_for_user.ctp | 58 ++++++++++------------ webroot/css/grd_styles.css | 56 ++++++++++++++++++--- websrc/src/less-files.css | 56 ++++++++++++++++++--- websrc/src/less/10-center.less | 41 ++++++++++++++- websrc/src/less/form.less | 26 +++++++--- 15 files changed, 293 insertions(+), 163 deletions(-) diff --git a/src/Controller/ServerUsersController.php b/src/Controller/ServerUsersController.php index fc6e95336..52165bb3b 100644 --- a/src/Controller/ServerUsersController.php +++ b/src/Controller/ServerUsersController.php @@ -27,12 +27,12 @@ class ServerUsersController extends AppController public function index() { $serverUsers = $this->paginate($this->ServerUsers); - $this->set(compact('serverUsers')); } public function login() { + $startTime = microtime(true); if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user) { @@ -41,6 +41,7 @@ class ServerUsersController extends AppController } $this->Flash->error(__('Invalid username or password, try again')); } + $this->set('timeUsed', microtime(true) - $startTime); } public function logout() diff --git a/src/Controller/StateErrorsController.php b/src/Controller/StateErrorsController.php index 37d37bdda..0c91d93e3 100644 --- a/src/Controller/StateErrorsController.php +++ b/src/Controller/StateErrorsController.php @@ -3,6 +3,9 @@ namespace App\Controller; use App\Controller\AppController; +use Model\Navigation\NaviHierarchy; +use Model\Navigation\NaviHierarchyEntry; + /** * StateErrors Controller * @@ -12,13 +15,19 @@ use App\Controller\AppController; */ class StateErrorsController extends AppController { - + public function initialize() { parent::initialize(); $this->Auth->allow(['showForUser', 'deleteForUser']); + $this->set( + 'naviHierarchy', + (new NaviHierarchy())-> + add(new NaviHierarchyEntry(__('Startseite'), 'Dashboard', 'index', false))-> + add(new NaviHierarchyEntry(__('Fehler'), 'StateErrors', 'ShowForUser', true)) + ); } - + /** * Index method * @@ -33,8 +42,8 @@ class StateErrorsController extends AppController $this->set(compact('stateErrors')); } - - public function showForUser() + + public function showForUser() { $startTime = microtime(true); $this->viewBuilder()->setLayout('frontend'); @@ -47,15 +56,15 @@ class StateErrorsController extends AppController } $user = $session->read('StateUser'); } - + $errors = $this->StateErrors->find('all')->where(['state_user_id' => $user['id']])->contain(false); $transactionTypes = $this->StateErrors->TransactionTypes->find('all')->select(['id', 'name', 'text'])->order(['id']); - + $this->set('errors', $errors); $this->set('transactionTypes', $transactionTypes->toList()); $this->set('timeUsed', microtime(true) - $startTime); } - + public function deleteForUser($id = null) { $this->request->allowMethod(['post', 'delete', 'get']); @@ -76,7 +85,7 @@ class StateErrorsController extends AppController } return $this->redirect(['action' => 'showForUser']); } - + /** * View method diff --git a/src/Template/Dashboard/index.ctp b/src/Template/Dashboard/index.ctp index ec4971657..b46abff94 100644 --- a/src/Template/Dashboard/index.ctp +++ b/src/Template/Dashboard/index.ctp @@ -52,15 +52,7 @@ $this->assign(

Gradido ...

- add_box - Html->link( - __('einzeln schöpfen'), - ['controller' => 'TransactionCreations', 'action' => 'create'], - ['class' => 'action-button-link'] - );?> -
-
- library_add + redeem Html->link( __('viele schöpfen'), ['controller' => 'TransactionCreations', 'action' => 'createMulti'], diff --git a/src/Template/Dashboard/server_index.ctp b/src/Template/Dashboard/server_index.ctp index a18ec3aa6..1b4da7647 100644 --- a/src/Template/Dashboard/server_index.ctp +++ b/src/Template/Dashboard/server_index.ctp @@ -1,30 +1,36 @@ assign('title', __('Willkommen')); +$this->assign( + 'header', + '

Server Dashboard, nur für Admins

' +); ?> -

Server Dashboard, nur für Admins

-
-
-

Gradido ...

+
+

Gradido ...

+
+
+ redeem Html->link( - __('einzeln schöpfen'), - ['controller' => 'TransactionCreations', 'action' => 'create'], - ['class' => 'grd-nav-bn grd-nav-bn-large'] - );?> + __('viele schöpfen'), + ['controller' => 'TransactionCreations', 'action' => 'createMulti'], + ['class' => 'action-button-link'] + );?> +
+
+
+
+ error_outline Html->link( - __('viele schöpfen'), - ['controller' => 'TransactionCreations', 'action' => 'createMulti'], - ['class' => 'grd-nav-bn grd-nav-bn-large'] - );?> -
- Html->link( __('Fehler') . ' (' . $adminErrorCount . ')', - ['controller' => 'AdminErrors'], ['class' => 'grd-nav-bn']); - ?> + ['controller' => 'AdminErrors'], ['class' => 'info-item-link']); + ?> +
+
\ No newline at end of file diff --git a/src/Template/Element/navi.ctp b/src/Template/Element/navi.ctp index fc9985037..7a22e8dce 100644 --- a/src/Template/Element/navi.ctp +++ b/src/Template/Element/navi.ctp @@ -47,6 +47,4 @@ if(intval($transactionPendings) > 0) { ?> - diff --git a/src/Template/Element/navi_header.ctp b/src/Template/Element/navi_header.ctp index cbc2eea97..4e0b6323b 100644 --- a/src/Template/Element/navi_header.ctp +++ b/src/Template/Element/navi_header.ctp @@ -1,6 +1,6 @@ - \ No newline at end of file + 0) : ?> +
  • + Html->link( + '' + . '', + ['controller' => 'StateErrors', 'action' => 'ShowForUser'], + ['class' => 'nav-link', 'escape' => false, 'title' => "$errorCount " . __('Fehler')]) ?> +
  • + + 0) : ?> +
  • + " href="account/checkTransactions"> + + + + +
  • + diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index fa09a03df..7b9da3b8f 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -25,37 +25,29 @@ $cakeDescription = 'Gradido'; fetch('title') ?> Html->meta('icon') ?> - - Html->css('base.css') ?> - Html->css('style.css') ?> - + Html->css(['main.css']) ?> + Html->script(['basic']) ?> fetch('meta') ?> fetch('css') ?> fetch('script') ?> - - Flash->render() ?> -
    - fetch('content') ?> + +
    + ms +
    +
    - -
    - ms -
    - diff --git a/src/Template/Layout/frontend.ctp b/src/Template/Layout/frontend.ctp index 062ae3844..451323d69 100644 --- a/src/Template/Layout/frontend.ctp +++ b/src/Template/Layout/frontend.ctp @@ -58,10 +58,12 @@ $GLOBALS["self"] = $this;
    Flash->render() ?>
    - element('navi_header'); ?>
    diff --git a/src/Template/ServerUsers/login.ctp b/src/Template/ServerUsers/login.ctp index 42e7a2c55..4996d5e7b 100644 --- a/src/Template/ServerUsers/login.ctp +++ b/src/Template/ServerUsers/login.ctp @@ -1,19 +1,22 @@ loadHelper('Form', [ + 'templates' => 'horizontal_form', +]); ?> -
    Flash->render() ?> -Form->create() ?> +
    + Form->create() ?>
    - - Form->control('username') ?> - Form->control('password') ?> + + Form->control('username') ?> + Form->control('password') ?>
    -Form->button(__('Login')); ?> -Form->end() ?> -
    \ No newline at end of file + Form->button(__('Login'), ['class' => 'form-button']); ?> + Form->end() ?> +
    diff --git a/src/Template/StateBalances/overview.ctp b/src/Template/StateBalances/overview.ctp index 113e74055..2eef35000 100644 --- a/src/Template/StateBalances/overview.ctp +++ b/src/Template/StateBalances/overview.ctp @@ -27,11 +27,11 @@ $this->assign('header', $header);

    Überweisungen

    - - - - - +
    +
    +
    +
    +
    assign('header', $header); $cellColorClass = 'grd-orange-color'; } ?> - - Html->image('50x50.png', ['class' => 'profile-img img-sm', 'alt' => 'profile image']) ?> +
    + Html->image('50x50.png', ['class' => 'profile-img', 'alt' => 'profile image']) ?> - + - + @@ -68,19 +68,19 @@ $this->assign('header', $header); - - +
    +
    30): ?> - - nice() ?> - element('printGradido', ['number' => $balance]) ?> - +
    +
    nice() ?>
    +
    element('printGradido', ['number' => $balance]) ?>
    +
    - +
    diff --git a/src/Template/StateErrors/show_for_user.ctp b/src/Template/StateErrors/show_for_user.ctp index a73f59dfc..5d8018990 100644 --- a/src/Template/StateErrors/show_for_user.ctp +++ b/src/Template/StateErrors/show_for_user.ctp @@ -1,6 +1,6 @@ assign('title', __('Fehlermeldungen')); //var_dump($transactionTypes); /*foreach($transactionTypes as $i => $t) { echo "$i => "; - var_dump($t); + var_dump($t); echo "
    "; }*/ ?> -
    - - - - - - transaction_type_id-1]; - $errorMessage = ""; - $errorArray = json_decode($error->message_json, true); - if(isset($errorArray['details']) && is_array($errorArray['details'])) { - - foreach($errorArray['details'][0] as $function => $errorString) { - $errorMessage = '' . $function . '
    ' . $errorString; - } - - } else { - $errorMessage = $error->message_json; +
    +

    Fehler

    +
    + Transaktion Typ + Datum + Fehler + Aktionen + transaction_type_id-1]; + $errorMessage = ""; + $errorArray = json_decode($error->message_json, true); + if(isset($errorArray['details']) && is_array($errorArray['details'])) { + foreach($errorArray['details'][0] as $function => $errorString) { + $errorMessage = '' . $function . '
    ' . $errorString; } - - - ?> -
    - - - - - - - -
    Transaktion TypDatumFehlerAktionen
    name ?>created ?>Html->link(__('Delete'), ['action' => 'deleteForUser', $error->id], ['class' => 'grd-form-bn grd-form-bn-discard']) ?>
    + } else { + $errorMessage = $error->message_json; + } + ?> + name ?> + created ?> + + Html->link(__('Delete'), ['action' => 'deleteForUser', $error->id], ['class' => 'grd-form-bn grd-form-bn-discard']) ?> + +
    diff --git a/webroot/css/grd_styles.css b/webroot/css/grd_styles.css index 4f1d38a5f..a0482db03 100644 --- a/webroot/css/grd_styles.css +++ b/webroot/css/grd_styles.css @@ -453,6 +453,11 @@ /* ========= CONTENT =========*/ + .content-default { + display: flex; + justify-content: center; + padding-top: 50px; + } .content { display: flex; justify-content: flex-start; @@ -492,6 +497,9 @@ border: 1px solid rgba(238, 238, 238, 0.75); margin: 1em 0.25em; } + .content-default .content-container { + min-width: 800px; + } /* Top Info Above Main */ .info-container { max-width: 70%; @@ -541,8 +549,10 @@ font-size: 16px; color: #212529; } + .cell { + padding: 1em 1.5em; + } .header-cell { - padding: 1em 2em; border-top: 1px solid #f2f4f9; background-color: #fafafa; color: #101010; @@ -560,6 +570,28 @@ .wiretransfer { grid-template-columns: 5fr 4fr 3fr 2fr 1fr; } + .error-list { + grid-template-columns: 2fr 2fr 5fr 1fr; + } + .profile-img { + width: 30px; + height: 30px; + border-radius: 6px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2); + overflow: hidden; + vertical-align: middle; + border-style: none; + box-sizing: border-box; + } + .tx-email { + cursor: pointer; + display: block; + color: #101010; + } + .small { + font-size: 80%; + font-weight: 400; + } /* OTHER */ .info-item i, .info-item-link, @@ -715,12 +747,6 @@ and open the template in the editor. margin-bottom: 15px; border-radius: 0 6px 0 0; } - .form-body form { - display: grid; - grid-template-columns: 200px 1fr; - margin: 36px 75px; - grid-gap: 1em; - } .form-label { grid-column: 0.5; font-weight: 400; @@ -769,6 +795,22 @@ and open the template in the editor. background-color: #034b04; border-color: #023f03; } + /* CENTER FORM SPECIFICS */ + .form-body form { + display: grid; + grid-template-columns: 200px 1fr; + margin: 36px 75px; + grid-gap: 1em; + } + .center-form { + width: 450px; + } + .center-form .form-control { + width: 90%; + } + .center-form fieldset { + margin-bottom: 1em; + } } /* Button diff --git a/websrc/src/less-files.css b/websrc/src/less-files.css index 4f1d38a5f..a0482db03 100644 --- a/websrc/src/less-files.css +++ b/websrc/src/less-files.css @@ -453,6 +453,11 @@ /* ========= CONTENT =========*/ + .content-default { + display: flex; + justify-content: center; + padding-top: 50px; + } .content { display: flex; justify-content: flex-start; @@ -492,6 +497,9 @@ border: 1px solid rgba(238, 238, 238, 0.75); margin: 1em 0.25em; } + .content-default .content-container { + min-width: 800px; + } /* Top Info Above Main */ .info-container { max-width: 70%; @@ -541,8 +549,10 @@ font-size: 16px; color: #212529; } + .cell { + padding: 1em 1.5em; + } .header-cell { - padding: 1em 2em; border-top: 1px solid #f2f4f9; background-color: #fafafa; color: #101010; @@ -560,6 +570,28 @@ .wiretransfer { grid-template-columns: 5fr 4fr 3fr 2fr 1fr; } + .error-list { + grid-template-columns: 2fr 2fr 5fr 1fr; + } + .profile-img { + width: 30px; + height: 30px; + border-radius: 6px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2); + overflow: hidden; + vertical-align: middle; + border-style: none; + box-sizing: border-box; + } + .tx-email { + cursor: pointer; + display: block; + color: #101010; + } + .small { + font-size: 80%; + font-weight: 400; + } /* OTHER */ .info-item i, .info-item-link, @@ -715,12 +747,6 @@ and open the template in the editor. margin-bottom: 15px; border-radius: 0 6px 0 0; } - .form-body form { - display: grid; - grid-template-columns: 200px 1fr; - margin: 36px 75px; - grid-gap: 1em; - } .form-label { grid-column: 0.5; font-weight: 400; @@ -769,6 +795,22 @@ and open the template in the editor. background-color: #034b04; border-color: #023f03; } + /* CENTER FORM SPECIFICS */ + .form-body form { + display: grid; + grid-template-columns: 200px 1fr; + margin: 36px 75px; + grid-gap: 1em; + } + .center-form { + width: 450px; + } + .center-form .form-control { + width: 90%; + } + .center-form fieldset { + margin-bottom: 1em; + } } /* Button diff --git a/websrc/src/less/10-center.less b/websrc/src/less/10-center.less index 9aaa6f920..c87bc313b 100644 --- a/websrc/src/less/10-center.less +++ b/websrc/src/less/10-center.less @@ -13,6 +13,12 @@ /* ========= CONTENT =========*/ + .content-default { + display: flex; + justify-content: center; + padding-top: 50px; + } + .content { display: flex; justify-content: flex-start; @@ -64,6 +70,10 @@ margin: 1em .25em; } + .content-default .content-container { + min-width: 800px; + } + /* Top Info Above Main */ .info-container { max-width: 70%; @@ -123,8 +133,11 @@ color: #212529; } + .cell { + padding: 1em 1.5em; + } + .header-cell { - padding: 1em 2em; border-top: 1px solid @content-table-header-border; background-color: @content-table-header-bg; color: @content-table-header; @@ -146,6 +159,32 @@ grid-template-columns: 5fr 4fr 3fr 2fr 1fr; } + .error-list { + grid-template-columns: 2fr 2fr 5fr 1fr; + } + + .profile-img { + width: 30px; + height: 30px; + border-radius: 6px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, .2); + overflow: hidden; + vertical-align: middle; + border-style: none; + box-sizing: border-box; + } + + .tx-email { + cursor: pointer; + display: block; + color: @content-table-header; + } + + .small { + font-size: 80%; + font-weight: 400; + } + /* OTHER */ .info-item i, .info-item-link, diff --git a/websrc/src/less/form.less b/websrc/src/less/form.less index 5c9c16c08..5c455c05d 100644 --- a/websrc/src/less/form.less +++ b/websrc/src/less/form.less @@ -34,13 +34,6 @@ and open the template in the editor. border-radius: 0 6px 0 0; } - .form-body form { - display: grid; - grid-template-columns: 200px 1fr; - margin: 36px 75px; - grid-gap: 1em; - } - .form-label { grid-column: 1 / 2; font-weight: 400; @@ -94,6 +87,25 @@ and open the template in the editor. border-color: #023f03; } + /* CENTER FORM SPECIFICS */ + .form-body form { + display: grid; + grid-template-columns: 200px 1fr; + margin: 36px 75px; + grid-gap: 1em; + } + + .center-form { + width: 450px; + } + + .center-form .form-control { + width: 90%; + } + .center-form fieldset { + margin-bottom: 1em; + } + } /*