3
3
@section (' page_header' )
4
4
<h1 class =" page-title" >
5
5
<i class =" voyager-hook" ></i > Hooks
6
- <a class =" btn btn-success refresh " href = " {{ route ( ' voyager.hooks.cache.refresh ' ) } } " >
7
- <i class =" voyager-refresh " ></i > Update cache
8
- </a >
6
+ <div class =" btn btn-success install " >
7
+ <i class =" voyager-plus " ></i > Add hook
8
+ </div >
9
9
</h1 >
10
10
@stop
11
11
46
46
<?= ($hook -> enabled ? ' <i class="voyager-check"></i> ENABLED' : ' <i class="voyager-x"></i> DISABLED' ) ? >
47
47
</td >
48
48
<td class =" no-sort no-click" >
49
- @if ($hook -> installed )
50
- <a href =" javascript:;" class =" btn-sm btn-danger pull-right uninstall"
51
- data-id =" {{ $hook -> name } }" id =" uninstall-{{ $hook -> name } }" >
52
- <i class =" voyager-trash" ></i > Uninstall
53
- </a >
54
- <a href =" {{ route (' voyager.hooks.' . ($hook -> enabled ? ' disable' : ' enable' ), $hook -> name ) } }"
55
- class =" btn-sm btn-{{ $hook -> enabled ? ' danger' : ' primary' } } pull-right edit" >
56
- <i class =" voyager-edit" ></i > {{ $hook -> enabled ? ' Disable' : ' Enable' } }
57
- </a >
58
- @else
59
- <a href =" {{ route (' voyager.hooks.install' , $hook -> name ) } }"
60
- class =" btn-sm btn-primary pull-right install" >
61
- <i class =" voyager-plus" ></i > Install
62
- </a >
63
- @endif
64
-
49
+ <div class =" btn-sm btn-danger pull-right delete" data-id =" {{ $hook -> name } }" id =" delete-{{ $hook -> name } }" >
50
+ <i class =" voyager-trash" ></i > Uninstall
51
+ </div >
52
+ <a href =" {{ route (' voyager.hooks.' . ($hook -> enabled ? ' disable' : ' enable' ), $hook -> name ) } }" class =" btn-sm btn-primary pull-right edit" >
53
+ <i class =" voyager-edit" ></i > {{ $hook -> enabled ? ' Disable' : ' Enable' } }
54
+ </a >
65
55
@if ($hook -> hasUpdateAvailable () )
66
- <a href =" {{ route (' voyager.hooks.update' , $hook -> name ) } }"
67
- class =" btn-sm btn-warning pull-right update" >
56
+ <a href =" {{ route (' voyager.hooks.update' , $hook -> name ) } }" class =" btn-sm btn-warning pull-right update" >
68
57
<i class =" voyager-edit" ></i > Update
69
58
</a >
70
59
@endif
@@ -79,23 +68,21 @@ class="btn-sm btn-warning pull-right update">
79
68
</div >
80
69
</div >
81
70
82
- <div class =" modal modal-danger fade" tabindex =" -1" id =" uninstall_modal " role =" dialog" >
71
+ <div class =" modal modal-danger fade" tabindex =" -1" id =" delete_modal " role =" dialog" >
83
72
<div class =" modal-dialog" >
84
73
<div class =" modal-content" >
85
74
<div class =" modal-header" >
86
75
<button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span
87
76
aria-hidden =" true" >× ; </span ></button >
88
- <h4 class =" modal-title" >
89
- <i class =" voyager-trash" ></i >
90
- Are you sure you want to uninstall this hook?
91
- </h4 >
77
+ <h4 class =" modal-title" ><i class =" voyager-trash" ></i > Are you sure you want to uninstall
78
+ this hook?</h4 >
92
79
</div >
93
80
<div class =" modal-footer" >
94
- <form action =" {{ route (' voyager.hooks' ) } }" id =" uninstall_form " method =" POST" >
81
+ <form action =" {{ route (' voyager.hooks' ) } }" id =" delete_form " method =" POST" >
95
82
{{ method_field (" DELETE " ) } }
96
83
{{ csrf_field () } }
97
- <input type =" submit" class =" btn btn-danger pull-right uninstall -confirm"
98
- value =" Yes, Uninstall This Hook" >
84
+ <input type =" submit" class =" btn btn-danger pull-right delete -confirm"
85
+ value =" Yes, Delete This Hook" >
99
86
</form >
100
87
<button type =" button" class =" btn btn-default pull-right" data-dismiss =" modal" >Cancel</button >
101
88
</div >
@@ -105,16 +92,25 @@ class="btn-sm btn-warning pull-right update">
105
92
106
93
<div class =" modal modal-success fade" tabindex =" -1" id =" install_modal" role =" dialog" >
107
94
<div class =" modal-dialog" >
108
- <div class =" modal-content" >
95
+ <form class =" modal-content" action = " {{ route ( ' voyager.hooks ' ) } } " id = " install_form " method = " POST " >
109
96
<div class =" modal-header" >
110
97
<button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span
111
98
aria-hidden =" true" >× ; </span ></button >
112
- <h4 class =" modal-title" ><i class =" voyager-plus" ></i > Installing hook</h4 >
99
+ <h4 class =" modal-title" ><i class =" voyager-plus" ></i >Install new hook. </h4 >
113
100
</div >
114
101
<div class =" modal-body" >
115
- <p >Please be patience, installation in process...</p >
102
+ <div class =" form-group" >
103
+ <label for =" name" >Name</label >
104
+ <input type =" text" name =" name" class =" form-control" id =" name" placeholder =" Name of hook" >
105
+ </div >
116
106
</div >
117
- </div ><!-- /.modal-content -->
107
+ <div class =" modal-footer" >
108
+ {{ csrf_field () } }
109
+ <input type =" submit" class =" btn btn-success pull-right install-confirm"
110
+ value =" Install" >
111
+ <button type =" button" class =" btn btn-default pull-right" data-dismiss =" modal" >Cancel</button >
112
+ </div >
113
+ </form ><!-- /.modal-content -->
118
114
</div ><!-- /.modal-dialog -->
119
115
</div ><!-- /.modal -->
120
116
@stop
@@ -126,22 +122,18 @@ class="btn-sm btn-warning pull-right update">
126
122
$ (' #dataTable' ).DataTable ({ " order" : [] });
127
123
});
128
124
129
- /* *
130
- * Install Hook
131
- */
132
- $ (' td' ).on (' click' , ' .install' , function (e ) {
125
+ $ (' .page-title' ).on (' click' , ' .install' , function (e ) {
126
+ var form = $ (' #install_form' )[0 ];
127
+
133
128
$ (' #install_modal' ).modal (' show' );
134
129
});
135
130
136
- /* *
137
- * Install Hook
138
- */
139
- $ (' td' ).on (' click' , ' .uninstall' , function (e ) {
140
- var form = $ (' #uninstall_form' )[0 ];
131
+ $ (' td' ).on (' click' , ' .delete' , function (e ) {
132
+ var form = $ (' #delete_form' )[0 ];
141
133
142
134
form .action = parseActionUrl (form .action , $ (this ).data (' id' ));
143
135
144
- $ (' #uninstall_modal ' ).modal (' show' );
136
+ $ (' #delete_modal ' ).modal (' show' );
145
137
});
146
138
147
139
function parseActionUrl (action , id ) {
0 commit comments