Skip to content

Commit

Permalink
close #2005 Fixed: Default currency fields should be disabled for def…
Browse files Browse the repository at this point in the history
…ault currency
  • Loading branch information
cuneytsenturk committed Apr 26, 2021
1 parent 8fa5d99 commit c5387f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
10 changes: 10 additions & 0 deletions public/css/akaunting-color.css
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,11 @@ button.bg-yellow:focus
{
box-shadow: none, 0 0 0 0 rgba(109, 162, 82, .5);
}
.form-group.disabled .btn-group.btn-group-toggle.radio-yes-no .btn-success.active-disabled {
color: #ffffff !important;
border-color: #6da252 !important;
background-color: #6da252 !important;
}
/*--Success Color Finish--*/

/*--Danger Color--*/
Expand Down Expand Up @@ -972,6 +977,11 @@ button.bg-yellow:focus
{
box-shadow: none, 0 0 0 0 rgba(239, 50, 50, .5);
}
.form-group.disabled .btn-group.btn-group-toggle.radio-yes-no .btn-danger.active-disabled {
color: #ffffff !important;
border-color: #ef3232 !important;
background-color: #ef3232 !important;
}
/*--Danger Color Finish--*/

/*--Warning Color--*/
Expand Down
14 changes: 14 additions & 0 deletions resources/views/partials/form/radio_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,29 @@ class="form-group {{ $col }}{{ isset($attributes['required']) ? ' required' : ''

<div class="tab-pane tab-example-result fade show active" role="tabpanel" aria-labelledby="-component-tab">
<div class="btn-group btn-group-toggle radio-yes-no" data-toggle="buttons">
@if (empty($attributes['disabled']))
<label class="btn btn-success" @click="form.{{ $name }}=1" v-bind:class="{ active: form.{{ $name }} == 1 }">
{{ trans('general.yes') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name) }}">
</label>
@else
<label class="btn btn-success{{ ($value) ? ' active-disabled disabled' : ' disabled' }}">
{{ trans('general.yes') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" disabled>
</label>
@endif

@if (empty($attributes['disabled']))
<label class="btn btn-danger" @click="form.{{ $name }}=0" v-bind:class="{ active: form.{{ $name }} == 0 }">
{{ trans('general.no') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name) }}">
</label>
@else
<label class="btn btn-danger{{ ($value) ? ' disabled' : ' active-disabled disabled' }}">
{{ trans('general.no') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" disabled>
</label>
@endif
</div>

<input type="hidden" name="{{ $name }}" value="{{ ($value) ? 1 : 0 }}" />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/settings/currencies/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

{{ Form::radioGroup('enabled', trans('general.enabled'), $currency->enabled) }}

{{ Form::radioGroup('default_currency', trans('currencies.default'), $currency->default_currency) }}
{{ Form::radioGroup('default_currency', trans('currencies.default'), $currency->default_currency, '', '', ['disabled' => (setting('default.currency') == $currency->code) ? 'disabled': false]) }}
</div>
</div>

Expand Down

0 comments on commit c5387f0

Please sign in to comment.