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').slideDown();
99 $('#wait_message').html('{% trans "All data sucessfully imported."%}')
104 msg = '{% trans "An error has occurred during de export proccess"%}';
106 msg = '{% trans "An error has occurred during de import proccess"%}';
108 $('#wait_message').html(msg + ': ' + data.errors + '<br />' +
109 '{% trans "Please check the log file for a full stack trace." %}')
116 window.setTimeout(function() {
123 $.getJSON('{% url exporter_state %}', callback);
131 {% block admincontent %}
132 <p id="wait_message">
133 {% ifequal mode "exporter" %}
134 {% trans "Please wait while we prepare your backup file to download." %}
136 {% trans "Please wait while we import your data." %}
139 Started <span id="time_started"></span>
142 <p id="download_link"><a href="{% url exporter_download %}">{% trans "Download file" %}</a></p>
143 <table style="width: 100%">
146 <div class="state_bar" id="state_overall">
147 <div class="state_label"><span class="state_status"></span> ({% trans "Total progress" %}: <span class="state_percentage">0%</span>)</div>
148 <div class="progress"></div>
154 <td>{{ s.name }}:</td>
156 <div class="state_bar" id="state_{{ s.id }}">
157 <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>
158 <div class="progress"></div>