This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
/
Copy pathindex.blade.php
141 lines (111 loc) · 4.42 KB
/
index.blade.php
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@extends('layouts.app')
@section('title', trans('manager.services.index.title'))
@section('subtitle', trans('manager.services.index.instructions'))
@section('content')
<div class="container-fluid">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-body">
@foreach ($business->services as $service)
<p>
<div class="btn-group">
{!! Button::danger()->withIcon(Icon::trash())->withAttributes([
'type' => 'button',
'data-toggle' => 'tooltip',
'data-original-title' => trans('manager.service.btn.delete'),
'data-method' => 'DELETE',
'data-confirm' => trans('manager.service.btn.delete').'?']
)->asLinkTo( route('manager.business.service.destroy', [$service->business, $service]) ) !!}
{!! Button::normal()
->withIcon(Icon::edit())
->asLinkTo(route('manager.business.service.edit', [$business, $service->id]) ) !!}
@if($service->type)
{!! Button::normal($service->type->name) !!}
@endif
{!! Button::normal($service->name)
->asLinkTo( route('manager.business.service.show', [$business, $service->id]) ) !!}
</div>
</p>
@endforeach
</div>
<div class="panel-footer">
{!! Button::primary(trans('manager.services.btn.create'))
->withIcon(Icon::plus())
->asLinkTo( route('manager.business.service.create', [$business]) )
->block() !!}
{!! Button::primary(trans('servicetype.btn.edit'))
->asLinkTo( route('manager.business.servicetype.edit', [$business]) )
->block() !!}
</div>
</div>
@if ($business->services()->count())
{!! Alert::success(trans('manager.services.create.alert.go_to_vacancies')) !!}
{!! Button::success(trans('manager.services.create.btn.go_to_vacancies'))
->withIcon(Icon::time())
->asLinkTo(route('manager.business.vacancy.create', $business))
->large()
->block() !!}
@endif
</div>
</div>
@endsection
@push('footer_scripts')
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
var laravel = {
initialize: function() {
this.methodLinks = $('a[data-method]');
this.registerEvents();
},
registerEvents: function() {
this.methodLinks.on('click', this.handleMethod);
},
handleMethod: function(e) {
var link = $(this);
var httpMethod = link.data('method').toUpperCase();
var form;
// If the data-method attribute is not PUT or DELETE,
// then we don't know what to do. Just ignore.
if ( $.inArray(httpMethod, ['PUT', 'DELETE']) === - 1 ) {
return;
}
// Allow user to optionally provide data-confirm="Are you sure?"
if ( link.data('confirm') ) {
if ( ! laravel.verifyConfirm(link) ) {
return false;
}
}
form = laravel.createForm(link);
form.submit();
e.preventDefault();
},
verifyConfirm: function(link) {
return confirm(link.data('confirm'));
},
createForm: function(link) {
var form =
$('<form>', {
'method': 'POST',
'action': link.attr('href')
});
var token =
$('<input>', {
'type': 'hidden',
'name': '_token',
'value': '{{{ csrf_token() }}}'
});
var hiddenInput =
$('<input>', {
'name': '_method',
'type': 'hidden',
'value': link.data('method')
});
return form.append(token, hiddenInput)
.appendTo('body');
}
};
laravel.initialize();
});
</script>
@endpush