developer.twig
6.91 KB
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
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><i class="fa fa-cog"></i> {{ heading_title }}</h4>
</div>
<div class="modal-body">
<table class="table table-bordered">
<thead>
<tr>
<td>{{ column_component }}</td>
<td style="width: 150px;">{{ entry_cache }}</td>
<td class="text-right" style="width: 1px;">{{ column_action }}</td>
</tr>
</thead>
<tr>
<td>{{ entry_theme }}</td>
<td ><div class="btn-group" data-toggle="buttons">{% if developer_theme %}
<label class="btn btn-success active" {% if not eval %}disabled="disabled"{% endif %}>
<input type="radio" name="developer_theme" value="1" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %} checked/>
{{ button_on }}
</label>
{% else %}
<label class="btn btn-success" {% if not eval %}disabled="disabled"{% endif %}>
<input type="radio" name="developer_theme" value="1" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %}/>
{{ button_on }}
</label>
{% endif %}
{% if not developer_theme %}
<label class="btn btn-danger active" {% if not eval %}disabled="disabled"{% endif %}>
<input type="radio" name="developer_theme" value="0" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %} checked/>
{{ button_off }}
</label>
{% else %}
<label class="btn btn-danger" {% if not eval %}disabled="disabled"{% endif %}>
<input type="radio" name="developer_theme" value="0" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %}/>
{{ button_off }}
</label>
{% endif %}</div></td>
<td class="text-right"><button type="button" value="theme" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
</tr>
<tr>
<td>{{ entry_sass }}</td>
<td><div class="btn-group" data-toggle="buttons">{% if developer_sass %}
<label class="btn btn-success active">
<input type="radio" name="developer_sass" value="1" autocomplete="off" checked>
{{ button_on }}</label>
{% else %}
<label class="btn btn-success">
<input type="radio" name="developer_sass" value="1" autocomplete="off">
{{ button_on }}</label>
{% endif %}
{% if not developer_sass %}
<label class="btn btn-danger active">
<input type="radio" name="developer_sass" value="0" autocomplete="off" checked>
{{ button_off }}</label>
{% else %}
<label class="btn btn-danger">
<input type="radio" name="developer_sass" value="0" autocomplete="off">
{{ button_off }}</label>
{% endif %}</div></td>
<td class="text-right"><button type="button" value="sass" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
</tr>
<tr>
<td colspan="2">{{ entry_systemcache }}</td>
<td class="text-right"><button type="button" value="systemcache" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
</tr>
<tr>
<td colspan="2">{{ entry_imgcache }}</td>
<td class="text-right"><button type="button" value="imgcache" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
</tr>
<tr>
<td colspan="2">{{ entry_allcache }}</td>
<td class="text-right"><button type="button" value="allcache" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
</tr>
</table>
</div>
</div>
</div>
<script type="text/javascript"><!--
$('input[name=\'developer_theme\'], input[name=\'developer_sass\']').on('change', function() {
$.ajax({
url: 'index.php?route=common/developer/edit&user_token={{ user_token }}',
type: 'post',
data: $('input[name=\'developer_theme\']:checked, input[name=\'developer_sass\']:checked'),
dataType: 'json',
beforeSend: function() {
$('input[name=\'developer_theme\'], input[name=\'developer_sass\']').prop('disabled', true);
},
complete: function() {
$('input[name=\'developer_theme\'], input[name=\'developer_sass\']').prop('disabled', false);
},
success: function(json) {
$('.alert-dismissible').remove();
if (json['error']) {
$('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
if (json['success']) {
$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('#modal-developer table button').on('click', function() {
var element = this;
$.ajax({
url: 'index.php?route=common/developer/' + $(element).attr('value') + '&user_token={{ user_token }}',
dataType: 'json',
beforeSend: function() {
$(element).button('loading');
},
complete: function() {
$(element).button('reset');
},
success: function(json) {
$('.alert-dismissible').remove();
if (json['error']) {
$('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
if (json['success']) {
$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>