Blame | Last modification | View Log | RSS feed
<?php
namespace wpsgTicket;
?>
<div id="wpsg_ticket_modul_template">
<div class="head">
<a href="#" @click.prevent="addTemplate" title="<?php echo __('Neues Template anlegen', 'wpsg'); ?>">
<span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
</a>
<div v-if="data.arTemplates.length > 0">
<select v-model="template">
<option :value="null"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
<option v-for="(template, index) in data.arTemplates" :value="template">
{{template.template_name}} ({{template.config.arField.length}} <?php echo __('Felder', 'wpsg'); ?><template v-if="template.defaulttemplate">, <?php echo __('Standard', 'wpsg'); ?></template>)
</option>
</select>
</div>
<div v-else>
<?php echo __('Keine Templates vorhanden', 'wpsg'); ?>
</div>
<a v-if="template" href="#" @click.prevent="removeTemplate" title="<?php echo __('Template löschen', 'wpsg'); ?>">
<span class="wpsg-glyphicon glyphicon glyphicon-trash"></span>
</a>
</div>
<div v-if="template" class="template">
<div class="form-group form-group-sm has-feedback">
<label class="col-sm-6 control-label label-copy" for="wpsg_mod_downloadplus_filename">
<a href="#" title="<?php echo __('Template kopieren', 'wpsg'); ?>" @click="copyTemplate()"><span class="wpsg-glyphicon glyphicon glyphicon-copy"></span></a>
<span><?php echo __('Name des Templates', 'wpsg'); ?></span>
</label>
<div class="col-sm-6">
<div class="wpsg_field_wrap wpsg_field_wrap_template_name">
<input type="text" v-model="template.template_name" />
<div>
<label class="control-label"><?php echo __('Standard: ', 'wpsg'); ?></label>
<input type="checkbox" :checked="template.defaulttemplate" @click="setDefaultTemplate" />
</div>
</div>
</div>
</div>
<div class="form-group form-group-sm has-feedback">
<label class="col-sm-6 control-label"><?php echo __('Template Größe (mm)', 'wpsg'); ?></label>
<div class="col-sm-6">
<div class="wpsg_field_wrap flex items-center justify-start gap-2">
<input type="text" class="form-control input-sm" autocomplete="off" v-model="template.config.width">
x
<input type="text" class="form-control input-sm" autocomplete="off" v-model="template.config.height">
</div>
</div>
</div>
<div class="form-group form-group-sm has-feedback">
<label class="col-sm-6 control-label"><?php echo __('Hintergrund (PDF/JPEG)', 'wpsg'); ?></label>
<div class="col-sm-6">
<div class="wpsg_field_wrap flex items-start justify-between gap-2">
<input type="file" @change.prevent="uploadBg" ref="file_upload" accept=".jpeg,.jpg,.pdf" />
<span class="flex items-center">
<a v-if="template.hasBackground" :href="template.url_bg_download" target="_blank"><?php echo __('Anzeigen', 'wpsg'); ?></a>
</span>
</div>
</div>
</div>
<br />
<table class="table table_qr table-body-striped wpsg_mod_downloadplus_fieldtable">
<thead>
<tr>
<th colspan="8"><?php echo __('QR - Code', 'wpsg'); ?></th>
</tr>
</thead>
<template v-for="(field, field_index) in template.config.arField">
<tbody v-if="field.text === '%qr%'">
<tr>
<td class="col_w0"></td>
<td class="col_w1">
<div class="text-right"><strong><?php echo __('X / Y', 'wpsg'); ?></strong></div>
</td>
<td class="col_w1">
<div clasS="flex items-center gap-2">
<input type="text" style="width:50px;" v-model="field.x" />
<span>/</span>
<input type="text" style="width:50px;" v-model="field.y" />
</div>
</td>
<td class="col_w1">
<div class="text-right"><strong><?php echo __('Breite', 'wpsg'); ?></strong></div>
</td>
<td class="col_w1">
<input type="text" style="width:50px;" v-model="field.w" />
</td>
<td class="col_w1">
<div class="text-right"><strong><?php echo __('Höhe', 'wpsg'); ?>:</strong></div>
</td>
<td class="col_w1">
<input type="text" style="width:50px;" v-model="field.h" />
</td>
<td class="col_w0"></td>
</tr>
</tbody>
</template>
</table>
<table class="table table-body-striped wpsg_mod_downloadplus_fieldtable">
<thead>
<tr>
<th colspan="8"><?php echo __('Weitere Felder mit Platzhaltern', 'wpsg'); ?></th>
</tr>
<tr>
<th class="col_w0">
<a href="#" @click.prevent="addField" title="<?php echo __('Neues Feld', 'wpsg'); ?>">
<span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
</a>
</th>
<th class="col_w1"><?php echo __('X', 'wpsg'); ?></th>
<th class="col_w1"><?php echo __('Y', 'wpsg'); ?></th>
<th class="col_w1"><?php echo __('Ausrichtung', 'wpsg'); ?></th>
<th class="col_w1"><?php echo __('Farbe', 'wpsg'); ?></th>
<th class="col_w1"><?php echo __('Deckkraft', 'wpsg'); ?></th>
<th class="col_w1"><?php echo __('Winkel', 'wpsg'); ?></th>
<th class="col_action"></th>
</tr>
</thead>
<template v-for="(field, field_index) in template.config.arField">
<tbody v-if="field.text !== '%qr%'">
<tr>
<td class="col_w0">#{{field_index + 1}}</td>
<td class="col_w1">
<input type="text" style="width:50px;" v-model="field.x" />
</td>
<td class="col_w1">
<input type="text" style="width:50px;" v-model="field.y" />
</td>
<td class="col_w1">
<select v-model="field.align" v-if="field.text !== '%qr%'">
<option value="L">Links</option>
<option value="C">Zentriert</option>
<option value="R">Rechts</option>
</select>
<div v-else class="text-right"><strong><?php echo __('Breite', 'wpsg'); ?></strong></div>
</td>
<td class="col_w1">
<input class="wpsg_hideBarcode" v-if="field.text !== '%qr%'" type="text" style="width:75px;" v-model="field.color" />
<input v-else type="text" style="width:50px;" v-model="field.w" />
</td>
<td class="col_w1">
<input class="wpsg_hideBarcode" v-if="field.text !== '%qr%'" type="text" style="width:50px;" v-model="field.opaque" />
<div v-else class="text-right"><strong><?php echo __('Höhe', 'wpsg'); ?>:</strong></div>
</td>
<td class="col_w1">
<input class="wpsg_hideBarcode" v-if="field.text !== '%qr%'" type="text" style="width:50px;" v-model="field.angle" />
<input v-else type="text" style="width:50px;" v-model="field.h" />
</td>
<td class="col_w0"></td>
</tr>
<tr>
<td class="col_w0">
<a href="#" @click.prevent="addField(field_index)" title="<?php echo __('Neues Feld davor einfügen', 'wpsg'); ?>">
<span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
</a>
</td>
<td class="col_freitext_label col_w1" colspan="1">
<span v-if="field.text !== '%qr%'"><?php echo __('Freitext', 'wpsg'); ?>:</span>
</td>
<td colspan="5" class="col_freitext">
<div class="flex items-center gap-2">
<input v-if="field.text !== '%qr%'" type="text" style="width:100%;" v-model="field.text" />
<span v-else>QR Code</span>
<template v-if="field.text !== '%qr%'">
<select class="fontselect" v-model="field.font" style="width:100%;">
<option v-for="(font, index_font) in data.arFonts" :value="font.code">{{font.label}}</option>
</select>
<select v-model="field.fontsize" style="width:100%;">
<option v-for="size in [4,5,6,7,8,9,10,11,12,13,14,16,18,20,22,24,26,28,30,32,34]" :value="size">{{size}}</option>
</select>
</template>
</div>
</td>
<td>
<a v-if="field.text !== '%qr%'" target="_blank" href="#" @click.prevent="removeField(field_index)" title="<?php echo __('Feld löschen', 'wpsg'); ?>">
<span class="wpsg-glyphicon glyphicon glyphicon-trash"></span>
</a>
</td>
</tr>
</tbody>
</template>
</table>
<a :href="template.url_preview" target="_blank" class="button button-primary"><?php echo __('Vorschau', 'wpsg'); ?></a>
</div>
<br />
</div>