last change inside the server

This commit is contained in:
gerchek 2024-05-14 15:05:45 +05:00
parent 6de252ce74
commit e68319107a
65 changed files with 2079 additions and 1553 deletions

View File

@ -467,4 +467,17 @@ return [
'enableBackendServiceWorkers' => false,
'fileDefinitions' => [
'defaultExtensions' => [
'vtt',
'jpg',
'jpeg',
'png',
'gif',
'mp4',
'mpeg4',
'pdf'
]
],
];

View File

@ -154,7 +154,9 @@ trait UploadableWidget
$extension = strtolower(File::extension($name));
$allowedFileTypes = FileDefinitions::get('defaultExtensions');
array_push($allowedFileTypes, 'xls', 'xlsx', 'doc');
//dd($allowedFileTypes);
if (!in_array($extension, $allowedFileTypes)) {
return false;
}

View File

@ -8,6 +8,9 @@ use Illuminate\Http\Request;
use AhmadFatoni\ApiGenerator\Helpers\Helpers;
use Illuminate\Support\Facades\Validator;
use Tps\Reklama\Models\Reklama;
use Tps\Reklama\Models\Statistika;
use Carbon\Carbon;
class AdvertisementsController extends Controller
{
protected $Advertisement;
@ -22,7 +25,17 @@ class AdvertisementsController extends Controller
}
public function index(){
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
$dataInc = $this->Reklama
->where('active',1)
->orderBy('order_app', 'ASC')
->paginate(5);
$this->incrementView($dataInc);
//categories list
$data = $this->Reklama->select('id','title', 'url', DB::raw("IF(media_mobile<>'',concat('$path',media_mobile),media_mobile) as media_mobile"))
->where('active',1)
@ -32,6 +45,46 @@ class AdvertisementsController extends Controller
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
}
public function getByGroup(Request $request){
$data = $request->all();
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
$dataInc = $this->Reklama->select('id','title', 'url', 'enable_stats', DB::raw("IF(media<>'',concat('$path',media),media) as media"))
->where('active',1)
->where('group_id', $data["group_id"])
->paginate(15);
$this->incrementView($dataInc);
//categories list
$data = $this->Reklama->select('id','title', 'url', 'enable_stats', DB::raw("IF(media<>'',concat('$path',media),media) as media"))
->where('active',1)
->where('group_id', $data["group_id"])
->paginate(15)
->toArray();
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
}
public function incrementView($data){
foreach ($data as $adv){
if($adv->enable_stats){
$statistika = Statistika::firstOrCreate(['item_id' => $adv->id,'date' => Carbon::today()]);
$statistika->increment('view');
}
}
}
}

View File

@ -33,6 +33,7 @@ class CategoriesV2Controller extends Controller
$query
->select('rainlab_blog_categories.id', 'rainlab_blog_categories.name', 'rainlab_blog_categories.slug', 'rainlab_blog_category_pivot.order')
->with(['translations:model_id,locale,attribute_data'])
->where('slug', '!=', 'watan')
->orderBy('rainlab_blog_category_pivot.order', 'ASC');
}])
->get();

View File

@ -27,9 +27,10 @@ class MediaController extends Controller
$type = input('type');
$data = $this->Media::where('type', $type)
->where('status', 1)
->with(['translations:model_id,locale,attribute_data'])
->orderBy('created_at', 'DESC')
->paginate(15);
->paginate(5);
$data->getCollection()->transform(function ($value) use ($path) {
$value->poster_file = $path.$value->poster_file;

View File

@ -6,6 +6,8 @@ Route::get('fatoni/delete/api/{id}', array('as' => 'fatoni.delete.api', 'uses' =
//postlar bilen categorialar
Route::resource('api/categories', 'AhmadFatoni\ApiGenerator\Controllers\API\CategoriesController', ['except' => ['destroy', 'create', 'edit']]);
Route::resource('api/advetisements', 'AhmadFatoni\ApiGenerator\Controllers\API\AdvertisementsController', ['except' => ['destroy', 'create', 'edit']]);
Route::get('api/group/advertisements', 'AhmadFatoni\ApiGenerator\Controllers\API\AdvertisementsController@getByGroup');
Route::resource('{locale}/api/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\postsController', ['except' => ['destroy', 'create', 'edit']]);

View File

@ -2,12 +2,12 @@
<div class="toolbar-item toolbar-primary">
<div data-control="toolbar">
<button type="button"
class="btn btn-primary oc-icon-floppy-o create-backup"
data-request="onCreateBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create backup
</button>
<!-- <button type="button"
class="btn btn-primary oc-icon-floppy-o create-backup"
data-request="onCreateBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create backup
</button> -->
<button type="button"
class="btn btn-default oc-icon-database create-backup"
@ -16,20 +16,20 @@
Create database backup
</button>
<button type="button"
class="btn btn-success oc-icon-copy create-backup"
data-request="onCreateFilesBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create files backup
</button>
<button type="button"
class="btn btn-success oc-icon-copy create-backup"
data-request="onCreateWholeProjectBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create whole project backup
</button>
<!-- <button type="button"
class="btn btn-success oc-icon-copy create-backup"
data-request="onCreateFilesBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create files backup
</button>
-->
<!-- <button type="button"
class="btn btn-success oc-icon-copy create-backup"
data-request="onCreateWholeProjectBackup"
data-request-complete="$('.loading-indicator-container').css('display', 'none')">
Create whole project backup
</button>
-->
<div class="loading-indicator-container">
<div class="loading-indicator size-small">
<span></span>

View File

@ -107,6 +107,7 @@ class Posts extends Controller
if (!$this->user->hasAnyAccess(['rainlab.blog.access_other_posts'])) {
$query->where('user_id', $this->user->id);
}
$query->leftJoin('vdomah_blogviews_views', 'rainlab_blog_posts.id', 'vdomah_blogviews_views.post_id');
@ -176,4 +177,7 @@ class Posts extends Controller
'preview' => $previewHtml
];
}
}

View File

@ -4,21 +4,21 @@
class="btn btn-primary oc-icon-plus">
<?= e(trans('rainlab.blog::lang.posts.new_post')) ?>
</a>
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('rainlab.blog::lang.blog.delete_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
<!-- <button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('rainlab.blog::lang.blog.delete_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button> -->
<?php if ($this->user->hasAnyAccess(['rainlab.blog.access_import_export'])): ?>
<div class="btn-group">

View File

@ -50,11 +50,11 @@
<?php if (!$isCreate): ?>
<!-- Delete -->
<button
type="button"
class="btn btn-default empty oc-icon-trash-o"
data-request="onDelete"
data-request-confirm="<?= e(trans('rainlab.blog::lang.post.delete_confirm')) ?>"
data-control="delete-button"></button>
<!-- <button
type="button"
class="btn btn-default empty oc-icon-trash-o"
data-request="onDelete"
data-request-confirm="<?= e(trans('rainlab.blog::lang.post.delete_confirm')) ?>"
data-control="delete-button"></button> -->
<?php endif ?>
</div>

View File

@ -32,7 +32,8 @@ defaultSort:
direction: desc
# Display checkboxes next to each record
showCheckboxes: true
#showCheckboxes: true
# Toolbar widget configuration
toolbar:

View File

@ -395,7 +395,7 @@ class Post extends Model
}
$this->content_html = self::formatHtml($this->content);
Log::info(input());
//Log::info(input());
}
protected function afterSave()

View File

@ -66,10 +66,12 @@ class StatisticsController extends Controller
$this->vars['reklama'] = 'Reklama';
$filters = $this->getCurrentFilters();
if(!isset($filters['scope-reklama'])) return;
$reklamas = $filters['scope-reklama'];
$dates = $filters['scope-date'];
$dates = $filters['scope-date'] ?? false;
if($reklamas)
{
@ -91,6 +93,8 @@ class StatisticsController extends Controller
$this->vars['reklams'] = $reklamas;
$this->vars['reklam_stats'] = $stats->get();
//dd($this->vars['reklam_stats']);
return ['#linechart' => $this->makePartial('linechart')];
}

View File

@ -1,4 +1,7 @@
<?php foreach($reklams as $id => $reklam):?>
<?php $totalViews = 0; $totalClicks = 0; ?>
<?php if(count($reklam_stats) > 0):?>
<div
class="tab-pane active"
id="curve_chart_<?=$id?>" style="width:100%; height:400px; margin-top: 10px;">
@ -12,13 +15,15 @@
var data = google.visualization.arrayToDataTable([
['date', 'views', 'clicks',],
['date', 'views', 'clicks']
<?php foreach($reklam_stats->where('item_id',$id) as $stats):?>
['<?=date_format(date_create($stats->date),'m/d')?>', <?=$stats->view?>, <?=$stats->click?>],
<?php $totalViews+=$stats->view; $totalClicks+=$stats->click; ?>
,['<?=date_format(date_create($stats->date),'m/d')?>', <?=$stats->view?>, <?=$stats->click?>]
<?php endforeach; ?>
]);
var options = {
title: '<?=$reklam?>',
title: '<?=$reklam." views: ".$totalViews." clicks: ".$totalClicks?>',
curveType: 'function',
legend: { position: 'bottom' }
};
@ -26,4 +31,15 @@
curve_chart.draw(data, options);
}
</script>
<?php else: ?>
<div style="width:100%; height:400px; margin-top: 10px;">
<h1 style="text-align: center;">Это объявление вообще не смотрели в этом месяце.</h1>
</div>
<?php endif; ?>
<?php endforeach;?>

View File

@ -25,7 +25,18 @@ class Media extends Model
public $translatable = [
'name',
'subtitle'
];
public function scopeGetVideo($query)
{
return $query->where('type', 'video');
}
public function scopeGetPhoto($query)
{
return $query->where('type', 'photo');
}
/**
* @var array Validation rules

View File

@ -22,3 +22,7 @@ columns:
type: datetime
searchable: true
sortable: true
status:
label: status
type: switch
sortable: true

View File

@ -20,6 +20,11 @@ fields:
span: auto
mode: datetime
type: datepicker
status:
label: Status
span: left
default: 1
type: switch
media_file:
label: 'Media Files'
prompt: 'Add new media file'
@ -37,3 +42,8 @@ fields:
label: 'Media Title'
span: auto
type: text
subtitle:
label: 'Subtitle File'
mode: file
span: auto
type: mediafinder

View File

@ -22,14 +22,20 @@ navigation:
label: 'Media View'
url: tps/tps/mediaview
icon: icon-signal
permissions:
- media.authors
side-menu-item3:
label: Tests
url: tps/tps/test
icon: icon-sitemap
permissions:
- media.authors
side-menu-item4:
label: 'Test questions'
url: tps/tps/testquestion
icon: icon-question
permissions:
- media.authors
permissions:
media.media:
tab: Media

View File

@ -0,0 +1,23 @@
<?php namespace Tps\Tps\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsTpsMedia extends Migration
{
public function up()
{
Schema::table('tps_tps_media', function($table)
{
$table->text('subtitle')->nullable();
});
}
public function down()
{
Schema::table('tps_tps_media', function($table)
{
$table->dropColumn('subtitle');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Tps\Tps\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsTpsMedia2 extends Migration
{
public function up()
{
Schema::table('tps_tps_media', function($table)
{
$table->boolean('status')->nullable()->default(1);
});
}
public function down()
{
Schema::table('tps_tps_media', function($table)
{
$table->dropColumn('status');
});
}
}

View File

@ -30,3 +30,9 @@
1.0.11:
- 'Created table tps_tps_test_questions'
- builder_table_create_tps_tps_test_questions_2.php
1.0.12:
- 'Updated table tps_tps_media'
- builder_table_update_tps_tps_media.php
1.0.13:
- 'Updated table tps_tps_media'
- builder_table_update_tps_tps_media_2.php

View File

@ -24,6 +24,12 @@ $(".swiper-wrapper").slick({
prevArrow: $(".p3"),
nextArrow: $(".n3"),
});
// start test
// end test
$(".newsSlider").slick({
dots: false,
infinite: true,

File diff suppressed because one or more lines are too long

View File

@ -78,12 +78,39 @@
flex-direction: column;
align-items: stretch;
&.big {
button {
max-width: 500px;
}
}
&.bigger {
button {
max-width: 100%;
}
}
button {
cursor: pointer;
position: relative;
display: flex;
align-items: baseline;
max-width: 300px;
padding: 5px 14px;
margin-bottom: 12px;
color: #00822c;
border: 1px solid #00822c;
transition: 0.2s linear;
&.big {
max-width: 500px;
}
&.bigger {
max-width: 100%;
}
p {
font-weight: 600;
font-size: 14px;
@ -92,13 +119,6 @@
text-align: left;
}
max-width: 300px;
padding: 5px 14px;
margin-bottom: 12px;
color: #00822c;
border: 1px solid #00822c;
transition: 0.2s linear;
&::before {
content: "";
display: block;
@ -107,6 +127,8 @@
border-radius: 50%;
background: #00822c;
margin-right: 10px;
position: relative;
top: -2px;
}
&:hover {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -57,8 +57,8 @@ default = 0
<div class="header-left">
<a href="/" class="header-logo">
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="Orient News" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
</a>
<h1> {{'site.slogan'|_}}</h1>
</div>

View File

@ -35,11 +35,11 @@ random = 0
<section class="big-banner rek_adverts">
<!-- <a href="#"> -->
<picture>
<div id="adv_2">
{% component 'adverts'%}
</picture>
</div>
<!-- </a> -->
</section>
@ -59,8 +59,8 @@ random = 0
<div class="header-left">
<a href="/" class="header-logo">
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="logo" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
<!-- <img src="{{ 'assets/images/newYearLogo.png'|theme}}" alt="Orient News" /> -->
<img src="{{ 'assets/new/icons/orientlogo.svg'|theme}}" alt="Orient News" />
</a>
<h1> {{'site.slogan'|_}}</h1>
@ -154,4 +154,4 @@ random = 0
</script>
</body>
</html>
</html>

View File

@ -0,0 +1,149 @@
[localePicker]
forceUrl = 1
[SeoCmsPage]
==
<!DOCTYPE html>
<html lang="{{ activeLocale }}">
<head>
{% partial 'new/head' %}
{% component 'SeoCmsPage' %}
<style>
.trending-banner a {
display: block;
max-width: unset;
max-height: 95%;
width: auto !important;
height: 100%;
margin: auto 0 0 0;
}
</style>
{% styles %}
</head>
<body>
{% partial 'new/mobile-search' %}
<section class="big-banner rek_adverts">
<!-- <a href="#"> -->
<div id="adv_2">
</div>
<!-- </a> -->
</section>
<!-- HEAD ======== -->
<header class="header">
<div class="container">
<div class="header-inner">
{% partial 'test/mobile-menu' %}
<div class="header-search-icon">
<img src="{{ 'assets/new/icons/search.svg'|theme}}" alt="seach" />
</div>
<div class="header-left">
<a href="/" class="header-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>
<div class="header-right">
<ul class="header-ext">
{% if this.theme.facebook %}
<li>
<a href="{{ this.theme.facebook }}">
<img src="{{'assets/new/icons/fb.svg'|theme}}" alt="fb" />
</a>
</li>
{% endif %}
{% if this.theme.instagram %}
<li>
<a href="{{ this.theme.instagram }}">
<img src="{{'assets/new/icons/insta.svg'|theme}}" alt="" />
</a>
</li>
{% endif %}
{% if this.theme.telegram %}
<li>
<a href="{{ this.theme.telegram }}">
<img src="{{'assets/new/icons/tg.svg'|theme}}" alt="" />
</a>
</li>
{% endif %}
{% if this.theme.twitter %}
<li>
<a href="{{ this.theme.twitter }}">
<img src="{{'assets/new/icons/twit.svg'|theme}}" alt="" />
</a>
</li>
{% endif %}
</ul>
{% partial 'new/searchForm' %}
</div>
<div class="header-burger">
<img src="{{ 'assets/new/icons/burger.svg'|theme}}" alt="" />
</div>
</div>
</div>
</header>
{% partial 'test/menu' %}
{% partial 'new/latest-news-mobile' %}
{% partial 'new/morque' %}
<!-- HEAD end ======== -->
{% page %}
{% partial 'new/footer' %}
<!-- SCRIPTS -->
<script src="{{ 'assets/new/scripts/swiper/swiper-bundle.min.js'|theme}}"></script>
<script src="{{ 'assets/new/jquery.js'|theme}}"></script>
<script src="{{ 'assets/new/copy.js'|theme}}"></script>
{% scripts %}
{% framework extras %}
<!-- javascript end
============================================= -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HHRB3PCSBQ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-HHRB3PCSBQ');
</script>
</body>
</html>

View File

@ -1,18 +1,18 @@
items:
-
title: OGT
title: 'В помощь экспортерам'
type: url
url: /
url: /ru/new/posts/news/pomosh-eksporteram
code: ''
viewBag:
locale:
en:
title: ''
url: ''
title: 'Export Promotion'
url: /en/new/posts/news/pomosh-eksporteram
tm:
title: ''
url: ''
isHidden: '1'
title: 'Eksporty ösdürmek'
url: /tm/new/posts/news/pomosh-eksporteram
isHidden: '0'
cssClass: ''
isExternal: '0'
name: event_menu

View File

@ -40,26 +40,6 @@ items:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Watan
nesting: null
type: url
url: /ru/new/posts/news/watan
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
en:
title: Watan
url: ''
tm:
title: Watan
url: /tm/new/posts/news/watan
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Экономика
nesting: null
@ -525,9 +505,13 @@ items:
isExternal: '0'
-
title: Кинотеатры
nesting: null
type: url
url: /ru/new/posts/poster/kinoteatry
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
en:
@ -601,9 +585,13 @@ items:
isExternal: '0'
-
title: Объявления
nesting: null
type: url
url: /ru/new/posts/poster/obyavleniya
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
en:

View File

@ -11,36 +11,16 @@ robot_follow = "follow"
[viewBag]
localeTitle[en] = "Home"
localeTitle[tm] = "Baş Sahypa"
[adverts adverts5]
code = 5
type = "slider"
random = 0
[adverts adverts6]
code = 6
type = "slider"
random = 0
[adverts adverts7]
code = 7
type = "slider"
random = 0
[adverts adverts8]
code = 8
type = "slider"
random = 0
==
{% partial 'newHome/main' %}
{% partial 'test/main' %}
{% partial 'newHome/main-popular' %}
{% partial 'adv/2adv' adv1=adverts5 adv2=adverts6 %}
{% partial 'adv/2adv' adv1Id="19" adv2Id="20" %}
{% partial 'newHome/publication' %}
{% partial 'adv/2adv' adv1=adverts7 adv2=adverts8 %}
{% partial 'adv/2adv' adv1Id="21" adv2Id="22" %}
{% partial 'newHome/poleznoe' %}
@ -67,9 +47,9 @@ random = 0
<h2 class="partners-head">{{'media_partners'|_}}</h2>
<div class="partners-content">
<div class="swiper partnerSwiper">
<div class="swiper-wrapper">
<div class="swiper-wrapper" id="adv_partners">
{% partial 'newHome/partners' header="" %}
</div>
<div class="partner-prev photo-prev video-prev">
@ -103,6 +83,27 @@ random = 0
</div>
</div>
</section>
{% partial 'scripts/getAdv' groupId='16' %}
{% partial 'scripts/getAdv' groupId='2' %}
{% partial 'scripts/getAdv' groupId='17' %}
{% partial 'scripts/getAdv' groupId='18' %}
{% partial 'scripts/getAdv' groupId='19' %}
{% partial 'scripts/getAdv' groupId='20' %}
{% partial 'scripts/getAdv' groupId='21' %}
{% partial 'scripts/getAdv' groupId='22' %}
{% partial 'scripts/getPartners' groupId='1' %}
{% put scripts %}
<script src="{{ 'assets/new/scripts/marquee/marquee3k.js'|theme}}"></script>

View File

@ -89,7 +89,7 @@ function onStart(){
<div class="swiper-slide">
<div class="article-item">
<img src="{{img.photoq|media_cdn|resize(692)}}" alt=" {{post.title}}" />
<img src="{{img.photoq|media_cdn|resize(693)}}" alt=" {{post.title}}" />
</div>
</div>
@ -98,7 +98,7 @@ function onStart(){
{% else %}
<div class="swiper-slide">
<div class="article-item">
<img src="{{post.featured_image|media_cdn|resize(692)}}" alt=" {{post.title}}" />
<img src="{{post.featured_image|media_cdn|resize(693)}}" alt=" {{post.title}}" />
</div>
</div>
{% endif %}

View File

@ -1,6 +1,6 @@
title = "Пост"
url = "/old/post/:id/:slug"
layout = "cms"
layout = "new/master-inside"
is_hidden = 0
seo_keywords = "Türkmenistan, Turkmenistan, Туркменистан, Ориент новости, Orient news, Orienttm, Turkmen habarlary, Turkmen habarlar, Turkmen news, Новости Туркменистана, Новости СНГ, Новости средней азии, Новости Центральной Азии,"
robot_index = "index"
@ -20,118 +20,149 @@ slug = "{{ :slug }}"
[SeoBlogPost]
post = "post"
==
<style>
.main {
margin-top: 45px;
<?php
function onStart(){
//dd($this->page->blogPost);
$postId = $this->param('id');
$currentPost = RainLab\Blog\Models\Post::where('id', $postId)->with(['category_groups'])->first();
$this['featuredPosts'] = RainLab\Blog\Models\Post::with(['categories'])->where('id', $postId)->paginate(10);
$catId = $this['featuredPosts'][0]->categories[0]->id;
//dd($this['featuredPosts'][0]->categories[0]->slug);
if($this->menuItems && $postId && $currentPost && $currentPost->category_groups->count() > 0){
$currentGroup = $currentPost->category_groups[0]->name;
foreach ($this->menuItems as $menu){
//dump($menu->title);
if($menu->title === $currentGroup){
$menu->isActive = true;
break;
}
}
}
// dd($this['posts']);
}
.news__image {
width: 100%;
margin: 20px 0;
display: block;
}
.news__date {
display: flex;
align-items: center;
font-size: 20px;
line-height: 26px;
color: #a2a2a2;
font-weight: 400;
margin-bottom: 5px;
}
.news__sidebar .card {
padding: 18px 0;
border-bottom: 1px solid #dcdcdc;
}
.card__header-view svg {
margin-right: 5px;
stroke: #a2a2a2;
width: 21px;
height: 15px;
}
</style>
{% component 'SeoBlogPost' %}
<article class="news__content">
<header>
<div class="news__content-header">
<time class="news__date">
<span>{{post.published_at|date('d.m.Y')}}</span>
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4">
<path data-name="Polygon 1" d="M2,0,4,2,2,4,0,2Z" fill="#a2a2a2" />
</svg>
<span>{{post.published_at|date('H:i')}}</span>
</time>
<div class="card__header-view" id="view">
<svg xmlns="http://www.w3.org/2000/svg">
<g id="eye" transform="translate(-0.5 -3.5)">
<path id="Path_6489" data-name="Path 6489"
d="M1,11S4.636,4,11,4s10,7,10,7-3.636,7-10,7S1,11,1,11Z" fill="none" stroke=""
stroke-linecap="round" stroke-linejoin="round" stroke-width="1"></path>
<ellipse id="Ellipse_12" data-name="Ellipse 12" cx="4.859" cy="4.791" rx="4.859" ry="4.791"
transform="translate(6.141 6.209)" fill="none" stroke="" stroke-linecap="round"
stroke-linejoin="round" stroke-width="1"></ellipse>
</g>
</svg>
{% partial 'view' %}
</div>
</div>
<h1 class="news__title">
{{post.title}}
</h1>
{% if post.featured_image %}
<picture class="news__image">
<soruce media="(min-width: 1024px)" srcset="{{post.featured_image|media_cdn}}" >
<soruce media="(min-width: 768px)" srcset="{{post.featured_image|media_cdn|resize(720)}}" >
<soruce srcset="{{post.featured_image|media_cdn|resize(400)}}">
<img src="{{post.featured_image|media_cdn}}" alt="{{post.title}}">
</picture>
{% endif %}
</header>
<div class="news__body">
{{post.content|md}}
</div>
<div class="news__footer">
<div class="news__footer-social">
{% partial 'social' %}
</div>
<div class="news__footer-name">
{% if post.author %}
<p><em><strong>{{post.author}}</strong></em></p>
{% endif %}
</div>
</div>
</article>
<div class="news__sidebar">
{% partial 'latest_news'%}
</div>
{% put scripts %}
<script>
$.request('views::onIncrement', {
update: { view: '@#view' },
})
var re = /\[video poster=\"(.+?)\".+?mp4=\"(.+?)\"/g;
// re = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/g
var ptags = document.querySelectorAll('p');
ptags.forEach(s => {
var m;
m = re.exec(s.innerText);
if (m) {
var video = document.createElement('video');
video.setAttribute('src', m[2]);
video.setAttribute('controls', "")
video.setAttribute('width', "100%")
video.setAttribute('type', "video/mp4")
video.setAttribute('poster', m[1])
s.parentNode.replaceChild(video, s);
?>
==
{% put styles %}
<style>
p img {
width: 100%;
}
});
</script>
{% endput %}
</style>
{% endput %}
{% component 'SeoBlogPost' %}
{% set post = blogPost.post %}
<main class="article">
<div class="container">
<div class="article-inner">
<div class="article-content">
<div class="article-content-top">
<div class="article-head">
<h2>
{{post.title}}
</h2>
<span id="view" style="display: flex !important;">{{post.published_at|date('d.m.Y')}} | {{post.published_at|date('H:i')}} | <div style="padding-left: 10px;padding-right: 10px;"><img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" style="width: 18px;" /></div> {% partial 'view' %}</span>
</div>
<div class="article-swiper-wrapper">
<div class="swiper articleSwiper">
<div class="swiper-wrapper">
{% if post.more_photo|length > 0 %}
{% for img in post.more_photo %}
<div class="swiper-slide">
<div class="article-item">
<img src="{{img.photoq|media_cdn|resize(692)}}" alt=" {{post.title}}" />
</div>
</div>
{% endfor %}
{% else %}
<div class="swiper-slide">
<div class="article-item">
<img src="{{post.featured_image|media_cdn|resize(692)}}" alt=" {{post.title}}" />
</div>
</div>
{% endif %}
</div>
<div class="photo-prev video-prev article-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="photo-next video-next article-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
</div>
<div class="article-desc">
{{post.content|md}}
<!-- <h5>ORIENT NEWS</h5>
-->
{% if post.img_source %}
<h5 style="font-style: italic;text-align: right;">{{ 'Фото'|_ }}: {{ post.img_source }}</h5>
{% endif %}
</div>
{% partial 'new/social' %}
</div>
{% partial 'new/post-featured' %}
</div>
{% partial 'newHome/right-sidebar.htm' class="article-aside" %}
</div>
</div>
</main>
{% put scripts %}
<script>
$.request('views::onIncrement', {
update: { view: '@#view' },
})
var re = /\[video poster=\"(.+?)\".+?mp4=\"(.+?)\"/g;
// re = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/g
var ptags = document.querySelectorAll('p');
ptags.forEach(s => {
var m;
m = re.exec(s.innerText);
if (m) {
var video = document.createElement('video');
video.setAttribute('src', m[2]);
video.setAttribute('controls', "")
video.setAttribute('width', "100%")
video.setAttribute('type', "video/mp4")
video.setAttribute('poster', m[1])
s.parentNode.replaceChild(video, s);
}
});
</script>
<script src="{{'assets/new/scripts/core/article.js'|theme}}"></script>
{% endput %}

View File

@ -9,9 +9,25 @@ robot_follow = "follow"
function onStart(){
$this['questions'] = Tps\Tps\Models\TestQuestion::with('image')->where('test_id', $this->param('id'))->get()->shuffle();
$this['test_id'] = $this->param('id');
$this['otherTest'] = Tps\Tps\Models\Test::where('id', '!=', $this->param('id'))->with('image')->get();
}
?>
==
{% put styles %}
<style>
.aside-ad-wrapper-txt {
font-weight: bold !important;
font-size: 18px !important;
line-height: 1.4;
margin-top: 10px;
}
</style>
{% endput %}
<!-- Test ================================== -->
<main class="article">
<div class="container">
@ -51,35 +67,21 @@ function onStart(){
{{'test.see_also'|_}}
</h6>
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/affiche.jpg" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
В Минфине обсудили разработку стратегии АБР для Туркменистана с новым страновым
директором
</p>
</div>
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/affiche.jpg" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
В Минфине обсудили разработку стратегии АБР для Туркменистана с новым страновым
директором
</p>
</div>
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/affiche.jpg" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
В Минфине обсудили разработку стратегии АБР для Туркменистана с новым страновым
директором
</p>
</div>
{% for test in otherTest %}
<div class="aside-ad-wrapper">
<a href="{{'test'|page({id: test.id})}}">
<img src="{{test.image.path}}" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
{{test.title}}
</p>
</div>
{% endfor %}
</aside>
</div>
</div>
@ -121,12 +123,32 @@ function onStart(){
let question_title = document.getElementById("question_container");
let percentage = correct_answers / questions.length * 100;
let result_text = '<p>{{'test.results_100'|_}}</p>';
switch (true)
{
case (percentage <= 30):
result_text = '<p>{{'test.results_30'|_}}</p>';
break;
case (percentage <= 50):
result_text = '<p>{{'test.results_50'|_}}</p>';
break;
case (percentage <= 70):
result_text = '<p>{{'test.results_70'|_}}</p>';
break;
case (percentage <= 99):
result_text = '<p>{{'test.results_99'|_}}</p>';
break;
}
question_title.innerHTML =
`<h6 class="article_desc-result">
{{'test.results'|_}}
<br>
${correct_answers}/${questions.length}
</h6>`;
</h6>
${result_text}`;
}
function startNewQuestion(){
@ -201,6 +223,30 @@ function onStart(){
})
}
}
const parent = document.querySelector('.article-test');
let maxWords = 0;
let maxWordsIndex = -1;
// Loop through each <p> tag
const paragraphs = parent.querySelectorAll('p');
paragraphs.forEach((paragraph, index) => {
// Count the number of words in the paragraph
const wordCount = paragraph.textContent.trim().split(/\s+/).length;
// Check if this paragraph has the most words so far
if (wordCount > maxWords) {
maxWords = wordCount;
maxWordsIndex = index;
}
});
// Add the appropriate class to the parent <div>
if (maxWords >= 20) {
parent.classList.add('bigger');
} else if (maxWords >= 10) {
parent.classList.add('big');
}
getQuestions();

View File

@ -8,11 +8,25 @@ robot_follow = "follow"
<?php
function onStart(){
$this['test'] = Tps\Tps\Models\Test::where('id', $this->param('id'))->get()->first();
$this['otherTest'] = Tps\Tps\Models\Test::where('id', '!=', $this->param('id'))->with('image')->get();
}
?>
==
{% put styles %}
<style>
.aside-ad-wrapper-txt {
font-weight: bold !important;
font-size: 18px !important;
line-height: 1.4;
margin-top: 10px;
}
</style>
{% endput %}
<!-- Test ================================== -->
<!-- Test ================================== -->
<main class="article">
<div class="container">
<div class="article-wrap">
@ -61,27 +75,22 @@ function onStart(){
<h6 class="aside-ad-wrapper-title">
{{'test.see_also'|_}}
</h6>
{% for test in otherTest %}
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/affiche.jpg" alt="" />
<a href="{{'test'|page({id: test.id})}}">
<img src="{{test.image.path}}" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
В Минфине обсудили разработку стратегии АБР для Туркменистана с новым страновым
директором
</p>
</div>
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/affiche.jpg" alt="" />
</a>
<p class="aside-ad-wrapper-txt">
В Минфине обсудили разработку стратегии АБР для Туркменистана с новым страновым
директором
{{test.title}}
</p>
</div>
{% endfor %}
</aside>
</div>
</div>
</div>

View File

@ -0,0 +1,85 @@
title = "test/home2-new"
url = "/home2-new"
layout = "test/test-master"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
{% partial 'test/main3' %}
{% partial 'newHome/main-popular' %}
{% partial 'adv/2adv' adv1Id="19" adv2Id="20" %}
{% partial 'newHome/publication' %}
{% partial 'adv/2adv' adv1Id="21" adv2Id="22" %}
{% partial 'newHome/poleznoe' %}
<section class="media">
<div class="container">
<div class="media-inner">
<div class="media-videos">
{% partial 'test/video' %}
</div>
<div class="media-videos media-photos">
{% partial 'newHome/photo' %}
</div>
</div>
</div>
</section>
<section class="partners">
<div class="container">
<div class="partners-inner">
<h2 class="partners-head">{{'media_partners'|_}}</h2>
<div class="partners-content">
<div class="swiper partnerSwiper">
<div class="swiper-wrapper">
{% partial 'newHome/partners' header="" %}
</div>
<div class="partner-prev photo-prev video-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="partner-next photo-next video-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
</div>
</div>
</div>
</section>
<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>
{% put scripts %}
<script src="{{ 'assets/new/scripts/marquee/marquee3k.js'|theme}}"></script>
<script src="{{ 'assets/new/scripts/core/main.js'|theme}}"></script>
{% endput %}

View File

@ -0,0 +1,83 @@
title = "test/home1-new"
url = "/testhome1-new"
layout = "test/test-master"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
{% partial 'test/main2' %}
{% partial 'newHome/main-popular' %}
{% partial 'adv/2adv' adv1=adverts5 adv2=adverts6 %}
{% partial 'newHome/publication' %}
{% partial 'adv/2adv' adv1=adverts7 adv2=adverts8 %}
{% partial 'newHome/poleznoe' %}
<section class="media">
<div class="container">
<div class="media-inner">
<div class="media-videos">
{% partial 'newHome/video' %}
</div>
<div class="media-videos media-photos">
{% partial 'newHome/photo' %}
</div>
</div>
</div>
</section>
<section class="partners">
<div class="container">
<div class="partners-inner">
<h2 class="partners-head">{{'media_partners'|_}}</h2>
<div class="partners-content">
<div class="swiper partnerSwiper">
<div class="swiper-wrapper">
{% partial 'newHome/partners' header="" %}
</div>
<div class="partner-prev photo-prev video-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="partner-next photo-next video-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
</div>
</div>
</div>
</section>
<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>
{% put scripts %}
<script src="{{ 'assets/new/scripts/marquee/marquee3k.js'|theme}}"></script>
<script src="{{ 'assets/new/scripts/core/main.js'|theme}}"></script>
{% endput %}

View File

@ -4,6 +4,11 @@ layout = "new/master-inside"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
[adverts adverts3]
code = 3
type = "single"
random = 0
==
<?php
function onStart(){
@ -38,19 +43,22 @@ function onStart(){
{% endfor %}
</div>
</div>
<aside class="aside article-aside">
<!-- <aside class="aside article-aside">
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/aside-ad.jpg" alt="" />
</a>
</div>
<div class="aside-ad-wrapper">
<a href="#">
<img src="../assets/images/aside-ad.jpg" alt="" />
</a>
</div>
</aside>
</aside> -->
{% partial 'adv/right-sidebar2' adv=adverts3 css="aside" %}
</div>
</div>
</div>

View File

@ -5,58 +5,19 @@
<div class="banners-inner">
<div class="swiper bannerSwiper-1">
<div class="swiper-wrapper">
{% if adv1.group and adv1.group.adds %}
{% for reklama in adv1.group.adds %}
<div class="swiper-slide">
<div class="banner">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif %}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
</div>
{% endfor %}
{% endif %}
<div class="swiper-wrapper" id="adv_{{adv1Id}}">
</div>
</div>
<div class="swiper bannerSwiper-2">
<div class="swiper-wrapper">
{% if adv2.group and adv2.group.adds %}
{% for reklama in adv2.group.adds %}
<div class="swiper-slide">
<div class="banner">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif %}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
</div>
{% endfor %}
{% endif %}
<div class="swiper-wrapper" id="adv_{{adv2Id}}">
</div>
</div>
</div>
</div>
</section>
</section>

View File

@ -21,4 +21,4 @@
{% endif %}
</div>
</div>

View File

@ -2,29 +2,11 @@
==
<div class="{{css}}-banner">
<div class="swiper trendingSwiper">
<div class="swiper-wrapper">
{% if adv.group and adv.group.adds %}
{% for reklama in adv.group.adds %}
<div class="swiper-slide">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif %}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
{% endfor %}
{% endif %}
<div class="swiper-wrapper" id="adv_{{groupId}}">
</div>
</div>
</div>
</div>

View File

@ -13,24 +13,31 @@ code = "event_menu"
<div class="nav-left">
<ul class="nav-ul">
{% for item in staticMenu.menuItems %}
{% if not item.isHidden %}
<li>
<span class="nav-section-span {% if (item.isActive) %} active {% endif %} "> <a href="{{ item.url }}" style="color:white;">{{ item.title }}</a></span>
</li>
{% endif %}
{% endfor %}
{% for item2 in staticMenu2.menuItems %}
<a href="{{item2.url}}" class="nav-section-usaid-wrapper">
<span class="nav-section-usaid">{{ item2.title }}</span>
<p class="nav-section-usaid-dropdown">
{{'new.nav'|_}}
</p>
</a>
{% endfor %}
</ul>
</div>
<div class="nav-right">
{% for item2 in staticMenu2.menuItems %}
<a href="{{ item2.url }}" class="nav-right-link" style="{% if item2.viewBag.isHidden %} display:none; {% endif %}">{{ item2.title }}</a>
{% endfor %}

View File

@ -18,11 +18,6 @@ noRecordsMessage = "No records found"
detailsPage = "-"
detailsUrlParameter = "id"
pageNumber = "{{ :page }}"
[adverts adverts4]
code = 4
type = "slider"
random = 0
==
{% set post = byEditor.posts %}
@ -57,7 +52,7 @@ random = 0
{% partial 'newHome/popular-item' %}
{% partial 'adv/right-sidebar2' adv=adverts4 css="trending" %}
{% partial 'adv/right-sidebar2' css="trending" groupId="18" %}
</div>
</div>

View File

@ -49,29 +49,9 @@ postPage = 404
<div class="main-advert-inner">
<div class="swiper mainAdvertSwiper">
<div class="swiper-wrapper">
<div class="swiper-wrapper" id="adv_16">
{% if adverts2.group and adverts2.group.adds %}
{% for reklama in adverts2.group.adds %}
<div class="swiper-slide">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif
%}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>

View File

@ -23,14 +23,14 @@ pageNumber = "{{ :page }}"
{% set detailsUrlParameter = partners.detailsUrlParameter %}
{% for record in records if record.group_id == 1 %}
{% for record in records if record.group_id == 1 %}
<div class="swiper-slide">
<div class="partners-item">
<img src="{{record.media|media}}" alt="" />
</div>
</div>
<div class="swiper-slide">
<div class="partners-item">
<img src="{{record.media|media}}" alt="" />
</div>
</div>
{% else %}
<li class="no-data">{{ noRecordsMessage }}</li>
{% endfor %}
{% else %}
<li class="no-data">{{ noRecordsMessage }}</li>
{% endfor %}

View File

@ -3,7 +3,7 @@
<?php
function onStart(){
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', 'photo')->orderBy('created_at', 'DESC')->get();
$this['mediaPostsFilter'] = Tps\Tps\Models\Media::where('type', 'photo')->orderBy('created_at', 'DESC')->limit(5)->get();
}
?>

View File

@ -19,11 +19,6 @@ sortOrder = "created_at desc"
categoryPage = 404
postPage = 404
exceptPost = "{{ :id }}"
[adverts adverts3]
code = 3
type = "slider"
random = 0
==
{% set turkmenPosts = turkmenistan.posts %}
{% set worldPosts = world.posts %}
@ -72,7 +67,7 @@ random = 0
</div>
</div>
{% partial 'adv/right-sidebar2' adv=adverts3 css="aside" %}
{% partial 'adv/right-sidebar2' css="aside" groupId="17" %}
</aside>
</div>

View File

@ -6,7 +6,14 @@
<img src="{{post.poster_file|media|resize(683, 385, )}}" loading="lazy">
{% else %}
<a onClick="countView({{post.id}});">
<video src="{{post.media_file[0].media|media}}" controls poster="{{post.poster_file|media|resize(513, 288, {mode: 'crop'})}}" ></video>
<video id="video" poster="{{post.poster_file|media|resize(513, 288, {mode: 'crop'})}}" controls preload="metadata">
<source src="{{post.media_file[0].media|media}}" type="video/mp4">
<track label="{{activeLocaleName}}" kind="subtitles" srclang="{{activeLocale}}" src="{{post.subtitle|media}}" default>
</video>
</a>
{% endif %}
@ -24,4 +31,4 @@
{{post.name}}
</p>
</div>
</div>
</div>

View File

@ -1,36 +1,22 @@
[viewBag]
[builderList]
modelClass = "Tps\Tps\Models\Media"
scope = "-"
scopeValue = "{{ :scope }}"
displayColumn = "id"
noRecordsMessage = "No records found"
detailsPage = "-"
detailsUrlParameter = "id"
recordsPerPage = 8
pageNumber = "{{ :page }}"
sortColumn = "id"
sortDirection = "desc"
==
{% set records = builderList.records %}
{% set displayColumn = builderList.displayColumn %}
{% set noRecordsMessage = builderList.noRecordsMessage %}
{% set detailsPage = builderList.detailsPage %}
{% set detailsKeyColumn = builderList.detailsKeyColumn %}
{% set detailsUrlParameter = builderList.detailsUrlParameter %}
<?php
function onStart(){
$this['mediaVideo'] = Tps\Tps\Models\Media::where('type', 'video')->where('status', 1)->orderBy('created_at', 'DESC')->limit(5)->get();
}
?>
==
<div class="trending-head media-head">
<h2><a href="{{'new/group'|page({categoryGroup: 'media', slug:'video'})}}" style="color:white;">{{ 'new.page.video.archive'|_ }}</a></h2>
<span></span>
</div>
<div class="trending-content">
<div class="swiper videoSwiper">
<div class="swiper-wrapper">
<div class="swiper-wrapper" id="media_video">
{% for post in records if post.type == 'video' %}
{% for post in mediaVideo %}
<div class="swiper-slide">
{% partial 'newHome/video-item' post=post %}
</div>

View File

@ -34,16 +34,24 @@ code = "event_menu"
{% endif %}
{% endfor %}
{% for item2 in staticMenu2.menuItems %}
<a href="{{item2.url}}" class="nav-section-usaid-wrapper">
<span class="nav-section-usaid">{{ item2.title }}</span>
<p class="nav-section-usaid-dropdown">
{{'new.nav'|_}}
</p>
</a>
{% endfor %}
</ul>
</div>
<div class="nav-right">
{% for item2 in staticMenu2.menuItems %}
<a href="{{ item2.url }}" class="nav-right-link" style="{% if item2.viewBag.isHidden %} display:none; {% endif %}">{{ item2.title }}</a>
{% endfor %}
<ul class="nav-lang">
<li>

View File

@ -0,0 +1,44 @@
[viewBag]
==
{% put scripts %}
<script>
getAdvs('{{groupId}}');
// console.log("qqq");
function getAdvs(groupId) {
//console.log(query.html());
$(document).ready(function () {
$.ajax({
url: `https://orient.tm/api/group/advertisements?group_id=`+groupId,
type: 'GET',
dataType: 'json',
success: function (data, textStatus, xhr) {
var advs = data.data.data;
for (var adv of advs) {
//console.log(adv);
$('#adv_{{groupId}}').append(`
<div class="swiper-slide">
<a `+ (adv.enable_stats && adv.url ? `data-request="onRedirect" data-request-data='[{id:` + adv.id + `},{url:"` + adv.url + `"}]' onclick='window.open("` + adv.url + `", "_blank");'` : href="#" ) + `>
<picture>
<source media="(min-width:700px)" srcset="`+adv.media+`">
<img src="`+ adv.media +`" alt="`+ adv.title +`" style="width: 100%;">
</picture>
</a>
</div>
`);
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}

View File

@ -0,0 +1,61 @@
[viewBag]
==
{% put scripts %}
<script>
getMedia('{{type}}');
// console.log("qqq");
function getMedia(typeq) {
//console.log(query.html());
$(document).ready(function () {
$.ajax({
url: `https://orient.tm/api/v2/media?type=`+typeq,
type: 'GET',
dataType: 'json',
success: function (data, textStatus, xhr) {
var medias = data.data.data;
for (var media of medias) {
//console.log(media);
$('#media_{{type}}').append(`
<div class="swiper-slide">
<div class="video-item `+ ( media.type == 'photo' ? ` photo-item` : `` ) +` ">
<div class="video `+ ( media.type == 'photo' ? ` photo` : ``) +`">
`+ ( media.type == 'photo' ? ` <img src="`+ media.poster_file +`" loading="lazy">` : ` <a onClick="countView(` + media.id +`);">
<video src="`+ media.media_file[0].media +`" controls poster="`+ media.poster_file +`" ></video>
</a>` ) +`
</div>
<div class="sub-news-left-content-item-content video-info">
<div class="sub-news-left-content-item-date-content-head">
<h4>`+media.published_at+`</h4>
<span>|</span>
<h4> {{post.published_at|date('H:i')}}</h4>
<!-- <span>|</span>
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" style="width: 18px;" />
<span id="media_view_{{post.id}}">{% if post.view == null %} 0 {% else %} {{ post.view }} {% endif %}</span> -->
</div>
<p class="sub-news-left-content-item-date-content-info">
{{post.name}}
</p>
</div>
</div>
</div>
`);
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}

View File

@ -0,0 +1,43 @@
[viewBag]
==
{% put scripts %}
<script>
getPartners('{{groupId}}');
// console.log("qqq");
function getPartners(groupId) {
//console.log(query.html());
$(document).ready(function () {
$.ajax({
url: `https://orient.tm/api/group/advertisements?group_id=`+groupId,
type: 'GET',
dataType: 'json',
success: function (data, textStatus, xhr) {
var advs = data.data.data;
var i = 0;
for (var adv of advs) {
//console.log(adv);
$('#adv_partners').append(`
<div class="swiper-slide" data-swiper-slide-index="`+i+`" role="group" aria-label="`+(i+1)+` / `+ (advs.length) +`" style="width: 284px; margin-right: 60px;">
<div class="partners-item">
<img src="`+ adv.media +`" alt="`+ adv.title +`" />
</div>
</div>
`);
i++;
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}

View File

@ -0,0 +1,80 @@
[viewBag]
==
{% put scripts %}
<script>
getPosts('{{query}}');
// console.log("qqq");
function getPosts(query, limit) {
//console.log(query.html());
var converted = query.replaceAll('&amp;', '&');
$(document).ready(function () {
$.ajax({
url: `https://orient.tm/{{activeLocale}}/api/posts?`+converted,
type: 'GET',
dataType: 'json',
success: function (data, textStatus, xhr) {
var posts = data.data.data;
$('#{{id}}').append(`
<a href="/post/`+posts[0].id+`/`+posts[0].slug+`" class="main-news-lead">
<div class="main-news-bg">
<img src="`+posts[0].main_image+`" alt="{{posts[0].title}}" />
</div>
<div class="main-news-overlay"></div>
<div class="main-news-info">
<div class="main-news-info-title">
<h3> `+posts[0].categories[0].name+`</h3>
<span>|</span>
<h4>`+posts[0].published_at+`</h4>
<span>|</span>
<h4>`+posts[0].published_at+`</h4>
</div>
<p class="main-news-info-content">
`+posts[0].title+`
</p>
</div>
</a>
<div class="main-news-min" id="featured_small">
</div>
`);
var i = 1;
for (var post of posts) {
console.log(post);
$('#featured_small').append(`
<a href="/post/`+posts[i].id+`/`+posts[i].slug+`" class="main-news-min-item">
<div class="main-news-min-bg">
<img src="`+posts[i].main_image+`" alt="{{posts[i].title}}" />
<div class="main-news-overlay"></div>
<p class="main-news-min-info">
`+posts[i].title+`
</p>
</div>
</a>
`);
i++;
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}

View File

@ -0,0 +1,77 @@
[viewBag]
==
<section class="main-news">
<div class="container main-news-container">
<div class="main-news-inner" id="featured_posts">
<!-- <div class="main-news-min">
<a href="{{'new/newPost'|page({id:posts[1].id,slug:posts[1].slug})}}" class="main-news-min-item">
<div class="main-news-min-bg">
<img src="{{posts[1].featured_image|media|resize(275)}}" alt="{{posts[1].title}}" />
<div class="main-news-overlay"></div>
<p class="main-news-min-info">
{{posts[1].title}}
</p>
</div>
</a>
<a href="{{'new/newPost'|page({id:posts[2].id,slug:posts[2].slug})}}" class="main-news-min-item">
<div class="main-news-min-bg">
<img src="{{posts[2].featured_image|media|resize(275)}}" alt="{{posts[2].title}}" />
<div class="main-news-overlay"></div>
<p class="main-news-min-info">
{{posts[2].title}}
</p>
</div>
</a>
<a href="{{'new/newPost'|page({id:posts[3].id,slug:posts[3].slug})}}" class="main-news-min-item">
<div class="main-news-min-bg">
<img src="{{posts[3].featured_image|media|resize(275)}}" alt="{{posts[3].title}}" />
<div class="main-news-overlay"></div>
<p class="main-news-min-info">
{{posts[3].title}}
</p>
</div>
</a>
</div> -->
<div class="swiper mainNewsSwiper">
<div class="swiper-wrapper">
{% for post in posts %}
<div class="swiper-slide">
<a href="{{'new/newPost'|page({id:post.id,slug:post.slug})}}" class="main-news-min-item">
<div class="main-news-min-bg">
<img src="{{post.featured_image|media|resize(534)}}" alt=""/>
<div class="main-news-overlay"></div>
<p class="main-news-min-info">
{{ post.title }}
</p>
</div>
</a>
</div>
{% endfor %}
</div>
<div class="video-prev main-news-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="video-next main-news-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
</div>
</div>
</section>

View File

@ -0,0 +1,93 @@
[viewBag]
[blogPosts postsMainLeft]
pageNumber = "{{ :page }}"
categoryFilter = "pomosh-eksporteram"
postsPerPage = 6
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
[popularPosts]
category = "{{ :category }}"
postsLimit = 6
noPostsMessage = "No posts found"
postPage = 404
[adverts adverts2]
code = 2
type = "slider"
random = 0
==
{% set postsMainLeft = postsMainLeft.posts %}
{% set postsMainRight = postsMainRight.posts %}
{% set populars = popularPosts.posts %}
<!-- MAIN ======== -->
<main class="main" style="margin-top: 40px;">
<div class="main-inner">
<section class="main-inner-content">
{% partial 'newHome/main-slider' %}
<section class="main-advert">
<div class="container main-news-container">
<div class="main-advert-inner">
<div class="swiper mainAdvertSwiper">
<div class="swiper-wrapper">
{% if adverts2.group and adverts2.group.adds %}
{% for reklama in adverts2.group.adds %}
<div class="swiper-slide">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif
%}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</section>
<section class="sub-news">
<div class="container">
<div class="sub-news-inner">
{% partial 'test/special-projects' categoryPosts = postsMainLeft %}
{% partial 'newHome/main-tender' categoryPosts = populars %}
</div>
</div>
</section>
</section>
{% partial 'newHome/right-sidebar'%}
</div>
</main>
<!-- MAIN end ======== -->

View File

@ -0,0 +1,93 @@
[viewBag]
[blogPosts postsMainLeft]
pageNumber = "{{ :page }}"
categoryFilter = "novosti-biznesa"
postsPerPage = 6
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
[adverts adverts2]
code = 2
type = "slider"
random = 0
[popularPosts]
category = "{{ :category }}"
postsLimit = 6
noPostsMessage = "No posts found"
postPage = 404
==
{% set postsMainLeft = postsMainLeft.posts %}
{% set postsMainRight = postsMainRight.posts %}
{% set populars = popularPosts.posts %}
<!-- MAIN ======== -->
<main class="main" style="margin-top: 40px;">
<div class="main-inner">
<section class="main-inner-content">
{% partial 'newHome/main-slider' %}
<section class="main-advert">
<div class="container main-news-container">
<div class="main-advert-inner">
<div class="swiper mainAdvertSwiper">
<div class="swiper-wrapper">
{% if adverts2.group and adverts2.group.adds %}
{% for reklama in adverts2.group.adds %}
<div class="swiper-slide">
<a {% if reklama.enable_stats and reklama.url %} data-request="onRedirect"
data-request-data='[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
onclick='window.open("{{reklama.url}}", "_blank");' {% else %} href="#" {% endif
%}>
<picture>
<source media="(min-width:700px)" srcset="{{reklama.media|media_cdn}}">
<img src="{{reklama.web_media_mobile|default(reklama.media)|media_cdn}}"
alt="{{reklama.title}}">
</picture>
</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</section>
<section class="sub-news">
<div class="container">
<div class="sub-news-inner">
{% partial 'test/special-projects2' categoryPosts = postsMainLeft %}
{% partial 'newHome/main-tender' categoryPosts = populars %}
</div>
</div>
</section>
</section>
{% partial 'newHome/right-sidebar'%}
</div>
</main>
<!-- MAIN end ======== -->

View File

@ -0,0 +1,86 @@
[viewBag]
[blogPosts postsMainLeft]
pageNumber = "{{ :page }}"
categoryFilter = "pomosh-eksporteram"
postsPerPage = 6
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = 404
[popularPosts]
category = "{{ :category }}"
postsLimit = 6
noPostsMessage = "No posts found"
postPage = 404
==
{% set postsMainLeft = postsMainLeft.posts %}
{% set postsMainRight = postsMainRight.posts %}
{% set populars = popularPosts.posts %}
<!-- MAIN ======== -->
<main class="main" style="margin-top: 40px;">
<div class="main-inner">
<section class="main-inner-content">
{% partial 'newHome/main-slider' %}
<section class="main-advert">
<div class="container main-news-container">
<div class="main-advert-inner">
<div class="swiper mainAdvertSwiper">
<div class="swiper-wrapper" id="adv_16">
</div>
</div>
</div>
</div>
</section>
<section class="sub-news">
<div class="container">
<div class="sub-news-inner">
{% partial 'test/special-projects2' categoryPosts = postsMainLeft %}
{% partial 'newHome/main-tender' categoryPosts = populars %}
</div>
</div>
</section>
</section>
{% partial 'newHome/right-sidebar'%}
</div>
</main>
<!-- MAIN end ======== -->
{% partial 'scripts/getAdv' groupId='16' %}
{% partial 'scripts/getAdv' groupId='2' %}
{% partial 'scripts/getAdv' groupId='17' %}
{% partial 'scripts/getAdv' groupId='18' %}
{% partial 'scripts/getAdv' groupId='19' %}
{% partial 'scripts/getAdv' groupId='20' %}
{% partial 'scripts/getAdv' groupId='21' %}
{% partial 'scripts/getAdv' groupId='22' %}

View File

@ -0,0 +1,71 @@
[viewBag]
[staticMenu]
code = "new-top-menui"
[staticMenu staticMenu2]
code = "event_menu"
==
<nav class="nav" style="margin-bottom: 0px;">
<section class="nav-top">
<div class="container">
<div class="nav-inner">
<div class="nav-left">
<ul class="nav-ul">
{% for item in staticMenu.menuItems %}
<li>
<span class="nav-section-span {% if (item.isActive) %} active {% endif %} "> <a href="{{ item.url }}" style="color:white;">{{ item.title }}</a></span>
</li>
{% endfor %}
{% for item2 in staticMenu2.menuItems %}
<li class="nav-section-usaid-wrapper">
<span class="nav-section-usaid">{{ item2.title }}</span>
<p class="nav-section-usaid-dropdown">
{{'new.nav'|_}}
</p>
</li>
{% endfor %}
</ul>
</div>
<div class="nav-right">
<ul class="nav-lang">
<li>
<a data-request="onSwitchLocale" data-request-data="locale: 'en'">
<div class="lang-country">
<img src="{{'assets/new/icons/ukflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a data-request="onSwitchLocale" data-request-data="locale: 'tm'">
<div class="lang-country">
<img src="{{'assets/new/icons/tmflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a data-request="onSwitchLocale" data-request-data="locale: 'ru'">
<div class="lang-country">
<img src="{{'assets/new/icons/ruflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</section>
</nav>

View File

@ -0,0 +1,67 @@
[staticMenu]
code = "new-top-menui"
[staticMenu staticMenu2]
code = "event_menu"
[viewBag]
==
<div class="burger-wrapper">
<div class="burger-close">
<img src="{{ 'assets/new/icons/close.svg'|theme}}" alt="" />
</div>
<div class="burger-content">
<div class="burger-list-wrapper">
<ul class="burger-list-ul">
{% for item in staticMenu.menuItems %}
{% if not item.viewBag.isHidden and item.items|length %}
<li class="burger-list">
<div href="{{item.url}}">{{ item.title }}</div>
<ul class="burger-list-nested">
<li><a href="{{ item.url }}">{{'new.read.more'|_}}</a></li>
{% for item in item.items %}
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
</li>
{% elseif not item.viewBag.isHidden %}
<li class="burger-list">
<a href="{{ item.url }}" class="burger-item">{{ item.title }}</a>
</li>
{% endif %}
{% endfor %}
{% for item2 in staticMenu2.menuItems %}
<li class="burger-list-li green" style="">
<a href="{{ item2.url }}" class="burger-item">{{ item2.title }}</a>
</li>
{% endfor %}
</ul>
<div class="burger-lang">
<ul>
<li>
<button data-request="onSwitchLocale" data-request-data="locale: 'ru'">
<img src="{{ 'assets/new/icons/ruflag.svg'|theme}}" alt="" />
</button>
</li>
<li>
<button data-request="onSwitchLocale" data-request-data="locale: 'en'">
<img src="{{ 'assets/new/icons/ukflag.svg'|theme}}" alt="" />
</button>
</li>
<li>
<button data-request="onSwitchLocale" data-request-data="locale: 'tm'">
<img src="{{ 'assets/new/icons/tmflag.svg'|theme}}" alt="" />
</button>
</li>
</ul>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,18 @@
[viewBag]
==
<div class="sub-news-left" style="margin-bottom: 30px;gap: 0rem !important;">
<h2><a href="{{'new/group'|page({categoryGroup: 'news', slug:'novosti-biznesa'})}}">{{ 'new.home.page.left.special'|_ }} </h2>
<div class="sub-news-left-content">
{% for post in categoryPosts %}
{% partial 'newHome/post-item-img' post = post %}
{% endfor %}
<a href="{{'new/group'|page({categoryGroup: 'news', slug:'pomosh-eksporteram'})}}" class="aside-content-more" style="margin-top: 25px;">
<span>{{'new.read.more.usaid'|_}}</span>
<div class="aside-content-more-img">
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />
</div>
</a>
</div>
</div>

View File

@ -0,0 +1,38 @@
[viewBag]
==
<div class="sub-news-left">
<h2><a href="{{'new/group'|page({categoryGroup: 'news', slug:'novosti-biznesa'})}}">{{ 'new.home.page.left.special'|_ }}</a></h2>
<div class="sub-news-left-content">
{% for post in categoryPosts %}
<a href="{{'new/newPost'|page({id:post.id,slug:post.slug})}}" class="sub-news-left-content-item">
<div class="sub-news-left-content-item-img">
<img src="{{post.featured_image|media|resize(87)}}" loading="lazy" alt="" />
</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>
<span>|</span>
<h4><font style="color: darkblue;"> US</font><font style="color:darkred;">AID</font></h4>
</div>
<p class="sub-news-left-content-item-date-content-info">
{{post.title}}
</p>
</div>
</a>
{% endfor %}
<a href="{{'new/group'|page({categoryGroup: 'news', slug:'novosti-biznesa'})}}" class="aside-content-more" style="margin-top: 25px;">
<span>{{'new.read.more'|_}}</span>
<div class="aside-content-more-img">
<img src="{{'assets/new/icons/arrow-right-black.svg'|theme}}" alt="" />
</div>
</a>
</div>
</div>

View File

@ -0,0 +1,33 @@
[viewBag]
==
<div class="video-item {% if post.type == 'photo' %} photo-item {% endif %}">
<div class="video {% if post.type == 'photo' %} photo {% endif %}">
{% if post.type == 'photo' %}
<img src="{{post.poster_file|media|resize(683, 385, )}}" loading="lazy">
{% else %}
<a onClick="countView({{post.id}});">
<video id="video" poster="{{post.poster_file|media|resize(513, 288, {mode: 'crop'})}}" controls preload="metadata">
<source src="{{post.media_file[0].media|media}}" type="video/mp4">
<!-- <track label="English" kind="subtitles" srclang="en" src="3798-233163.vtt"> -->
<track label="{{activeLocaleName}}" kind="subtitles" srclang="{{activeLocale}}" src="{{post.subtitle|media}}" default>
</video>
</a>
{% endif %}
</div>
<div class="sub-news-left-content-item-content video-info">
<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>
<!-- <span>|</span>
<img src="{{'assets/new/icons/eye.svg'|theme}}" alt="" style="width: 18px;" />
<span id="media_view_{{post.id}}">{% if post.view == null %} 0 {% else %} {{ post.view }} {% endif %}</span> -->
</div>
<p class="sub-news-left-content-item-date-content-info">
{{post.name}}
</p>
</div>
</div>

View File

@ -0,0 +1,34 @@
[viewBag]
==
<?php
function onStart(){
$this['mediaVideo'] = Tps\Tps\Models\Media::where('type', 'video')->where('status', 0)->orderBy('created_at', 'DESC')->limit(5)->get();
}
?>
==
<div class="trending-head media-head">
<h2><a href="{{'new/group'|page({categoryGroup: 'media', slug:'video'})}}" style="color:white;">{{ 'new.page.video.archive'|_ }}</a></h2>
<span></span>
</div>
<div class="trending-content">
<div class="swiper videoSwiper">
<div class="swiper-wrapper" id="media_video">
{% for post in mediaVideo %}
<div class="swiper-slide">
{% partial 'test/video-item' post=post %}
</div>
{% endfor %}
</div>
<div class="video-prev">
<img src="{{'assets/new/icons/arrow-left-white.svg'|theme}}" alt="" />
</div>
<div class="video-next">
<img src="{{'assets/new/icons/arrow-right-white.svg'|theme}}" alt="" />
</div>
</div>
</div>