from server 11.01

This commit is contained in:
root 2023-01-11 16:28:59 +05:00
parent d9be37cf6a
commit 5425010b38
7 changed files with 92 additions and 15 deletions

View File

@ -43,7 +43,6 @@ class Post extends Model
'powerseo_description' => 'required',
'powerseo_keywords' => 'required',
'excerpt' => 'required',
'category_groups' => 'required',
'awtor' => 'required',
'img_source' => 'required'
];
@ -177,16 +176,16 @@ class Post extends Model
public function filterFields($fields, $context = null)
{
if($this->awtor){
if(isset($this->awtor)){
if($this->awtor->type == 'other'){
$fields->author_name->hidden = false;
}else{
$fields->author_name->value = null;
}elseif(isset($fields->author_name)){
//$fields->author_name->value = null;
$fields->author_name->hidden = true;
}
}else{
$fields->author_name->value = null;
$fields->author_name->hidden = true;
//$fields->author_name->hidden = true;
return;
}
if(isset($fields->category_groups)){

View File

@ -26,7 +26,7 @@ default = 0
</head>
<body>
{% partial 'snowfall' %}
<!-- {% partial 'snowfall' %} -->
{% partial 'new/mobile-search' %}
<section class="big-banner">
@ -57,7 +57,8 @@ default = 0
<div class="header-left">
<a href="/" class="header-logo">
<img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="" />
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
</a>
<h1> {{'site.slogan'|_}}</h1>
</div>

View File

@ -28,7 +28,7 @@ random = 0
</head>
<body>
{% partial 'snowfall' %}
<!-- {% partial 'snowfall' %} -->
{% partial 'new/mobile-search' %}
@ -61,7 +61,9 @@ random = 0
<div class="header-left">
<a href="/" class="header-logo">
<img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="logo" />
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="logo" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
</a>
<h1> {{'site.slogan'|_}}</h1>
</div>

View File

@ -73,7 +73,7 @@ function onStart(){
if($this['categorySlug']){
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', $this['categorySlug'])->orderBy('created_at', 'DESC')->get();
}else{
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::all();
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::orderBy('created_at', 'DESC')->get();
}
@ -130,7 +130,7 @@ function onStart(){
{% partial 'new/pagination' items = blogPosts.posts %}
{% partial 'new/pagination' items = blogPosts.posts %}
</div>

View File

@ -116,9 +116,12 @@ function onStart(){
<!-- <h5>ORIENT NEWS</h5>
<h5>Фото: figma.com</h5> -->
-->
{% if post.img_source %}
<h5 style="font-style: italic;text-align: right;">{{ 'Фото'|_ }}: {{ post.img_source }}</h5>
{% endif %}
</div>
{% partial 'new/social' %}
</div>

View File

@ -0,0 +1,72 @@
title = "report/awtor"
url = "/report/qawtorq/:year"
layout = "report"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
<?php
function onStart(){
$this['backendUsers'] = Tps\Tps\Models\Authors::all();
$this['yearq'] = $this->param('year');
$this['allPost'] = $this['posts'] = RainLab\Blog\Models\Post::count();
$this['allPostYear'] = $this['posts'] = RainLab\Blog\Models\Post::whereYear('published_at', $this['yearq'])->count();
}
?>
==
<style>
table {
border-spacing: 0px;
border-collapse: separate;
}
td {
border: 1px solid #999;
padding: 8px;
text-align: center;
}
</style>
<div style="padding: 20px;">
<div style="text-align: center;">
<h2>{{ yearq }} report</h2>
</div>
<table style="border: 1px solid black;width: 100%;">
<tr style="background: #ffc577;font-weight: bold;">
<td>NO:</td>
<td>Users</td>
<td>ALL</td>
<td style="background: #ffc577;">ALL ({{ yearq }})</td>
<td>Yanwar</td>
<td>Fewral</td>
<td>Mart</td>
<td>Aprel</td>
<td>May</td>
<td>Iyun</td>
<td>Iyul</td>
<td>Awgust</td>
<td>Sentyabr</td>
<td>Oktyabr</td>
<td>Noyabr</td>
<td>Dekabr</td>
</tr>
{% for index, record in backendUsers %}
{% partial 'report/report' user = record.name index = index userId = record.id year = yearq %}
{% endfor %}
<tr style="background: #a77427;font-weight: bold;">
<td colspan="2" >HEMMESI</td>
<td>{{ allPost }}</td>
<td style="background: #a77427;">{{ allPostYear }}</td>
{% partial 'report/yearAll' month = 1 %}
{% partial 'report/yearAll' month = 2 %}
{% partial 'report/yearAll' month = 3 %}
{% partial 'report/yearAll' month = 4 %}
{% partial 'report/yearAll' month = 5 %}
{% partial 'report/yearAll' month = 6 %}
{% partial 'report/yearAll' month = 7 %}
{% partial 'report/yearAll' month = 8 %}
{% partial 'report/yearAll' month = 9 %}
{% partial 'report/yearAll' month = 10 %}
{% partial 'report/yearAll' month = 11 %}
{% partial 'report/yearAll' month = 12 %}
</tr>
</table>
</div>

View File

@ -10,7 +10,7 @@
{% for photo in post.media_file %}
<div class="swiper-slide">
<div class="photo-scroller-item">
<img src="{{photo.media|media|resize(283)}}" />
<img src="{{photo.media|media|resize(483)}}" />
</div>
</div>
{% endfor %}