From 44c1a0bd39fc41c4dda50e0ccf4e95aa0fc4a4cb Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 May 2021 08:54:14 +0000 Subject: [PATCH] server blog featerd and author --- plugins/rainlab/blog/models/post/fields.yaml | 87 +++++++------------ ...uilder_table_update_rainlab_blog_posts.php | 25 ++++++ plugins/rainlab/blog/updates/version.yaml | 3 + rss.xml | 7 ++ themes/modern2/pages/post.htm | 3 + themes/modern2/partials/head.htm | 2 +- 6 files changed, 72 insertions(+), 55 deletions(-) create mode 100644 plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_posts.php diff --git a/plugins/rainlab/blog/models/post/fields.yaml b/plugins/rainlab/blog/models/post/fields.yaml index 08f9d11f5..ec670334d 100644 --- a/plugins/rainlab/blog/models/post/fields.yaml +++ b/plugins/rainlab/blog/models/post/fields.yaml @@ -1,63 +1,59 @@ -# =================================== -# Field Definitions -# =================================== - fields: - title: - label: rainlab.blog::lang.post.title - placeholder: rainlab.blog::lang.post.title_placeholder - + label: 'rainlab.blog::lang.post.title' + 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 + label: 'rainlab.blog::lang.post.slug' + placeholder: 'rainlab.blog::lang.post.slug_placeholder' preset: field: title type: slug - + type: text toolbar: type: partial path: post_toolbar cssClass: collapse-visible - secondaryTabs: - stretch: true fields: content: - tab: rainlab.blog::lang.post.tab_edit + tab: 'rainlab.blog::lang.post.tab_edit' type: RainLab\Blog\FormWidgets\BlogMarkdown -# type: richeditor - cssClass: field-slim blog-post-preview + cssClass: 'field-slim blog-post-preview' stretch: true mode: split - locale: - tab: rainlab.blog::lang.post.tab_categories - label: Language of Post + tab: 'rainlab.blog::lang.post.tab_categories' + label: 'Language of Post' span: left type: dropdown default: ru options: ru: Russian en: English - translated_post: - label: Translated Post id + label: 'Translated Post id' type: number - tab: rainlab.blog::lang.post.tab_categories + tab: 'rainlab.blog::lang.post.tab_categories' span: right - active_categories: - tab: rainlab.blog::lang.post.tab_categories + tab: 'rainlab.blog::lang.post.tab_categories' type: relation - commentAbove: rainlab.blog::lang.post.categories_comment - placeholder: rainlab.blog::lang.post.categories_placeholder - - + commentAbove: 'rainlab.blog::lang.post.categories_comment' + placeholder: 'rainlab.blog::lang.post.categories_placeholder' + author: + label: 'Post author' + span: auto + type: text + tab: 'rainlab.blog::lang.post.tab_manage' + featured: + label: Featured + span: auto + type: checkbox + tab: 'rainlab.blog::lang.post.tab_manage' published_at: - tab: rainlab.blog::lang.post.tab_manage - label: rainlab.blog::lang.post.published_on + tab: 'rainlab.blog::lang.post.tab_manage' + label: 'rainlab.blog::lang.post.published_on' span: left cssClass: checkbox-align type: datepicker @@ -67,35 +63,18 @@ secondaryTabs: field: published condition: checked published: - tab: rainlab.blog::lang.post.tab_manage - label: rainlab.blog::lang.post.published + tab: 'rainlab.blog::lang.post.tab_manage' + label: 'rainlab.blog::lang.post.published' span: right type: checkbox - - user: - tab: rainlab.blog::lang.post.tab_manage - label: rainlab.blog::lang.post.published_by - span: left - type: relation - nameFrom: login - emptyOption: rainlab.blog::lang.post.current_user - excerpt: - tab: rainlab.blog::lang.post.tab_manage - label: rainlab.blog::lang.post.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 featured_image: - label: Featured image - tab: rainlab.blog::lang.post.tab_manage + label: 'Featured image' + tab: 'rainlab.blog::lang.post.tab_manage' type: mediafinder mode: image span: storm diff --git a/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_posts.php b/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_posts.php new file mode 100644 index 000000000..27a788174 --- /dev/null +++ b/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_posts.php @@ -0,0 +1,25 @@ +string('author')->nullable(); + $table->boolean('featured')->default(0); + }); + } + + public function down() + { + Schema::table('rainlab_blog_posts', function($table) + { + $table->dropColumn('author'); + $table->dropColumn('featured'); + }); + } +} diff --git a/plugins/rainlab/blog/updates/version.yaml b/plugins/rainlab/blog/updates/version.yaml index 957a442a8..5f48b5037 100644 --- a/plugins/rainlab/blog/updates/version.yaml +++ b/plugins/rainlab/blog/updates/version.yaml @@ -69,3 +69,6 @@ 1.5.3: - 'Updated table rainlab_blog_categories' - builder_table_update_rainlab_blog_categories_3.php +1.5.4: + - 'Updated table rainlab_blog_posts' + - builder_table_update_rainlab_blog_posts.php diff --git a/rss.xml b/rss.xml index 64b48dd02..cc404a3c4 100644 --- a/rss.xml +++ b/rss.xml @@ -6,6 +6,13 @@ + + В День города в Ашхабаде запустят 200 новых такси и 400 автобусов + /v-den-goroda-v-ashhabade-zapustyat-200-novyh-taksi-i-400-avtobusov + /v-den-goroda-v-ashhabade-zapustyat-200-novyh-taksi-i-400-avtobusov + Fri, 21 May 2021 13:00:00 +0500 + + Бердымухамедов поручил изучить возможность производства водорода в Туркменистане /berdymuhamedov-poruchil-izuchit-vozmozhnost-proizvodstva-vodoroda-v-turkmenistane diff --git a/themes/modern2/pages/post.htm b/themes/modern2/pages/post.htm index 65543f91e..c76349329 100644 --- a/themes/modern2/pages/post.htm +++ b/themes/modern2/pages/post.htm @@ -55,6 +55,9 @@ post = "post"
{{post.content|md}} + {% if post.author %} +

{{post.author}}

+ {% endif %}