Skip to content

Commit

Permalink
Merge pull request #11 from secondnetwork/feature-post-section
Browse files Browse the repository at this point in the history
Feature post section
  • Loading branch information
secondnetwork authored Oct 5, 2023
2 parents 5fa7edd + 6fb4890 commit 41b0f39
Show file tree
Hide file tree
Showing 23 changed files with 1,374 additions and 173 deletions.
2 changes: 2 additions & 0 deletions config/kompass.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
'adminmenu' => Livewire\Menu::class,
'blocks.blocks-table' => Livewire\BlocksTable::class,
'blocks.blocks-data' => Livewire\BlocksData::class,
'pages.posts-table' => Livewire\PostsTable::class,
'pages.posts-show' => Livewire\PostsData::class,
'pages.pages-table' => Livewire\PagesTable::class,
'pages.pages-show' => Livewire\PagesData::class,
'menus.menus-table' => Livewire\MenuTable::class,
Expand Down
28 changes: 18 additions & 10 deletions resources/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@ import '/resources/css/kompass.css'

import click_to_edit from './alpine/click_to_edit'

// import * as livewiresortable from './livewire.sortable';
import * as livewiresortable from './livewire.sortable';

// import * as editorjs from './editorjs';
import * as editorjs from './editorjs';
// const { livewiresortable } = import('./livewire.sortable');

// const { editorjs } = import('./editorjs');

document.addEventListener('livewire:initialized', () => {
const { livewiresortable } = import('./livewire.sortable');
// document.addEventListener('livewire:init', () => {
// livewiresortable();
// editorjs()
// console.log('go');

const { editorjs } = import('./editorjs');
})
// })
// Alpine.start();
// Livewire.start();
// if (document.getElementsByClassName('kompass-admin-dashboard')) {

// livewiresortable();
// if (document.getElementById('parent')) {
// const { app } = import('./plugins/lite-yt-embed')
// app();
// livewiresortable();
// editorjs()

// console.log('goss');
// // const { app } = import('./plugins/lite-yt-embed')
// // app();
// }
window.click_to_edit = click_to_edit;
4 changes: 3 additions & 1 deletion resources/views/admin/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

</div>


<p class="alert alert-warning" wire:offline>
Whoops, your device has lost connection. The web page you are viewing is offline.
</p>

</div>
</div>
Expand Down
22 changes: 6 additions & 16 deletions resources/views/admin/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@if(isset($seo->description))
<meta name="description" content="{{ $seo->description }}">
@endif

@livewireStyles
@kompassCss

</head>
Expand Down Expand Up @@ -82,33 +82,24 @@

<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.dashboard')) class="active" @endif href="/admin/dashboard"><x-tabler-chalkboard class="icon-lg"/><span >Dashboard</span></a></li>

{{-- <li class="sidenav__list-item"><a href="/admin/posts"><x-tabler-news class="icon-lg"/><span>{{ __('Posts') }}</span></a></li> --}}
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.posts*')) class="active" @endif href="/admin/posts"><x-tabler-news class="icon-lg"/><span>{{ __('Posts') }}</span></a></li>
<li class="sidenav__list-item "><a wire:navigate @if(Route::is('admin.pages*')) class="active" @endif href="/admin/pages"><x-tabler-file-text class="icon-lg"/><span>{{ __('Pages') }}</span></a></li>

{{-- <livewire:adminmenu name="admin-sidebar-top"> --}}


<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.medialibrary')) class="active" @endif href="/admin/medialibrary"><x-tabler-photo class="icon-lg"/><span>{{ __('Media library') }}</span></a></li>
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.medialibrary')) class="active" @endif href="/admin/medialibrary"><x-tabler-photo-video class="icon-lg"/><span>{{ __('Media library') }}</span></a></li>
<div class="uppercase text-xs mt-5 px-6 text-gray-500 font-semibold">{{ __('Theme') }}</div>

<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.blocks*')) class="active" @endif href="/admin/blocks"><x-tabler-layout-grid-add class="icon-lg"/><span>{{ __('Block') }}</span></a></li>
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.menus*') ) class="active" @endif href="/admin/menus"><x-tabler-layout-navbar class="icon-lg"/><span>{{ __('Menu') }}</span></a></li>
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.settings*') ) class="active" @endif href="/admin/settings"><x-tabler-settings class="icon-lg"/><span>{{ __('Settings') }}</span></a></li>


@canany(['admin','user'])

@endcanany
@role('admin')
<div class="uppercase text-xs mt-5 px-6 text-gray-500 font-semibold">{{ __('Permissions') }}</div>
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.account*') ) class="active" @endif href="/admin/account"><x-tabler-users class="icon-lg"/><span>{{ __('User account') }}</span></a></li>
<li class="sidenav__list-item"><a wire:navigate @if(Route::is('admin.roles*') ) class="active" @endif href="/admin/roles"><x-tabler-lock-access class="icon-lg"/><span>{{ __('Manage Role') }}</span></a></li>


{{-- @canany(['update', 'view', 'delete'])
// This user can update, view, or delete
@elsecanany(['admin', 'user'])
// This user can create
@endcanany --}}
@endrole

<li class="sidenav__list-item mt-8"><a wire:navigate @if(Route::is('admin.about*') ) class="active" @endif href="/admin/about"><x-tabler-signature class="icon-lg"/><span>{{ __('About') }}</span></a></li>
</ul>
Expand Down Expand Up @@ -147,8 +138,7 @@
</main>
</page-main>

{{-- <wireui:scripts /> --}}
{{-- @wireUiScripts --}}
@livewireScripts
@kompassJs
@stack('scripts')

Expand Down
34 changes: 9 additions & 25 deletions resources/views/components/blocks.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
<div class="relative">

<img on="pages.pages-show" alt="logo" class="w-full aspect-[4/3] object-cover rounded-xl"
src="{{ asset('storage/' . $file->path . '/' . $file->slug . '_small.' . $file->extension) }}">
src="{{ asset('storage/' . $file->path . '/' . $file->slug . '.' . $file->extension) }}">
<action-button class="absolute flex justify-between items-center w-full bottom-0 right-0 z-10 p-3 gap-1 bg-gray-100/80 ">
<div class="text-xs font-semibold truncate">{{ $file->name }}</div>
<div class="flex">
<span wire:click="removemedia({{ $idField }})">
<x-tabler-trash class="cursor-pointer stroke-current text-red-500 " />
</span>
<span wire:click="selectItem({{ $idField }}, 'addMedia')"">
<span wire:click="selectitem('addMedia','{{ $type }}',{{ $blockId }})">
<x-tabler-edit class=" cursor-pointer stroke-current text-blue-500 " />
</span>
</div>
Expand All @@ -77,14 +77,10 @@

</div>
@endif
@else
<img-block wire:click=" selectItem({{ $idField }}, 'addMedia' ,{{ $blockId }})"
class="cursor-pointer grid place-content-center border-2 border-dashed border-gray-400 rounded-2xl text-gray-400 aspect-[4/3] ">
<x-tabler-photo-plus class="h-[4rem] w-[4rem] stroke-[1.5]" />
</img-block>

@endif
@else
<img-block wire:click="selectItem({{ $idField }}, 'addMedia',{{ $blockId }})"
<img-block wire:click="selectitem('addMedia',{{ $idField }},'{{ $type }}',{{ $blockId }})"
class="cursor-pointer grid place-content-center border-2 border-dashed border-gray-400 rounded-2xl text-gray-400 aspect-[4/3] ">
<x-tabler-photo-plus class="h-[4rem] w-[4rem] stroke-[1.5]" />
</img-block>
Expand All @@ -104,36 +100,24 @@ class="cursor-pointer grid place-content-center border-2 border-dashed border-gr
<div class="relative">

<img on="pages.pages-show" alt="logo" class="w-full aspect-[4/3] object-cover rounded-xl"
src="{{ asset('storage/' . $file->path . '/' . $file->slug . '_small.' . $file->extension) }}">
src="{{ asset('storage/' . $file->path . '/' . $file->slug . '.' . $file->extension) }}">
<action-button class="absolute flex justify-between items-center w-full bottom-0 right-0 z-10 p-3 gap-1 bg-gray-100/80 ">
<div class="text-xs font-semibold truncate">{{ $file->name }}</div>
<div class="flex">
<span wire:click="removemediaIngallery({{ $idField }})">
<x-tabler-trash class="cursor-pointer stroke-current text-red-500 " />
</span>
<span wire:click="selectItem({{ $idField }}, 'addMedia')">

<span wire:click="selectitem( 'addMedia', {{ $idField }})">
<x-tabler-edit class=" cursor-pointer stroke-current text-blue-500 " />
</span>
</div>
</action-button>



</div>


@endif
@else
<img-block wire:click=" selectItem({{ $idField }}, 'addMedia ' ,{{ $blockId }})"
class="cursor-pointer grid place-content-center border-2 border-dashed border-gray-400 rounded-xl w-full text-gray-400 aspect-[4/3] ">
<x-tabler-photo-plus class="h-[4rem] w-[4rem] stroke-[1.5]" />
</img-block>
@endif
@endif
@else
<img-block wire:click="selectItem({{ $idField }}, 'addMedia' ,{{ $blockId }})"
class="cursor-pointer grid place-content-center border-2 border-dashed border-gray-400 rounded-xl w-full text-gray-400 aspect-[4/3] ">
<x-tabler-photo-plus class="h-[4rem] w-[4rem] stroke-[1.5]" />
</img-block>

@endif
@endif

Expand Down
9 changes: 5 additions & 4 deletions resources/views/components/blocksgroup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing

<div class="flex items-center gap-1">
@if ($type == 'group')
<span wire:click="selectitem({{ $page->id }}, 'addBlock', {{ $itemblocks->id }})">
<span wire:click="selectitem('addBlock', {{ $itemblocks->id }},'page',{{ $itemblocks->id }})">
<x-tabler-layout-grid-add class="cursor-pointer stroke-current h-6 w-6 text-blue-600" />
</span>
@if ($itemblocks->status == 'published')
Expand All @@ -85,7 +85,7 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing
<x-tabler-eye-off class="cursor-pointer stroke-current h-6 w-6 text-red-500" />
</span>
@endif
<span wire:click="selectitem({{ $itemblocks->id }}, 'deleteblock')" class="flex justify-center">
<span wire:click="selectitem('deleteblock', {{ $itemblocks->id }})" class="flex justify-center">
<x-tabler-trash class="cursor-pointer stroke-current h-6 w-6 text-red-500" />
</span>
@endif
Expand All @@ -104,7 +104,7 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing
<x-tabler-copy class="cursor-pointer h-6 w-6 stroke-violet-500" />
</span>

<span wire:click="selectitem({{ $itemblocks->id }}, 'deleteblock')" class="flex justify-center">
<span wire:click="selectitem('deleteblock',{{ $itemblocks->id }})" class="flex justify-center">
<x-tabler-trash class="cursor-pointer stroke-current h-6 w-6 text-red-500" />
</span>
<div class="flex items-center gap-2">
Expand Down Expand Up @@ -140,7 +140,8 @@ class="transform transition-transform duration-500">
</x-kompass::blocks>
@endif
@endforeach
<img-block wire:click="selectitem(0, 'addMedia' ,{{ $itemblocks->id }})"

<img-block wire:click="selectitem('addMedia',0,'gallery',{{ $itemblocks->id }})"
class="cursor-pointer grid place-content-center border-2 border-dashed border-gray-400 rounded-2xl w-full text-gray-400 aspect-[4/3] ">
<x-tabler-photo-plus class="h-[4rem] w-[4rem] stroke-[1.5]" />
</img-block>
Expand Down
23 changes: 0 additions & 23 deletions resources/views/components/rich-text/quill.blade.php

This file was deleted.

12 changes: 6 additions & 6 deletions resources/views/livewire/pages/pages-show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class="grid place-content-center border-2 border-dashed border-gray-300 rounded-
@endforelse
<div class="flex justify-end my-6">
<button class="btn"
wire:click="selectitem({{ $page->id }}, 'addBlock')">{{ __('Add') }}</button>
wire:click="selectitem('addBlock',{{ $page->id }})">{{ __('Add') }}</button>
</div>


Expand Down Expand Up @@ -211,7 +211,7 @@ class="grid place-content-center border-2 border-dashed border-gray-300 rounded-
<div class="grid grid-cols-4">
@foreach ($blocktemplates as $itemblock)
<div class="bg-gray-300 rounded-lg p-2 m-2 cursor-pointer"
wire:click.defer="addBlock({{ $page['id'] }},{{ $itemblock['id'] }},'{{ $itemblock['name'] }}','{{ $itemblock['slug'] }}',{{ $itemblock['grid'] }})">
wire:click.defer="addBlock({{ $itemblock['id'] }},'{{ $itemblock['name'] }}','{{ $itemblock['slug'] }}',{{ $itemblock['grid'] }})">
@if ($itemblock['icon_img_path'])
<img class=" w-full border-gray-200 border-solid border-2 rounded object-cover"
src="{{ asset('storage/' . $itemblock['icon_img_path']) }}" alt="">
Expand All @@ -220,25 +220,25 @@ class="grid place-content-center border-2 border-dashed border-gray-300 rounded-
</div>
@endforeach
<div class="bg-gray-300 rounded-lg p-2 m-2 cursor-pointer"
wire:click.defer="addBlock({{ $page['id'] }},'','Textblock','wysiwyg','1','wysiwyg')">
wire:click.defer="addBlock('','Textblock','wysiwyg','1','wysiwyg')">
<img src="{{ kompass_asset('icons-blocks/default.png') }}" alt="">
<span class="text-xs block mt-2">Textblock</span>
</div>

<div class="bg-gray-300 rounded-lg p-2 m-2 cursor-pointer"
wire:click.defer="addBlock({{ $page['id'] }},'','Gallery','gallery','1','gallery')">
wire:click.defer="addBlock('','Gallery','gallery','1','gallery')">
<img class="rounded" src="{{ kompass_asset('icons-blocks/gallery.png') }}" alt="">
<span class="text-xs block mt-2">Gallery</span>
</div>

<div class="bg-gray-300 rounded-lg p-2 m-2 cursor-pointer"
wire:click.defer="addBlock({{ $page['id'] }},'','Group','group','1','group')">
wire:click.defer="addBlock('','Group','group','1','group')">
<img src="{{ kompass_asset('icons-blocks/group.png') }}" alt="">
<span class="text-xs block mt-2">Layout Block</span>
</div>

<div class="bg-gray-300 rounded-lg p-2 m-2 cursor-pointer"
wire:click.defer="addBlock({{ $page['id'] }},'','Accordion Group','group','1','accordiongroup')">
wire:click.defer="addBlock('','Accordion Group','group','1','accordiongroup')">
<img src="{{ kompass_asset('icons-blocks/accordion.png') }}" alt="">
<span class="text-xs block mt-2">Accordion Group</span>
</div>
Expand Down
Loading

0 comments on commit 41b0f39

Please sign in to comment.