Skip to content

Commit

Permalink
Dashboard widget position fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mervekaraman committed Dec 1, 2023
1 parent a015016 commit 9211405
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Abstracts/Widget.php
Expand Up @@ -17,7 +17,7 @@ abstract class Widget
public $default_name = '';

public $default_settings = [
'width' => 'w-full lg:w-2/4 lg:px-12 my-8',
'width' => 'w-full lg:w-2/4 lg:px-6 my-8',
];

public $description = '';
Expand Down
4 changes: 2 additions & 2 deletions app/Listeners/Update/V30/Version303.php
Expand Up @@ -88,10 +88,10 @@ public function updateWidgets()
$widget_settings->width = 'w-full lg:w-1/3 px-6';
break;
case 'col-md-6':
$widget_settings->width = 'w-full lg:w-2/4 px-12';
$widget_settings->width = 'w-full lg:w-2/4 px-6';
break;
case 'col-md-12':
$widget_settings->width = 'w-full px-12';
$widget_settings->width = 'w-full px-6';
break;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Widgets/CashFlow.php
Expand Up @@ -17,7 +17,7 @@ class CashFlow extends Widget
public $default_name = 'widgets.cash_flow';

public $default_settings = [
'width' => 'w-full my-8 lg:px-12',
'width' => 'w-full my-8 lg:px-6',
];

public $description = 'widgets.description.cash_flow';
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/components/AkauntingWidget.vue
Expand Up @@ -173,11 +173,11 @@ export default {
},
{
label: '50%',
value: 'w-full lg:w-2/4 lg:px-12'
value: 'w-full lg:w-2/4 lg:px-6'
},
{
label: '100%',
value: 'w-full lg:px-12'
value: 'w-full lg:px-6'
}
],
form: {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/common/dashboards/show.blade.php
Expand Up @@ -145,7 +145,7 @@ class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-10
@endsection

<x-slot name="content">
<div class="dashboard flex flex-wrap lg:-mx-12">
<div class="dashboard flex flex-wrap px-6 lg:-mx-12">
@foreach($widgets as $widget)
@widget($widget)
@endforeach
Expand Down
12 changes: 12 additions & 0 deletions resources/views/components/widgets/header.blade.php
Expand Up @@ -7,11 +7,23 @@

<div class="flex items-center">
@if ($report = $class->getReportUrl())
@if (1)
<x-link href="{{ $report }}" class="lg:flex hidden text-purple hover:bg-gray-100 rounded-xl w-8 h-8 items-center justify-center text-sm text-right" override="class">
<x-tooltip id="tooltip-view-report" placement="top" message="{{ trans('widgets.view_report') }}" class="text-black left-5">
<x-icon icon="visibility" class="text-lg font-normal"></x-icon>
</x-tooltip>
</x-link>

<x-link href="{{ $report }}" class="lg:hidden text-purple text-sm text-right" override="class">
{{ trans('widgets.view_report') }}
</x-link>
@else
<x-link href="{{ $report }}" class="text-purple text-sm mr-3 text-right" override="class">
<x-link.hover color="to-purple">
{{ trans('widgets.view_report') }}
</x-link.hover>
</x-link>
@endif
@endif

<x-dropdown id="show-more-actions-widget-{{ $class->model->id }}">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/widgets/donut_chart.blade.php
@@ -1,4 +1,4 @@
<div id="widget-{{ $class->model->id }}" class="apexcharts-donut-custom {{ $class->model->settings->width }} my-8">
<div id="widget-{{ $class->model->id }}" class="apexcharts-donut-custom {{ $class->model->settings->width }}">
@include($class->views['header'], ['header_class' => ''])

<div class="flex flex-col lg:flex-row mt-3" id="widget-donut-{{ $class->model->id }}">
Expand Down

0 comments on commit 9211405

Please sign in to comment.