change button style..

This commit is contained in:
Cüneyt Şentürk 2022-11-28 16:51:15 +03:00
parent 26943351e0
commit 4702202184
3 changed files with 161 additions and 97 deletions

View File

@ -1,6 +1,6 @@
@props(['module', 'installed', 'enable'])
@if (! empty($module->plan))
<div x-show="price_type == 'monthly'" class="w-full">
<x-tooltip message="{{ trans('modules.hosted_on_akaunting') }}" placement="top" width="w-full">
<x-link
href="{{ $module->action_url }}"
@ -11,88 +11,79 @@
{{ trans('modules.switch_to_cloud') }}
</x-link>
</x-tooltip>
@elseif (in_array('onprime', $module->where_to_use))
@if ($installed)
@can('delete-modules-item')
<x-link
href="{{ route('apps.app.uninstall', $module->slug) }}"
class="bg-red rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-red-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.uninstall') }}
</x-link.loading>
</x-link>
@endcan
</div>
@can('update-modules-item')
@if ($enable)
<div x-show="price_type == 'yearly'" class="w-full">
@if (in_array('onprime', $module->where_to_use) || $module->isPurchase)
@if ($installed)
@can('delete-modules-item')
<x-link
href="{{ route('apps.app.disable', $module->slug) }}"
class="bg-orange rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-orange-700"
href="{{ route('apps.app.uninstall', $module->slug) }}"
class="bg-red rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-red-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.disable') }}
{{ trans('modules.button.uninstall') }}
</x-link.loading>
</x-link>
@else
<x-link
href="{{ route('apps.app.enable', $module->slug) }}"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.enable') }}
</x-link.loading>
</x-link>
@endif
@endcan
@else
@can('create-modules-item')
@if ($module->install)
@if (! empty($module->isPurchase) && (! empty($module->purchase_type) && $module->purchase_type == 'monthly'))
<x-tooltip message="{!! trans('modules.can_not_install', ['app' => $module->name]) !!}" placement="right">
<x-button disabled="disabled">
{{ trans('modules.install') }}
</x-button>
</x-tooltip>
@else
<button type="button"
@click="onInstall('{{ $module->action_url }}', '{{ $module->slug }}', '{!! str_replace("'", "\'", $module->name) !!}', '{{ $module->version }}')"
class="bg-green disabled:bg-green-100 rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
id="install-module"
:disabled="installation.show"
@endcan
@can('update-modules-item')
@if ($enable)
<x-link
href="{{ route('apps.app.disable', $module->slug) }}"
class="bg-orange rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-orange-700"
override="class"
>
<x-button.loading action="installation.show">
{{ trans('modules.install') }}
</x-button.loading>
</button>
<x-link.loading>
{{ trans('modules.button.disable') }}
</x-link.loading>
</x-link>
@else
<x-link
href="{{ route('apps.app.enable', $module->slug) }}"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.enable') }}
</x-link.loading>
</x-link>
@endif
@else
<x-link
href="{{ $module->action_url }}"
target="_blank"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
{{ trans('modules.use_app') }}
</x-link>
@endif
@endcan
@endif
@else
@if ($module->install)
<x-tooltip message="{{ trans('modules.hosted_on_akaunting') }}" placement="top" width="w-full">
<x-link
href="{{ $module->action_url }}"
target="_blank"
class="bg-green rounded-md text-white text-sm text-center w-full flex items-center justify-center px-3 py-2 truncate hover:bg-green-700"
override="class"
>
{{ trans('modules.switch_to_cloud') }}
</x-link>
</x-tooltip>
@endcan
@else
@can('create-modules-item')
@if ($module->install)
@if (! empty($module->isPurchase) && (! empty($module->purchase_type) && $module->purchase_type == 'monthly'))
<x-tooltip message="{!! trans('modules.can_not_install', ['app' => $module->name]) !!}" placement="right">
<x-button disabled="disabled">
{{ trans('modules.install') }}
</x-button>
</x-tooltip>
@else
<button type="button"
@click="onInstall('{{ $module->action_url }}', '{{ $module->slug }}', '{!! str_replace("'", "\'", $module->name) !!}', '{{ $module->version }}')"
class="bg-green disabled:bg-green-100 rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
id="install-module"
:disabled="installation.show"
>
<x-button.loading action="installation.show">
{{ trans('modules.install') }}
</x-button.loading>
</button>
@endif
@else
<x-link
href="{{ $module->action_url }}"
target="_blank"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
{{ trans('modules.use_app') }}
</x-link>
@endif
@endcan
@endif
@else
<x-tooltip message="{{ trans('modules.hosted_on_akaunting') }}" placement="top" width="w-full">
<x-link
@ -105,4 +96,89 @@
</x-link>
</x-tooltip>
@endif
@endif
</div>
<div x-show="price_type == 'lifetime'" class="w-full">
@if (empty($module->plan))
@if ($installed)
@can('delete-modules-item')
<x-link
href="{{ route('apps.app.uninstall', $module->slug) }}"
class="bg-red rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-red-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.uninstall') }}
</x-link.loading>
</x-link>
@endcan
@can('update-modules-item')
@if ($enable)
<x-link
href="{{ route('apps.app.disable', $module->slug) }}"
class="bg-orange rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-orange-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.disable') }}
</x-link.loading>
</x-link>
@else
<x-link
href="{{ route('apps.app.enable', $module->slug) }}"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
<x-link.loading>
{{ trans('modules.button.enable') }}
</x-link.loading>
</x-link>
@endif
@endcan
@else
@can('create-modules-item')
@if ($module->install)
@if (! empty($module->isPurchase) && (! empty($module->purchase_type) && $module->purchase_type == 'monthly'))
<x-tooltip message="{!! trans('modules.can_not_install', ['app' => $module->name]) !!}" placement="right">
<x-button disabled="disabled">
{{ trans('modules.install') }}
</x-button>
</x-tooltip>
@else
<button type="button"
@click="onInstall('{{ $module->action_url }}', '{{ $module->slug }}', '{!! str_replace("'", "\'", $module->name) !!}', '{{ $module->version }}')"
class="bg-green disabled:bg-green-100 rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
id="install-module"
:disabled="installation.show"
>
<x-button.loading action="installation.show">
{{ trans('modules.install') }}
</x-button.loading>
</button>
@endif
@else
<x-link
href="{{ $module->lifetime_url }}"
target="_blank"
class="bg-green rounded-md text-white text-sm text-center w-full py-2 truncate hover:bg-green-700"
override="class"
>
{{ trans('modules.use_app') }}
</x-link>
@endif
@endcan
@endif
@else
<x-tooltip message="{{ trans('modules.hosted_on_akaunting') }}" placement="top" width="w-full">
<x-link
href="{{ $module->action_url }}"
target="_blank"
class="bg-green rounded-md text-white text-sm text-center w-full flex items-center justify-center px-3 py-2 truncate hover:bg-green-700"
override="class"
>
{{ trans('modules.switch_to_cloud') }}
</x-link>
</x-tooltip>
@endif
</div>

View File

@ -1,7 +1,7 @@
@props(['module'])
@if (! empty($module->plan))
<div class="text-center text-sm mt-3 mb--2 bg-red-100 rounded-lg p-2 cursor-default">
<div x-show="price_type == 'monthly' || price_type == 'yearly'" class="text-center text-sm mt-3 mb--2 bg-red-100 rounded-lg p-2 cursor-default">
<span class="text-sm text-red-700">
{!! trans('modules.only_premium_plan') !!}
</span>
@ -14,7 +14,7 @@
</span>
</div>
@else
<div class="text-center text-sm mt-3 mb--2 bg-red-100 rounded-lg p-2 cursor-default">
<div x-show="price_type == 'monthly' || price_type == 'yearly'" class="text-center text-sm mt-3 mb--2 bg-red-100 rounded-lg p-2 cursor-default">
<span class="text-sm text-red-700">
{!! trans('modules.only_works_cloud') !!}
</span>

View File

@ -101,29 +101,17 @@
{!! ! empty($module->sort_desc) ? $module->sort_desc : strip_tags($module->description) !!}
</div>
@if (! in_array('onprime', $module->where_to_use))
@if (! empty($module->cloud_information))
{!! $module->cloud_information !!}
@else
<div class="text-center text-sm mt-3 mb--2 bg-red-100 rounded-lg p-2 cursor-default">
<span class="text-sm text-red-700">
{!! trans('modules.only_works_cloud') !!}
</span>
</div>
@endif
@else
<div class="relative flex items-center space-x-4 justify-between">
<x-layouts.modules.show.price :module="$module" />
<div class="relative flex items-center space-x-4 justify-between">
<x-layouts.modules.show.price :module="$module" />
<div class="flex w-1/2 lg:justify-center">
@if ($module->price != '0.0000')
<x-layouts.modules.show.toggle />
@endif
</div>
<div class="flex w-1/2 lg:justify-center">
@if ($module->price != '0.0000')
<x-layouts.modules.show.toggle />
@endif
</div>
</div>
<x-layouts.modules.show.information :module="$module" />
@endif
<x-layouts.modules.show.information :module="$module" />
</div>
<div class="flex justify-around space-x-12 mt-5">