Merge branch 'master' of https://github.com/brkcvn/akaunting into text-hover

This commit is contained in:
Burak Civan 2022-06-24 10:04:10 +03:00
commit 8ca2a931ec
11 changed files with 160 additions and 24 deletions

View File

@ -276,10 +276,10 @@ class Item extends Controller
public function uninstall($alias)
{
try {
$this->dispatch(new UninstallModule($alias, company_id()));
$name = module($alias)->getName();
$this->dispatch(new UninstallModule($alias, company_id()));
$message = trans('modules.uninstalled', ['module' => $name]);
flash($message)->success();
@ -295,10 +295,10 @@ class Item extends Controller
public function enable($alias)
{
try {
$this->dispatch(new EnableModule($alias, company_id()));
$name = module($alias)->getName();
$this->dispatch(new EnableModule($alias, company_id()));
$message = trans('modules.enabled', ['module' => $name]);
flash($message)->success();
@ -314,10 +314,10 @@ class Item extends Controller
public function disable($alias)
{
try {
$this->dispatch(new DisableModule($alias, company_id()));
$name = module($alias)->getName();
$this->dispatch(new DisableModule($alias, company_id()));
$message = trans('modules.disabled', ['module' => $name]);
flash($message)->success();

View File

@ -59,6 +59,13 @@ class ShowInNotifications
continue;
}
$app_url = route('apps.app.show', [
'alias' => $new_app->alias,
'utm_source' => 'notification',
'utm_medium' => 'software',
'utm_campaign' => str_replace('-', '', $new_app->alias),
]);
$new = new DatabaseNotification();
$new->id = $key;
$new->type = 'new-apps';
@ -66,7 +73,7 @@ class ShowInNotifications
$new->notifiable_id = user()->id;
$new->data = [
'title' => $new_app->name,
'description' => '', // $new_app->message,
'description' => trans('notifications.new_apps', ['app' => $new_app->name, 'url' => $app_url]),
'alias' => $new_app->alias,
];
$new->created_at = $new_app->started_at->date;

View File

@ -0,0 +1,107 @@
<?php
namespace App\Listeners\Update\V30;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Models\Common\Widget;
use App\Models\Common\Company;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class Version303 extends Listener
{
const ALIAS = 'core';
const VERSION = '3.0.3';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stderr')->info('Starting the Akaunting 3.0.3 update...');
$this->updateCompanies();
Log::channel('stderr')->info('Akaunting 3.0.3 update finished.');
}
public function updateCompanies()
{
Log::channel('stderr')->info('Updating companies...');
$company_id = company_id();
$companies = Company::cursor();
foreach ($companies as $company) {
Log::channel('stderr')->info('Updating company:' . $company->id);
$company->makeCurrent();
$this->updateWidgets();
Log::channel('stderr')->info('Company updated:' . $company->id);
}
company($company_id)->makeCurrent();
Log::channel('stderr')->info('Companies updated.');
}
public function updateWidgets()
{
Log::channel('stderr')->info('Updating widgets...');
$widgets = Widget::cursor();
foreach ($widgets as $widget) {
Log::channel('stderr')->info('Updating widget:' . $widget->id);
$widget_settings = $widget->settings;
if (empty($widget_settings->width)) {
Log::channel('stderr')->info('Skip widget:' . $widget->id);
continue;
}
if (Str::contains($widget_settings->width, 'w-full')) {
Log::channel('stderr')->info('Already new classs widget:' . $widget->id);
continue;
}
switch ($widget_settings->width) {
case 'col-md-3':
$widget_settings->width = 'w-full lg:w-1/4 px-6';
break;
case 'col-md-4':
$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';
break;
case 'col-md-12':
$widget_settings->width = 'w-full px-12';
break;
}
$widget->settings = $widget_settings;
$widget->save();
Log::channel('stderr')->info('Widget updated:' . $widget->id);
}
Log::channel('stderr')->info('Widgets updated.');
}
}

View File

@ -16,6 +16,7 @@ class Event extends Provider
'App\Listeners\Update\CreateModuleUpdatedHistory',
'App\Listeners\Module\UpdateExtraModules',
'App\Listeners\Update\V30\Version300',
'App\Listeners\Update\V30\Version303',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',

View File

@ -582,6 +582,8 @@ export default {
if (this.filter_index == 0) {
this.onChangeSearchAndFilterText(this.defaultPlaceholder, true);
} else {
this.show_icon = false;
}
this.filter_last_step = 'options';

View File

@ -6,9 +6,10 @@ return [
'hello' => 'Hello!',
'salutation' => 'Regards,<br> :company_name',
'subcopy' => 'If youre having trouble clicking the ":text" button, copy and paste the URL below into your web browser: [:url](:url)',
'mark_read' => 'Mark Read',
'mark_read_all' => 'Mark Read All',
'mark_read' => 'Mark as Read',
'mark_read_all' => 'Mark as All Read',
'empty' => 'Woohoo, notification zero!',
'new_apps' => ':app is available. <a href=":url">Check it out now</a>!',
'update' => [

View File

@ -9,7 +9,7 @@
@if ($notifications)
<div class="flex justify-end mt-1 mb-3">
<x-tooltip id="notification-all" placement="top" message="Mark as All Read">
<x-tooltip id="notification-all" placement="top" message="{{ trans('notifications.mark_read_all') }}">
<button type="button" wire:click="markReadAll()">
<span id="menu-notification-read-all" class="material-icons text-lg text-purple">done_all</span>
</button>
@ -26,15 +26,18 @@
<div class="flex items-start justify-between font-medium text-sm text-purple mb-1">
<div class="flex flex-col">
{!! $notification->data['title'] !!}
<span class="text-gray-500" style="font-size: 10px;">{{ \Carbon\Carbon::createFromTimeStamp(strtotime($notification->created_at))->diffForHumans() }}</span>
<span class="text-gray-500" style="font-size: 10px;">
{{ \Carbon\Carbon::createFromTimeStamp(strtotime($notification->created_at))->diffForHumans() }}
</span>
</div>
@if ($notification->type != 'updates')
<x-tooltip id="notification-{{ $notification->id }}" placement="top" message="Clear Notification">
<button type="button" wire:click="markRead('{{ $notification->type }}', '{{ $notification->id }}')">
<span id="menu-notification-mark-read" class="material-icons text-lg text-purple">check_circle_outline</span>
</button>
</x-tooltip>
<x-tooltip id="notification-{{ $notification->id }}" placement="top" message="{{ trans('notifications.mark_read') }}">
<button type="button" wire:click="markRead('{{ $notification->type }}', '{{ $notification->id }}')">
<span id="menu-notification-mark-read" class="material-icons text-lg text-purple">check_circle_outline</span>
</button>
</x-tooltip>
@endif
</div>

View File

@ -4,8 +4,11 @@
<ul class="text-sm space-y-3 my-3">
@foreach($accounts as $item)
<li class="flex justify-between">
{{ $item->name }}
<span class="font-medium">{{ $item->balance_formatted }}</span>
{{ $item->title }}
<span class="font-medium">
{{ $item->balance_formatted }}
</span>
</li>
@endforeach
</ul>

View File

@ -12,7 +12,9 @@
{{ $totals['incoming'] }}
</div>
<span class="text-green text-xs">{{ trans('general.incoming') }}</span>
<span class="text-green text-xs">
{{ trans('general.incoming') }}
</span>
<span class="material-icons mt-2">remove</span>
</div>
@ -22,7 +24,9 @@
{{ $totals['outgoing'] }}
</div>
<span class="text-rose text-xs">{{ trans('general.outgoing') }}</span>
<span class="text-rose text-xs">
{{ trans('general.outgoing') }}
</span>
<span class="material-icons mt-2">drag_handle</span>
</div>

View File

@ -5,7 +5,10 @@
@foreach($currencies as $item)
<li class="flex justify-between">
{{ $item->name }}
<span class="font-medium">{{ $item->rate }}</span>
<span class="font-medium">
{{ $item->rate }}
</span>
</li>
@endforeach
</ul>

View File

@ -34,11 +34,16 @@
<span class="material-icons-round cursor-pointer">arrow_drop_down</span>
<div id="widgets-list-{{ $class->model->id }}" class="absolute right-0 mt-3 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 hidden" style="left: auto; min-width: 10rem;">
@foreach($periods as $name => $amount)
@foreach ($periods as $name => $amount)
<div id="dashboard-widget-{{ strtolower(class_basename($class)) }}-{{ str_replace('_', '-', $name) }}" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap cursor-auto">
<div class="w-full h-full flex items-center justify-between rounded-md px-2 text-sm hover:bg-lilac-100">
<div class="font-normal text-sm">{{ trans('widgets.periods.' . $name) }}</div>
<div class="pl-12 text-sm">{{ $amount }}</div>
<div class="font-normal text-sm">
{{ trans('widgets.periods.' . $name) }}
</div>
<div class="pl-12 text-sm">
{{ $amount }}
</div>
</div>
</div>
@endforeach