Fixes

parent 0d7cd6d9
......@@ -63,4 +63,15 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link {
}
.button_social{
margin-top: -10px;
}
img.play_img{
width: 85px;
height: auto;
top: 50%;
left: 50%;
position: absolute;
cursor: pointer;
}
.ytb_video img {
cursor: pointer;
}
\ No newline at end of file
......@@ -62,7 +62,14 @@ WidgetAssetBundle::register($this);
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="ytb_video">
<iframe width="903" height="508" src="https://www.youtube.com/embed/<?php echo $model->video_id ?>" frameborder="0" allowfullscreen></iframe>
<?php if (!Yii::$app->user->isGuest):?>
<iframe width="903" height="508" src="https://www.youtube.com/embed/<?php echo $model->video_id ?>" frameborder="0" allowfullscreen></iframe>
<?php else:?>
<a href="#registration_form2" class="popup-form">
<img width="903" height="508" src="http://img.youtube.com/vi/<?php echo $model->video_id ?>/0.jpg">
<img width="85" src="/images/youtube_play.png" alt="" class="play_img">
</a>
<?php endif;?>
</div>
<?php if($model->course->spec_proposition):?>
......@@ -154,18 +161,20 @@ WidgetAssetBundle::register($this);
<div class="row">
<div class="col-md-6 col-xs-6 col-sm-12">
<i class="ai_format"></i>
<a href="<?php echo Url::toRoute(['/school/lesson/download-documents', 'id' => $file->id]);?>" class="ai_link">
<a href="<?php echo Yii::$app->user->isGuest ? '#registration_form2': Url::toRoute(['/school/lesson/download-documents', 'id' => $file->id]);?>"
class="ai_link <?php echo Yii::$app->user->isGuest ? 'popup-form': '';?>">
<?php echo $file->title;?>
</a>
</div>
<?php else:?>
<div class="col-md-6 col-xs-6 col-sm-12">
<i class="ai_format"></i>
<a href="<?php echo Url::toRoute(['/school/lesson/download-documents', 'id' => $file->id]);?>" class="ai_link">
<?php echo $file->title;?>
</a>
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<i class="ai_format"></i>
<a href="<?php echo Yii::$app->user->isGuest ? '#registration_form2': Url::toRoute(['/school/lesson/download-documents', 'id' => $file->id]);?>"
class="ai_link <?php echo Yii::$app->user->isGuest ? 'popup-form': '';?>">
<?php echo $file->title;?>
</a>
</div>
</div>
<?php endif;?>
<?php endforeach;?>
<?php if((count($model->files) % 2) != 0):?>
......
......@@ -182,6 +182,7 @@ return [
'school/' => 'school/course/index',
'school/course/<id>/<source>' => 'school/course/view',
'school/course/<id>' => 'school/course/view',
'school/lesson/download-documents/<id>' => 'school/lesson/download-documents',
'school/lesson/<id>/<source>' => 'school/lesson/view',
'school/lesson/<id>' => 'school/lesson/view',
'login/eauth/<service_eauth:google|vk|facebook>' => 'site/login',
......
......@@ -163,7 +163,7 @@ class SiteController extends Controller
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->validate())
{
if($model->user->role == User::ROLE_USER)
if($model->user->role == User::ROLE_USER || $model->user->role == User::ROLE_ADMIN)
{
$model->login();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment