Merge branch 'master' of https://github.com/brkcvn/akaunting into form-elements

This commit is contained in:
Burak Civan
2022-06-27 10:10:50 +03:00
24 changed files with 330 additions and 126 deletions

View File

@ -1,45 +1,61 @@
@props(['module', 'installed', 'enable'])
@if ($installed)
@can('delete-modules-item')
<a href="{{ route('apps.app.uninstall', $module->slug) }}" class="bg-red text-white rounded-md text-sm text-center w-1/2 py-2 truncate">
{{ trans('modules.button.uninstall') }}
</a>
@endcan
@if (! empty($module->plan))
<a href="{{ $module->action_url }}" class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate" target="_blank">
{{ trans('modules.get_premium_cloud') }}
</a>
@elseif (in_array('onprime', $module->where_to_use))
@if ($installed)
@can('delete-modules-item')
<a href="{{ route('apps.app.uninstall', $module->slug) }}" class="bg-red text-white rounded-md text-sm text-center w-1/2 py-2 truncate">
{{ trans('modules.button.uninstall') }}
</a>
@endcan
@can('update-modules-item')
@if ($enable)
<a href="{{ route('apps.app.disable', $module->slug) }}" class="bg-orange rounded-md text-white w-1/2 text-center text-sm py-2 truncate">
{{ trans('modules.button.disable') }}
</a>
@else
<a href="{{ route('apps.app.enable', $module->slug) }}" class="bg-green rounded-md text-white text-sm text-center w-1/2 py-2 truncate">
{{ trans('modules.button.enable') }}
</a>
@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>
@can('update-modules-item')
@if ($enable)
<a href="{{ route('apps.app.disable', $module->slug) }}" class="bg-orange rounded-md text-white w-1/2 text-center text-sm py-2 truncate">
{{ trans('modules.button.disable') }}
</a>
@else
<button type="button"
@click="onInstall('{{ $module->action_url }}', '{{ $module->slug }}', '{!! str_replace("'", "\'", $module->name) !!}', '{{ $module->version }}')"
class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate"
id="install-module"
>
{{ trans('modules.install') }}
</button>
<a href="{{ route('apps.app.enable', $module->slug) }}" class="bg-green rounded-md text-white text-sm text-center w-1/2 py-2 truncate">
{{ trans('modules.button.enable') }}
</a>
@endif
@else
<a href="{{ $module->action_url }}" class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate" target="_blank">
{{ trans('modules.use_app') }}
</a>
@endif
@endcan
@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 hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate"
id="install-module"
>
{{ trans('modules.install') }}
</button>
@endif
@else
<a href="{{ $module->action_url }}" class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate" target="_blank">
{{ trans('modules.use_app') }}
</a>
@endif
@endcan
@endif
@else
@if ($module->install)
<a href="{{ $module->action_url }}" class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate" target="_blank">
{{ trans('modules.install_cloud') }}
</a>
@else
<a href="{{ $module->action_url }}" class="bg-green hover:bg-green-700 rounded-md text-white text-sm text-center w-full py-2 truncate" target="_blank">
{{ trans('modules.get_cloud') }}
</a>
@endif
@endif

View File

@ -1,11 +1,25 @@
@props(['module'])
<div x-show="price_type == true" class="text-center text-sm mt-3 mb--2">
<span style="height: 21px;display: block;"></span>
</div>
@if (! empty($module->plan))
<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_premium_plan') !!}
</span>
</div>
@if (in_array('onprime', $module->where_to_use))
<div x-show="price_type == true" class="text-center text-sm mt-3 mb--2">
<span style="height: 21px;display: block;"></span>
</div>
<div x-show="price_type == false" class="text-center text-sm mt-3 mb--2">
<span style="font-size: 12px;">
<span class="text-danger">*</span> <a href="https://akaunting.com/features/why-akaunting-cloud?utm_source=app_show&utm_medium=software&utm_campaign={{ str_replace('-', '', $module->slug) }}" target="_blank">{!! trans('modules.information_monthly') !!}</a>
</span>
</div>
<div x-show="price_type == false" class="text-center text-sm mt-3 mb--2">
<span style="font-size: 12px;">
<span class="text-red">*</span> <a href="https://akaunting.com/features/why-akaunting-cloud?utm_source=app_show&utm_medium=software&utm_campaign={{ str_replace('-', '', $module->slug) }}" target="_blank">{!! trans('modules.information_monthly') !!}</a>
</span>
</div>
@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

View File

@ -1,23 +1,21 @@
<x-form>
<div class="lg:absolute lg:ltr:right-0 lg:rtl:left-0 top-4">
<label for="priceToggle" class="flex items-center cursor-pointer" x-on:click="price_type = ! price_type">
<div class="relative">
<input type="checkbox" id="priceToggle" class="sr-only" x-model="price_type">
<div class="lg:absolute lg:ltr:right-0 lg:rtl:left-0 top-4" x-on:click="price_type = ! price_type">
<div class="relative" x-model="price_type">
<div class="w-36 flex items-center bg-gray-200 p-1 ltr:mr-2 rtl:ml-2 rounded-lg">
<button type="button"
class="w-18 flex justify-center px-2"
x-bind:class="price_type == true ? 'btn-outline-primary' : 'bg-white rounded-lg'"
>
{{ trans('general.monthly') }}
</button>
<div class="bg-purple-300 w-24 h-7 rounded-full">
<span id="apps-toggle-monthly" class="monthly-badge text-xs text-white float-left ml-3 mt-1.5" x-show="price_type == true">
{{ trans('general.monthly') }}
</span>
<span id="apps-toggle-yearly" class="yearly-badge text-xs text-white float-right mr-3 mt-1.5" x-show="price_type == false">
{{ trans('general.yearly') }}
</span>
</div>
<div class="dot absolute left-1 top-1 bg-white w-5 h-5 rounded-full transition"
x-bind:style="price_type == true ? 'transform: translateX(333%)' : ' transform: translateX(0) '"
></div>
<button type="button"
class="w-18 flex justify-center px-2"
x-bind:class="price_type == false ? 'btn-outline-primary' : 'bg-white rounded-lg'"
>
{{ trans('general.yearly') }}
</button>
</div>
</label>
</div>
</div>
</x-form>