Test Failed
Push — master ( 470d4b...33c92c )
by Terzi
04:31
created

publishes/views/translations/index.blade.php (1 issue)

Labels
Severity
1
@extends($template->layout())
2
3
@inject('config', 'scaffold.config')
4
@inject('template', 'scaffold.template')
5
6
@section('scaffold.content')
7
    <h4>
8
        {{ trans('administrator::module.resources.translations') }}
9
        <sup class="small">({{ $pagination->total() }})</sup>
10
    </h4>
11
12
    <div class="panel">
13
        <ul class="panel-options">
14
            <li><a class="panel-minimize"><i class="fa fa-chevron-down"></i></a></li>
15
        </ul>
16
        <div class="panel-heading">
17
            <h4 class="panel-title panel-minimize">{{ trans('administrator::module.filters') }}</h4>
18
        </div>
19
        <div class="panel-body" style="display: {{ request('term') ? 'block' : 'none' }}">
20
            <form action="{{ route('scaffold.translations.store') }}" data-id="filter-form" class="form">
21
                <div class="scaffold-filters">
22
                    <div class="inputs">
23
                        <div class="form-group">
24
                            <label for="company_id">
25
                                {{ trans('administrator::buttons.search') }}
26
                                <input name="term" type="search" class="form-control"
27
                                       value="{{ app('request')->input('term') }}">
28
                            </label>
29
                        </div>
30
                    </div>
31
                    <div class="buttons">
32
                        <button type="submit" class="btn btn-primary btn-block btn-quirk">
33
                            <i class="fa fa-search"></i>
34
                            {{ trans('administrator::buttons.search') }}
35
                        </button>
36
                    </div>
37
                </div>
38
            </form>
39
        </div>
40
    </div>
41
42
    <div class="row">
43
        <div class="col-sm-12 people-list">
44
            <div class="batch-options nomargin">
45
                @foreach($scopes->prepend('all') as $filter)
46
                    <a class="btn btn-link {{ app('request')->input('only') === $filter ? 'active' : '' }}"
47
                       href="{{ route('scaffold.translations.index', ['only' => $filter, 'term' => request('term')], false) }}">
48
                        {{ title_case($filter) }}
49
                    </a>
50
                @endforeach
51
            </div>
52
        </div>
53
    </div>
54
55
    <div class="panel">
56
        <div class="panel-body">
57
            <form action="" method="post">
58
                {!! csrf_field() !!}
59
                <table class="table table-bordered">
60
                    <thead>
61
                    <tr>
62
                        <th width="20%" style="vertical-align: middle">Key</th>
63
                        <th style="vertical-align: middle">Translation</th>
64
                        <th width="20%">
65
                            <div class="btn-group global" style="padding-left: 0;">
66
                                @foreach($locales = \localizer\locales() as $loc)
67
                                    <button type="button"
68
                                            class="btn btn-default btn-sm {{ ($loc->isDefault() ? 'active' : '') }}"
69
                                            data-locale="{{$loc->iso6391()}}"
70
                                    >
71
                                        {{$loc->iso6391()}}
72
                                    </button>
73
                                @endforeach
74
                            </div>
75
                        </th>
76
                    </tr>
77
                    </thead>
78
                    <tbody>
79
                    @foreach ($pagination->items() as $key => $value)
80
                        <tr>
81
                            <td>
82
                                <?php
83
                                $parts = array_map(function ($part) {
84
                                    return title_case(str_replace(['_', '-'], ' ', $part));
0 ignored issues
show
The function title_case was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

84
                                    return /** @scrutinizer ignore-call */ title_case(str_replace(['_', '-'], ' ', $part));
Loading history...
85
                                }, explode('.', $key));
86
                                ?>
87
                                <span class="bold">{!! ucwords(implode(' &raquo; ', $parts)) !!}</span>
88
                            </td>
89
                            <td>
90
                                <div class="translatable-item pull-left" style="width:100%">
91
                                    @foreach($locales as $locale)
92
                                        <div class="translatable {{ $locale->isDefault() ? '' : 'hidden'}}"
93
                                             style="width:100%"
94
                                             data-locale="{{$locale->iso6391()}}">
95
                                            <textarea
96
                                                    {{ app('scaffold.translations')->readonly($locale) ? 'disabled="disabled"' : '' }}
97
                                                    class="form-control" style="width:100%"
98
                                                    name="translation[{{ $key }}][{{ $locale->iso6391() }}]" cols="50"
99
                                                    rows="2">{{ $value[$locale->iso6391()] ?? '' }}
100
                                            </textarea>
101
                                        </div>
102
                                    @endforeach()
103
                                </div>
104
                            </td>
105
                            <td>
106
                                <div class="btn-group">
107
                                    @foreach($locales as $locale)
108
                                        <button
109
                                                type="button"
110
                                                class="btn btn-default btn-sm {{ ($locale->isDefault() ? 'active' : '') }}"
111
                                                data-locale="{{ $locale->iso6391() }}"
112
                                        >
113
                                            {{ $locale->iso6391() }}
114
                                        </button>
115
                                    @endforeach
116
                                </div>
117
                            </td>
118
                        </tr>
119
                    @endforeach
120
                    </tbody>
121
122
                    @if($pagination->total())
123
                        <tfoot>
124
                        <tr>
125
                            <th></th>
126
                            <th>
127
                                <button type="reset" class="btn btn-default pull-right">
128
                                    {{ trans('administrator::buttons.reset') }}
129
                                </button>
130
                            </th>
131
                            <th>
132
                                <button style="margin-right: 15px;" class="btn btn-block btn-primary">
133
                                    {{ trans('administrator::buttons.save') }}
134
                                </button>
135
                            </th>
136
                        </tr>
137
                        </tfoot>
138
                    @endif
139
                </table>
140
            </form>
141
142
            <div class="pull-right">
143
                {!! $pagination->links() !!}
144
            </div>
145
        </div>
146
    </div>
147
@endsection
148