-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.html
More file actions
249 lines (215 loc) · 12.3 KB
/
Copy pathexport.html
File metadata and controls
249 lines (215 loc) · 12.3 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'tools'}
{/block}
{block name="page-title"}{intl l='Exports'}{/block}
{block name="check-resource"}admin.export{/block}
{block name="check-access"}view{/block}
{block name="main-content"}
{if $category_order != "manual"}
{assign url_category "category_order="|cat:$category_order}
{/if}
{if $export_order != "manual"}
{assign url_export "export_order="|cat:$export_order}
{/if}
<div id="export-modal"></div>
<div class="configuration">
<div id="wrapper" class="container">
<nav>
<ul class="breadcrumb">
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
<li><a href="{url path='admin/tools'}">{intl l='Tools'}</a></li>
<li>{intl l="Exports"}</li>
</ul>
</nav>
{hook name="exports.top" location="exports_top" }
{loop name="export-category" type="export-category" order=$category_order}
{ifloop rel="export-categ-list"}
{assign category_title $TITLE}
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{admin_position_block
resource="admin.export"
access="UPDATE"
path={url path="admin/export/position/category"}
url_parameter="id"
in_place_edit_class="exportCategoryPositionChange"
position=$POSITION
id=$ID
}
{$TITLE}
</caption>
<thead>
<tr>
<th class="col-md-1">
{if $export_order == "id"}
<i class="glyphicon glyphicon-chevron-up"></i>
{elseif $export_order == "id_reverse"}
<i class="glyphicon glyphicon-chevron-down"></i>
{/if}
<a href="{url path="/admin/export"}?{if $url_category}{$url_category nofilter}&{/if}export_order=id{if $export_order == "id"}_reverse{/if}#category_{$category_title}">
{intl l="ID"}
</a>
</th>
<th class="col-md-2">
{if $export_order == "alpha"}
<i class="glyphicon glyphicon-chevron-up"></i>
{elseif $export_order == "alpha_reverse"}
<i class="glyphicon glyphicon-chevron-down"></i>
{/if}
<a href="{url path="/admin/export"}?{if $url_category}{$url_category nofilter}&{/if}export_order=alpha{if $export_order == "alpha"}_reverse{/if}#category_{$category_title}">
{intl l="Name"}
</a>
</th>
<th class="col-md-6">
{intl l="Description"}
</th>
<th class="col-md-2">
{if $export_order == "manual"}
<i class="glyphicon glyphicon-chevron-up"></i>
{elseif $export_order == "manual_reverse"}
<i class="glyphicon glyphicon-chevron-down"></i>
{/if}
<a href="{url path="/admin/export"}?{if $url_category}{$url_category nofilter}&{/if}export_order=manual{if $export_order == "manual"}_reverse{/if}#category_{$category_title}">
{intl l="Position"}
</a>
</th>
{hook name="export.table-header"}
<th class="col-md-1">
{intl l="Actions"}
</th>
</tr>
</thead>
<tbody>
{loop name="export-categ-list" type="export" order=$export_order category=$ID}
<tr>
<td>
{$ID}
</td>
<td>
<a class="btn-show-export-modal" href="#category_{$category_title}" data-id="{$ID}" data-url="{$URL nofilter}">{$TITLE}</a>
</td>
<td>
{$DESCRIPTION nofilter}
</td>
<td>
{admin_position_block
resource="admin.export"
access="UPDATE"
path={url path="admin/export/position"}
url_parameter="id"
in_place_edit_class="exportPositionChange"
position=$POSITION
id=$ID
}
</td>
{hook name="export.table-row" export_id=$ID}
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs btn-show-export-modal" data-id="{$ID}" data-url="{$URL nofilter}" title="{intl l="Do this export"}">
<span class="glyphicon glyphicon-open"></span>
</a>
</div>
</td>
</tr>
{/loop}
{hook name="exports.row" category=$ID }
</tbody>
</table>
</div>
</div>
</div>
</div>
{/ifloop}
{/loop}
{elseloop rel="export-category"}
<div class="alert alert-info">
{intl l="You don't have any export"}
</div>
{/elseloop}
{hook name="exports.bottom" location="exports_bottom" }
</div>
</div>
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{/block}
{block name="javascript-last-call"}
<script>
$(document).ready(function() {
$('.exportPositionChange').editable({
type : 'text',
title : "{intl l="Enter new export position"}",
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url noamp='1' path='/admin/export/position' id='__ID__' value='__POS__'}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id'))
.replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
$('.exportCategoryPositionChange').editable({
type : 'text',
title : "{intl l="Enter new export category position"}",
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url noamp='1' path='/admin/export/position/category' id='__ID__' value='__POS__'}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id'))
.replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
var export_modal = $("#export-modal");
$(".btn-show-export-modal").click(function() {
var export_id = $(this).data("id");
/**
* If we can't load the modal form, redirect to a page where the form is too.
*/
$.ajax(
$(this).data("url")
).success(function(data) {
export_modal.html(data);
var compression_switch = $("#export-compression-switch", export_modal);
var compression_row = $(".export-compression-selection-row", export_modal);
compression_switch.on("switch-change", function(e, data) {
var is_checked = data.value;
if (is_checked) {
compression_row.show("slow");
} else {
compression_row.hide("slow");
}
});
if ($("input[type=checkbox]", compression_switch).is(":checked")) {
compression_row.show();
} else {
compression_row.hide();
}
$(".make-switch", export_modal).bootstrapSwitch();
$("#real-export-modal").modal();
}).fail(function() {
window.location.replace("{url path='/admin/export/'}"+export_id);
});
});
});
</script>
{hook name="exports.js" location="exports-js" }
{/block}