code from amapei
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
::use 'contractadmin/design.mtt'::
|
||||
|
||||
|
||||
<h2>::_("Import a photo of the product")::</h2>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<form action="" method="POST" enctype="multipart/form-data">
|
||||
<input name="image" type="file" class="btn btn-default"/>
|
||||
|
||||
<br/>
|
||||
::_("Size of the photo: 300 x 300px"):: <br/>
|
||||
::_("Format : JPEG"):: <br/>
|
||||
<br/>
|
||||
|
||||
<input type="submit" value="::_("Send")::" class="btn btn-primary" />
|
||||
</form>
|
||||
<br/>
|
||||
<a href="/contractAdmin/products/::c.id::" class="btn btn-default btn-xs">::_("Back to the management of products")::</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" ::cond image!=null:: >
|
||||
|
||||
<img src="::file(image)::" class="img-thumbnail" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
::end::
|
||||
@@ -0,0 +1,57 @@
|
||||
::use 'contractadmin/design.mtt'::
|
||||
|
||||
<h3>::_("Categories")::</h3>
|
||||
|
||||
<p>
|
||||
::raw _("You can link your products to categories, in order to better organize them in the \"shop mode\".<br/><b>To add categories: </b>select checkboxes of products and then select a category in the list at the bottom of the page. Click then on \"add\".<br /><b>To remove a category:<b/> click on it.")::
|
||||
</p>
|
||||
|
||||
<script language="javascript">
|
||||
var tagger;
|
||||
$(function(){
|
||||
tagger = _.getTagger(::c.id::);
|
||||
tagger.init();
|
||||
});
|
||||
|
||||
var check = function(){
|
||||
var inputs = document.querySelectorAll('#tagger input');
|
||||
var value = inputs[0].checked==true;
|
||||
for ( i of inputs ) {
|
||||
i.checked = !value;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="tagger">
|
||||
<!-- filled by ajax -->
|
||||
</div>
|
||||
|
||||
<form class="form-inline">
|
||||
|
||||
<a onClick="check();" class='btn btn-default btn-noAntiDoubleClick'>::_("Select all")::</a>
|
||||
|
||||
<select name="tag" id="tag" class="form-control">
|
||||
|
||||
::foreach cg user._amap.getCategoryGroups()::
|
||||
<optgroup label="::cg.name::">
|
||||
::foreach cat cg.categs::
|
||||
<option value="::cat.id::">::cat.name::</option>
|
||||
::end::
|
||||
</optgroup>
|
||||
::end::
|
||||
|
||||
</select>
|
||||
|
||||
<a onClick="tagger.add()" class='btn btn-default'><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> ::_("Add the category")::</a>
|
||||
<a onClick="tagger.submit()" class='btn btn-success'>::_("Save modifications")::</a>
|
||||
|
||||
</form>
|
||||
|
||||
<div ::cond user.isAmapManager()::>
|
||||
<hr />
|
||||
<a href="/amapadmin/categories/" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> ::_("Manage categories")::</a>
|
||||
</div>
|
||||
|
||||
|
||||
::end::
|
||||
@@ -0,0 +1,20 @@
|
||||
::use 'design.mtt'::
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="article">
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="app"></div>
|
||||
|
||||
|
||||
<script language="javascript">
|
||||
_.getProductComposer();
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
::end::
|
||||
@@ -0,0 +1,111 @@
|
||||
::use 'design.mtt'::
|
||||
|
||||
<div class="span12">
|
||||
<div class="article">
|
||||
<h2>::_("Import products")::</h2>
|
||||
|
||||
::if step==1::
|
||||
|
||||
<form action="/product/import/::contract.id::" method="POST" enctype="multipart/form-data">
|
||||
<p>
|
||||
<input name="file" type="file"/>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" class="btn btn-primary" value="::_("Import")::"/>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
::elseif step==2::
|
||||
|
||||
<h4>Produits à importer</h4>
|
||||
<div style="margin-bottom:24px;">
|
||||
::if !csv.isEmpty()::
|
||||
|
||||
<table class="table table-bordered" style="/*font-size:11px;*/background-color:#FFF;">
|
||||
|
||||
<tr>
|
||||
::foreach h csv.getHeaders()::
|
||||
<th>::_(h)::</th>
|
||||
::end::
|
||||
</tr>
|
||||
|
||||
::foreach d csv.getDatas()::
|
||||
<tr>
|
||||
::foreach r d::
|
||||
<td>
|
||||
::if r!=null:: ::r:: ::end::
|
||||
</td>
|
||||
::end::
|
||||
</tr>
|
||||
::end::
|
||||
</table>
|
||||
<div class="alert alert-error">
|
||||
<b>::_("Warning")::</b>
|
||||
<p>
|
||||
::raw _("Before validating the import, please check if the table above is correctly filled.<br/>If data are not in line or not corresponding to the right column, it means that your CSV file is not correct.")::
|
||||
</p>
|
||||
<a href="/product/import/::contract.id::">Recommencer</a>
|
||||
</div>
|
||||
<a href="/product/import/::contract.id::?confirm=1" class="btn btn-danger">::_("Import these products in the database")::</a>
|
||||
::else::
|
||||
|
||||
<div class="alert alert-error">
|
||||
<b>::_("Ouch!")::</b>
|
||||
<p>::_("It seems that there is no data to import.")::</p>
|
||||
<a href="/product/import/::contract.id::">Recommencer</a>
|
||||
</div>
|
||||
|
||||
::end::
|
||||
</div>
|
||||
|
||||
<!--<div ::cond data2.length > 0:: >
|
||||
|
||||
<h4>::_("Products already available in the database")::</h4>
|
||||
<table class="table" style="font-size:11px;color:#666666;background-color:#FFF;">
|
||||
<tr>
|
||||
<th>::_("Name")::</th>
|
||||
<th>::_("Price")::</th>
|
||||
</tr>
|
||||
::foreach d data2::
|
||||
<tr>
|
||||
::foreach r d::
|
||||
<td>
|
||||
::if r!=null:: ::r:: ::end::
|
||||
</td>
|
||||
::end::
|
||||
</tr>
|
||||
::end::
|
||||
</table>
|
||||
</div>-->
|
||||
::elseif step==3::
|
||||
::if numImported>0::
|
||||
|
||||
<div class="alert alert-success">
|
||||
<b>::__("Congratulations! You have imported ::num:: products in your database", {num:numImported})::</b>
|
||||
</div>
|
||||
|
||||
::else::
|
||||
<p>::_("You did not import anything in your database because your file was empty or contained products already present in the database.")::</p>
|
||||
::end::
|
||||
<a href="/contractAdmin/products/::contract.id::">::_("Back to the management of products")::</a>
|
||||
|
||||
|
||||
::end::
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h3>::_("Help")::</h3>
|
||||
::_("This page will allow you to import a large number of products in your database from an Excel file.")::
|
||||
<br/>
|
||||
<ul>
|
||||
<li>::raw _("To start, <a href=\"/produits.xls\">Download this demo file</a>")::</li>
|
||||
<li>::raw _("Fill correctly this file, or modify your existing file to respect strictly the order of columns")::</li>
|
||||
<li>::raw _("When your file is ready, click on\"Save as\" in your Excel sheet and choose the format CSV")::</li>
|
||||
<li>::raw _("Choose the following options: separation characters: <b>comma</b>, encoding: <b>Unicode UTF8<b/>"):: </li>
|
||||
<li>::raw _("Save your file")::</li>
|
||||
<li>::raw _("Then click on the button above \"Choose a file\" and send your file"):: </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
::end::
|
||||
Reference in New Issue
Block a user