from server 16.12

This commit is contained in:
root 2022-12-16 05:52:23 +00:00
parent 0d28519d5a
commit c3dccaa0f1
19 changed files with 407 additions and 106 deletions

View File

@ -0,0 +1,33 @@
<?php namespace AhmadFatoni\ApiGenerator\Controllers\API;
use Cms\Classes\Controller;
use BackendMenu;
use DB;
use Config;
use Illuminate\Http\Request;
use AhmadFatoni\ApiGenerator\Helpers\Helpers;
use Illuminate\Support\Facades\Validator;
use Tps\Tps\Models\Afisha;
class AfishaController extends Controller
{
protected $Afisha;
protected $helpers;
public function __construct(Afisha $Afisha, Helpers $helpers)
{
parent::__construct();
$this->Afisha = $Afisha;
$this->helpers = $helpers;
}
public function index(){
$data = $this->Afisha::all();
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
}
}

View File

@ -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';

View File

@ -2,6 +2,7 @@ columns:
id:
label: ID
type: text
searchable: true
title:
label: 'rainlab.blog::lang.post.title'
type: text

View File

@ -0,0 +1,18 @@
<?php namespace Tps\Tps\Controllers;
use Backend\Classes\Controller;
use BackendMenu;
class Afisha extends Controller
{
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';
public function __construct()
{
parent::__construct();
BackendMenu::setContext('Tps.Tps', 'main-menu-item');
}
}

View File

@ -0,0 +1,18 @@
<div data-control="toolbar">
<a href="<?= Backend::url('tps/tps/afisha/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></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('backend::lang.list.delete_selected_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>
</div>

View File

@ -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

View File

@ -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'

View File

@ -0,0 +1,46 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/tps/afisha') ?>">Afisha</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.create')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.create_and_close')) ?>
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/tps/afisha') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('tps/tps/afisha') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1 @@
<?= $this->listRender() ?>

View File

@ -0,0 +1,22 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/tps/afisha') ?>">Afisha</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<div class="form-preview">
<?= $this->formRenderPreview() ?>
</div>
<?php else: ?>
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
<?php endif ?>
<p>
<a href="<?= Backend::url('tps/tps/afisha') ?>" class="btn btn-default oc-icon-chevron-left">
<?= e(trans('backend::lang.form.return_to_list')) ?>
</a>
</p>

View File

@ -0,0 +1,54 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('tps/tps/afisha') ?>">Afisha</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-request-data="redirect:0"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.save')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.save_and_close')) ?>
</button>
<button
type="button"
class="oc-icon-trash-o btn-icon danger pull-right"
data-request="onDelete"
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/tps/afisha') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('tps/tps/afisha') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1,31 @@
<?php namespace Tps\Tps\Models;
use Model;
/**
* Model
*/
class Afisha extends Model
{
use \October\Rain\Database\Traits\Validation;
public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];
public $translatable = [
'name',
'description',
'addr',
];
/**
* @var string The database table used by the model.
*/
public $table = 'tps_tps_afisha';
/**
* @var array Validation rules
*/
public $rules = [
];
}

View File

@ -0,0 +1,13 @@
columns:
id:
label: id
type: number
name:
label: name
type: text
addr:
label: addr
type: text
phone:
label: phone
type: text

View File

@ -0,0 +1,28 @@
fields:
name:
label: Name
span: auto
type: text
img:
label: Image
mode: file
span: auto
type: mediafinder
addr:
label: Address
span: auto
type: text
phone:
label: Phone
span: auto
type: text
published_at:
label: 'Published At'
mode: datetime
span: auto
type: datepicker
description:
label: Desc
size: large
span: auto
type: richeditor

View File

@ -4,3 +4,8 @@ plugin:
author: TPS
icon: oc-icon-adn
homepage: ''
navigation:
main-menu-item:
label: Afisha
url: tps/tps/afisha
icon: icon-life-ring

View File

@ -0,0 +1,29 @@
<?php namespace Tps\Tps\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateTpsTpsAfisha extends Migration
{
public function up()
{
Schema::create('tps_tps_afisha', function($table)
{
$table->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');
}
}

View File

@ -1,2 +1,5 @@
1.0.1:
- Initialize plugin.
- 'Initialize plugin.'
1.0.2:
- 'Created table tps_tps_afisha'
- builder_table_create_tps_tps_afisha.php

View File

@ -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:

View File

@ -3,97 +3,67 @@
[staticMenu]
code = "new-top-menui"
==
<!-- {% for item in staticMenu.menuItems %}
{% if not item.isHidden and item.items|length %}
<li>
<span class="service_nav-link">
{{ item.title }}
</span>
<div class="service_nav">
{% for item in item.items %}
<a href="{{ item.url }}">{{ item.title }}</a>
{% endfor %}
</div>
</li>
{% elseif not item.viewBag.isHidden %}
<li>
<a href="{{ item.url }}">
{{ item.title }}
</a>
</li>
{% endif %}
{% endfor %} -->
<nav class="nav removed-mq">
<div class="container">
<div class="nav-inner">
<div class="nav-left">
<ul class="nav-ul">
{% for item in staticMenu.menuItems %}
{% if not item.isHidden %}
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="nav-right">
<a href="https://ogt-turkmenistan.com" target="_blank" class="nav-right-link">OGT</a>
<ul class="nav-lang">
<li>
<a href="#">
<div class="lang-country">
<img src="{{ 'assets/new/icons/ukflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a href="#">
<div class="lang-country">
<img src="{{ 'assets/new/icons/tmflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a href="#">
<div class="lang-country">
<img src="{{ 'assets/new/icons/ruflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
<section class="nav-bottom">
<div class="container">
<div class="nav-bottom-inner">
<ul>
<nav class="nav">
<section class="nav-top">
<div class="container">
<div class="nav-inner">
<div class="nav-left">
<ul class="nav-ul">
{% for item in staticMenu.menuItems %}
{% if not item.isHidden and item.items|length %}
{% for item in item.items %}
<li><a href="{{ item.url }}" class="{% if(item.isChildActive) %} active {% endif %} ">{{ item.title }}</a></li>
{% endfor %}
<li>
<span class="nav-section-span {% if(item.isChildActive) %} active {% endif %}">{{ item.title }}</span>
<ul class="nav-section-dropdown active">
{% for item in item.items %}
<li><a href="{{ item.url }}" class="{% if (item.isActive) %} active {% endif %} ">{{ item.title }}</a></li>
{% endfor %}
</ul>
</li>
{% elseif not item.viewBag.isHidden %}
<li>
<span class="nav-section-span {% if (item.isActive) %} active {% endif %} "> <a href="{{ item.url }}">{{ item.title }}</a></span>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="nav-right">
<a class="nav-right-link">OGT</a>
<ul class="nav-lang">
<li>
<a href="#">
<div class="lang-country">
<img src="{{'assets/new/icons/ukflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a href="#">
<div class="lang-country">
<img src="{{'assets/new/icons/tmflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
<li>
<a href="#">
<div class="lang-country">
<img src="{{'assets/new/icons/ruflag.svg'|theme}}" alt="" />
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</section>
</nav>