from server 18

This commit is contained in:
root 2022-12-18 11:13:59 +00:00
parent d65495c00f
commit bd707d8c2e
10 changed files with 345 additions and 41 deletions

View File

@ -85,6 +85,12 @@ class Posts extends ComponentBase
'type' => 'string', 'type' => 'string',
'default' => '', 'default' => '',
], ],
'categoryGroup' => [
'title' => 'categoryGroup',
'description' => 'categoryGroup',
'type' => 'string',
'default' => '',
],
'typePost' => [ 'typePost' => [
'title' => 'typePost', 'title' => 'typePost',
'description' => 'typePost', 'description' => 'typePost',
@ -223,6 +229,7 @@ class Posts extends ComponentBase
'perPage' => $this->property('postsPerPage'), 'perPage' => $this->property('postsPerPage'),
'featured' => $featured, 'featured' => $featured,
'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'), 'typePost' => empty($this->property('typePost')) ? null : $this->property('typePost'),
'group' => empty($this->property('categoryGroup')) ? null : $this->property('categoryGroup'),
'search' => trim(input('q')), 'search' => trim(input('q')),
'category' => $category, 'category' => $category,
'date' => input('date'), 'date' => input('date'),
@ -234,7 +241,7 @@ class Posts extends ComponentBase
? $this->property('exceptCategories') ? $this->property('exceptCategories')
: preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY), : preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY),
]); ]);
//dd($this->property('categoryGroup'));
/* /*
* Add a "url" helper attribute for linking to each post and category * Add a "url" helper attribute for linking to each post and category
*/ */

View File

@ -1,9 +1,13 @@
items: items:
- -
title: Новости title: Новости
nesting: null
type: url type: url
url: /ru/new/posts/news url: /ru/new/posts/news
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -18,9 +22,13 @@ items:
items: items:
- -
title: События title: События
nesting: null
type: url type: url
url: /ru/new/posts/news/events url: /ru/new/posts/news/events
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -34,9 +42,13 @@ items:
isExternal: '0' isExternal: '0'
- -
title: Watan title: Watan
nesting: null
type: url type: url
url: /ru/new/posts/news/watan url: /ru/new/posts/news/watan
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -52,7 +64,7 @@ items:
title: Экономика title: Экономика
nesting: null nesting: null
type: url type: url
url: /new/group/news/economy url: /ru/new/posts/news/economy
code: '' code: ''
reference: null reference: null
cmsPage: null cmsPage: null
@ -72,7 +84,7 @@ items:
title: Общество title: Общество
nesting: null nesting: null
type: url type: url
url: /new/group/news/society url: /ru/new/posts/news/society
code: '' code: ''
reference: null reference: null
cmsPage: null cmsPage: null
@ -90,9 +102,13 @@ items:
isExternal: '0' isExternal: '0'
- -
title: Статьи title: Статьи
nesting: null
type: url type: url
url: /ru/new/posts/stati url: /ru/new/posts/stati
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -107,9 +123,13 @@ items:
items: items:
- -
title: Экономика title: Экономика
nesting: null
type: url type: url
url: /ru/new/posts/stati/economy url: /ru/new/posts/stati/economy
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -124,12 +144,12 @@ items:
- -
title: Экомир title: Экомир
nesting: null nesting: null
type: category-blog-posts type: url
url: null url: /ru/new/posts/stati/eco-world
code: '' code: ''
reference: '13' reference: null
cmsPage: new/newPost cmsPage: null
replace: 0 replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -143,9 +163,13 @@ items:
isExternal: '0' isExternal: '0'
- -
title: Технологии title: Технологии
nesting: null
type: url type: url
url: /ru/new/posts/stati/technology url: /ru/new/posts/stati/technology
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -160,12 +184,12 @@ items:
- -
title: Спорт title: Спорт
nesting: null nesting: null
type: category-blog-posts type: url
url: null url: /ru/new/posts/stati/sport
code: '' code: ''
reference: '10' reference: null
cmsPage: new/newPost cmsPage: null
replace: 0 replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -180,12 +204,12 @@ items:
- -
title: События title: События
nesting: null nesting: null
type: category-blog-posts type: url
url: null url: /ru/new/posts/stati/events
code: '' code: ''
reference: '9' reference: null
cmsPage: new/newPost cmsPage: null
replace: 0 replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -200,12 +224,12 @@ items:
- -
title: Полезное title: Полезное
nesting: null nesting: null
type: category-blog-posts type: url
url: null url: /ru/new/posts/stati/poleznoe
code: '' code: ''
reference: '803' reference: null
cmsPage: new/newPost cmsPage: null
replace: 0 replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -239,13 +263,9 @@ items:
isExternal: '0' isExternal: '0'
- -
title: Афиша title: Афиша
nesting: null
type: url type: url
url: / url: /ru/new/posts/poster
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
en: en:
@ -257,6 +277,103 @@ items:
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
items:
-
title: Театры
type: url
url: /ru/new/posts/poster/teatry
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Спорт
type: url
url: /ru/new/posts/poster/sport
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Объявления
type: url
url: /ru/new/posts/poster/obyavleniya
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Концерты
type: url
url: /ru/new/posts/poster/koncerty
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Кинотеатры
type: url
url: /ru/new/posts/poster/kinoteatry
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Выставки
type: url
url: /ru/new/posts/poster/vystavki
code: ''
viewBag:
locale:
en:
title: ''
url: ''
tm:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
- -
title: Контакты title: Контакты
nesting: null nesting: null

View File

@ -0,0 +1,92 @@
title = "new/afisha-post"
url = "/new/afisha-post/:id/:slug"
layout = "new/master-inside"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
[views]
slug = "{{ :slug }}"
[blogPost]
slug = "{{ :slug }}"
id = "{{ :id }}"
categoryPage = 404
==
{% put styles %}
<style>
p img {
width: 100%;
}
</style>
{% endput %}
{% set post = blogPost.post %}
<main class="affiche-item">
<div class="container">
<div class="affiche-item-inner">
<div class="affiche-item-content">
<div class="affiche-item-head">
<h1>
{{post.title}}
</h1>
<span>{{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}}</span>
</div>
<div class="affiche-item-item">
<div class="affiche-item-top">
<div class="affiche-item-data">
<div class="affiche-item-data">
{% if post.afisha_address %}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/location.svg'|theme}}" alt="" />
</div>
<span>{{ post.afisha_address }}</span>
</div>
{% endif %}
{% if post.afisha_address %}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/phone.svg'|theme}}" alt="" />
</div>
<span>{{ post.afisha_phone }}</span>
</div>
{% endif %}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" />
</div>
<span>1938</span>
</div>
</div>
</div>
<div class="affiche-item-img">
{% if post.featured_image %}
<img src="{{post.featured_image|media}}" alt="{{post.title}}" />
{% endif %}
</div>
</div>
<div class="affiche-item-bottom">
{{post.content|md}}
</div>
</div>
</div>
{% partial 'newHome/right-sidebar.htm' class="article-aside" %}
</div>
</div>
</main>
{% put scripts %}
<script src="{{'assets/new/scripts/core/affiche-item.js'|theme}}"></script>
{% endput %}

View File

@ -0,0 +1,39 @@
title = "new/afisha"
url = "/new/afisha/:slug"
layout = "new/master-inside"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
[blogPosts]
pageNumber = "{{ :page }}"
categoryFilter = "{{ :slug }}"
postsPerPage = 10
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
==
<main class="affiche">
<div class="container">
<div class="affiche-inner">
<div class="trending-head affiche-head">
<h2>Афиша</h2>
<span></span>
</div>
<div class="rubric-items affiche-items">
{% for post in blogPosts.posts %}
{% partial 'new/afisha-item' post = post %}
{% else %}
<p>No posts found</p>
{% endfor %}
</div>
{% partial 'new/pagination' items = blogPosts.posts %}
</div>
</div>
</main>

View File

@ -1,5 +1,5 @@
title = "new/group/category" title = "new/group/category"
url = "/new/posts/:group/:slug?" url = "/new/posts/:categoryGroup/:slug?"
layout = "new/master-inside" layout = "new/master-inside"
is_hidden = 0 is_hidden = 0
robot_index = "index" robot_index = "index"
@ -8,6 +8,7 @@ robot_follow = "follow"
[blogPosts] [blogPosts]
pageNumber = "{{ :page }}" pageNumber = "{{ :page }}"
categoryFilter = "{{ :slug }}" categoryFilter = "{{ :slug }}"
Group Filter = "{{ :categoryGroup }}"
postsPerPage = 10 postsPerPage = 10
noPostsMessage = "No posts found" noPostsMessage = "No posts found"
sortOrder = "published_at desc" sortOrder = "published_at desc"
@ -15,11 +16,12 @@ categoryPage = "new/category"
postPage = "new/newPost" postPage = "new/newPost"
== ==
<?php <?php
function onStart(){ //function onStart(){
//$this['backendUsers'] = Backend\Models\User::all(); //$this['backendUsers'] = Backend\Models\User::all();
$this['group'] = $this->param('group'); // $this['group'] = $this->param('categoryGroup');
// $this['groupName'] = RainLab\Blog\Models\CategoryGroup::where('slug', $this['group'])->first();
} //dd( $this['groupName']);
//}
?> ?>
== ==
<!-- HEAD end ======== --> <!-- HEAD end ======== -->
@ -27,7 +29,7 @@ function onStart(){
<div class="container"> <div class="container">
<div class="rubric-inner"> <div class="rubric-inner">
<div class="trending-head"> <div class="trending-head">
<h2>{{category.name}}</h2> <h2>{% if category.name != "" %}{{category.name}}{% else %} {{ groupName.name }} {% endif %}</h2>
<!-- <h2>{{ group }}</h2> --> <!-- <h2>{{ group }}</h2> -->
<span></span> <span></span>
</div> </div>

View File

@ -0,0 +1,44 @@
[viewBag]
==
<a href="{{'new/afisha-post'|page({id:post.id,slug:post.slug})}}" class="sub-news-left-content-item rubric-item affiche-item">
<div class="sub-news-left-content-item-img">
{% if post.featured_image %}
<img src="{{post.featured_image|media|resize(350, 200)}}" alt="{{post.title}}" />
{% endif %}
</div>
<div class="sub-news-left-content-item-content">
<div class="sub-news-left-content-item-date-content-head">
<h4>{{post.published_at|date('d.m.Y')}}</h4>
<span>|</span>
<h4>{{post.published_at|date('H:i')}}</h4>
</div>
<h3> {{post.title}}</h3>
<div class="affiche-item-data">
{% if post.afisha_address %}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/location.svg'|theme}}" alt="" />
</div>
<span>{{ post.afisha_address }}</span>
</div>
{% endif %}
{% if post.afish_phone %}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/phone.svg'|theme}}" alt="" />
</div>
<span>{{ post.afish_phone }}</span>
</div>
{%endif%}
<div class="affiche-item-data-row">
<div class="affiche-item-data-img">
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" />
</div>
<span>1938</span>
</div>
</div>
</div>
</a>

View File

@ -3,7 +3,7 @@
<?php <?php
function onStart(){ function onStart(){
$this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'afisha')->with('category_items')->first(); $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'poster')->with('category_items')->first();
} }
?> ?>
@ -36,7 +36,7 @@ $this['afisha'] = RainLab\Blog\Models\CategoryGroup::where('slug', 'afisha')->wi
<h2>{{afisha.name}}</h2> <h2>{{afisha.name}}</h2>
<div class="sub-news-right-bottom-content"> <div class="sub-news-right-bottom-content">
{% for category in afisha.category_items %} {% for category in afisha.category_items %}
<a href="{{ 'new/category'|page({slug:category.slug}) }}" class="sub-news-right-bottom-item">{{ category.name }}</a> <a href="{{ 'new/afisha'|page({slug:category.slug}) }}" class="sub-news-right-bottom-item">{{ category.name }}</a>
{% else %} {% else %}
<a href="#" class="sub-news-right-bottom-item">No Record</a> <a href="#" class="sub-news-right-bottom-item">No Record</a>

View File

@ -51,7 +51,7 @@ postPage = 404
{% for post in mediaPosts %} {% for post in mediaPosts %}
{% partial 'newHome/media-post-item' post=post %} {% partial 'newHome/post-item-img-cat' post=post categoryHidden=true %}
{% endfor %} {% endfor %}

View File

@ -6,8 +6,11 @@
</div> </div>
<div class="trending-main-content-inner"> <div class="trending-main-content-inner">
<div class="sub-news-left-content-item-date-content-head trending-aside-content-head"> <div class="sub-news-left-content-item-date-content-head trending-aside-content-head">
<h3>{{post.categories.implode('name', ', ')}}</h3> {% if not categoryHidden %}
<span>|</span> <h3>{{post.categories.implode('name', ', ')}}</h3>
<span>|</span>
{% endif %}
<h4>{{post.published_at|date('d.m.Y')}}</h4> <h4>{{post.published_at|date('d.m.Y')}}</h4>
<span>|</span> <span>|</span>
<h4> {{post.published_at|date('H:i')}}</h4> <h4> {{post.published_at|date('H:i')}}</h4>

View File

@ -41,7 +41,7 @@ exceptPost = "{{ :id }}"
{% endfor %} {% endfor %}
<a href="/new/typePost/turkmenistan" class="aside-content-more"> <a href="/new/posts/news" class="aside-content-more">
<span>{{'new.read.more'|_}}</span> <span>{{'new.read.more'|_}}</span>
<div class="aside-content-more-img"> <div class="aside-content-more-img">
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" /> <img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />
@ -59,7 +59,7 @@ exceptPost = "{{ :id }}"
{% endfor %} {% endfor %}
<a href="/new/typePost/world" class="aside-content-more"> <a href="/new/posts/news" class="aside-content-more">
<span>{{'new.read.more'|_}}</span> <span>{{'new.read.more'|_}}</span>
<div class="aside-content-more-img"> <div class="aside-content-more-img">
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" /> <img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />