Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yang committed Jul 2, 2016
1 parent 08ae34c commit 9deb969
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 59 deletions.
2 changes: 1 addition & 1 deletion frontend/assets/common/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ p {
transition-timing-function: ease;
transition-duration: 0.2s;
transition-property: background-color;
}
}
18 changes: 9 additions & 9 deletions frontend/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'basePath' => dirname(__DIR__),
'bootstrap' => [
'log',
'assetsCompress'
// 'assetsCompress'
],
'controllerNamespace' => 'frontend\controllers',
'defaultRoute' => 'user/dashboard',
Expand Down Expand Up @@ -42,14 +42,14 @@
],
'components' => [
'db' => $db,
'assetsCompress' => [
'class' => '\iisns\assets\AssetsCompressComponent',
'enabled' => true,
'jsCompress' => true,
'cssFileCompile' => true,
'jsFileCompile' => false,
'jsFileCompress' => false,
],
// 'assetsCompress' => [
// 'class' => '\iisns\assets\AssetsCompressComponent',
// 'enabled' => true,
// 'jsCompress' => true,
// 'cssFileCompile' => true,
// 'jsFileCompile' => false,
// 'jsFileCompress' => false,
// ],
'urlManager' => [
'enablePrettyUrl' => true,
'rules' => [
Expand Down
3 changes: 1 addition & 2 deletions frontend/controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use yii\base\InvalidParamException;
use yii\web\BadRequestHttpException;
use common\components\BaseController;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;

/**
Expand Down Expand Up @@ -188,7 +187,7 @@ public function actionDevelop()
Yii::setAlias('avatar', '@web/uploads/user/avatar/');
$this->layout = '@app/modules/user/views/layouts/user.php';
}

return $this->render('develop');
}
}
13 changes: 7 additions & 6 deletions frontend/modules/user/controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ public function behaviors()
'allow' => true,
'roles' => ['@'],
],
[
'actions' => ['index'],
'allow' => true,
'roles' => ['?'],
],
],
],
];
}

public function beforeAction()
public function actionIndex()
{
if (Yii::$app->user->isGuest) {
$this->redirect(['/explore/index']);
return $this->redirect(['/explore/index']);
}
}

public function actionIndex()
{
$model = $this->findModel();
$newFeed = new Feed;
$newFeed->setScenario('create');
Expand Down
60 changes: 39 additions & 21 deletions frontend/themes/basic/explore/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,39 @@
$this->params['breadcrumb'][] = Yii::t('app', 'Posts');

$this->registerCss('
.tag-group-item {
list-style-type: none;
.widget {
position: relative;
margin-bottom: 20px;
position: relative;
margin-bottom: 15px;
background-color: #fff;
overflow: hidden;
clear: both;
}
.tag-group-item {
display: inline-block;
min-width: 10px;
margin: 2px;
padding: 3px 7px;
font-size: 17px;
font-weight: bold;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: middle;
border-radius: 10px;
background-color: #F1F5FC;
color: #777;
.widget .panel-heading, .widget .panel-body {
padding: 0px;
}
.widget .panel-heading{
position: relative;
}
.widget .panel-heading:after{
content: "";
width: 67px;
height: 1px;
background: #007aff;
position: absolute;
left: 0;
bottom: 10px;
}
.widget h3 {
width: 100%;
color:#666; /*#666#1FA756*/
font-size: 16px;
font-weight: normal;
padding: 11px 15px 5px 0;
margin: 0px 0px 10px;
border-bottom: 1px solid #DFDFDF;
line-height: 26px;
}
');
?>
Expand Down Expand Up @@ -66,9 +82,11 @@
]); ?>
</div>
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading"><?= Yii::t('app', 'Tags') ?></div>
<div class="panel-body">
<section class="widget widget-tag">
<header class="panel-heading">
<h3 class="widget-tit">热门标签</h3>
</header>
<section class="panel-body">
<?= TaggingWidget::widget([
'items' => $tags,
'url' => ['/explore/posts'],
Expand All @@ -77,7 +95,7 @@
'listOptions' => ['class' => 'tag-group'],
'liOptions' => ['class' => 'tag-group-item']
]) ?>
</div>
</div>
</section>
</section>
</div>
</div>
81 changes: 77 additions & 4 deletions frontend/themes/basic/layouts/explore.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,86 @@
$this->registerMetaTag(['name' => 'description', 'content' => Yii::$app->setting->get('siteDescription')]);
$this->registerCss('
.wrap {background-color: #FFF;}
.page-header {
margin: 0;
}
.page-header .navbar-brand img {
width: 178px;
height: 52px;
}
.logo .brand {
color: #666;
font-size: 22px;
float: left;
padding-left: 10px;
position: relative;
top: 1px;
border-left: 1px solid #eaeaea;
margin-top: 15px;
margin-left: 5px;
overflow: hidden;
height: 55px;
line-height: 55px;
}
.navbar-nav .active>a .nav-highlight {
-webkit-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
.navbar-nav > li > a:hover, .navbar-nav > li > a:focus {
background-color: #EEE;
-webkit-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
.navbar-nav a .nav-highlight {
background: none repeat scroll 0 0 #4e6cef;
border-top: 1px solid #2b1600;
bottom: 0;
height: 2px;
left: 0;
position: absolute;
-moz-transform: scale(0,1);
-webkit-transform: scale(0,1);
-ms-transform: scale(0,1);
-o-transform: scale(0,1);
transform: scale(0,1);
width: 100%;
}
.navbar-nav a, .navbar-nav a .nav-highlight {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: all .12s ease-in-out 0s;
-o-transition: all .12s ease-in-out 0s;
transition: all .12s ease-in-out 0s;
}
.navbar-nav a:hover .nav-highlight {
-webkit-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
');
?>
<div class="wrap">
<header id="header" class="hidden-xs">
<div class="container">
<div class="page-header">
<h1><?= $this->params['title'] ?> <small><?= Yii::$app->setting->get('siteTitle') ?></small></h1>
<div class="logo pull-left">
<div class="pull-left">
<a class="navbar-brand" href="<?= Yii::$app->request->baseUrl ?>">
<img src="<?= Yii::getAlias('@web') ?>/images/logo.png" />
</a>
</div>
<div class="brand">
<?= $this->params['title'] ?> <small><?= Yii::$app->setting->get('siteTitle') ?></small>
<br />
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</header>
Expand All @@ -43,16 +116,16 @@
]);
$menuItems = [
[
'label' => '<i class="glyphicon glyphicon-comment"></i> ' . Yii::t('app', 'Forums'),
'label' => '<i class="glyphicon glyphicon-comment"></i> ' . Yii::t('app', 'Forums') . '<span class="nav-highlight"></span>',
'url' => ['/explore/index'],
'linkOptions' => ['data-pjax' => 0]
],
[
'label' => '<i class="glyphicon glyphicon-picture"></i> ' . Yii::t('app', 'Photos'),
'label' => '<i class="glyphicon glyphicon-picture"></i> ' . Yii::t('app', 'Photos') . '<span class="nav-highlight"></span>',
'url' => ['/explore/photos'],
'linkOptions' => ['data-pjax' => 0]
],
['label' => '<i class="glyphicon glyphicon-list-alt"></i> ' . Yii::t('app', 'Posts'), 'url' => ['/explore/posts']],
['label' => '<i class="glyphicon glyphicon-list-alt"></i> ' . Yii::t('app', 'Posts') . '<span class="nav-highlight"></span>', 'url' => ['/explore/posts']],
];
echo Nav::widget([
'options' => ['class' => 'navbar-nav'],
Expand Down
1 change: 1 addition & 0 deletions frontend/themes/basic/modules/forum/assets/css/forum.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ float: right; position: relative; line-height: 45px;color: #596F37;
-moz-transition: background-color .2s;
-webkit-transition: background-color .2s;
transition: background-color .2s;
border-bottom: 1px solid #ddd;
}
.tbox .board {
cursor:pointer;
Expand Down
5 changes: 0 additions & 5 deletions frontend/themes/basic/modules/user/assets/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ aside .sidebar-inner .user-block img {
border-radius: 50em;
-moz-border-radius: 50em;
-webkit-border-radius: 50em;
animation: fadeInRotate 0.9s ease;
-webkit-animation: fadeInRotate 0.9s ease;
-moz-animation: fadeInRotate 0.9s ease;
-ms-animation: fadeInRotate 0.9s ease;
-o-animation: fadeInRotate 0.9s ease;
}
aside .sidebar-inner .user-block .detail {
float: left;
Expand Down
10 changes: 0 additions & 10 deletions frontend/themes/basic/site/signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
');
?>
<div class="form-signin">
Expand Down
2 changes: 1 addition & 1 deletion frontend/widgets/login/views/loginWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
])->passwordInput()->label(false);
?>
<div style="color:#999;margin:1em 0">
<?= Yii::t('app', 'If you forgot your password you can ') . Html::a(Yii::t('app', 'reset it'), ['site/request-password-reset']) ?>.
<?= Yii::t('app', 'If you forgot your password you can ') . Html::a(Yii::t('app', 'reset it'), ['/site/request-password-reset']) ?>.
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('app', 'Log in'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
Expand Down
1 change: 1 addition & 0 deletions vendor/yiisoft/yii2/captcha/CaptchaAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public function run()
'url' => Url::to([$this->id, 'v' => uniqid()]),
];
} else {
ob_clean();
$this->setHttpHeaders();
Yii::$app->response->format = Response::FORMAT_RAW;
return $this->renderImage($this->getVerifyCode());
Expand Down

0 comments on commit 9deb969

Please sign in to comment.