Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from justcoded/develop
Browse files Browse the repository at this point in the history
Upgrade to Bootstrap4
  • Loading branch information
aprokopenko authored Jul 15, 2019
2 parents 883ed0e + 4fc2f2f commit bd96574
Show file tree
Hide file tree
Showing 39 changed files with 813 additions and 632 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tests/_support/_generated

# env files
.env
public/.htaccess

# extension dev files
/ext
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ CHANGELOG for Yii2 STARTER PROJECT TEMPLATE

*should be replaced with real project changelog later*

v2.0
---------------------
* Replaced Bootstrap 3 with Bootstrap 4
* Replaced AdmitLTE 2.x admin theme (based on Bootstrap 3) with AdminLTE 3.0-beta (based on Bootstrap 4)
* Refactored using View blocks: new Block widget

v1.0
---------------------
* Added APP_KEY hash generator console command.
Expand Down
8 changes: 6 additions & 2 deletions app/assets/AssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace app\assets;

use yii\bootstrap4\BootstrapAsset;
use yii\web\YiiAsset;

class AssetBundle extends \yii\web\AssetBundle
{
public $sourcePath = '@app/assets';
Expand All @@ -12,7 +15,8 @@ class AssetBundle extends \yii\web\AssetBundle
public $js = [
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
YiiAsset::class,
BootstrapAsset::class,
FontAwesomeAsset::class,
];
}
21 changes: 21 additions & 0 deletions app/assets/FontAwesomeAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace app\assets;

use yii\bootstrap4\BootstrapAsset;
use yii\web\YiiAsset;

class FontAwesomeAsset extends \yii\web\AssetBundle
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/plugins/fontawesome-free/';

public $css = [
'css/all.min.css',
];

public $js = [
];

public $depends = [
];
}
122 changes: 42 additions & 80 deletions app/assets/css/site.css
Original file line number Diff line number Diff line change
@@ -1,119 +1,81 @@
html,
body {
height: 100%;
height: 100%;
}

.wrap {
min-height: 100%;
height: auto;
margin: 0 auto -60px;
padding: 0 0 60px;
min-height: 100%;
height: auto;
margin: 0 auto -60px;
padding: 0 0 60px;
}

.wrap > .container {
padding: 70px 15px 20px;
padding: 20px 15px 20px;
}

.footer {
height: 60px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
padding-top: 20px;
height: 60px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
padding-top: 20px;
}

.jumbotron {
text-align: center;
background-color: transparent;
text-align: center;
background-color: transparent;
}

.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
font-size: 21px;
padding: 14px 24px;
}

.not-set {
color: #c55;
font-style: italic;
color: #c55;
font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
padding-left: 5px;
thead:first-child > tr:first-child a {
position: absolute;
bottom: 0px;
right: 8px;
display: block;
font-family: 'Font Awesome 5 Free';
opacity: 0.7;
color: #333;
}

a.asc:after {
content: /*"\e113"*/ "\e151";
}

a.desc:after {
content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
content: "\e153";
}

.sort-numerical a.desc:after {
content: "\e154";
thead:first-child > tr:first-child a:after {
content: "\f0dc";
opacity: 0.2;
}

.sort-ordinal a.asc:after {
content: "\e155";
thead:first-child > tr:first-child a.asc:after {
content: "\f0dd";
}

.sort-ordinal a.desc:after {
content: "\e156";
thead:first-child > tr:first-child a.desc:after {
content: "\f0de";
}

.grid-view th {
white-space: nowrap;
white-space: nowrap;
}

.hint-block {
display: block;
margin-top: 5px;
color: #999;
display: block;
margin-top: 5px;
color: #999;
}

.error-summary {
color: #a94442;
background: #fdf7f7;
border-left: 3px solid #eed3d7;
padding: 10px 20px;
margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
padding: 15px;
border: none;
}

@media(max-width:767px) {
.nav li > form > button.logout {
display:block;
text-align: left;
width: 100%;
padding: 10px 15px;
}
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
text-decoration: none;
color: #a94442;
background: #fdf7f7;
border-left: 3px solid #eed3d7;
padding: 10px 20px;
margin: 0 0 15px 0;
}

.nav > li > form > button.logout:focus {
outline: none;
}
.permissions {
font-size: 16px;
cursor: pointer;
font-size: 16px;
cursor: pointer;
}
13 changes: 13 additions & 0 deletions app/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @property integer $created_at
* @property integer $updated_at
* @property string $password write-only password
* @property-read string fullName
* @property-read string shortName
*/
class User extends ActiveRecord implements IdentityInterface
{
Expand Down Expand Up @@ -63,6 +65,17 @@ public function getFullName()
{
return "{$this->first_name} {$this->last_name}";
}

/**
* User short name
* (as first name, last name first letter)
*
* @return string
*/
public function getShortName()
{
return trim($this->first_name . ' ' . ($this->last_name ? $this->last_name{0} . '.' : ''));
}

/**
* List of user status aliases
Expand Down
1 change: 0 additions & 1 deletion app/modules/admin/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Module extends \yii\base\Module
*/
public $layout = 'main';


/**
* @inheritdoc
*/
Expand Down
30 changes: 30 additions & 0 deletions app/modules/admin/assets/AdminLteAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace app\modules\admin\assets;

use yii\bootstrap4\BootstrapAsset;
use yii\bootstrap4\BootstrapPluginAsset;
use yii\jui\JuiAsset;
use yii\web\JqueryAsset;
use yii\web\YiiAsset;

class AdminLteAsset extends \yii\web\AssetBundle
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/dist/';

public $css = [
'css/adminlte.css',
];

public $js = [
'js/adminlte.js',
];

public $depends = [
YiiAsset::class,
JqueryAsset::class,
JuiAsset::class,
BootstrapAsset::class,
BootstrapPluginAsset::class,
];
}
22 changes: 0 additions & 22 deletions app/modules/admin/assets/AdminltePluginsAssetBundle.php

This file was deleted.

10 changes: 5 additions & 5 deletions app/modules/admin/assets/AssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

namespace app\modules\admin\assets;

use app\assets\FontAwesomeAsset;

class AssetBundle extends \yii\web\AssetBundle
{
public $sourcePath = '@app/modules/admin/assets';

public $css = [
'css/extra.css'
'css/admin.css'
];

public $js = [];

public $depends = [
'dmstr\web\AdminLteAsset',
//'app\modules\admin\assets\AdminltePluginsAssetBundle',
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
AdminLteAsset::class,
FontAwesomeAsset::class,
];
}
28 changes: 0 additions & 28 deletions app/modules/admin/assets/ThemeHelper.php

This file was deleted.

Loading

0 comments on commit bd96574

Please sign in to comment.