Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f9bdde1a

Von Cem Aydin vor etwa 2 Jahren hinzugefügt

  • ID f9bdde1aa9f42cb28dba6e3e72211dd482066b52
  • Vorgänger ac4f772b
  • Nachfolger 54798123

design40: Templates zum CSV Import vereinheitlicht

- Einrückung angepasst
- inline Styles durch Klassen ersetzt
- form.html: div und Klassen für Buttons hinzugefügt, HTML Kommentare aus script tags entfernt

Unterschiede anzeigen:

templates/design40_webpages/csv_import/_form_banktransactions.html
[% USE LxERP %]
[% USE L %]
<tr>
<th>[% LxERP.t8("Existing bank transactions") %]:</th>
<td>
[% opts = [ [ 'skip', LxERP.t8('Skip entry') ] , [ 'insert_new', LxERP.t8('Insert new') ] ] %]
[% L.select_tag('settings.update_policy', opts, default = SELF.profile.get('update_policy'), class='wi-normal') %]
</td>
</tr>
<th>[% LxERP.t8("Existing bank transactions") %]:</th>
<td>
[% opts = [
[ 'skip', LxERP.t8('Skip entry') ],
[ 'insert_new', LxERP.t8('Insert new') ] ] %]
[% L.select_tag('settings.update_policy', opts,
default = SELF.profile.get('update_policy'), class='wi-normal') %]
</td>
</tr>
templates/design40_webpages/csv_import/_form_customers_vendors.html
[% USE L %]
<tr>
<th>[%- LxERP.t8('Target table') %]:</th>
<td>
[% opts = [ [ 'customer', LxERP.t8('Customers') ], [ 'vendor', LxERP.t8('Vendors') ] ] %]
[% L.select_tag('settings.table', opts, default = SELF.profile.get('table'), style = 'width: 300px') %]
</td>
<th>[% LxERP.t8('Target table') %]:</th>
<td>
[% opts = [
[ 'customer', LxERP.t8('Customers') ],
[ 'vendor', LxERP.t8('Vendors') ] ] %]
[% L.select_tag('settings.table', opts, default = SELF.profile.get('table'),
class='wi-wide') %]
</td>
</tr>
<tr>
<th>[%- LxERP.t8('Existing customers/vendors with same customer/vendor number') %]:</th>
<td>
[% opts = [ [ 'update_existing', LxERP.t8('Update properties of existing entries') ], [ 'insert_new', LxERP.t8('Insert with new customer/vendor number') ], [ 'skip', LxERP.t8('Skip entry') ] ] %]
[% L.select_tag('settings.update_policy', opts, default = SELF.profile.get('update_policy'), style = 'width: 300px') %]
</td>
<th>[% LxERP.t8('Existing customers/vendors with same customer/vendor number') %]:</th>
<td>
[% opts = [
[ 'update_existing', LxERP.t8('Update properties of existing entries') ],
[ 'insert_new', LxERP.t8('Insert with new customer/vendor number') ],
[ 'skip', LxERP.t8('Skip entry') ] ] %]
[% L.select_tag('settings.update_policy', opts,
default = SELF.profile.get('update_policy'), class='wi-wide') %]
</td>
</tr>
<tr>
<th>[%- LxERP.t8('Default taxzone') %]:</th>
<td>
[% L.select_tag('settings.default_taxzone', SELF.all_taxzones, default = SELF.profile.get('default_taxzone'), title_key = 'description', style => 'width: 300px') %]
</td>
</tr>
<th>[% LxERP.t8('Default taxzone') %]:</th>
<td>
[% L.select_tag('settings.default_taxzone', SELF.all_taxzones,
default = SELF.profile.get('default_taxzone'),
title_key = 'description', class='wi-wide') %]
</td>
</tr>
templates/design40_webpages/csv_import/form.html
<tr>
<th>[% LxERP.t8('Existing profiles') %]:</th>
<td>
[% L.select_tag('profile.id', SELF.all_profiles, title_key = 'name', default = SELF.profile.id, style = 'width: 300px') %] <br>
[% L.submit_tag('action_new', LxERP.t8('Load profile')) %]
[% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
[% L.select_tag('profile.id', SELF.all_profiles, title_key = 'name', default = SELF.profile.id, class='wi-wide') %]
<div class="buttons below">
[% L.submit_tag('action_new', LxERP.t8('Load profile')) %]
[% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
</div>
</td>
</tr>
[% END %]
<tr>
<th>[% LxERP.t8('Save settings as') %]:</th>
<td>
[% L.input_tag('profile.name', '', style => 'width: 300px') %]<br>
[% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %]<br>
<div class="buttons below">[% L.submit_tag('action_save', LxERP.t8('Save profile'), class='below') %]</div>
[% L.input_tag('profile.name', '', class='wi-wide') %]
<div class="below">
[% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile'), class='below') %]
</div>
<div class="buttons below">
[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]
</div>
</td>
</tr>
</tbody>
......
<tr>
<th>[% LxERP.t8('Separator') %]:</th>
<td>
[% SET custom_sep_char = SELF.sep_char %]
[% FOREACH entry = SELF.all_sep_chars %]
[% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [% END %]
[% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %]<br>
[% END %]
[% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %]
[% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %]
[% SET custom_sep_char = SELF.sep_char %]
[% FOREACH entry = SELF.all_sep_chars %]
[% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [% END %]
[% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %]<br>
[% END %]
[% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %]
[% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %]
</td>
</tr>
<tr>
......
[% opts = [ [ 'no_check', LxERP.t8('Do not check for duplicates') ],
[ 'check_csv', LxERP.t8('Discard duplicate entries in CSV file') ],
[ 'check_db', LxERP.t8('Discard entries with duplicates in database or CSV file') ] ] %]
[% L.select_tag('settings.duplicates', opts, default = SELF.profile.get('duplicates'), style = 'width: 300px') %]
[% L.select_tag('settings.duplicates', opts, default = SELF.profile.get('duplicates'), class='wi-wide') %]
</td>
</tr>
[% END %]
......
<script type="text/javascript">
<!--
$(document).ready(function() {
$('#action_save').click(function() {
if ($('#profile_name').val() != '')
return true;
alert('[% LxERP.t8('Please enter a profile name.') %]');
return false;
});
$('#add_empty_mapping_line').click(function(){
$.get('controller.pl', { action: 'CsvImport/add_empty_mapping_line', 'profile.type': $('#profile_type').val() }, kivi.eval_json_result);
});
$('#add_mapping_from_upload').click(function(){
$.get('controller.pl?action_add_mapping_from_upload=1', $('form').serialize() , kivi.eval_json_result);
});
$('#csv_import_mappings').on('click', '.remove_line', function(){ $(this).closest('tr').remove(); if (1==$('#csv_import_mappings tr:visible').length) $('#mapping_empty').show() });
$(document).ready(function() {
$('#action_save').click(function() {
if ($('#profile_name').val() != '')
return true;
alert('[% LxERP.t8('Please enter a profile name.') %]');
return false;
});
$('#add_empty_mapping_line').click(function(){
$.get('controller.pl', { action: 'CsvImport/add_empty_mapping_line', 'profile.type': $('#profile_type').val() }, kivi.eval_json_result);
});
$('#add_mapping_from_upload').click(function(){
$.get('controller.pl?action_add_mapping_from_upload=1', $('form').serialize() , kivi.eval_json_result);
});
-->
$('#csv_import_mappings').on('click', '.remove_line', function(){ $(this).closest('tr').remove(); if (1==$('#csv_import_mappings tr:visible').length) $('#mapping_empty').show() });
});
</script>
templates/design40_webpages/csv_import/report.html
[% USE HTML %]
[% USE LxERP %]
[% USE L %]
<h2>
[% IF SELF.report.test_mode %]
[% LxERP.t8('Import preview') %]
[% ELSE %]
[% LxERP.t8('Import result') %]
[% END %]
[% IF SELF.num_errors %]
<font color="red">([%- SELF.num_errors -%]&nbsp;[%- LxERP.t8('Errors') -%])</font>
[% END %]
<h2>
[% IF SELF.report.test_mode %]
[% LxERP.t8('Import preview') %]
[% ELSE %]
[% LxERP.t8('Import result') %]
[% END %]
[% IF SELF.num_errors %]
<font color="red">([%- SELF.num_errors -%]&nbsp;[%- LxERP.t8('Errors') -%])</font>
[% END %]
</h2>
[% IF SELF.report.test_mode %]
<p>
[% LxERP.t8("The following is only a preview.") %]
[% LxERP.t8("No entries have been imported yet.") %]
</p>
<p>
[% LxERP.t8("The following is only a preview.") %]
[% LxERP.t8("No entries have been imported yet.") %]
</p>
[% END %]
[% PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
<table class="tbl-list">
[% SET max_col = 0 %]
[% FOREACH rownum = SELF.display_rows %]
[% SET max_col = max_col > SELF.report_rows.${rownum}.size ? max_col : SELF.report_rows.${rownum}.size %]
[% LAST IF rownum >= SELF.report_numheaders %]
[% END %]
<table class="tbl-list">
<thead>
[% FOREACH rownum = SELF.display_rows %]
[% SET to_pad = max_col - SELF.report_rows.${rownum}.size %]
[% IF rownum < SELF.report_numheaders %]
<tr>
[% FOREACH value = SELF.report_rows.${rownum} %]
<th>[% value | html %]</th>
[% SET max_col = 0 %]
[% FOREACH rownum = SELF.display_rows %]
[% SET max_col = max_col > SELF.report_rows.${rownum}.size ? max_col : SELF.report_rows.${rownum}.size %]
[% LAST IF rownum >= SELF.report_numheaders %]
[% END %]
[% IF to_pad %]<th style="text-align:center" colspan="[% to_pad %]">-</th>[% END %]
<th>[% LxERP.t8('Notes') %]</th>
</tr>
[% END %]
[% END %]
</thead>
<tbody>
[% FOREACH rownum = SELF.display_rows %]
[% SET to_pad = max_col - SELF.report_rows.${rownum}.size %]
[% IF rownum > SELF.report_numheaders %]
[% csv_import_report_errors = SELF.report_status.${rownum}.errors %]
<tr class="listrow[% IF csv_import_report_errors && csv_import_report_errors.size %]_error[% END %][% (loop.count + SELF.report_numheaders) % 2 %]">
[% FOREACH value = SELF.report_rows.${rownum} %]
<td>[% value | html %]</td>
[% END %]
[% IF to_pad %]<td colspan="[% to_pad %]">-</td>[% END %]
<td>
[% FOREACH error = csv_import_report_errors %][% error | html %][% UNLESS loop.last %]<br>[% END %][% END %]
[% FOREACH info = SELF.report_status.${rownum}.information %][% IF rownum >= SELF.report_numheaders || csv_import_report_errors.size %]<br>[% END %][% info | html %][% END %]
</td>
</tr>
[% END %]
[% END %]
</tbody>
<thead>
[% FOREACH rownum = SELF.display_rows %]
[% SET to_pad = max_col - SELF.report_rows.${rownum}.size %]
[% IF rownum < SELF.report_numheaders %]
<tr>
[% FOREACH value = SELF.report_rows.${rownum} %]
<th>[% value | html %]</th>
[% END %]
[% IF to_pad %]<th style="text-align:center" colspan="[% to_pad %]">-</th>[% END %]
<th>[% LxERP.t8('Notes') %]</th>
</tr>
[% END %]
[% END %]
</thead>
<tbody>
[% FOREACH rownum = SELF.display_rows %]
[% SET to_pad = max_col - SELF.report_rows.${rownum}.size %]
[% IF rownum > SELF.report_numheaders %]
[% csv_import_report_errors = SELF.report_status.${rownum}.errors %]
<tr class="listrow[% IF csv_import_report_errors && csv_import_report_errors.size %]_error[% END %][% (loop.count + SELF.report_numheaders) % 2 %]">
[% FOREACH value = SELF.report_rows.${rownum} %]
<td>[% value | html %]</td>
[% END %]
[% IF to_pad %]<td colspan="[% to_pad %]">-</td>[% END %]
<td>
[% FOREACH error = csv_import_report_errors %][% error | html %][% UNLESS loop.last %]<br>[% END %][% END %]
[% FOREACH info = SELF.report_status.${rownum}.information %][% IF rownum >= SELF.report_numheaders || csv_import_report_errors.size %]<br>[% END %][% info | html %][% END %]
</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>

Auch abrufbar als: Unified diff