Commit 39ba64e5775aee542182b9ba09935c032dee2eaf

Authored by Alexey Boroda
1 parent fc4126a3

-Some style added

frontend/views/layouts/main.php
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 6
7 use frontend\assets\MaterializeAsset; 7 use frontend\assets\MaterializeAsset;
8 use yii\helpers\Html; 8 use yii\helpers\Html;
  9 + use yii\helpers\Url;
9 use yii\web\View; 10 use yii\web\View;
10 use yii\widgets\Breadcrumbs; 11 use yii\widgets\Breadcrumbs;
11 use frontend\assets\AppAsset; 12 use frontend\assets\AppAsset;
@@ -28,6 +29,7 @@ JS; @@ -28,6 +29,7 @@ JS;
28 <meta charset="<?= Yii::$app->charset ?>"> 29 <meta charset="<?= Yii::$app->charset ?>">
29 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 30 <meta http-equiv="X-UA-Compatible" content="IE=edge">
30 <meta name="viewport" content="width=device-width, initial-scale=1"> 31 <meta name="viewport" content="width=device-width, initial-scale=1">
  32 + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
31 <?= Html::csrfMetaTags() ?> 33 <?= Html::csrfMetaTags() ?>
32 <title><?= Html::encode($this->title) ?></title> 34 <title><?= Html::encode($this->title) ?></title>
33 <?php $this->head() ?> 35 <?php $this->head() ?>
@@ -36,34 +38,26 @@ JS; @@ -36,34 +38,26 @@ JS;
36 <?php $this->beginBody() ?> 38 <?php $this->beginBody() ?>
37 39
38 <div class="wrap"> 40 <div class="wrap">
39 -  
40 - <ul id="slide-out" class="side-nav">  
41 - <li>  
42 - <div class="user-view">  
43 - <div class="background">  
44 - <img src="images/office.jpg">  
45 - </div>  
46 - <a href="#!user"><img class="circle" src="images/yuna.jpg"></a>  
47 - <a href="#!name"><span class="white-text name">John Doe</span></a>  
48 - <a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>  
49 - </div>  
50 - </li>  
51 - <li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>  
52 - <li><a href="#!">Second Link</a></li>  
53 - <li>  
54 - <div class="divider"></div>  
55 - </li>  
56 - <li><a class="subheader">Subheader</a></li>  
57 - <li><a class="waves-effect" href="#!">Third Link With Waves</a></li>  
58 - </ul>  
59 - <a href="#" data-activates="slide-out" class="button-collapse"><i class="material-icons">menu</i></a> 41 +
  42 + <?php
  43 + if (!\Yii::$app->getUser()->isGuest) {
  44 + ?>
  45 + <ul id="slide-out" class="side-nav">
  46 +
  47 + <li><a href="<?= Url::to([ 'site/index' ]) ?>"><i class="material-icons">home</i>Home</a></li>
  48 + <li><a data-method="POST" href="<?= Url::to(
  49 + [ 'site/logout' ]
  50 + ) ?>"><i class="material-icons">exit_to_app</i>Logout</a>
  51 + </li>
  52 +
  53 + </ul>
  54 + <a href="#" data-activates="slide-out" class="button-collapse waves-effect waves-light btn"><i class="material-icons left">menu</i>Menu</a>
  55 + <?php
  56 + }
  57 + ?>
60 58
61 <div class="container"> 59 <div class="container">
62 - <?= Breadcrumbs::widget(  
63 - [  
64 - 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [],  
65 - ]  
66 - ) ?> 60 +
67 <?= Alert::widget() ?> 61 <?= Alert::widget() ?>
68 <?= $content ?> 62 <?= $content ?>
69 </div> 63 </div>
frontend/views/site/login.php
@@ -11,19 +11,33 @@ $this-&gt;title = &#39;Login&#39;; @@ -11,19 +11,33 @@ $this-&gt;title = &#39;Login&#39;;
11 $this->params['breadcrumbs'][] = $this->title; 11 $this->params['breadcrumbs'][] = $this->title;
12 ?> 12 ?>
13 <div class="site-login"> 13 <div class="site-login">
14 - <h1><?= Html::encode($this->title) ?></h1>  
15 -  
16 - <p>Please fill out the following fields to login:</p> 14 + <div class="row">
  15 + <div class="col s4 offset-s4">
  16 + <h1><?= Html::encode($this->title) ?></h1>
  17 +
  18 + <p>Please fill out the following fields to login:</p>
  19 + </div>
  20 + </div>
17 21
18 <div class="row"> 22 <div class="row">
19 - <div class="col-lg-5"> 23 + <div class="col s4 offset-s4">
20 <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> 24 <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
21 25
22 - <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>  
23 -  
24 - <?= $form->field($model, 'password')->passwordInput() ?>  
25 -  
26 - <?= $form->field($model, 'rememberMe')->checkbox() ?> 26 + <?= $form->field($model, 'username', [
  27 + 'options' => [
  28 + 'class' => 'input-field'
  29 + ]
  30 + ])->textInput(['autofocus' => true]) ?>
  31 +
  32 + <?= $form->field($model, 'password',[
  33 + 'options' => [
  34 + 'class' => 'input-field'
  35 + ]
  36 + ])->passwordInput() ?>
  37 +
  38 + <?= $form->field($model, 'rememberMe', [
  39 + 'template' => '<p>{input}{label}</p>{error}'
  40 + ])->checkbox([], false) ?>
27 41
28 <div style="color:#999;margin:1em 0"> 42 <div style="color:#999;margin:1em 0">
29 If you forgot your password you can <?= Html::a('reset it', ['site/request-password-reset']) ?>. 43 If you forgot your password you can <?= Html::a('reset it', ['site/request-password-reset']) ?>.
frontend/web/css/site.css
@@ -101,9 +101,9 @@ a.desc:after { @@ -101,9 +101,9 @@ a.desc:after {
101 border: none; 101 border: none;
102 } 102 }
103 103
104 -@media(max-width:767px) { 104 +@media (max-width: 767px) {
105 .nav li > form > button.logout { 105 .nav li > form > button.logout {
106 - display:block; 106 + display: block;
107 text-align: left; 107 text-align: left;
108 width: 100%; 108 width: 100%;
109 padding: 10px 15px; 109 padding: 10px 15px;
@@ -118,3 +118,8 @@ a.desc:after { @@ -118,3 +118,8 @@ a.desc:after {
118 .nav > li > form > button.logout:focus { 118 .nav > li > form > button.logout:focus {
119 outline: none; 119 outline: none;
120 } 120 }
  121 +
  122 +.button-collapse {
  123 + margin-left: 20px;
  124 + margin-top: 20px;
  125 +}
121 \ No newline at end of file 126 \ No newline at end of file