Первый работающий вариант показа условий использования
This commit is contained in:
parent
f3569f5ae4
commit
a0eb9f9d15
|
|
@ -419,7 +419,6 @@ class JsonController extends Controller
|
|||
if (!$article) {
|
||||
die;
|
||||
}
|
||||
// print_r($article->text);
|
||||
self::renderPartial('modals/article.php',
|
||||
array(
|
||||
'title' => $article->title,
|
||||
|
|
@ -428,4 +427,18 @@ class JsonController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
static function actionPointagreement()
|
||||
{
|
||||
$article = Article::model()->getByPK(4);
|
||||
|
||||
if (!$article) {
|
||||
die;
|
||||
}
|
||||
self::renderPartial('modals/pointAgreement.php',
|
||||
array(
|
||||
'title' => $article->title,
|
||||
'text' => $article->text,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
|
||||
<?php if ($user): ?>
|
||||
<div class="glyphicon glyphicon-map-marker _t" id="addPointButton" title="Добавить точку" onclick="<?= $addWithoutConfirm ? 'activateAddPoint()' : 'showArticle(1)'; ?>"></div>
|
||||
<div class="glyphicon glyphicon-map-marker _t" id="addPointButton" title="Добавить точку" onclick="<?= $addWithoutConfirm ? 'activateAddPoint()' : 'showPointagreement()'; ?>"></div>
|
||||
<div class="glyphicon glyphicon-star _c boxButtonFavorites" onclick="openBox('Favorites')" title="Хочу посетить"></div>
|
||||
<div class="glyphicon glyphicon-cloud-download _c boxButtonRoutes" onclick="openBox('Routes')" title="Мои маршруты"></div>
|
||||
<div class="glyphicon glyphicon-user _b boxButtonUser" onclick="openBox('User')" title="Профиль"></div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<div class="modal fade" id="articleModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title"><?= $title; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?= $text; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="activateAddPoint()" >Я согласен(-а) с условиями и принимаю их.</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -308,3 +308,15 @@ function showArticle(id)
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showPointagreement()
|
||||
{
|
||||
$.ajax({
|
||||
url: "/json/pointagreement",
|
||||
success: function (data) {
|
||||
$('#articleModal').modal('hide').remove();
|
||||
$('body').append($(data));
|
||||
$('#articleModal').modal('show');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue