ORIENT/themes/modern2/pages/new/group.htm

288 lines
9.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

title = "Рубрика"
url = "/posts/:categoryGroup/:slug?"
layout = "new/master-inside"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
[viewBag]
localeTitle[en] = "Category"
[blogPosts]
pageNumber = "{{ :page }}"
categoryFilter = "{{ :slug }}"
categoryGroup = "{{ :categoryGroup }}"
postsPerPage = 10
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "new/category"
postPage = "new/newPost"
[mediaView]
[expertForm]
==
<?php
function onStart(){
// $postId = $this->param('id');
// $currentPost = RainLab\Blog\Models\Post::where('id', $postId)->with(['category_groups'])->first();
$currentLocale = $this->activeLocale;
$this['group'] = $this->param('categoryGroup');
$this['categorySlug'] = $this->param('slug');
$this['groupName'] = RainLab\Blog\Models\CategoryGroup::where('slug', $this['group'])->first();
$currentCatLink = '/'.$this['categorySlug'];
$currentUrl = '/'.$currentLocale.'/new/posts/'.$this['group'].$currentCatLink;
if(!$this['categorySlug'] && $this['group'] != 'media'){
//$this->page->meta_title = $this['groupName']->name;
if ($this['groupName']) {
$this->page->meta_title = $this['groupName']->name;
} else {
// Handle the case where the group is not found
$this->page->meta_title = 'Unknown Group';
}
}elseif(!$this['categorySlug'] && $this['group'] == 'media'){
$this->page->meta_title = 'Media';
}
//dd($currentUrl);
if($this->menuItems && $this['group']){
foreach ($this->menuItems as $menu){
//dump($currentUrl);
if(!$this['categorySlug']){
if($menu->url.'/' === $currentUrl){
$menu->isActive = true;
break;
}
}else{
foreach ($menu->items as $menuItem){
if($menuItem->url === $currentUrl){
// dump($menuItem);
$menuItem->isActive = true;
$menuItem->isChildActive = true;
break;
}
}
}
}
}
//$this['backendUsers'] = Backend\Models\User::all();
if($this['categorySlug']){
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', $this['categorySlug'])->orderBy('published_at', 'DESC')
//->with(['media_view' ])
->withCount(['media_view AS view' => function ($query) {
$query->select(DB::raw("SUM(view) as media_view"));
}
])
->paginate(9);
}else{
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::orderBy('published_at', 'DESC')->paginate(9);
}
}
?>
==
{% set records = media.records %}
{% set displayColumn = media.displayColumn %}
{% set noRecordsMessage = media.noRecordsMessage %}
{% set detailsPage = media.detailsPage %}
{% set detailsKeyColumn = media.detailsKeyColumn %}
{% set detailsUrlParameter = media.detailsUrlParameter %}
{% put styles %}
<link href="{{'assets/css/form-faq.css'|theme}}" rel="stylesheet" />
<style>
.about__para_h3 {
line-height: 38px;
font-weight: 600;
text-align: center;
font-size: 2rem !important;
}
/*.about__para {
font-size: 20px;
line-height: 38px;
font-weight: 400;
}*/
.article-desc{
padding: 0 !important;
text-align: center;
gap: 0.4rem;
}
.btn-wrapper {
display: flex;
flex-direction: row;
justify-content: center;
}
.btn {
background: white;
border-radius: 20px;
border: 1px solid #504f4f;
display: flex;
align-items: center;
padding: 5px 15px;
margin: 5px;
width: auto;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btn img {
height: 80%;
width: auto;
margin-right: 3px;
}
</style>
{% endput %}
<!-- HEAD end ======== -->
<main class="rubric-main">
<div class="container">
<div class="rubric-inner">
<div class="trending-head">
<h2 style="text-transform: capitalize;">{% if category.name != "" %}{{category.name}}{% else %} {% if group == 'media' %} {{ group }} {% else %}{{ groupName.name }}{% endif %} {% endif %}</h2>
<span></span>
</div>
{% if category.id == 813 %}
<div class="article-desc">
<p class="about__para_h3">{{'Добро пожаловать в раздел "В помощь экспортерам"!'|_}}</p>
<p>{{'Здесь вы можете бесплатно задать вопрос эксперту консалтинговой компании “Export Hyzmat” по экспортной деятельности и получить на него ответ в течение 24 часов.'|_}}</p>
<p>{{'Для этого необходимо заполнить контактную форму, нажав на кнопку «Вопрос эксперту».'|_}}</p>
<p>{{'Вы также можете просмотреть "Часто задаваемые вопросы" ниже. Возможно, среди них уже есть ответ на ваш вопрос.'|_}}</p>
</div>
<div class="btn-wrapper">
<a href="{{'new/faq'|page}}" class="btn" style="font-size: 14px;">
<img src="{{'assets/images/faq-icon.svg'|theme}}" alt="faq icon">
<span>{{'Часто задаваемые вопросы'|_}}</span>
</a>
<button class="btn ask-expert-btn">
<img src="{{'assets/images/question-mark-icon.svg'|theme}}" alt="question mark icon">
<span>{{'Спроси эксперта'|_}}</span>
</button>
</div>
{% endif %}
{% if group == 'media' %}
<div class="video-main-top {% if categorySlug == 'photo' %} photo-main-top {% endif %}">
{% for post in mediaPostsFilter %}
{% if post.type == 'photo' %}
{% partial 'newHome/photo-item' post=post %}
{% else %}
{% partial 'newHome/video-item' post=post %}
{% endif %}
{% else %}
<li class="no-data">{{ 'no Records' }}</li>
{% endfor %}
</div>
{% partial 'new/pagination' items = mediaPostsFilter %}
{% else %}
<div class="rubric-items {% if group == 'poster' %} affiche-items {% endif %}">
{% for post in blogPosts.posts %}
{% if group == 'poster' %}
{% partial 'new/afisha-item' post = post %}
{% else %}
{% partial 'new/post_list_item' post = post %}
{% endif %}
{% else %}
<p>No posts found</p>
{% endfor %}
</div>
{% partial 'new/pagination' items = blogPosts.posts %}
{% endif %}
</div>
</div>
</main>
<section class="photo-scroller">
<div class="photo-scroller-inner">
<div class="swiper photoScrollerSwiper">
<div class="swiper-wrapper">
</div>
<div class="photo-scroller-prev video-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="photo-scroller-next video-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
<div class="photo-scroller-closer">
<img src="{{'assets/new/icons/close.svg'|theme}}" alt="" />
</div>
</div>
</section>
<main class="rubric-main">
<div class="container">
<div class="rubric-inner">
<div class="modal" id="expertFormModal">
<div class="modal-content">
<h2 id="form-header">{{'Спроси эксперта'|_}}</h2>
{% component 'expertForm' %}
</div>
</div>
</div>
</div>
</main>
{% put scripts %}
<!--<script src="{{'assets/new/scripts/core/affiche-item.js'|theme}}"></script>-->
<script src="{{'assets/new/scripts/core/rubric.js'|theme}}"></script>
<script src="{{'assets/js/form-faq.js'|theme}}"></script>
<script>
function countView(id) {
$(this).request('onCountView', {
data: { mediaId: id },
success: function (data) {
// var data = JSON.parse(data);
console.log(data.result);
$('#media_view_'+id).html(data.result);
}
});
};
</script>
{% endput %}