from server

This commit is contained in:
Shohrat 2023-02-20 05:47:57 +00:00
parent 6ad31119f9
commit a488efe6b3
9 changed files with 947 additions and 844 deletions

View File

@ -66,7 +66,10 @@
]
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": true
}
},
"minimum-stability": "dev",
"prefer-stable": true

View File

@ -1,33 +1,37 @@
<?php
namespace RainLab\Blog\Classes;
use Illuminate\Http\Resources\Json\JsonResource;
class PostResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$locale = $request->get('locale');
return [
'id' => $this->id,
'title' => $this->getAttributeTranslated('title', $locale),
'slug' => $this->getAttributeTranslated('slug', $locale),
'excerpt' => $this->getAttributeTranslated('excerpt', $locale),
'published_at' => $this->published_at->format('d.m.Y'),
'featured_images' => ImageResource::collection($this->featured_images),
'content_html' => $this->getAttributeTranslated('content_html', $locale),
'categories' => CategoryResource::collection($this->categories),
'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale),
'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale),
'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale),
];
}
}
<?php
namespace RainLab\Blog\Classes;
use Illuminate\Http\Resources\Json\JsonResource;
use Config;
class PostResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$locale = $request->get('locale');
$path = Config::get('app.cdn').Config::get('cms.storage.media.path');
return [
'id' => $this->id,
'title' => $this->getAttributeTranslated('title', $locale),
'slug' => $this->getAttributeTranslated('slug', $locale),
'excerpt' => $this->getAttributeTranslated('excerpt', $locale),
'published_at' => $this->published_at->format('d.m.Y'),
'type' => $this->type,
'featured_images' => ImageResource::collection($this->featured_images),
'video' => $path.$this->video,
'content_html' => $this->getAttributeTranslated('content_html', $locale),
'categories' => CategoryResource::collection($this->categories),
'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale),
'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale),
'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale),
];
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,73 +1,95 @@
fields:
title:
label: 'rainlab.blog::lang.post.title'
span: left
placeholder: 'rainlab.blog::lang.post.title_placeholder'
type: text
slug:
label: 'rainlab.blog::lang.post.slug'
span: right
placeholder: 'rainlab.blog::lang.post.slug_placeholder'
preset:
field: title
type: slug
type: text
toolbar:
type: partial
path: post_toolbar
cssClass: collapse-visible
secondaryTabs:
fields:
content:
tab: 'rainlab.blog::lang.post.tab_edit'
type: RainLab\Blog\FormWidgets\BlogMarkdown
cssClass: 'field-slim blog-post-preview'
stretch: true
mode: split
categories:
nameFrom: name
descriptionFrom: description
span: left
type: relation
commentAbove: 'rainlab.blog::lang.post.categories_comment'
tab: 'rainlab.blog::lang.post.tab_categories'
published:
label: 'rainlab.blog::lang.post.published'
span: left
type: checkbox
tab: 'rainlab.blog::lang.post.tab_manage'
featured:
label: 'показать в слайдере на главной странице'
span: auto
type: checkbox
comment: 'не отмечать если не нужно выставлять на слайдере'
tab: 'rainlab.blog::lang.post.tab_manage'
user:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.published_by'
span: right
type: dropdown
emptyOption: 'rainlab.blog::lang.post.current_user'
published_at:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.published_on'
span: left
cssClass: checkbox-align
type: datepicker
mode: datetime
trigger:
action: enable
field: published
condition: checked
excerpt:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.excerpt'
type: textarea
size: small
featured_images:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.featured_images'
type: fileupload
mode: image
imageWidth: 200
imageHeight: 200
fields:
title:
label: 'rainlab.blog::lang.post.title'
span: left
placeholder: 'rainlab.blog::lang.post.title_placeholder'
type: text
slug:
label: 'rainlab.blog::lang.post.slug'
span: right
placeholder: 'rainlab.blog::lang.post.slug_placeholder'
preset:
field: title
type: slug
type: text
toolbar:
type: partial
path: post_toolbar
cssClass: collapse-visible
secondaryTabs:
fields:
content:
tab: 'rainlab.blog::lang.post.tab_edit'
type: RainLab\Blog\FormWidgets\BlogMarkdown
cssClass: 'field-slim blog-post-preview'
stretch: true
mode: split
categories:
nameFrom: name
descriptionFrom: description
span: left
type: relation
commentAbove: 'rainlab.blog::lang.post.categories_comment'
tab: 'rainlab.blog::lang.post.tab_categories'
published:
label: 'rainlab.blog::lang.post.published'
span: left
type: checkbox
tab: 'rainlab.blog::lang.post.tab_manage'
featured:
label: 'показать в слайдере на главной странице'
span: auto
type: checkbox
comment: 'не отмечать если не нужно выставлять на слайдере'
tab: 'rainlab.blog::lang.post.tab_manage'
user:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.published_by'
span: right
type: dropdown
emptyOption: 'rainlab.blog::lang.post.current_user'
published_at:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.published_on'
span: left
cssClass: checkbox-align
type: datepicker
mode: datetime
trigger:
action: enable
field: published
condition: checked
excerpt:
tab: 'rainlab.blog::lang.post.tab_manage'
label: 'rainlab.blog::lang.post.excerpt'
type: textarea
size: small
featured_images:
label: 'rainlab.blog::lang.post.featured_images'
mode: image
imageWidth: 200
imageHeight: 200
useCaption: true
thumbOptions:
mode: crop
extension: auto
span: left
type: fileupload
dependsOn: type
tab: 'rainlab.blog::lang.post.tab_manage'
type:
label: Type
options:
photo: Photo
video: Video
span: auto
default: photo
type: balloon-selector
tab: 'rainlab.blog::lang.post.tab_manage'
video:
label: Video
mode: file
span: left
type: mediafinder
dependsOn: type
tab: 'rainlab.blog::lang.post.tab_manage'

View File

@ -0,0 +1,25 @@
<?php namespace RainLab\Blog\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRainlabBlogPosts2 extends Migration
{
public function up()
{
Schema::table('rainlab_blog_posts', function($table)
{
$table->string('type')->nullable();
$table->string('video')->nullable();
});
}
public function down()
{
Schema::table('rainlab_blog_posts', function($table)
{
$table->dropColumn('type');
$table->dropColumn('video');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace RainLab\Blog\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRainlabBlogPosts3 extends Migration
{
public function up()
{
Schema::table('rainlab_blog_posts', function($table)
{
$table->string('type', 191)->default('photo')->change();
});
}
public function down()
{
Schema::table('rainlab_blog_posts', function($table)
{
$table->string('type', 191)->default(null)->change();
});
}
}

View File

@ -70,3 +70,9 @@
1.6.3:
- 'Updated table rainlab_blog_posts'
- builder_table_update_rainlab_blog_posts.php
1.6.4:
- 'Updated table rainlab_blog_posts'
- builder_table_update_rainlab_blog_posts_2.php
1.6.5:
- 'Updated table rainlab_blog_posts'
- builder_table_update_rainlab_blog_posts_3.php

View File

@ -0,0 +1,6 @@
title = "home"
url = "/"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"
==

5
themes/hhm/theme.yaml Normal file
View File

@ -0,0 +1,5 @@
name: hhm
description: ''
author: ''
homepage: ''
code: ''