Esempio n. 1
0
 public function init()
 {
     if (!$this->title) {
         $this->title = \Yii::$app->view->title;
     }
     parent::init();
     // TODO: Change the autogenerated stub
     $this->description = String::truncate($this->description, 1000);
 }
Esempio n. 2
0
	<div class="event-body">
		<a href="<?php 
echo Url::to(['/user/index', 'id' => $event->user->id]);
?>
">
			<?php 
echo \common\helpers\Html::avatar($event->user, 50, ['alt' => $event->user->username, 'class' => 'media-object img-circle owner-img']);
?>
		</a>

		<div class="event-title"><?php 
echo $event->name;
?>
</div>
		<div class="event-description"><?php 
echo \common\helpers\String::truncate($event->description, $context->descriptionLength);
?>
</div>
		<div class="event-date"><?php 
echo \common\helpers\Time::dateNormalize($event->begin);
?>
</div>
		<div class="event-control">
			<?php 
if ($user) {
    ?>
				<i class="md <% if(subscribe){%> md-add-circle<% }else{ %>md-add-circle-outline <%} %> event-control-subscribe "
				   data-remote="<%=link.subscribe%>"
				   title="<% if(subscribe){%> Отменить подписку<% }else{ %>Подписаться<%} %>"></i>
			<?php 
}
Esempio n. 3
0
?>
		на событие | <small><?php 
echo Time::dateNormalize($model->created);
?>
</small></h5>
		<div class="media">
			<div class="media-left">
				<a href="<?php 
echo Url::to(['event/view', 'id' => $event->id]);
?>
">
					<?php 
echo $event->getImage(\common\models\Event::IMAGE_THUMB_SM, ['class' => 'media-object', 'width' => 50]);
?>
				</a>
			</div>
			<div class="media-body">
				<strong	 class="media-heading"><?php 
echo $event->name;
?>
</strong>
				<p>
					<?php 
echo \common\helpers\String::truncate($event->description);
?>
				</p>
			</div>
		</div>

	</div>
</div>
Esempio n. 4
0
 * Time: 18:28
 * @var $this \yii\base\View
 * @var $context \common\widgets\Share
 */
$context = $this->context;
use ijackua\sharelinks\ShareLinks;
use yii\helpers\Html;
Yii::$app->view->registerMetaTag(['name' => "keywords", 'content' => $context->title]);
Yii::$app->view->registerMetaTag(['property' => "og:type", 'content' => 'article']);
Yii::$app->view->registerMetaTag(['property' => "og:url", 'content' => \yii\helpers\Url::canonical()]);
Yii::$app->view->registerMetaTag(['property' => "og:image", 'itemprop' => "image primaryImageOfPage", 'content' => $context->image]);
//twitter
Yii::$app->view->registerMetaTag(['name' => "twitter:card", 'content' => 'summary']);
Yii::$app->view->registerMetaTag(['name' => "twitter:domain", 'content' => Yii::$app->getHomeUrl()]);
Yii::$app->view->registerMetaTag(['name' => "twitter:title", 'property' => 'og:title', 'itemprop' => 'title name', 'content' => \common\helpers\String::truncate($context->title, 140)]);
Yii::$app->view->registerMetaTag(['name' => "twitter:description", 'property' => "og:description", 'itemprop' => "description", 'content' => \common\helpers\String::truncate($context->description, 140)]);
Yii::$app->view->registerMetaTag(['name' => "twitter:image", 'content' => $context->image]);
?>
<div class="socialShareBlock">
	<?php 
echo Html::a('', $context->shareUrl(ShareLinks::SOCIAL_FACEBOOK), ['title' => 'Поделиться в Facebook', 'class' => "socicon socicon-facebook"]);
?>
	<?php 
echo Html::a('', $context->shareUrl(ShareLinks::SOCIAL_TWITTER), ['title' => 'Поделиться в Twitter', 'class' => "socicon socicon-twitter"]);
?>
	<?php 
echo Html::a('<i class="icon-gplus-squared"></i>', $context->shareUrl(ShareLinks::SOCIAL_GPLUS), ['title' => 'Поделиться в Google Plus', 'class' => "socicon socicon-google"]);
?>
	<?php 
echo Html::a('<i class="icon-vkontakte"></i>', $context->shareUrl(ShareLinks::SOCIAL_VKONTAKTE), ['title' => 'Поделиться в VK', 'class' => "socicon socicon-vkontakte"]);
?>