1 {% extends basetemplate %}
6 {% ifequal mode "exporter" %}{% trans "XML data exporter" %}{% else %}{% trans "XML data importer" %}{% endifequal %}
8 {% block description %}
9 {% ifequal mode "exporter" %}{% trans "Export database to XML format" %}{% else %}{% trans "Restore data from a previouus export" %}{% endifequal %}
13 <style type="text/css">
17 border: 1px solid black;
50 <script type="text/javascript">
52 var exporting = {% ifequal mode "exporter" %}true{% else %}false{% endifequal %};
56 function set_state(name, data) {
57 var $bar = $('#state_' + name);
59 if (data[name] === undefined) {
60 $bar.find('.state_label').html('{% trans "Skiped" %}')
61 } else if (state == null || data[name] != state[name]) {
62 var width = $bar.width();
64 $bar.find('.state_parsed').html(data[name].parsed);
65 $bar.find('.state_count').html(data[name].count);
66 $bar.find('.state_status').html(data[name].status);
68 var rel_parse = data[name].parsed / data[name].count;
70 $bar.find('.state_percentage').html(parseInt(rel_parse * 100) + '%');
71 $bar.find('.progress').css('width', parseInt(rel_parse * width) + 'px')
75 function check_state() {
78 function callback(data) {
82 set_state('overall', data.state);
84 set_state('{{ s.id }}', data.state);
87 $('#time_started').html(data.time_started);
94 if (data.errors == false) {
96 $('#wait_message').html('{% trans "Your backup is ready to be downloaded."%}');
97 $('#download_link_a').attr('href', '{% url exporter_download %}?file=' + data.state.overall.fname)
98 $('#download_link').slideDown();
100 $('#wait_message').html('{% trans "All data sucessfully imported."%}')
105 msg = '{% trans "An error has occurred during de export proccess"%}';
107 msg = '{% trans "An error has occurred during de import proccess"%}';
109 $('#wait_message').html(msg + ': ' + data.errors + '<br />' +
110 '{% trans "Please check the log file for a full stack trace." %}')
117 window.setTimeout(function() {
124 $.getJSON('{% url exporter_state %}', callback);
132 {% block admincontent %}
133 <p id="wait_message">
134 {% ifequal mode "exporter" %}
135 {% trans "Please wait while we prepare your backup file to download." %}
137 {% trans "Please wait while we import your data." %}
140 Started <span id="time_started"></span>
143 <p id="download_link"><a id="download_link_a" href="#">{% trans "Download file" %}</a></p>
144 <table style="width: 100%">
147 <div class="state_bar" id="state_overall">
148 <div class="state_label"><span class="state_status"></span> ({% trans "Total progress" %}: <span class="state_percentage">0%</span>)</div>
149 <div class="progress"></div>
155 <td>{{ s.name }}:</td>
157 <div class="state_bar" id="state_{{ s.id }}">
158 <div class="state_label"><span class="state_status"></span> - </span><span class="state_parsed">0</span> {% trans " of " %} <span class="state_count">{% trans "unknown" %}</span> (<span class="state_percentage">0%</span>)</div>
159 <div class="progress"></div>