tweaks to the importer

This commit is contained in:
vabene1111
2021-05-02 17:33:52 +02:00
parent 373df5d99f
commit 3baa03396c

View File

@@ -75,6 +75,25 @@
<label class="btn btn-outline-info btn-sm" @click="recipe_app='SAFRON'"> <label class="btn btn-outline-info btn-sm" @click="recipe_app='SAFRON'">
<input type="radio" autocomplete="off"> Safron <input type="radio" autocomplete="off"> Safron
</label> </label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='CHEFTAP'">
<input type="radio" autocomplete="off"> Cheftap
</label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='PEPPERPLATE'">
<input type="radio" autocomplete="off"> Pepperplate
</label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='RECIPESAGE'">
<input type="radio" autocomplete="off"> Recipesage
</label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='DOMESTICA'">
<input type="radio" autocomplete="off"> Domestica
</label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='MEALMASTER'">
<input type="radio" autocomplete="off"> Mealmaster
</label>
<label class="btn btn-outline-info btn-sm" @click="recipe_app='REZKONV'">
<input type="radio" autocomplete="off"> Rezkonv
</label>
</div> </div>
<b-form-file <b-form-file
class="my-2" class="my-2"
@@ -105,7 +124,7 @@
</textarea> </textarea>
</div> </div>
<button @click="loadRecipe()" class="btn btn-primary shadow-none" type="button" <button @click="loadRecipe()" class="btn btn-primary shadow-none" type="button"
id="id_btn_app"><i class="fas fa-code"></i> {% trans 'Import' %} id="id_btn_app"><i class="fas fa-code"></i> {% trans 'Import' %}
</button> </button>
</div> </div>
</div> </div>
@@ -266,18 +285,18 @@
</div> </div>
<br/> <br/>
<!-- end of preview card --> <!-- end of preview card -->
<button @click="showRecipe()" class="btn btn-primary shadow-none" type="button" <button @click="showRecipe()" class="btn btn-primary shadow-none" type="button" style="margin-bottom: 2vh"
id="id_btn_json"><i class="fas fa-code"></i> {% trans 'Import' %} id="id_btn_json"><i class="fas fa-code"></i> {% trans 'Import' %}
</button> </button>
</div> </div>
<!-- start of source data --> <!-- start of source data -->
<div class="col" style="max-width:50%"> <div class="col" style="max-width:50%;">
<div class="card card-border-primary"> <div class="card card-border-primary sticky-top" style="z-index: 100;">
<div class="card-header"> <div class="card-header">
<h3>{% trans 'Discovered Attributes' %}</h3> <h3>{% trans 'Discovered Attributes' %}</h3>
<div class='small text-muted'> <div class='small text-muted'>
{% trans 'Drag recipe attributes from below into the appropriate box on the left. Click any node to display its full properties.' %} {% trans 'Drag recipe attributes from below into the appropriate box on the left. Click any node to display its full properties.' %}
</div> </div>
</div> </div>
<div class="btn-group btn-group-toggle" data-toggle="buttons"> <div class="btn-group btn-group-toggle" data-toggle="buttons">
@@ -291,8 +310,8 @@
<input type="radio" autocomplete="off"> images <input type="radio" autocomplete="off"> images
</label> </label>
</div> </div>
<i :class="[show_blank ? 'fa-chevron-up' : 'fa-chevron-down', 'fas']" <i :class="[show_blank ? 'fa-chevron-up' : 'fa-chevron-down', 'fas']"
style="cursor:pointer;" style="cursor:pointer;"
@click="show_blank=!show_blank" @click="show_blank=!show_blank"
title="{% trans 'Show Blank Field' %}"></i> title="{% trans 'Show Blank Field' %}"></i>
<div class="card-body p-1"> <div class="card-body p-1">
@@ -304,9 +323,9 @@
</div> </div>
<div class="small text-muted">{% trans 'Items dragged to Blank Field will be appended.'%}</div> <div class="small text-muted">{% trans 'Items dragged to Blank Field will be appended.'%}</div>
</div> </div>
<div class="card-body drop-zone" <div class="card-body drop-zone"
@drop="replacePreview('blank', $event)" @drop="replacePreview('blank', $event)"
@dragover.prevent @dragover.prevent
@dragenter.prevent @dragenter.prevent
draggable draggable
@dragstart="htmlDragStart($event)"> @dragstart="htmlDragStart($event)">
@@ -324,7 +343,7 @@
<div class="col" @click.ctrl="customItemClickWithCtrl"> <div class="col" @click.ctrl="customItemClickWithCtrl">
<div class="row clearfix" style="width:100%" > <div class="row clearfix" style="width:100%" >
<div class="col-es" style="align-right"> <div class="col-es" style="align-right">
<button style="border: 0px; background-color: transparent; cursor: pointer;" <button style="border: 0px; background-color: transparent; cursor: pointer;"
@click="deleteNode(_.vm, _.model, $event)"><i class="fas fa-minus-square" style="color:red"></i></button> @click="deleteNode(_.vm, _.model, $event)"><i class="fas fa-minus-square" style="color:red"></i></button>
</div> </div>
<div class="col overflow-hidden"> <div class="col overflow-hidden">
@@ -335,17 +354,17 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template>
</v-jstree> </v-jstree>
<!-- start of html data --> <!-- start of html data -->
<div v-if="preview_type=='html'"> <div v-if="preview_type=='html'">
<ul class="list-group list-group-flush" v-for="(txt, key) in recipe_html"> <ul class="list-group list-group-flush" v-for="(txt, key) in recipe_html">
<div class="list-group-item bg-light m-0 small" <div class="list-group-item bg-light m-0 small"
draggable draggable
@dragstart="htmlDragStart($event)" @dragstart="htmlDragStart($event)"
style="display:flex; justify-content:space-between;"> style="display:flex; justify-content:space-between;">
[[txt]] [[txt]]
<i class="fas fa-minus-square" style="cursor:pointer; color:red" @click="$delete(recipe_html, key)" title="{% trans 'Delete Text'%}"></i> <i class="fas fa-minus-square" style="cursor:pointer; color:red" @click="$delete(recipe_html, key)" title="{% trans 'Delete Text'%}"></i>
</div> </div>
</ul> </ul>
@@ -353,10 +372,10 @@
<!-- start of images --> <!-- start of images -->
<div v-if="preview_type=='image'"> <div v-if="preview_type=='image'">
<ul class="list-group list-group-flush" v-for="(img, key) in images"> <ul class="list-group list-group-flush" v-for="(img, key) in images">
<div class="list-group-item bg-light m-0 small" <div class="list-group-item bg-light m-0 small"
draggable draggable
@dragstart="imageDragStart($event)" @dragstart="imageDragStart($event)"
style="display:flex; justify-content:space-between;"> style="display:flex; justify-content:space-between;">
<img class="card-img" v-bind:src=[[img]] alt="Image"> <img class="card-img" v-bind:src=[[img]] alt="Image">
<i class="fas fa-minus-square" style="cursor:pointer; color:red" @click="$delete(images, key)" title="{% trans 'Delete image'%}"></i> <i class="fas fa-minus-square" style="cursor:pointer; color:red" @click="$delete(images, key)" title="{% trans 'Delete image'%}"></i>
</div> </div>