Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "7.2"
- "7.3"
- "7.4"
- "8.0"

steps:
- name: Checkout
Expand Down Expand Up @@ -72,7 +73,7 @@ jobs:
restore-keys: |
php${{ matrix.php }}-composer-${{ matrix.dependencies }}-

- name: Install dependencies with composer php PHP [5.6 - 7.4]
- name: Install dependencies with composer php PHP [5.6 - 8.0]
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with codeception
Expand Down
2 changes: 1 addition & 1 deletion assets/AppAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class AppAsset extends AssetBundle
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap4\BootstrapAsset',
];
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require": {
"php": ">=5.6.0",
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap": "~2.0.0",
"yiisoft/yii2-bootstrap4": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0"
},
"require-dev": {
Expand Down
36 changes: 18 additions & 18 deletions views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,39 @@
/* @var $this \yii\web\View */
/* @var $content string */

use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use app\widgets\Alert;
use yii\bootstrap4\Breadcrumbs;
use yii\bootstrap4\Html;
use yii\bootstrap4\Nav;
use yii\bootstrap4\NavBar;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<html lang="<?= Yii::$app->language ?>" class="h-100">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body>
<body class="d-flex flex-column h-100">
<?php $this->beginBody() ?>

<div class="wrap">
<header>
<?php
NavBar::begin([
'brandLabel' => Yii::$app->name,
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
'class' => 'navbar navbar-expand-md navbar-dark bg-dark fixed-top',
],
]);
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'options' => ['class' => 'navbar-nav'],
'items' => [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
Expand All @@ -45,7 +44,7 @@
['label' => 'Login', 'url' => ['/site/login']]
) : (
'<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::beginForm(['/site/logout'], 'post', ['class' => 'form-inline'])
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-link logout']
Expand All @@ -57,21 +56,22 @@
]);
NavBar::end();
?>
</header>

<main role="main" class="flex-shrink-0">
<div class="container">
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= Alert::widget() ?>
<?= $content ?>
</div>
</div>
</main>

<footer class="footer">
<footer class="footer mt-auto py-3 text-muted">
<div class="container">
<p class="pull-left">&copy; My Company <?= date('Y') ?></p>

<p class="pull-right"><?= Yii::powered() ?></p>
<p class="float-left">&copy; My Company <?= date('Y') ?></p>
<p class="float-right"><?= Yii::powered() ?></p>
</div>
</footer>

Expand Down
6 changes: 3 additions & 3 deletions views/site/contact.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $form yii\bootstrap4\ActiveForm */
/* @var $model app\models\ContactForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\bootstrap4\ActiveForm;
use yii\bootstrap4\Html;
use yii\captcha\Captcha;

$this->title = 'Contact';
Expand Down
10 changes: 5 additions & 5 deletions views/site/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
?>
<div class="site-index">

<div class="jumbotron">
<h1>Congratulations!</h1>
<div class="jumbotron text-center bg-transparent">
<h1 class="display-4">Congratulations!</h1>

<p class="lead">You have successfully created your Yii-powered application.</p>

Expand All @@ -25,7 +25,7 @@
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>

<p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation &raquo;</a></p>
<p><a class="btn btn-outline-secondary" href="http://www.yiiframework.com/doc/">Yii Documentation &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
Expand All @@ -35,7 +35,7 @@
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>

<p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p>
<p><a class="btn btn-outline-secondary" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
Expand All @@ -45,7 +45,7 @@
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.</p>

<p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p>
<p><a class="btn btn-outline-secondary" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p>
</div>
</div>

Expand Down
14 changes: 7 additions & 7 deletions views/site/login.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $form yii\bootstrap4\ActiveForm */
/* @var $model app\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\bootstrap4\ActiveForm;
use yii\bootstrap4\Html;

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
Expand All @@ -20,7 +20,7 @@
'layout' => 'horizontal',
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
'labelOptions' => ['class' => 'col-lg-1 control-label'],
'labelOptions' => ['class' => 'col-lg-1 col-form-label'],
],
]); ?>

Expand All @@ -29,18 +29,18 @@
<?= $form->field($model, 'password')->passwordInput() ?>

<?= $form->field($model, 'rememberMe')->checkbox([
'template' => "<div class=\"col-lg-offset-1 col-lg-3\">{input} {label}</div>\n<div class=\"col-lg-8\">{error}</div>",
'template' => "<div class=\"offset-lg-1 col-lg-3 custom-control custom-checkbox\">{input} {label}</div>\n<div class=\"col-lg-8\">{error}</div>",
]) ?>

<div class="form-group">
<div class="col-lg-offset-1 col-lg-11">
<div class="offset-lg-1 col-lg-11">
<?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div>
</div>

<?php ActiveForm::end(); ?>

<div class="col-lg-offset-1" style="color:#999;">
<div class="offset-lg-1" style="color:#999;">
You may login with <strong>admin/admin</strong> or <strong>demo/demo</strong>.<br>
To modify the username/password, please check out the code <code>app\models\User::$users</code>.
</div>
Expand Down
73 changes: 21 additions & 52 deletions web/css/site.css
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
html,
body {
height: 100%;
}

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

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

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

.jumbotron {
text-align: center;
background-color: transparent;
font-size: .9em;
height: 60px;
}

.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}

.not-set {
Expand All @@ -38,38 +20,24 @@ body {

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
position: relative;
top: 1px;
content: '';
left: 3px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
padding-left: 5px;
width: 0;
height: 0;
border: solid 5px transparent;
margin: 4px 4px 2px 4px;
background: transparent;
}

a.asc:after {
content: /*"\e113"*/ "\e151";
border-bottom: solid 7px #212529;
border-top-width: 0;
}

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

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

.sort-numerical a.desc:after {
content: "\e154";
}

.sort-ordinal a.asc:after {
content: "\e155";
}

.sort-ordinal a.desc:after {
content: "\e156";
border-top: solid 7px #212529;
border-bottom-width: 0;
}

.grid-view th {
Expand All @@ -92,22 +60,23 @@ a.desc:after {

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
padding: 15px;
border: none;
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}

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

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
text-decoration: none;
color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
Expand Down
5 changes: 3 additions & 2 deletions widgets/Alert.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace app\widgets;

use Yii;
Expand All @@ -22,7 +23,7 @@
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @author Alexander Makarov <sam@rmcreative.ru>
*/
class Alert extends \yii\bootstrap\Widget
class Alert extends \yii\bootstrap4\Widget
{
/**
* @var array the alert types configuration for the flash messages.
Expand Down Expand Up @@ -59,7 +60,7 @@ public function run()
}

foreach ((array) $flash as $i => $message) {
echo \yii\bootstrap\Alert::widget([
echo \yii\bootstrap4\Alert::widget([
'body' => $message,
'closeButton' => $this->closeButton,
'options' => array_merge($this->options, [
Expand Down