From c3dccaa0f1b44899ee0422805dd591edff587f61 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Dec 2022 05:52:23 +0000 Subject: [PATCH] from server 16.12 --- .../controllers/api/AfishaController.php | 33 ++++ plugins/ahmadfatoni/apigenerator/routes.php | 1 + plugins/rainlab/blog/models/post/columns.yaml | 1 + plugins/tps/tps/controllers/Afisha.php | 18 +++ .../tps/controllers/afisha/_list_toolbar.htm | 18 +++ .../tps/controllers/afisha/config_form.yaml | 10 ++ .../tps/controllers/afisha/config_list.yaml | 12 ++ plugins/tps/tps/controllers/afisha/create.htm | 46 ++++++ plugins/tps/tps/controllers/afisha/index.htm | 1 + .../tps/tps/controllers/afisha/preview.htm | 22 +++ plugins/tps/tps/controllers/afisha/update.htm | 54 +++++++ plugins/tps/tps/models/Afisha.php | 31 ++++ plugins/tps/tps/models/afisha/columns.yaml | 13 ++ plugins/tps/tps/models/afisha/fields.yaml | 28 ++++ plugins/tps/tps/plugin.yaml | 5 + .../builder_table_create_tps_tps_afisha.php | 29 ++++ plugins/tps/tps/updates/version.yaml | 5 +- themes/modern2/meta/menus/new-top-menui.yaml | 42 ++--- themes/modern2/partials/newMenu/menu.htm | 144 +++++++----------- 19 files changed, 407 insertions(+), 106 deletions(-) create mode 100644 plugins/ahmadfatoni/apigenerator/controllers/api/AfishaController.php create mode 100644 plugins/tps/tps/controllers/Afisha.php create mode 100644 plugins/tps/tps/controllers/afisha/_list_toolbar.htm create mode 100644 plugins/tps/tps/controllers/afisha/config_form.yaml create mode 100644 plugins/tps/tps/controllers/afisha/config_list.yaml create mode 100644 plugins/tps/tps/controllers/afisha/create.htm create mode 100644 plugins/tps/tps/controllers/afisha/index.htm create mode 100644 plugins/tps/tps/controllers/afisha/preview.htm create mode 100644 plugins/tps/tps/controllers/afisha/update.htm create mode 100644 plugins/tps/tps/models/Afisha.php create mode 100644 plugins/tps/tps/models/afisha/columns.yaml create mode 100644 plugins/tps/tps/models/afisha/fields.yaml create mode 100644 plugins/tps/tps/updates/builder_table_create_tps_tps_afisha.php diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/AfishaController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/AfishaController.php new file mode 100644 index 000000000..a28ada337 --- /dev/null +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/AfishaController.php @@ -0,0 +1,33 @@ +Afisha = $Afisha; + $this->helpers = $helpers; + } + + public function index(){ + + $data = $this->Afisha::all(); + + return $this->helpers->apiArrayResponseBuilder(200, 'success', $data); + } + + +} diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php index f2a1adc45..637cbb3d2 100644 --- a/plugins/ahmadfatoni/apigenerator/routes.php +++ b/plugins/ahmadfatoni/apigenerator/routes.php @@ -10,6 +10,7 @@ Route::resource('{locale}/api/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\ Route::get('api/v2/categories', 'AhmadFatoni\ApiGenerator\Controllers\API\CategoriesV2Controller@index'); +Route::get('api/v2/afisha', 'AhmadFatoni\ApiGenerator\Controllers\API\AfishaController@index'); Route::get('api/version',function (){ return '2.0.8'; diff --git a/plugins/rainlab/blog/models/post/columns.yaml b/plugins/rainlab/blog/models/post/columns.yaml index 78853ae18..76881e6db 100644 --- a/plugins/rainlab/blog/models/post/columns.yaml +++ b/plugins/rainlab/blog/models/post/columns.yaml @@ -2,6 +2,7 @@ columns: id: label: ID type: text + searchable: true title: label: 'rainlab.blog::lang.post.title' type: text diff --git a/plugins/tps/tps/controllers/Afisha.php b/plugins/tps/tps/controllers/Afisha.php new file mode 100644 index 000000000..d31021017 --- /dev/null +++ b/plugins/tps/tps/controllers/Afisha.php @@ -0,0 +1,18 @@ + + + + diff --git a/plugins/tps/tps/controllers/afisha/config_form.yaml b/plugins/tps/tps/controllers/afisha/config_form.yaml new file mode 100644 index 000000000..2868fce60 --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/config_form.yaml @@ -0,0 +1,10 @@ +name: Afisha +form: $/tps/tps/models/afisha/fields.yaml +modelClass: Tps\Tps\Models\Afisha +defaultRedirect: tps/tps/afisha +create: + redirect: 'tps/tps/afisha/update/:id' + redirectClose: tps/tps/afisha +update: + redirect: tps/tps/afisha + redirectClose: tps/tps/afisha diff --git a/plugins/tps/tps/controllers/afisha/config_list.yaml b/plugins/tps/tps/controllers/afisha/config_list.yaml new file mode 100644 index 000000000..69db91a52 --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/config_list.yaml @@ -0,0 +1,12 @@ +list: $/tps/tps/models/afisha/columns.yaml +modelClass: Tps\Tps\Models\Afisha +title: Afisha +noRecordsMessage: 'backend::lang.list.no_records' +showSetup: true +showCheckboxes: true +recordsPerPage: 20 +toolbar: + buttons: list_toolbar + search: + prompt: 'backend::lang.list.search_prompt' +recordUrl: 'tps/tps/afisha/update/:id' diff --git a/plugins/tps/tps/controllers/afisha/create.htm b/plugins/tps/tps/controllers/afisha/create.htm new file mode 100644 index 000000000..20e0b6d2e --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/create.htm @@ -0,0 +1,46 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + +
+
+ + + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/controllers/afisha/index.htm b/plugins/tps/tps/controllers/afisha/index.htm new file mode 100644 index 000000000..ea43a3636 --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/index.htm @@ -0,0 +1 @@ +listRender() ?> diff --git a/plugins/tps/tps/controllers/afisha/preview.htm b/plugins/tps/tps/controllers/afisha/preview.htm new file mode 100644 index 000000000..c1e145da8 --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/preview.htm @@ -0,0 +1,22 @@ + + + + +fatalError): ?> + +
+ formRenderPreview() ?> +
+ + +

fatalError) ?>

+ + +

+ + + +

\ No newline at end of file diff --git a/plugins/tps/tps/controllers/afisha/update.htm b/plugins/tps/tps/controllers/afisha/update.htm new file mode 100644 index 000000000..945652f61 --- /dev/null +++ b/plugins/tps/tps/controllers/afisha/update.htm @@ -0,0 +1,54 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + + + +
+
+ + + +

fatalError)) ?>

+

+ \ No newline at end of file diff --git a/plugins/tps/tps/models/Afisha.php b/plugins/tps/tps/models/Afisha.php new file mode 100644 index 000000000..7448a5cff --- /dev/null +++ b/plugins/tps/tps/models/Afisha.php @@ -0,0 +1,31 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + $table->timestamp('published_at'); + $table->string('name')->nullable(); + $table->text('description'); + $table->string('img'); + $table->string('addr')->nullable(); + $table->string('phone')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('tps_tps_afisha'); + } +} diff --git a/plugins/tps/tps/updates/version.yaml b/plugins/tps/tps/updates/version.yaml index 52dd186d0..210a73f52 100644 --- a/plugins/tps/tps/updates/version.yaml +++ b/plugins/tps/tps/updates/version.yaml @@ -1,2 +1,5 @@ 1.0.1: - - Initialize plugin. \ No newline at end of file + - 'Initialize plugin.' +1.0.2: + - 'Created table tps_tps_afisha' + - builder_table_create_tps_tps_afisha.php diff --git a/themes/modern2/meta/menus/new-top-menui.yaml b/themes/modern2/meta/menus/new-top-menui.yaml index 613c845da..410cee67d 100644 --- a/themes/modern2/meta/menus/new-top-menui.yaml +++ b/themes/modern2/meta/menus/new-top-menui.yaml @@ -1,25 +1,12 @@ items: - - - title: Главная - type: url - url: / - code: '' - viewBag: - locale: - en: - title: '' - url: '' - tm: - title: '' - url: '' - isHidden: '0' - cssClass: '' - isExternal: '0' - title: Новости - type: url - url: / + nesting: 0 + type: blog-category code: '' + reference: '9' + cmsPage: new/category + replace: 0 viewBag: locale: en: @@ -36,6 +23,7 @@ items: title: События nesting: 0 type: blog-category + url: null code: '' reference: '9' cmsPage: new/category @@ -55,6 +43,7 @@ items: title: Экономика nesting: 0 type: blog-category + url: null code: '' reference: '5' cmsPage: new/category @@ -74,6 +63,7 @@ items: title: Культура nesting: 0 type: blog-category + url: null code: '' reference: '8' cmsPage: new/category @@ -91,9 +81,13 @@ items: isExternal: '0' - title: Статьи + nesting: null type: url url: / code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -107,9 +101,13 @@ items: isExternal: '0' - title: Media + nesting: null type: url url: / code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -123,9 +121,13 @@ items: isExternal: '0' - title: Афиша + nesting: null type: url url: / code: '' + reference: null + cmsPage: null + replace: null viewBag: locale: en: @@ -139,9 +141,13 @@ items: isExternal: '0' - title: Контакты + nesting: null type: cms-page + url: null code: '' reference: new/contact + cmsPage: null + replace: null viewBag: locale: en: diff --git a/themes/modern2/partials/newMenu/menu.htm b/themes/modern2/partials/newMenu/menu.htm index b6e6d9f3f..158b6b808 100644 --- a/themes/modern2/partials/newMenu/menu.htm +++ b/themes/modern2/partials/newMenu/menu.htm @@ -3,97 +3,67 @@ [staticMenu] code = "new-top-menui" == - - - - - - - + \ No newline at end of file