last server commit

This commit is contained in:
gerchek 2023-05-02 11:53:47 +05:00
parent f74fc59e70
commit 6de252ce74
29 changed files with 246 additions and 77 deletions

View File

@ -125,8 +125,8 @@ return [
'providers' => array_merge(include(base_path('modules/system/providers.php')), [
// 'Illuminate\Html\HtmlServiceProvider', // Example
'Laravel\Scout\ScoutServiceProvider',
'Meilisearch\Scout\MeilisearchServiceProvider',
// 'Laravel\Scout\ScoutServiceProvider',
// 'Meilisearch\Scout\MeilisearchServiceProvider',
'System\ServiceProvider',
]),

1
config/data.ms/VERSION Normal file
View File

@ -0,0 +1 @@
1.1.1

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
2755314f-2c64-4295-871d-b9669df51998

Binary file not shown.

Binary file not shown.

View File

@ -33,6 +33,6 @@ return [
|
*/
'key' => env('MEILISEARCH_KEY', null),
'key' => env('MEILISEARCH_KEY', 'MihLUv8vE7NWFsv0zXirY-VM56MqS1A-oP9FUWtF-wo'),
];

View File

@ -15,7 +15,7 @@ return [
|
*/
'driver' => env('SCOUT_DRIVER', 'algolia'),
// 'driver' => env('SCOUT_DRIVER', 'algolia'),
/*
|--------------------------------------------------------------------------
@ -28,7 +28,7 @@ return [
|
*/
'prefix' => env('SCOUT_PREFIX', ''),
// 'prefix' => env('SCOUT_PREFIX', ''),
/*
|--------------------------------------------------------------------------
@ -41,7 +41,7 @@ return [
|
*/
'queue' => env('SCOUT_QUEUE', false),
// 'queue' => env('SCOUT_QUEUE', false),
/*
|--------------------------------------------------------------------------

View File

@ -26,7 +26,7 @@ class postsController extends Controller
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
$filter = [
'page' => input('page'),
'sort' => input('sort')??'published_at desc',
'sort' => input('sort') ??'published_at desc',
'perPage' => input('count'),
'search' => trim(input('search')),
'category' => input('category'),
@ -34,7 +34,7 @@ class postsController extends Controller
'typePost' => input('typePost'),
'postGroup' => input('group'),
'published' => true,
'select' => ['id','title','slug','published_at', 'more_photo','afisha_phone', 'afisha_address', 'afisha_phone_new', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]
'select' => ['id','title','slug', 'featured', 'published_at', 'more_photo','afisha_phone', 'afisha_address', 'afisha_phone_new', DB::raw("IF(featured_image<>'',concat('$path',featured_image),featured_image) as main_image")]
];
if(request()->has('featured')){

View File

@ -30,6 +30,7 @@ class Meilisearch extends ComponentBase
public function onRun()
{
//dd("hi");
$this->posts = $this->listPosts();
//$this->page = $this->listPosts();
}
@ -37,7 +38,7 @@ class Meilisearch extends ComponentBase
protected function listPosts()
{
$query = get('q');
$query = get('q') ?? 'Turkmenistan';
$page = get('page');
//dd($query);
if(is_null($page))
@ -47,7 +48,7 @@ class Meilisearch extends ComponentBase
if(is_null($query))
{
$query = 'здравоохранения';
$query = 'сотрудников';
}
$this->page = $page;
@ -61,24 +62,26 @@ class Meilisearch extends ComponentBase
$client = new Client([
'headers' => [ 'Content-Type' => 'application/json' ]
]);
//---------------------------------------------------------------
// $response = BlogPost::search('архитектуры')->get();
$queries = explode(' ', $query);
$response = BlogPost::search(implode(' OR ', $queries))->where('locale', 'en')->get();
$json = json_decode($response);
dd($json);
//-----------------------------------------------------------------
$response = $client->post('http://localhost:7700/indexes/posts_index/search',
['body' => json_encode(
[
'q' => $query,
'limit' => $per_page,
'offset' => $offset + $per_page,
]
)]
);
$res = json_decode($response->getBody()->getContents());
//$res = json_decode($response->getBody()->getContents());
//$query = post('query');
//dd($res);
return $res->hits;
//return $res->hits;
return $response;
}

View File

@ -33,11 +33,34 @@ class Post extends Model
use \October\Rain\Database\Traits\Validation;
use Searchable;
public $implement = [
\RainLab\Translate\Behaviors\TranslatableModel::class
];
public $translatable = ['title','content_html'];
public function searchableAs()
{
return 'posts_index';
}
public function toSearchableArray()
{
return [
'id' => $this->id,
'title' => $this->title,
'excerpt' => $this->excerpt,
'locale' => $this->locale,
// add any other fields you want to make searchable
];
}
public function filterableAttributes()
{
return ['locale'];
}
public $table = 'rainlab_blog_posts';
// public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];

View File

@ -0,0 +1,25 @@
<?php namespace Tps\Tps\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateTpsTpsTestQuestions2 extends Migration
{
public function up()
{
Schema::create('tps_tps_test_questions', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->text('description')->nullable();
$table->integer('test_id');
$table->text('question');
$table->text('answers');
});
}
public function down()
{
Schema::dropIfExists('tps_tps_test_questions');
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Tps\Tps\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateTpsTpsTests extends Migration
{
public function up()
{
Schema::create('tps_tps_tests', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->string('title')->nullable();
$table->text('description')->nullable();
});
}
public function down()
{
Schema::dropIfExists('tps_tps_tests');
}
}

View File

@ -24,3 +24,9 @@
1.0.9:
- 'Updated table tps_tps_media_view'
- builder_table_update_tps_tps_media_view_2.php
1.0.10:
- 'Created table tps_tps_tests'
- builder_table_create_tps_tps_tests.php
1.0.11:
- 'Created table tps_tps_test_questions'
- builder_table_create_tps_tps_test_questions_2.php

View File

@ -82,11 +82,15 @@
cursor: pointer;
position: relative;
display: flex;
align-items: center;
align-items: baseline;
font-weight: 600;
font-size: 14px;
line-height: 1.4;
p {
font-weight: 600;
font-size: 14px;
line-height: 1.4;
width: calc(100% - 15px);
text-align: left;
}
max-width: 300px;
padding: 5px 14px;
@ -97,14 +101,12 @@
&::before {
content: "";
display: inline-block;
width: 5px;
height: 5px;
display: block;
width: 5px !important;
height: 5px !important;
border-radius: 50%;
background: #00822c;
margin-right: 10px;
text-align: center;
align-self: center;
}
&:hover {
@ -404,4 +406,4 @@
}
}
}
}
}

View File

@ -16,6 +16,7 @@ html {
body {
flex-grow: 1;
overflow-x: hidden;
}
input,

View File

@ -29,7 +29,6 @@
object-fit: contain;
}
}
// Media
@media screen and (max-width: 850px) {
.affiche-inner {

View File

@ -39,7 +39,7 @@
@include transition-std;
&::before {
content: "";
content: '';
border-radius: 50%;
display: block;
width: 0.4rem;
@ -133,11 +133,11 @@
.aside-content-item-info {
font-size: 1.5rem;
line-height: 1.77rem;
// display: -webkit-box;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;
// overflow: hidden;
// text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.aside-content-more {
@ -255,4 +255,4 @@
.aside-content-wrapper {
gap: 2.2rem;
}
}
}

View File

@ -6,6 +6,10 @@
padding: 4rem 0;
@include flex(column);
gap: 5.2rem;
.trending-head {
width: 100% !important;
}
}
.media-head {
@ -147,6 +151,21 @@
}
// Media
@media screen and (max-width: 1550px) {
.video {
img {
height: 25rem;
}
}
}
@media screen and (max-width: 1100px) {
.video {
img {
height: 20rem;
}
}
}
@media screen and (max-width: 950px) {
.media {
display: none;

View File

@ -5,16 +5,23 @@
.posts-inner {
@include flex(column);
gap: 4rem;
.trending-head {
span {
width: 45%;
}
}
}
.posts-content {
display: grid;
grid-template-areas: "big big sm1 sm2" "big big sm3 sm4" "sm5 sm6 sm7 sm8";
grid-template-areas: 'big big sm1 sm2' 'big big sm3 sm4' 'sm5 sm6 sm7 sm8';
gap: 2.5rem;
.trending-aside-content-head {
h3 {
display: block;
color: $base-green;
& + span {
display: block;

View File

@ -40,8 +40,12 @@
@include flex;
align-items: center;
gap: 0.4rem;
color: $base-green;
color: rgb(85, 85, 85);
font-size: 1.4rem;
* {
font-weight: normal;
}
}
.sub-news-left-content-item-date-content-info {
@ -49,11 +53,11 @@
font-size: 1.5rem;
color: $base-black;
line-height: 1.6rem;
// display: -webkit-box;
// -webkit-line-clamp: 3;
// -webkit-box-orient: vertical;
// overflow: hidden;
// text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
//
&.edit {

View File

@ -3,6 +3,12 @@
display: grid;
grid-template-columns: 67% auto;
gap: 3.6rem;
.trending-head {
span {
width: 40% !important;
}
}
}
.useful-aside-item-top {
@ -45,6 +51,12 @@
.useful-aside {
@include flex(column);
gap: 2.5rem;
.trending-head {
span {
display: none;
}
}
}
.useful-main {

View File

@ -2,6 +2,10 @@
padding: 4.7rem 0 8rem 0;
@include flex(column);
gap: 4.3rem;
.trending-head {
width: 100% !important;
}
}
.rubric-items {
@ -70,7 +74,6 @@
}
@media screen and (max-width: 1080px) {
.rubric-items,
.rubric-bottom {
padding: 0;
@ -86,4 +89,4 @@
max-height: unset;
}
}
}
}

View File

@ -25,6 +25,7 @@ body {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
overflow-x: hidden;
}
input,
@ -1478,6 +1479,11 @@ a {
.aside-content-item-info {
font-size: 1.5rem;
line-height: 1.77rem;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.aside-content-more {
@ -1699,14 +1705,22 @@ a {
-ms-flex-align: center;
align-items: center;
gap: 0.4rem;
color: rgb(3, 159, 55);
color: rgb(85, 85, 85);
font-size: 1.4rem;
}
.sub-news-left-content-item-date-content-head * {
font-weight: normal;
}
.sub-news-left-content-item-date-content-info {
font-size: 1.5rem;
color: rgb(36, 36, 36);
line-height: 1.6rem;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.sub-news-left-content-item-date-content-info.edit {
font-size: 1.75rem;
@ -2157,6 +2171,9 @@ a {
flex-direction: column;
gap: 4rem;
}
.posts-inner .trending-head span {
width: 45%;
}
.posts-content {
display: -ms-grid;
@ -2166,6 +2183,7 @@ a {
}
.posts-content .trending-aside-content-head h3 {
display: block;
color: rgb(3, 159, 55);
}
.posts-content .trending-aside-content-head h3 + span {
display: block;
@ -2258,6 +2276,9 @@ a {
flex-direction: column;
gap: 5.2rem;
}
.media-inner .trending-head {
width: 100% !important;
}
.media-head h2 {
color: rgb(255, 255, 255);
@ -2453,6 +2474,16 @@ a {
display: none;
}
@media screen and (max-width: 1550px) {
.video img {
height: 25rem;
}
}
@media screen and (max-width: 1100px) {
.video img {
height: 20rem;
}
}
@media screen and (max-width: 950px) {
.media {
display: none;
@ -2466,6 +2497,9 @@ a {
grid-template-columns: 67% auto;
gap: 3.6rem;
}
.useful-inner .trending-head span {
width: 40% !important;
}
.useful-aside-item-top {
display: -webkit-box;
@ -2540,6 +2574,9 @@ a {
flex-direction: column;
gap: 2.5rem;
}
.useful-aside .trending-head span {
display: none;
}
.useful-main {
width: 100%;
@ -3027,6 +3064,9 @@ a {
flex-direction: column;
gap: 4.3rem;
}
.rubric-inner .trending-head {
width: 100% !important;
}
.rubric-items {
padding: 0 6.7rem;
@ -3204,12 +3244,9 @@ a {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-weight: 600;
font-size: 14px;
line-height: 1.4;
-webkit-box-align: baseline;
-ms-flex-align: baseline;
align-items: baseline;
max-width: 300px;
padding: 5px 14px;
margin-bottom: 12px;
@ -3218,18 +3255,21 @@ a {
-webkit-transition: 0.2s linear;
transition: 0.2s linear;
}
.article-test button p {
font-weight: 600;
font-size: 14px;
line-height: 1.4;
width: calc(100% - 15px);
text-align: left;
}
.article-test button::before {
content: "";
display: inline-block;
width: 5px;
height: 5px;
display: block;
width: 5px !important;
height: 5px !important;
border-radius: 50%;
background: #00822c;
margin-right: 10px;
text-align: center;
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center;
}
.article-test button:hover {
border-color: #000;

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ robot_follow = "follow"
</div>
{% component 'meilisearch' %}
{% component 'meilisearch' %}
</div>

View File

@ -5,16 +5,13 @@ is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
<?php
function onStart(){
$this['questions'] = Tps\Tps\Models\TestQuestion::with('image')->where('test_id', $this->param('id'))->get()->shuffle();
$this['test_id'] = $this->param('id');
}
?>
==
<!-- Test ================================== -->
<main class="article">
<div class="container">
@ -27,12 +24,7 @@ function onStart(){
<div class="article-inner">
<div class="article-content">
<div class="article-content-top">
<div class="article-head">
<h2>
{{questions.first.test.title}}
</h2>
</div>
<div class="article-desc" id="question_container">
<h4 class="article_desc-title" id="question_title"></h4>
@ -171,7 +163,7 @@ function onStart(){
answersBox +=
`<button class="article-test-btn" onclick="checkAnswer(this, ${correct})">
${title}
<p>${title}</p>
</button>`;
});
question_answer.innerHTML = answersBox;

View File

@ -5,6 +5,14 @@ is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==
<?php
function onStart(){
$this['tests'] = Tps\Tps\Models\Test::all();
}
?>
==
<!-- Test ================================== -->
<main class="article">
<div class="container">