Skip to content

Commit c65611a

Browse files
committed
Dashboard setup tweaks
1 parent ffc5e0c commit c65611a

File tree

9 files changed

+29
-40
lines changed

9 files changed

+29
-40
lines changed

lang/en/dashboard.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
'widgets' => [
9292
'calendar' => 'Calendar',
9393
'campaign' => 'Campaign header',
94-
'header' => 'Text header',
94+
'header' => 'Title',
9595
'preview' => 'Entity preview',
9696
'random' => 'Random entity',
9797
'recent' => 'Entity list',

public/build/assets/app-67af7cb2.css

-1
This file was deleted.

public/build/assets/auth-d2779fa4.css

-1
This file was deleted.

public/build/assets/front-47473f50.css

-1
This file was deleted.

public/build/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@
263263
"src": "resources/js/vendor-final.js"
264264
},
265265
"resources/sass/app.scss": {
266-
"file": "assets/app-67af7cb2.css",
266+
"file": "assets/app-cc3df3a9.css",
267267
"isEntry": true,
268268
"src": "resources/sass/app.scss"
269269
},
270270
"resources/sass/auth.scss": {
271-
"file": "assets/auth-d2779fa4.css",
271+
"file": "assets/auth-ce539f4d.css",
272272
"isEntry": true,
273273
"src": "resources/sass/auth.scss"
274274
},
@@ -293,7 +293,7 @@
293293
"src": "resources/sass/freyja/freyja.scss"
294294
},
295295
"resources/sass/front.scss": {
296-
"file": "assets/front-47473f50.css",
296+
"file": "assets/front-6f03c24c.css",
297297
"isEntry": true,
298298
"src": "resources/sass/front.scss"
299299
},

resources/sass/colour.scss

+4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@
153153
--tw-bg-opacity: 1;
154154
border-color: hsl(var(--p)/var(--tw-border-opacity));
155155
}
156+
.hover\:border-primary:hover {
157+
--tw-border-opacity: 1;
158+
border-color: hsl(var(--p)/var(--tw-border-opacity));
159+
}
156160
.border-primary-content {
157161
--tw-bg-opacity: 1;
158162
border-color: hsl(var(--pc)/var(--tw-border-opacity));

resources/views/dashboard/_widget.blade.php

+13-25
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@
33
use Illuminate\Support\Str;
44
use App\Enums\Widget;
55
6-
$background = null;
7-
8-
if ($widget->entity && $widget->entity->hasImage()) {
9-
$background = Avatar::entity($widget->entity)->size(40)->thumbnail();
10-
}
116
if (!empty($widget->conf('entity'))) {
127
$entityString = $moduleService->plural($widget->conf('entity'), 'entities.' . Str::plural($widget->conf('entity')));
138
}
149
?>
1510

1611

1712
<div class="col-span-{{ $widget->colSize() }}">
18-
<div class="{{ $widgetClass }} cursor-pointer widget-{{ $widget->widget->value }} cover-background {{ $widget->widget->isHeader() ? 'h-auto' : null }}"
13+
<div class="{{ $widgetClass }} cursor-pointer widget-{{ $widget->widget->value }} cover-background {{ $widget->widget->isHeader() ? 'h-28' : null }}"
1914
@if($widget->widget == Widget::Campaign)
2015
data-toggle="dialog"
2116
data-target="primary-dialog"
@@ -29,25 +24,24 @@
2924
style="background-image: url('{{ Img::crop(1200, 400)->url($campaign->header_image) }}')"
3025
@endif
3126
>
32-
<div class="{{ $overlayClass }}">
33-
<div class="handle rounded px-2 py-1 top-1 left-1 text-center absolute w-10 border cursor-move background bg-box" data-toggle="tooltip" data-title="{{ __('dashboard.setup.reorder.helper') }}">
34-
<x-icon class="fa-solid fa-arrows" />
35-
</div>
36-
@if ($widget->widget != Widget::Header)
37-
<span class="truncate w-full px-12" >
27+
<div class="rounded bg-box flex gap-2 flex-col p-4 h-full">
28+
<div class="flex gap-4 items-center w-full ">
29+
<div class="grow truncate">
3830
<x-icon :class="$widget->widgetIcon()" tooltip title="{{ __('dashboard.setup.widgets.' . $widget->widget->value) }}" />
3931
@if (!empty($widget->conf('text')))
4032
{{ $widget->conf('text') }} ({{ __('dashboard.setup.widgets.' . $widget->widget->value) }})
4133
@else
4234
{{ __('dashboard.setup.widgets.' . $widget->widget->value) }}
4335
@endif
44-
</span>
45-
@endif
46-
36+
</div>
37+
<div class="flex-none handle cursor-move text-neutral-content" data-toggle="tooltip" data-title="{{ __('dashboard.setup.reorder.helper') }}">
38+
<x-icon class="fa-solid fa-arrows" />
39+
</div>
40+
</div>
4741

4842
@if ($widget->entity)
49-
<div class="widget-entity flex items-center gap-2 w-full justify-center">
50-
<div class="rounded-full entity-image flex-none" style="background-image: url('{!! $background !!}');"></div>
43+
<div class="widget-entity flex items-center gap-2 w-full">
44+
<div class="rounded entity-picture w-9 h-9 flex-none" style="background-image: url('{!! Avatar::entity($widget->entity)->size(40)->fallback()->thumbnail() !!}');"></div>
5145
<div class="truncate text-md">
5246
<a href="{{ $widget->entity->url() }}">
5347
{!! $widget->entity->name !!}
@@ -56,12 +50,6 @@
5650
</div>
5751
@endif
5852

59-
@if ($widget->widget == Widget::Header)
60-
@if (!empty($widget->conf('text')))
61-
<span class="text-lg">{{ $widget->conf('text') }}</span>
62-
@endif
63-
@endif
64-
6553
@if ($widget->widget == Widget::Unmentioned)
6654
@if (!empty($widget->conf('entity')))
6755
<span class="text-sm">{{ __('entities.' . $widget->conf('entity')) }}</span>
@@ -84,8 +72,8 @@
8472
</p>
8573
@endif
8674

87-
@if (!empty($widget->tags))
88-
<div class="flex flex-wrap gap-1 items-center justify-center tags">
75+
@if ($widget->tags->isNotEmpty())
76+
<div class="flex flex-wrap gap-1 items-center tags">
8977
@foreach ($widget->tags as $tag)
9078
@include ('tags._badge')
9179
@endforeach

resources/views/dashboard/setup.blade.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
@php
1111
use App\Enums\Widget;
12-
$widgetClass = 'widget relative rounded text-center h-28 shadow-xs hover:shadow-md cursor-pointer bg-box' ;
13-
$overlayClass = 'bg-box opacity-80 rounded flex gap-2 flex-col p-2 justify-center items-center h-full';
12+
$widgetClass = 'widget rounded h-28 shadow-xs hover:shadow-md cursor-pointer bg-box' ;
13+
$overlayClass = 'rounded flex gap-2 flex-col p-2 items-center h-full';
1414
@endphp
1515

1616
@section('content')
@@ -118,12 +118,12 @@
118118
<div class="grid grid-cols-12 gap-2 md:gap-5" id="widgets" data-url="{{ route('dashboard.reorder', $campaign) }}">
119119
@if (empty($dashboard))
120120
<div class="col-span-12">
121-
<div class="{{ $widgetClass }} border-dashboard widget-campaign cover-background h-auto p-4" @if($campaign->header_image) style="background-image: url({{ Img::crop(1200, 400)->url($campaign->header_image) }})" @endif
121+
<div class="{{ $widgetClass }} border-dashboard widget-campaign cover-background h-auto p-4 " @if($campaign->header_image) style="background-image: url({{ Img::crop(1200, 400)->url($campaign->header_image) }})" @endif
122122
data-toggle="dialog"
123123
data-target="primary-dialog"
124124
data-url="{{ route('campaigns.dashboard-header.edit', $campaign) }}"
125125
>
126-
<div class="{{ $overlayClass }}">
126+
<div class="{{ $overlayClass }} backdrop-blur bg-box opacity-60">
127127
<span class="widget-type">{{ __('dashboard.setup.widgets.campaign') }}</span>
128128
</div>
129129
</div>
@@ -133,10 +133,10 @@
133133
@includeWhen($widget->visible(), '.dashboard._widget')
134134
@endforeach
135135

136-
<div class="col-span-4 {{ $widgetClass }}" data-toggle="dialog" data-target="primary-dialog" data-url="{{ route('campaign_dashboard_widgets.index', [$campaign, 'dashboard' => $dashboard]) }}">
137-
<div class="text-lg flex gap-2 items-center justify-center p-2 talign-middle h-full">
136+
<div class="col-span-4 widget rounded h-28 hover:border-primary text-primary transition-all duration-150 cursor-pointer border-dashed border-2 py-6" data-toggle="dialog" data-target="primary-dialog" data-url="{{ route('campaign_dashboard_widgets.index', [$campaign, 'dashboard' => $dashboard]) }}">
137+
<div class="text-lg flex gap-2 items-center justify-center p-2 align-middle h-full">
138138
<x-icon class="plus" />
139-
<span>{{ __('dashboard.setup.actions.add') }}</span>
139+
<span class="uppercase">{{ __('crud.add') }}</span>
140140
</div>
141141
</div>
142142
</div>

resources/views/dashboard/widgets/_actions.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</x-dropdowns.item>
101101

102102
<x-dropdowns.item :link="route('campaign.modules', $campaign)" icon="fa-solid fa-floppy-disks">
103-
{{ __('sidebar.settings') }}
103+
{{ __('campaigns.show.tabs.modules') }}
104104
</x-dropdowns.item>
105105
</div>
106106
</div>

0 commit comments

Comments
 (0)