Skip to content

Commit

Permalink
login bg image option closes luyadev#316
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar authored and slowfox089 committed Dec 10, 2020
1 parent 48daa86 commit 872e5ab
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE
+ [#314](https://github.com/luyadev/luya-module-admin/issues/314) Fixed bug where schedule coult not find items when override default ActiveRecord find() method.
+ [#316](https://github.com/luyadev/luya-module-admin/issues/316) Fixed a bug where tempnam() throws a php notice since php 7.1 and higher.

### Added

+ [#315](https://github.com/luyadev/luya-module-admin/issues/315) Added property for login controller in order to display an background image on the login screen.

## 2.0.1 (29. May 2019)

### Changed
Expand Down
10 changes: 9 additions & 1 deletion src/controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class LoginController extends Controller
*/
public $layout = '@admin/views/layouts/nosession';

/**
* @var string A path to an image which should be display on the login screen, if not set no images is displayed.
* @since 2.0.1.1
*/
public $backgroundImage;

/**
* {@inheritDoc}
* @see \luya\admin\base\Controller::getRules()
Expand Down Expand Up @@ -88,7 +94,9 @@ public function actionIndex()

UserOnline::clearList($this->module->userIdleTimeout);

return $this->render('index');
return $this->render('index', [
'backgroundImage' => $this->backgroundImage,
]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/resources/dist/login.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/resources/scss/login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@ form .row {
@media (max-width: 800px) and (min-height: 730px) {
display: block;
}
}

.login-form {
background-color:white; padding:50px 25px 25px; border-radius:5px;
}
10 changes: 9 additions & 1 deletion src/views/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@
'cssClass' => 'svg-spinner',
'file' => 'login/spinner.svg'
]);

?>
<?php if ($backgroundImage): ?>
<style type="text/css">
body {
background-image: url('<?= $backgroundImage; ?>');
background-size: cover;
background-position: 50% 50%;
}
</style>
<?php endif; ?>
<div class="login-frame">
<div class="login-logo">
<?= Svg::widget([
Expand Down

0 comments on commit 872e5ab

Please sign in to comment.