main.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. /** @var yii\web\View $this */
  3. /** @var string $content */
  4. use app\assets\AppAsset;
  5. use app\models\base\NewsTopic;
  6. use app\widgets\Alert;
  7. use yii\bootstrap4\Breadcrumbs;
  8. use yii\bootstrap4\Html;
  9. use yii\bootstrap4\Nav;
  10. use yii\bootstrap4\NavBar;
  11. use app\modules\ldjson\jsonLD;
  12. AppAsset::register($this);
  13. ?>
  14. <?php $this->beginPage() ?>
  15. <!DOCTYPE html>
  16. <html lang="<?= Yii::$app->language ?>" class="h-100" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile# fb: http://ogp.me/ns/fb#">
  17. <head>
  18. <meta charset="<?= Yii::$app->charset ?>">
  19. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  20. <?= (Yii::$app->og->noindex == 'Y')?'<meta name="robots" content="noindex,nofollow" />'."\n":''?>
  21. <meta http-equiv="x-dns-prefetch-control" content="on">
  22. <link rel="manifest" href="/manifest.json">
  23. <link rel="dns-prefetch" href="//fonts.googleapis.com">
  24. <link rel="dns-prefetch" href="//mc.yandex.ru">
  25. <link rel="dns-prefetch" href="//www.google-analytics.com">
  26. <link rel="dns-prefetch" href="//cse.google.com">
  27. <link rel="dns-prefetch" href="//top-fwz1.mail.ru">
  28. <link rel="dns-prefetch" href="//counter.yadro.ru">
  29. <link rel="preconnect" href="https://www.googletagmanager.com" />
  30. <link rel="preconnect" href="https://mc.yandex.ru" />
  31. <link rel="preconnect" href="https://counter.yadro.ru" />
  32. <link rel="preconnect" href="https://yandex.ru" />
  33. <link rel="preconnect" href="https://avatars.mds.yandex.net" />
  34. <link rel="preconnect" href="https://matchid.adfox.yandex.ru" />
  35. <link rel="preconnect" href="https://yastatic.net" />
  36. <?php $this->registerCsrfMetaTags() ?>
  37. <title><?=Html::encode(Yii::$app->og->title)?></title>
  38. <meta name="title" content="<?= Html::encode(Yii::$app->og->title) ?>">
  39. <meta name="description" content="<?= preg_replace('/\s+/', ' ', str_replace( ["\n","\r"],' ',Html::encode(Yii::$app->og->description)))?>">
  40. <meta property="og:title" content="<?=Yii::$app->og->og_title?>"/>
  41. <meta property="og:description" content="<?=preg_replace('/\s+/', ' ',str_replace( ["\n","\r"],' ',Yii::$app->og->og_description))?>"/>
  42. <meta property="og:image" content="<?=Yii::$app->og->og_image?>"/>
  43. <meta property="og:type" content="<?=Yii::$app->og->og_type?>"/>
  44. <meta property="og:url" content= "<?=Yii::$app->og->og_url?>" />
  45. <meta name="author" content="<?=Yii::$app->og->author?>" />
  46. <meta name="copyright" content="Амител">
  47. <link rel="publisher" href="https://g.page/amitel?gm" />
  48. <?php if(!is_null(Yii::$app->og->dtpub)):?>
  49. <meta property="article:published_time" content="<?= Yii::$app->og->dtpub?>"/>
  50. <?php endif;?>
  51. <?php if(!is_null(Yii::$app->og->canonical)):?>
  52. <link rel="canonical" href="<?=Yii::$app->og->canonical?>">
  53. <?php endif;?>
  54. <?php if(!is_null(Yii::$app->og->amp)):?>
  55. <link rel="amphtml" href="<?=Yii::$app->og->amp?>">
  56. <?php endif;?>
  57. <link rel="alternate" type="application/rss+xml" title="RSS" href="/rss">
  58. <link rel="alternate" type="application/rss+xml" title="RSS" href="https://feeds.feedburner.com/amic/news">
  59. <link rel="icon" type="image/png" href="/img/favicon/favicon-32x32.png" sizes="32x32">
  60. <link rel="icon" type="image/png" href="/img/favicon/favicon-192x192.png" sizes="192x192">
  61. <link rel="icon" type="image/png" href="/img/favicon/favicon-96x96.png" sizes="96x96">
  62. <link rel="icon" type="image/png" href="/img/favicon/favicon-16x16.png" sizes="16x16">
  63. <link rel="icon" type="image/svg+xml" href="/img/favicon/favicon.svg">
  64. <?=(YII_ENV_DEV)?jsonLD::showtest():'' ?>
  65. <?=jsonLD::get() ?>
  66. <?/*=$this->render("@app/views/_etc/sw")*/?>
  67. <?php $this->head() ?>
  68. <?=$this->render('header/metrics')?>
  69. <?=$this->render("@app/views/_etc/banners/BannersImports")?>
  70. <?=$this->render("@app/views/layouts/jsComponents")?>
  71. </head>
  72. <body class="d-flex flex-column h-100 <?= $this->context->viewTheme ?? "" ?>">
  73. <?php $this->beginBody() ?>
  74. <?=$this->render("@app/views/_etc/header")?>
  75. <main role="main" class="flex-shrink-0 <?=\yii\helpers\ArrayHelper::getValue($this->params,'context','')?>">
  76. <div class="container<?=(isset($GLOBALS['type_long']) && $GLOBALS['type_long'] == 6)?' longrid':''?>">
  77. <?=$content?>
  78. </div>
  79. </main>
  80. <div class="sidemenu_overlay">
  81. <div class="sidemenu">
  82. <div class="sidemenu_header">
  83. <form action="/search" method="get" class="search_form">
  84. <input type="text" class="search_input" name="q" aria-label="Поиск">
  85. <button>Найти</button>
  86. </form>
  87. <div class="hamburger hamburger--squeeze js-hamburger is-active">
  88. <div class="hamburger-box">
  89. <div class="hamburger-inner"></div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="sidemenu_content">
  94. <ul>
  95. <li class="header-nav__item"><a href="/news" class="header-nav__link">
  96. Новости
  97. </a></li>
  98. <li class="header-nav__item"><a href="/articles" class="header-nav__link">
  99. Читай
  100. </a></li>
  101. <li class="header-nav__item"><a href="/podcasts" class="header-nav__link">
  102. Слушай
  103. </a></li>
  104. <li class="header-nav__item"><a href="/video" class="header-nav__link">
  105. Смотри
  106. </a></li>
  107. </ul>
  108. <div class="header-bottom__buttons">
  109. <div class="header-bottom__button">
  110. <a href="https://fmprod.ru/radiostantsii/item/evropa-plyus/" target="_blank" class="button button_grey">
  111. <span class="button__text tg">▶ Слушать радио</span>
  112. </a>
  113. </div>
  114. <div class="header-bottom__button">
  115. <a href="https://t.me/amic_ru" target="_blank" class="button button_grey button_grey-tg">
  116. <span class="button__icon">
  117. <svg style="width: 17px;height: 14px;" class="icon icon-tg"><use xlink:href="/svg/symbol/sprite-styled.svg#tg"></use></svg>
  118. </span>
  119. <span class="button__text tg">&nbsp;Телеграм</span>
  120. </a>
  121. </div>
  122. <?=$this->render("@app/views/layouts/filters_mobile")?>
  123. </div>
  124. <?php
  125. echo Yii::$app->cache->getOrSet("mobile_menu_rubrics",function (){
  126. return \yii\widgets\ListView::widget([
  127. "dataProvider" => new \yii\data\ActiveDataProvider([
  128. "query"=>NewsTopic::find()->andWhere(["show"=>"Y","active"=>1,"topic_id"=>null])->orderBy(["order"=>SORT_ASC]), //"topic_id"=>$topic->id next lavel maybe
  129. "pagination" =>[
  130. "pageSize"=>0
  131. ],
  132. ]),
  133. 'options' => [
  134. 'tag' => "ul",
  135. 'class' => 'list-wrapper',
  136. 'id' => 'list-wrapper',
  137. ],
  138. "itemOptions"=>[
  139. "tag"=>"li",
  140. "class"=>"header-nav__item"
  141. ],
  142. "itemView" => function($model) {
  143. if( $model->url == '----'){
  144. $ret = \yii\helpers\Html::tag('div','',['class' => ['hr']]);
  145. return $ret;
  146. }
  147. return \yii\helpers\Html::a($model->title,["news/{$model->url}"],['class'=>'header-nav__link']);},
  148. "layout" => "{items}"
  149. ]);
  150. },6000);
  151. ?>
  152. </div>
  153. </div>
  154. </div>
  155. <?=$this->render("@app/views/layouts/footer")?>
  156. <?=$this->render("@app/views/layouts/share")?>
  157. <script>
  158. (function (){
  159. const hamburgers = document.querySelectorAll(".burger, .js-hamburger.is-active");
  160. hamburgers.forEach(function (hamburger){
  161. hamburger.onclick = function (){
  162. document.querySelector(".sidemenu_overlay").classList.toggle('active');
  163. }
  164. })
  165. const hamburgersd = document.querySelectorAll(".burgerd");
  166. hamburgersd.forEach(function (hamburger){
  167. hamburger.onclick = function (){
  168. document.querySelector(".sidemenu_overlay").classList.toggle('active');
  169. }
  170. })
  171. })()
  172. </script>
  173. <?php $this->endBody() ?>
  174. </body>
  175. </html>
  176. <?php $this->endPage() ?>