Blame view

resources/views/settings/currencies/edit.blade.php 2.84 KB
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  @extends('layouts.admin')
  
  @section('title', trans('general.title.edit', ['type' => trans_choice('general.currencies', 1)]))
  
  @section('content')
      <!-- Default box -->
      <div class="box box-success">
          {!! Form::model($currency, [
              'method' => 'PATCH',
              'url' => ['settings/currencies', $currency->id],
              'role' => 'form'
          ]) !!}
  
          <div class="box-body">
              {{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
  
              {{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes) }}
  
              {{ Form::textGroup('rate', trans('currencies.rate'), 'money') }}
  
              {{ Form::numberGroup('precision', trans('currencies.precision'), 'bullseye') }}
  
              {{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
  
              {{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]) }}
  
              {{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'columns') }}
  
              {{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'columns', []) }}
  
              {{ Form::radioGroup('enabled', trans('general.enabled')) }}
  
              {{ Form::radioGroup('default_currency', trans('currencies.default')) }}
          </div>
          <!-- /.box-body -->
  
          @permission('update-settings-currencies')
          <div class="box-footer">
              {{ Form::saveButtons('settings/currencies') }}
          </div>
          <!-- /.box-footer -->
          @endpermission
  
          {!! Form::close() !!}
      </div>
  @endsection
  
  @push('scripts')
      <script type="text/javascript">
          var text_yes = '{{ trans('general.yes') }}';
          var text_no = '{{ trans('general.no') }}';
  
          $(document).ready(function(){
              $("#code").select2({
                  placeholder: "{{ trans('general.form.select.field', ['field' => trans('currencies.code')]) }}"
              });
  
              $('#code').change(function() {
                  $.ajax({
                      url: '{{ url("settings/currencies/config") }}',
                      type: 'GET',
                      dataType: 'JSON',
                      data: 'code=' + $(this).val(),
                      success: function(data) {
                          $('#precision').val(data.precision);
                          $('#symbol').val(data.symbol);
                          $('#symbol_first').val(data.symbol_first);
                          $('#decimal_mark').val(data.decimal_mark);
                          $('#thousands_separator').val(data.thousands_separator);
  
                          // This event Select2 Stylesheet
                          $('#symbol_first').trigger('change');
                      }
                  });
              });
          });
      </script>
  @endpush