diff options
author | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2019-12-10 11:34:53 +0100 |
---|---|---|
committer | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2019-12-10 11:34:53 +0100 |
commit | b8fa0246803dab40cf57d40b45984c53046f2d55 (patch) | |
tree | dc92b167c7542137c385614a1d558e57669a4339 /plugins/Customizer/Template/layout | |
parent | 2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff) |
Plugins directory and local modifications
Diffstat (limited to 'plugins/Customizer/Template/layout')
-rw-r--r-- | plugins/Customizer/Template/layout/index.php | 47 | ||||
-rw-r--r-- | plugins/Customizer/Template/layout/layout.php | 85 | ||||
-rw-r--r-- | plugins/Customizer/Template/layout/login_no_custom.php | 21 | ||||
-rw-r--r-- | plugins/Customizer/Template/layout/login_with_custom.php | 128 | ||||
-rw-r--r-- | plugins/Customizer/Template/layout/note.php | 7 | ||||
-rw-r--r-- | plugins/Customizer/Template/layout/preview_style.php | 77 |
6 files changed, 365 insertions, 0 deletions
diff --git a/plugins/Customizer/Template/layout/index.php b/plugins/Customizer/Template/layout/index.php new file mode 100644 index 00000000..587b3e04 --- /dev/null +++ b/plugins/Customizer/Template/layout/index.php @@ -0,0 +1,47 @@ +<div class="form-login"> + + <?= $this->hook->render('template:auth:login-form:before') ?> + + <?php if (isset($errors['login'])): ?> + <p class="alert alert-error"><?= $this->text->e($errors['login']) ?></p> + <?php endif ?> + + <?php if (! HIDE_LOGIN_FORM): ?> + <form method="post" action="<?= $this->url->href('AuthController', 'check') ?>"> + + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Username'), 'username') ?> + <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'placeholder="Enter your username"')) ?> + + <?= $this->form->label(t('Password'), 'password') ?> + <?= $this->form->password('password', $values, $errors, array('required', 'placeholder="Enter your password"')) ?> + + <?php if (isset($captcha) && $captcha): ?> + <?= $this->form->label(t('Enter the text below'), 'captcha') ?> + <img src="<?= $this->url->href('CaptchaController', 'image') ?>" alt="Captcha"> + <?= $this->form->text('captcha', array(), $errors, array('required')) ?> + <?php endif ?> + + <?php if (REMEMBER_ME_AUTH == true): ?> + <?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?> + <div class="mb-10"></div> + <?php else: ?> + <div class="mb-15"></div> + <?php endif ?> + + <div class="form-actions"> + <button type="submit" class="btn login-btn"><?= t('Sign in') ?></button> + </div> + <?php if ($this->app->config('password_reset') == 1): ?> + <div class="reset-password"> + <?= $this->url->link(t('Forgot password?'), 'PasswordResetController', 'create') ?> + </div> + <?php endif ?> + </form> + <?php endif ?> + + <?= $this->hook->render('template:auth:login-form:after') ?> +</div> + +<?= $this->hook->render('template:auth:login-form:newbox') ?> diff --git a/plugins/Customizer/Template/layout/layout.php b/plugins/Customizer/Template/layout/layout.php new file mode 100644 index 00000000..e5b4b772 --- /dev/null +++ b/plugins/Customizer/Template/layout/layout.php @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width"> + <meta name="mobile-web-app-capable" content="yes"> + <meta name="robots" content="noindex,nofollow"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="referrer" content="no-referrer"> + + <?php if (isset($board_public_refresh_interval)): ?> + <meta http-equiv="refresh" content="<?= $board_public_refresh_interval ?>"> + <?php endif ?> + + <?= $this->asset->colorCss() ?> + <?= $this->asset->css('assets/css/vendor.min.css') ?> + <?= $this->asset->css('assets/css/app.min.css') ?> + <?php if (file_exists('assets/css/print.min.css')) :?> + <?= $this->asset->css('assets/css/print.min.css', true, 'print') ?> + <?php endif ?> + <?= $this->asset->customCss() ?> + + <?php if (! isset($not_editable)): ?> + <?= $this->asset->js('assets/js/vendor.min.js') ?> + <?= $this->asset->js('assets/js/app.min.js') ?> + <?php endif ?> + + <?= $this->hook->asset('css', 'template:layout:css') ?> + <?= $this->hook->asset('js', 'template:layout:js') ?> + <?php if (null !== $this->task->customizerFileModel->getByType(2)) : ?> + <link rel="icon" type="image/png" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>"> + <link rel="apple-touch-icon" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>"> + <link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>"> + <link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>"> + <link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>"> + <?php else: ?> + <link rel="icon" type="image/png" href="<?= $this->url->dir() ?>assets/img/favicon.png"> + <link rel="apple-touch-icon" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone.png"> + <link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad.png"> + <link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone-retina.png"> + <link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad-retina.png"> + <?php endif ?> + + + <title> + <?php if (isset($page_title)): ?> + <?= $this->text->e($page_title) ?> + <?php elseif (isset($title)): ?> + <?= $this->text->e($title) ?> + <?php else: ?> + Kanboard + <?php endif ?> + </title> + + <?= $this->hook->render('template:layout:head') ?> + </head> + <body data-status-url="<?= $this->url->href('UserAjaxController', 'status') ?>" + data-login-url="<?= $this->url->href('AuthController', 'login') ?>" + data-keyboard-shortcut-url="<?= $this->url->href('DocumentationController', 'shortcuts') ?>" + data-timezone="<?= $this->app->getTimezone() ?>" + data-js-lang="<?= $this->app->jsLang() ?>" + data-js-date-format="<?= $this->app->getJsDateFormat() ?>" + data-js-time-format="<?= $this->app->getJsTimeFormat() ?>" + data-js-modal-close-msg="<?= t('Close window?\\n\\nChanges that you made have not been saved.') ?>" + > + + <?php if (isset($no_layout) && $no_layout): ?> + <?= $this->app->flashMessage() ?> + <?= $content_for_layout ?> + <?php else: ?> + <?= $this->hook->render('template:layout:top') ?> + <?= $this->render('header', array( + 'title' => $title, + 'description' => isset($description) ? $description : '', + 'board_selector' => isset($board_selector) ? $board_selector : array(), + 'project' => isset($project) ? $project : array(), + )) ?> + <section class="page"> + <?= $this->app->flashMessage() ?> + <?= $content_for_layout ?> + </section> + <?= $this->hook->render('template:layout:bottom') ?> + <?php endif ?> + </body> +</html> diff --git a/plugins/Customizer/Template/layout/login_no_custom.php b/plugins/Customizer/Template/layout/login_no_custom.php new file mode 100644 index 00000000..7e7cbd54 --- /dev/null +++ b/plugins/Customizer/Template/layout/login_no_custom.php @@ -0,0 +1,21 @@ +<?php global $customizer; ?> +<?php if ($customizer['loginCheck']): ?> +<?= $this->url->link('<img src="' . $this->url->href('CustomizerFileController', 'loginlogo', array('plugin' => 'customizer')) . '" height="' . $customizer['logoSize'] . '">', 'CustomizerFileController', 'link', array('plugin' => 'customizer')) ?> +<?php endif ?> +<?php +if (function_exists('session_exists')) { +if (session_exists('redirectAfterLogin') && ! filter_var(session_get('redirectAfterLogin'), FILTER_VALIDATE_URL)) { + $redirect = session_get('redirectAfterLogin'); + if (strpos($redirect, 'Customizer') !== false) { + session_remove('redirectAfterLogin'); + } +} +} else { +if (isset($this->task->sessionStorage->redirectAfterLogin) && ! empty($this->task->sessionStorage->redirectAfterLogin) && ! filter_var($this->task->sessionStorage->redirectAfterLogin, FILTER_VALIDATE_URL)) { + $redirect = $this->task->sessionStorage->redirectAfterLogin; + if (strpos($redirect, 'Customizer') !== false) { + unset($this->task->sessionStorage->redirectAfterLogin); + } +} +} +?> diff --git a/plugins/Customizer/Template/layout/login_with_custom.php b/plugins/Customizer/Template/layout/login_with_custom.php new file mode 100644 index 00000000..1ca70d77 --- /dev/null +++ b/plugins/Customizer/Template/layout/login_with_custom.php @@ -0,0 +1,128 @@ +<?php global $customizer; ?> +<?php if ($customizer['loginCheck']): ?> +<?= $this->url->link('<img src="' . $this->url->href('CustomizerFileController', 'loginlogo', array('plugin' => 'customizer')) . '" height="' . $customizer['logoSize'] . '">', 'CustomizerFileController', 'link', array('plugin' => 'customizer')) ?> +<?php endif ?> +<style> +body { + background: url("<?= $customizer['backURL'] ?>") no-repeat center center fixed; + background-size: cover; + background-color: <?= $customizer['backColor'] ?>; +} +.mb-10 { + margin-bottom: 10px !important; +} +.mb-15 { + margin-bottom: 15px !important; +} + +.form-login > a > img { + display: block; + margin: auto; + padding-top: 10px +} /* This aligns the logo to the text. Adds padding to top of logo. */ + +.form-login { + background-color: <?= $customizer['loginpanel_color'] ?>; + -webkit-box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px <?= $customizer['login_shadow_color'] ?>; + -moz-box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px <?= $customizer['login_shadow_color'] ?>; + box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px <?= $customizer['login_shadow_color'] ?>; + padding: 10px; + border: <?= $customizer['login_border'] ?>px solid <?= $customizer['login_border_color'] ?>; + border-radius: 5px; + max-width: max-content; + text-align: center; +} +.login-btn { + width: <?= $customizer['login_btn_width'] ?>px; + -webkit-box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + -moz-box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + border: <?= $customizer['login_btn_border'] ?>px solid <?= $customizer['login_btn_border_color'] ?>; + background: <?= $customizer['login_btn_color'] ?>; + color: <?= $customizer['login_btn_font_color'] ?>; + background-image: linear-gradient(-180deg, <?= $customizer['login_btn_color'] ?> 0%, <?= $customizer['login_btn_shade_color'] ?> 90%); + border-radius: 5px; + } +.login-btn:hover, .login-btn:focus { + border-color: <?= $customizer['login_btn_border_color'] ?>; + background: <?= $customizer['login_btn_font_color'] ?>; + color: <?= $customizer['login_btn_color'] ?>; +} +/*------ MOVED FROM PLUGIN CSS FILE TO AVOID AFFECTING OTHER PARTS OF KANBOARD. STYLES SET HERE APPLY ONLY TO THE LOGIN PAGE. ------*/ +.form-actions { + text-align: center; + padding-top: unset; + padding-bottom: 10px; +} /* This moves the login button to the centre of the box and removes the useless padding above the login button. Adds padding to bottom of login button. */ + +label:nth-of-type(3n) { + color: grey; + text-align: center; +} /* This makes the 'remember me' smaller and centralised*/ + +.form-actions > .login-btn { + font-variant-caps: all-small-caps; + text-align: center; + transition: cubic-bezier(0.1, 0.75, 0.57, 1) 0.4s; + -webkit-transition: cubic-bezier(0.1, 0.75, 0.57, 1) 0.4s; +} /* This makes the title text of the login button all capitals. Also adds smoothing when hover on the login button */ + +label:nth-of-type(1) { + visibility: hidden; +} /* This hides (to maintain the gap) the text of the labels */ + +label:nth-of-type(2n) { + visibility: hidden; + margin-top: -5px; +} /* This hides (to maintain the gap) the text of the labels and also reduces the top margin */ + +input::-webkit-input-placeholder { + color: #000; + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} /* This styles the placeholder to emphasise it. Cross-browser compatibility */ + +input::-moz-placeholder { + color: #000; + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} /* This styles the placeholder to emphasise it. Cross-browser compatibility */ + +input:-ms-input-placeholder { + color: #000; + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} /* This styles the placeholder to emphasise it. Cross-browser compatibility */ + +input::placeholder { + color: #000; + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} /* This styles the placeholder to emphasise it. Cross-browser compatibility */ + +input[type="password"], input[type="text"]:not(.input-addon-field) { + margin: auto; + display: block; + border-radius: 5px; +} /* This centralises the input fields and makes the borders consistent with the outer form */ + +.form-required { display: none;} /* This removes the standard required asterisk */ + +</style> +<?php +if (function_exists('session_exists')) { +if (session_exists('redirectAfterLogin') && ! filter_var(session_get('redirectAfterLogin'), FILTER_VALIDATE_URL)) { + $redirect = session_get('redirectAfterLogin'); + if (strpos($redirect, 'Customizer') !== false) { + session_remove('redirectAfterLogin'); + } +} +} else { +if (isset($this->task->sessionStorage->redirectAfterLogin) && ! empty($this->task->sessionStorage->redirectAfterLogin) && ! filter_var($this->task->sessionStorage->redirectAfterLogin, FILTER_VALIDATE_URL)) { + $redirect = $this->task->sessionStorage->redirectAfterLogin; + if (strpos($redirect, 'Customizer') !== false) { + unset($this->task->sessionStorage->redirectAfterLogin); + } +} +} +?> diff --git a/plugins/Customizer/Template/layout/note.php b/plugins/Customizer/Template/layout/note.php new file mode 100644 index 00000000..b8454e64 --- /dev/null +++ b/plugins/Customizer/Template/layout/note.php @@ -0,0 +1,7 @@ +<?php global $customizer; ?> + +<div class="form-login"> + <div class="login-note"> + <?= $customizer['login_note'] ?> + </div> +</div> diff --git a/plugins/Customizer/Template/layout/preview_style.php b/plugins/Customizer/Template/layout/preview_style.php new file mode 100644 index 00000000..fdd9576f --- /dev/null +++ b/plugins/Customizer/Template/layout/preview_style.php @@ -0,0 +1,77 @@ +<?php global $customizer; ?> +<style> +.preview-form-login > a > img { + display: block; + margin: auto; + padding-top: 10px +} /* This aligns the logo to the text. Adds padding to top of logo. */ + + +.preview-form-login, .preview-form-note { + background-color: <?= $customizer['loginpanel_color'] ?>; + -webkit-box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px; + -moz-box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px; + box-shadow: 0px 0px <?= $customizer['login_shadow'] ?>px <?= $customizer['login_shadow'] * .1 ?>px; + padding: 10px; + border: <?= $customizer['login_border'] ?>px solid <?= $customizer['login_border_color'] ?>; + border-radius: 5px; + text-align: center; + max-width: max-content; + margin: 5% auto 0;; +} +.preview-login-btn { + width: <?= $customizer['login_btn_width'] ?>px; + -webkit-box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + -moz-box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + box-shadow: 0px 0px <?= $customizer['login_btn_shadow'] ?>px <?= $customizer['login_btn_shadow'] * .1 ?>px <?= $customizer['login_btn_shadow_color'] ?>; + border: <?= $customizer['login_btn_border'] ?>px solid <?= $customizer['login_btn_border_color'] ?>; + background: <?= $customizer['login_btn_color'] ?>; + color: <?= $customizer['login_btn_font_color'] ?>; + background-image: linear-gradient(-180deg, transparent 0%, <?= $customizer['login_btn_shade_color'] ?> 90%); + border-radius: 5px; + } + +.preview-login-btn:hover, .preview-login-btn:focus { + border-color: <?= $customizer['login_btn_border_color'] ?>; + background: <?= $customizer['login_btn_font_color'] ?>; + color: <?= $customizer['login_btn_color'] ?>; + background-image: unset; +} + +.preview-form-actions > .preview-login-btn { + font-variant-caps: all-small-caps; + text-align: center; + transition: cubic-bezier(0.1, 0.75, 0.57, 1) 0.4s; + -webkit-transition: cubic-bezier(0.1, 0.75, 0.57, 1) 0.4s; +} + + +.preview-form-actions { + text-align: center; + padding-top: unset; + padding-bottom: 10px; +} /* This moves the login button to the centre of the box and removes the useless padding above the login button. Adds padding to bottom of login button. */ + + + +.preview-form-required { display: none;} /* This removes the standard required asterisk */ + +.avatar-preview img, .avatar-preview div { + border-radius: <?= $this->task->configModel->get('av_radius','50') ?>%; +} +.avatar-preview .avatar-letter { + line-height: <?= $this->task->configModel->get('av_size','20') ?>px; + width: <?= $this->task->configModel->get('av_size','20') ?>px; + font-size: <?= $this->task->configModel->get('av_size','20') / 2 ?>px; +} + +.b-avatar-preview img, .b-avatar-preview div { + border-radius: <?= $this->task->configModel->get('b_av_radius','50') ?>%; +} +.b-avatar-preview .avatar-letter { + line-height: <?= $this->task->configModel->get('b_av_size','20') ?>px; + width: <?= $this->task->configModel->get('b_av_size','20') ?>px; + font-size: <?= $this->task->configModel->get('b_av_size','20') / 2 ?>px; +} + +</style> |