Skip to content

Commit

Permalink
Merge pull request #13 from secondnetwork/feature-post-section
Browse files Browse the repository at this point in the history
Feature post section 2
  • Loading branch information
secondnetwork authored Oct 8, 2023
2 parents b2afcea + c93ce2c commit 94550f6
Show file tree
Hide file tree
Showing 38 changed files with 272 additions and 168 deletions.
2 changes: 0 additions & 2 deletions app/Providers/KompassServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace App\Providers;

use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use Laravel\Fortify\Fortify;
use Secondnetwork\Kompass\Models\Role;

class KompassServiceProvider extends ServiceProvider
{
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
"blade-ui-kit/blade-icons": "^1.5.2",
"illuminate/support": "^10.21",
"intervention/image": "^2.7.2",
"laravel/fortify": "^1.17.5",
"livewire/livewire": "^3.0.1",
"secondnetwork/blade-tabler-icons": "^2.32",
"symfony/http-client": "^6.3.2",
"symfony/mailgun-mailer": "^6.3.2"
"laravel/folio": "^1.1.2",
"laravel/fortify": "^1.18.0",
"livewire/livewire": "^3.0.5",
"livewire/volt": "^1.3.3",
"secondnetwork/blade-tabler-icons": "^2.37",
"symfony/http-client": "^6.3.5",
"symfony/mailgun-mailer": "^6.3.5"
},
"require-dev": {
"fakerphp/faker": "^1.23.0",
"laravel/pint": "^1.12.0",
"laravel/pint": "^1.13.2",
"mockery/mockery": "^1.6.6",
"phpunit/phpunit": "^10.3.2",
"phpunit/phpunit": "^10.4.1",
"spatie/laravel-ignition": "^2.3.0"
},
"autoload": {
Expand Down
17 changes: 17 additions & 0 deletions public/assets/build/css/kompass.13dfd741.css

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions public/assets/build/css/kompass.4dc3cf23.css

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions public/assets/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"file": "js/vendor.4259223b.js"
},
"resources/css/kompass.css": {
"file": "css/kompass.4dc3cf23.css",
"file": "css/kompass.13dfd741.css",
"isEntry": true,
"src": "resources/css/kompass.css"
},
"resources/js/main.js": {
"css": [
"css/kompass.4dc3cf23.css"
"css/kompass.13dfd741.css"
],
"file": "js/main.436795f1.js",
"file": "js/main.497f8671.js",
"imports": [
"_vendor.4259223b.js"
],
Expand Down
Binary file modified public/assets/icons-blocks/accordion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/icons-blocks/accordiongroup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/icons-blocks/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/icons-blocks/group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/css/blocks/blockitem.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.ce-block__content,
.ce-toolbar__content {
max-width: unset;
}

.itemblock {
background-color: #fff;
&.sort-ghost {
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/de/kompass.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
'Team Settings' => 'ST',
'Forgot your password?' => 'PAASSSSjdagjkb',
'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.',
'Invitation to access website' =>'Einladung zum Zugriff von Webseite'
'Invitation to access website' => 'Einladung zum Zugriff von Webseite',
];
61 changes: 37 additions & 24 deletions resources/views/components/blocksgroup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,56 @@
'page' => '',
'class' => '',
])
@php

$type = $itemblocks->set->type ?? '';

@endphp
<div class="{{ $class }} @if ($itemblocks->subgroup) group-block border-purple-600 @endif border-b-2 "
wire:sortable.item="{{ $itemblocks->id }}"
@if ($itemblocks->subgroup) wire:sortable-group.item="{{ $itemblocks->id }}" wire:key="group-{{ $itemblocks->id }}"
@else
wire:sortable.item="{{ $itemblocks->id }}" wire:key="group-{{ $itemblocks->id }}" @endif
x-data="{ expanded: false }">

<div-nav-action class="flex items-center justify-between border-b border-gray-200 px-4">
<div-nav-action class="flex items-center justify-between border-b border-gray-200 px-4"

@if ($itemblocks->type == 'group' || $itemblocks->type == 'accordiongroup') :class="'bg-slate-200 border-slate-600'" @endif
>
<span class="flex items-center py-2 w-full ">
@if ($itemblocks->subgroup)
<x-tabler-grip-vertical wire:sortable-group.handle
<span wire:sortable-group.handle>
<x-tabler-grip-vertical
class="cursor-move stroke-current h-6 w-6 mr-1 text-gray-900" />
</span>
@else
<x-tabler-grip-vertical wire:sortable.handle
<span wire:sortable.handle>
<x-tabler-grip-vertical
class="cursor-move stroke-current h-6 w-6 mr-1 text-gray-900" />
</span>
@endif

<span @click="expanded = ! expanded"
class="text-xs inline-flex items-center gap-1.5 py-1 px-1 capitalize rounded font-semibold text-gray-400 cursor-pointer">
@if ($itemblocks->iconclass)
@switch($itemblocks->type)
@case('group')
<x-tabler-template class="cursor-pointer stroke-current h-6 w-6 text-violet-600" />
@break
@case('accordiongroup')
<x-tabler-layout-list class="cursor-pointer stroke-current h-6 w-6 text-violet-600" />
@break
@default
@if ($itemblocks->iconclass)
@svg('tabler-' . $itemblocks->iconclass, 'w-5')
@else
@svg('tabler-section', 'w-5')
@endif
{{-- {{ $itemblocks->slug }} --}}
@else
@svg('tabler-section', 'w-5')
@endif
@endswitch



</span>
<span class="inline-block border-r border-gray-400 w-px h-5 ml-1 mr-2"></span>
<div x-data="click_to_edit()" class="w-11/12 flex items-center">
<a @click.prevent @click="toggleEditingState" x-show="!isEditing"
class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing = false">
@if ($type == 'group')
<x-tabler-stack class="cursor-pointer stroke-current h-6 w-6 text-green-600" />
@endif

<span class="text-sm font-semibold">{{ $itemblocks->name }}</span>
{{-- <span><x-tabler-edit class="cursor-pointer stroke-current h-6 w-6 text-gray-400 hover:text-blue-500" /></span> --}}
</a>
Expand All @@ -54,7 +65,7 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing

<div x-show=isEditing class="flex items-center" x-data="{ id: '{{ $itemblocks->id }}', name: '{{ $itemblocks->name }}' }">

<input type="text" class="px-1 border border-gray-400" x-model="name" wire:model.lazy="newName"
<input type="text" class="border border-gray-400 px-1 py-1 text-sm font-semibold" x-model="name" wire:model.lazy="newName"
x-ref="input" x-on:keydown.enter="isEditing = false" x-on:keydown.escape="isEditing = false"
{{-- @keydown.window.escape="disableEditing" --}} x-on:click.away="isEditing = false"
wire:keydown.enter="savename({{ $itemblocks->id }})">
Expand All @@ -72,7 +83,10 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing
</span>

<div class="flex items-center gap-1">
@if ($type == 'group')
@if ($itemblocks->type == 'group' || $itemblocks->type == 'accordiongroup')
<span @click="expanded = ! expanded">
<x-tabler-adjustments/>
</span>
<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>
Expand All @@ -88,8 +102,8 @@ class="flex items-center select-none cursor-text" x-on:keydown.escape="isEditing
<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
@if ($type != 'group')

@else
@if ($itemblocks->status == 'published')
<span wire:click="status({{ $itemblocks->id }}, 'draft')">
<x-tabler-eye class="cursor-pointer stroke-current h-6 w-6 text-gray-400" />
Expand Down Expand Up @@ -118,16 +132,15 @@ class="transform transition-transform duration-500">

</div-nav-action>

<div @if ($type !== 'group') x-show="expanded" x-collapse @endif>
<nav class="px-6 py-2 bg-gray-200 shadow-inner shadow-black/20 flex items-center gap-6 @if ($type == 'group') border-b-4 border-purple-700 @endif">
{{-- <span class="text-sm font-medium px-2.5 py-0.5 rounded bg-yellow-900 text-yellow-300">Dev</span> --}}
<div x-show="expanded" x-collapse>
<nav class="px-6 py-2 bg-gray-200 shadow-inner shadow-black/20 flex items-center gap-6 @if ($itemblocks->type == 'group' || $itemblocks->type == 'accordiongroup') border-b-4 border-purple-700 @endif">

<x-kompass::nav-item :itemblocks="$itemblocks" />

</nav>
<div class="@if ($type !== 'group')grid gap-6 p-6 grid-cols-{{ $itemblocks->grid }} @endif" >
<div class="grid gap-6 p-6 grid-cols-{{ $itemblocks->grid }} @if ($itemblocks->type == 'group' || $itemblocks->type == 'accordiongroup') p-0 @endif" >

@switch($type)
@switch($itemblocks->type)
@case('gallery')
<div class="@container">
<div class="grid @sm:grid-cols-1 @lg:grid-cols-3 @3xl:grid-cols-4 gap-6">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/blocksgroupsub.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

@foreach ($childrensub as $childitem )

<x-kompass::blocksgroup :itemblocks="$childitem" :fields="$fields" :page="$page" class="itemblock shadow border-r-4 border-purple-500"/>
<x-kompass::blocksgroup :itemblocks="$childitem" :fields="$fields" :page="$page" class="itemblock shadow border-purple-500"/>

@endforeach
2 changes: 1 addition & 1 deletion resources/views/components/menugroup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<input
type="text"
class="px-1 border border-gray-400"
class="border border-gray-400 px-1 py-1 text-sm font-semibold"
x-model="name"
wire:model.lazy="newName" x-ref="input"
x-on:keydown.enter="isEditing = false"
Expand Down
11 changes: 4 additions & 7 deletions resources/views/components/nav-item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@


@php

$layout = $itemblocks->set->layout ?? '';
$alignment = $itemblocks->set->alignment ?? '';
$slider = $itemblocks->set->slider ?? '';
$type = $itemblocks->set->type ?? '';
@endphp

<nav-item class="flex items-center gap-2">
<span class="text-sm font-medium px-2.5 py-0.5 rounded bg-gray-300">Layout</span>
<span class="cursor-pointer" wire:click="saveset({{ $itemblocks->id }},'layout', '')">
Expand All @@ -37,8 +34,8 @@
<x-tabler-arrow-autofit-width />
@endif
</span>
</nav-item>
@if ($type == 'group')
</nav-item>
@if ($itemblocks->type == 'group' || $itemblocks->type == 'accordiongroup')
<nav-item class="flex items-center gap-2">
<span class="text-sm font-medium px-2.5 py-0.5 rounded bg-gray-300">Grid</span>
<span class="cursor-pointer" x-data wire:click="updateGrid({{ $itemblocks->id }}, '1')">
Expand Down Expand Up @@ -78,7 +75,7 @@
</span>
</nav-item>
@endif
@if ($type == 'wysiwyg')
@if ($itemblocks->type == 'wysiwyg')
<nav-item class="flex items-center gap-2">
<span class="text-sm font-medium px-2.5 py-0.5 rounded bg-gray-300 ">{{ __('Alignment') }}</span>
<span class="cursor-pointer" wire:click="saveset({{ $itemblocks->id }},'alignment', 'left')">
Expand All @@ -98,7 +95,7 @@

</nav-item>
@endif
@if ($type == 'gallery')
@if ($itemblocks->type == 'gallery')
<nav-item class="flex items-center gap-2">
<span class="text-sm font-medium px-2.5 py-0.5 rounded bg-gray-300 ">Slider</span>
<span class="cursor-pointer" wire:click="saveset({{ $itemblocks->id }},'slider', '')">
Expand Down
68 changes: 68 additions & 0 deletions resources/views/components/popover.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<div x-data="{
popoverOpen: false,
popoverArrow: true,
popoverPosition: 'bottom',
popoverHeight: 0,
popoverOffset: 8,
popoverHeightCalculate() {
this.$refs.popover.classList.add('invisible');
this.popoverOpen=true;
let that=this;
$nextTick(function(){
that.popoverHeight = that.$refs.popover.offsetHeight;
that.popoverOpen=false;
that.$refs.popover.classList.remove('invisible');
that.$refs.popoverInner.setAttribute('x-transition', '');
that.popoverPositionCalculate();
});
},
popoverPositionCalculate(){
if(window.innerHeight < (this.$refs.popoverButton.getBoundingClientRect().top + this.$refs.popoverButton.offsetHeight + this.popoverOffset + this.popoverHeight)){
this.popoverPosition = 'top';
} else {
this.popoverPosition = 'bottom';
}
}
}"
x-init="
that = this;
window.addEventListener('resize', function(){
popoverPositionCalculate();
});
$watch('popoverOpen', function(value){
if(value){ popoverPositionCalculate(); document.getElementById('width').focus(); }
});
"
class="relative">

<button x-ref="popoverButton" @click="popoverOpen=!popoverOpen" class="flex items-center justify-center ">
<x-tabler-adjustments/>
</button>

<div x-ref="popover"
x-show="popoverOpen"
x-init="setTimeout(function(){ popoverHeightCalculate(); }, 100);"
x-trap.inert="popoverOpen"
@click.away="popoverOpen=false;"
@keydown.escape.window="popoverOpen=false"
:class="{ 'top-0 mt-8' : popoverPosition == 'bottom', 'bottom-0 mb-12' : popoverPosition == 'top' }"
class="absolute w-[300px] max-w-lg right-0 z-20 overflow-hidden" x-cloak>
<div x-ref="popoverInner" x-show="popoverOpen" class="w-full p-4 bg-white border rounded-md shadow-sm border-blue-400">
{{-- <div x-show="popoverArrow && popoverPosition == 'bottom'" class="absolute top-0 inline-block w-5 mt-px overflow-hidden -translate-x-2 -translate-y-2.5 right-0"><div class="w-2.5 h-2.5 origin-bottom-left transform rotate-45 bg-white border-t border-l rounded-sm"></div></div>
<div x-show="popoverArrow && popoverPosition == 'top'" class="absolute bottom-0 inline-block w-5 mb-px overflow-hidden -translate-x-2 right-0"><div class="w-2.5 h-2.5 origin-top-left transform -rotate-45 bg-white border-b border-l rounded-sm"></div></div> --}}
<div class="grid gap-4">
{{-- <div class="space-y-2">
<h4 class="font-medium leading-none">Dimensions</h4>
<p class="text-sm text-muted-foreground">Set the dimensions for the layer.</p>
</div> --}}
<div class="grid gap-2">
{{$slot}}
{{-- <div class="grid items-center grid-cols-3 gap-4"><label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="width">Width</label><input class="flex w-full h-8 col-span-2 px-3 py-2 text-sm bg-transparent border rounded-md border-input ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" id="width" value="100%"></div>
<div class="grid items-center grid-cols-3 gap-4"><label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxWidth">Max. width</label><input class="flex w-full h-8 col-span-2 px-3 py-2 text-sm bg-transparent border rounded-md border-input ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" id="maxWidth" value="300px"></div>
<div class="grid items-center grid-cols-3 gap-4"><label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="height">Height</label><input class="flex w-full h-8 col-span-2 px-3 py-2 text-sm bg-transparent border rounded-md border-input ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" id="height" value="25px"></div>
<div class="grid items-center grid-cols-3 gap-4"><label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxHeight">Max. height</label><input class="flex w-full h-8 col-span-2 px-3 py-2 text-sm bg-transparent border rounded-md border-input ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" id="maxHeight" value="none"></div> --}}
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 94550f6

Please sign in to comment.