Merge remote-tracking branch 'origin/master'
commit
4efedc24b6
|
|
@ -11,6 +11,7 @@ use App\Transformers\Registries\RegistryTransformer;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Date;
|
||||||
|
|
||||||
class PublicationsController extends Controller {
|
class PublicationsController extends Controller {
|
||||||
protected Publication $model;
|
protected Publication $model;
|
||||||
|
|
@ -27,7 +28,10 @@ class PublicationsController extends Controller {
|
||||||
public function index(Request $request): JsonResponse {
|
public function index(Request $request): JsonResponse {
|
||||||
$query = $this->model->query()->orderBy('published_at', 'desc');
|
$query = $this->model->query()->orderBy('published_at', 'desc');
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
if (!($user->isAdmin ?? null)) $query->where(['is_published' => true]);
|
if (!($user->isAdmin ?? null)) {
|
||||||
|
$query->where(['is_published' => true]);
|
||||||
|
$query->where('published_at', '<=', now());
|
||||||
|
}
|
||||||
|
|
||||||
if ($page = Page::byUuid($request->get('page_id'))->first()) {
|
if ($page = Page::byUuid($request->get('page_id'))->first()) {
|
||||||
$query->where(['page_id' => $page->id]);
|
$query->where(['page_id' => $page->id]);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ class DictionariesTableSeeder extends Seeder {
|
||||||
'title' => 'Перечни ПП',
|
'title' => 'Перечни ПП',
|
||||||
'items' => ['pp1521' => 'ПП №1521 от 26.12.2014 г.', 'pp985' => 'ПП № 985 от 04.07.2020 г.', 'pp815' => 'ПП № 815 от 28.05.2021 г.']
|
'items' => ['pp1521' => 'ПП №1521 от 26.12.2014 г.', 'pp985' => 'ПП № 985 от 04.07.2020 г.', 'pp815' => 'ПП № 815 от 28.05.2021 г.']
|
||||||
],
|
],
|
||||||
|
'images-types' => [
|
||||||
|
'title' => 'Тип изображения',
|
||||||
|
'items' => ['full-width' => 'во всю ширину', 'tiles' => 'плиткой']
|
||||||
|
],
|
||||||
'activities' => [
|
'activities' => [
|
||||||
'title' => 'Направления деятельности',
|
'title' => 'Направления деятельности',
|
||||||
'items' => ['products' => 'Продукция в строительстве', 'services' => 'Работы и услуги', 'management' => 'СМК']
|
'items' => ['products' => 'Продукция в строительстве', 'services' => 'Работы и услуги', 'management' => 'СМК']
|
||||||
|
|
|
||||||
|
|
@ -55,22 +55,6 @@ class FieldsTableSeeder extends Seeder {
|
||||||
'required' => true
|
'required' => true
|
||||||
],
|
],
|
||||||
|
|
||||||
// 'list-type' => [
|
|
||||||
// 'title' => 'Вид списка',
|
|
||||||
// 'type' => FieldType::RELATION,
|
|
||||||
// 'required' => true,
|
|
||||||
// 'params' => [
|
|
||||||
// 'related' => DictionaryItem::class, 'transformer' => DictionaryItemTransformer::class,
|
|
||||||
// 'options' => ['show' => true, 'whereHas' => ['dictionary' => ['name' => 'list-types']]]
|
|
||||||
// ]
|
|
||||||
// ],
|
|
||||||
// 'list-items' => [
|
|
||||||
// 'title' => 'Элементы списка',
|
|
||||||
// 'type' => FieldType::TEXT,
|
|
||||||
// 'multiple' => true,
|
|
||||||
// 'required' => true
|
|
||||||
// ],
|
|
||||||
|
|
||||||
'images' => [
|
'images' => [
|
||||||
'title' => 'Изображения',
|
'title' => 'Изображения',
|
||||||
'type' => FieldType::IMAGE,
|
'type' => FieldType::IMAGE,
|
||||||
|
|
@ -82,6 +66,15 @@ class FieldsTableSeeder extends Seeder {
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'required' => true
|
'required' => true
|
||||||
],
|
],
|
||||||
|
'images-type' => [
|
||||||
|
'title' => 'Тип изображения',
|
||||||
|
'type' => FieldType::RELATION,
|
||||||
|
'required' => true,
|
||||||
|
'params' => [
|
||||||
|
'related' => DictionaryItem::class, 'transformer' => DictionaryItemTransformer::class,
|
||||||
|
'options' => ['show' => true, 'whereHas' => ['dictionary' => ['name' => 'images-types']]]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
'video-url' => [
|
'video-url' => [
|
||||||
'title' => 'Ссылка на видео',
|
'title' => 'Ссылка на видео',
|
||||||
|
|
@ -100,12 +93,6 @@ class FieldsTableSeeder extends Seeder {
|
||||||
'required' => true
|
'required' => true
|
||||||
],
|
],
|
||||||
|
|
||||||
'iframe-url' => [
|
|
||||||
'title' => 'Ссылка',
|
|
||||||
'type' => FieldType::STRING,
|
|
||||||
'required' => true
|
|
||||||
],
|
|
||||||
|
|
||||||
'contact-name' => [
|
'contact-name' => [
|
||||||
'title' => 'Наименование',
|
'title' => 'Наименование',
|
||||||
'type' => FieldType::STRING,
|
'type' => FieldType::STRING,
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,10 @@ class ObjectTypeFieldsTableSeeder extends Seeder {
|
||||||
'fields' => ['html-required']
|
'fields' => ['html-required']
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
// 'page-section-list' => [
|
|
||||||
// 'common' => [
|
|
||||||
// 'fields' => ['list-type', 'list-items']
|
|
||||||
// ]
|
|
||||||
// ],
|
|
||||||
'page-section-images' => [
|
'page-section-images' => [
|
||||||
'common' => [
|
'common' => [
|
||||||
'fields' => ['images-required']
|
'fields' => ['images-required', 'images-type']
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'page-section-documents' => [
|
'page-section-documents' => [
|
||||||
|
|
@ -50,11 +46,6 @@ class ObjectTypeFieldsTableSeeder extends Seeder {
|
||||||
'fields' => ['button-title', 'button-url']
|
'fields' => ['button-title', 'button-url']
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'page-section-iframe' => [
|
|
||||||
'common' => [
|
|
||||||
'fields' => ['iframe-url']
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'page-section-contacts' => [
|
'page-section-contacts' => [
|
||||||
'common' => [
|
'common' => [
|
||||||
'fields' => ['contact-name', 'contact-legal-address', 'contact-location-address', 'contact-email', 'contact-phone', 'contact-description']
|
'fields' => ['contact-name', 'contact-legal-address', 'contact-location-address', 'contact-email', 'contact-phone', 'contact-description']
|
||||||
|
|
|
||||||
|
|
@ -20,33 +20,38 @@ class ObjectTypesTableSeeder extends Seeder {
|
||||||
'page-section-html' => [
|
'page-section-html' => [
|
||||||
'title' => 'Текстовый блок'
|
'title' => 'Текстовый блок'
|
||||||
],
|
],
|
||||||
// 'page-section-list' => [
|
|
||||||
// 'title' => 'Список'
|
|
||||||
// ],
|
|
||||||
'page-section-images' => [
|
|
||||||
'title' => 'Изображения'
|
|
||||||
],
|
|
||||||
'page-section-documents' => [
|
'page-section-documents' => [
|
||||||
'title' => 'Документы'
|
'title' => 'Документы'
|
||||||
],
|
],
|
||||||
'page-section-video' => [
|
'page-section-media' => [
|
||||||
'title' => 'Видео'
|
'title' => 'Визуальные элементы',
|
||||||
|
'children' => [
|
||||||
|
|
||||||
|
'page-section-images' => [
|
||||||
|
'title' => 'Изображения'
|
||||||
|
],
|
||||||
|
'page-section-video' => [
|
||||||
|
'title' => 'Видео'
|
||||||
|
],
|
||||||
|
'page-section-maps' => [
|
||||||
|
'title' => 'Карта'
|
||||||
|
],
|
||||||
|
]
|
||||||
],
|
],
|
||||||
'page-section-button' => [
|
'page-section-interactive' => [
|
||||||
'title' => 'Кнопка'
|
'title' => 'Интерактивные элементы',
|
||||||
|
'children' => [
|
||||||
|
'page-section-button' => [
|
||||||
|
'title' => 'Кнопка'
|
||||||
|
],
|
||||||
|
'page-section-contacts' => [
|
||||||
|
'title' => 'Контактная информация'
|
||||||
|
],
|
||||||
|
'page-section-feedback' => [
|
||||||
|
'title' => 'Форма обратной связи'
|
||||||
|
],
|
||||||
|
]
|
||||||
],
|
],
|
||||||
'page-section-iframe' => [
|
|
||||||
'title' => 'Интерактивное окно'
|
|
||||||
],
|
|
||||||
'page-section-contacts' => [
|
|
||||||
'title' => 'Контактная информация'
|
|
||||||
],
|
|
||||||
'page-section-feedback' => [
|
|
||||||
'title' => 'Форма обратной связи'
|
|
||||||
],
|
|
||||||
'page-section-maps' => [
|
|
||||||
'title' => 'Карта'
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue