Skip to content

Commit

Permalink
- Remove duplicate "borderWidth" key on achievement chart data
Browse files Browse the repository at this point in the history
- Use blade directive @lang
- Set class attribut "btn-icon icon-left"
- Set "startDate" and "endDate" into null when datarangepicker is canceled on laporan pencapaian new cin page
  • Loading branch information
ianriizky committed Feb 6, 2022
1 parent 8cc9dfb commit b88f520
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 33 deletions.
2 changes: 0 additions & 2 deletions app/Http/Controllers/AchievementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function laporanPencapaianNewCinChart()
[
'label' => 'Jumlah New CiN',
'data' => [460, 458, 330, 502, 430, 610, 488],
'borderWidth' => 2,
'backgroundColor' => 'rgba(254,86,83,.7)',
'borderColor' => 'rgba(254,86,83,.7)',
'borderWidth' => 2.5,
Expand All @@ -58,7 +57,6 @@ public function laporanPencapaianNewCinChart()
[
'label' => 'Target Bulanan',
'data' => [550, 558, 390, 562, 490, 670, 538],
'borderWidth' => 2,
'backgroundColor' => 'rgba(63,82,227,.8)',
'borderColor' => 'transparent',
'borderWidth' => 0,
Expand Down
17 changes: 8 additions & 9 deletions resources/views/achievement/laporan-pencapaian-new-cin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function daterangeHandler(start, end) {
daterangeHandler(startDate, endDate);
$('.btn-daterange').on('cancel.daterangepicker', function(ev, picker) {
startDate = null;
endDate = null;
$('.btn-daterange span').html('@lang('Choose date')');
});
Expand Down Expand Up @@ -98,7 +101,6 @@ function daterangeHandler(start, end) {
],
},
elements: {
borderWidth: 2,
pointRadius: 4,
},
},
Expand All @@ -114,22 +116,19 @@ function daterangeHandler(start, end) {
});
$('button#load-chart-data').click(async function () {
$(this)
.attr('disabled', 'disabled')
.addClass('btn-progress');
$(this).attr('disabled', 'disabled').addClass('btn-progress');
try {
chart.data = await getChartLabelsAndDatasets('{{ route('achievement.laporan-pencapaian-new-cin-chart') }}');
chart.update();
} catch (error) {
console.error(error);
alert(error.message);
}
$(this)
.removeAttr('disabled')
.removeClass('btn-progress');
$(this).removeAttr('disabled').removeClass('btn-progress');
});
});
</script>
Expand Down Expand Up @@ -171,11 +170,11 @@ function daterangeHandler(start, end) {
<div class="row">
<div class="col-12 col-xl-5 offset-xl-7">
<div class="btn-group btn-block">
<button class="btn btn-outline-primary icon-left btn-icon btn-daterange">
<button class="btn btn-outline-primary btn-icon icon-left btn-daterange">
<i class="fa fa-calendar"></i> <span>@lang('Choose date')</span>
</button>

<button type="button" id="load-chart-data" class="btn btn-primary col-2 col-xl-3">
<button type="button" id="load-chart-data" class="btn btn-primary btn-icon icon-left col-2 col-xl-3">
<i class="fa fa-search"></i> <span class="d-none d-xl-inline">@lang('Search')</span>
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- Password -->
<div>
<x-label for="password" :value="__('Password')" />
<x-label for="password" :value="@lang('Password')" />

<x-input id="password" class="block mt-1 w-full"
type="password"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- Email Address -->
<div>
<x-label for="email" :value="__('Email')" />
<x-label for="email" :value="@lang('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class="custom-control-input @error('remember') is-invalid @enderror"
</a>
@endif

<button type="submit" class="btn btn-primary btn-lg btn-icon icon-right" tabindex="4">
<button type="submit" class="btn btn-primary btn-lg" tabindex="4">
@lang('Log in')
</button>
</div>
Expand Down
5 changes: 2 additions & 3 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ class="custom-control-input @error('agree_with_terms') is-invalid @enderror"
</div>

<div class="form-group">
<button type="submit"
class="btn btn-primary btn-lg btn-block"
tabindex="9">@lang('Register')
<button type="submit" class="btn btn-primary btn-lg btn-block" tabindex="9">
@lang('Register')
</button>
</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@

<!-- Email Address -->
<div>
<x-label for="email" :value="__('Email')" />
<x-label for="email" :value="@lang('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
</div>

<!-- Password -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-label for="password" :value="@lang('Password')" />

<x-input id="password" class="block mt-1 w-full" type="password" name="password" required />
</div>

<!-- Confirm Password -->
<div class="mt-4">
<x-label for="password_confirmation" :value="__('Confirm Password')" />
<x-label for="password_confirmation" :value="@lang('Confirm Password')" />

<x-input id="password_confirmation" class="block mt-1 w-full"
type="password"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<i class="fa fa-chevron-left"></i> <span>{{ __('Go back') }}</span>
<i class="fa fa-chevron-left"></i> <span>@lang('Go back')</span>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<i class="fa fa-trash"></i> <span>{{ __('Delete') }}</span>
<i class="fa fa-trash"></i> <span>@lang('Delete')</span>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<i class="fa fa-info-circle"></i> <span>{{ __('Details') }}</span>
<i class="fa fa-info-circle"></i> <span>@lang('Details')</span>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<i class="fa fa-edit"></i> <span>{{ __('Edit') }}</span>
<i class="fa fa-edit"></i> <span>@lang('Edit')</span>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<button type="submit"
id="checkbox-delete-all"
class="btn btn-danger"
class="btn btn-danger btn-icon icon-left"
formaction="{{ $url }}"
name="_method"
value="DELETE"
onclick="return confirm('{{ __('Are you sure you want to delete this data?') }}')"
onclick="return confirm('@lang('Are you sure you want to delete this data?')')"
disabled>
<i class="fa fa-trash-alt"></i> <span>{{ __('Delete Selected') }}</span>
<i class="fa fa-trash-alt"></i> <span>@lang('Delete Selected')</span>
</button>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{{ $url }}" class="btn btn-danger" onclick="event.preventDefault(); if (confirm('{{ __('Are you sure you want to delete this data?') }}')) this.querySelector('form').submit();">
<a href="{{ $url }}" class="btn btn-danger" onclick="event.preventDefault(); if (confirm('@lang('Are you sure you want to delete this data?')')) this.querySelector('form').submit();">
@include('components.datatables.button-delete')

<form action="{{ $url }}" method="post">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/master/branch/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ class="form-control @error('address') is-invalid @enderror"
formaction="{{ $destroy_action }}"
@isset($method) name="_method" value="DELETE" @endisset
onclick="return (confirm('@lang('Are you sure you want to delete this data?')'))"
class="btn btn-danger">
class="btn btn-danger btn-icon icon-left">
<i class="fa fa-trash"></i> <span>@lang('Delete')</span>
</button>
@endif

<button type="submit"
formaction="{{ $submit_action }}"
@isset($method) name="_method" value="{{ $method }}" @endisset
class="btn btn-primary">
class="btn btn-primary btn-icon icon-left">
<i class="fa fa-save"></i> <span>@lang('Save')</span>
</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/master/user/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ class="form-control select2 @error('role') is-invalid @enderror"
formaction="{{ $destroy_action }}"
@isset($method) name="_method" value="DELETE" @endisset
onclick="return (confirm('@lang('Are you sure you want to delete this data?')'))"
class="btn btn-danger">
class="btn btn-danger btn-icon icon-left">
<i class="fa fa-trash"></i> <span>@lang('Delete')</span>
</button>
@endif

<button type="submit"
formaction="{{ $submit_action }}"
@isset($method) name="_method" value="{{ $method }}" @endisset
class="btn btn-primary">
class="btn btn-primary btn-icon icon-left">
<i class="fa fa-save"></i> <span>@lang('Save')</span>
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/profile/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class="form-control @error('password_confirmation') is-invalid @enderror">
<button type="submit"
formaction="{{ route('profile.update') }}"
name="_method" value="PUT"
class="btn btn-primary">
class="btn btn-primary btn-icon icon-left">
<i class="fa fa-save"></i> <span>@lang('Update')</span>
</button>
</div>
Expand Down

0 comments on commit b88f520

Please sign in to comment.