add Twig templates and translations, move Smarty templates to appropriate folder

This commit is contained in:
Daniel Seifert 2024-05-10 12:18:00 +02:00
parent 7ed3a7be0e
commit bb7b9c2025
13 changed files with 231 additions and 5 deletions

View File

@ -0,0 +1,25 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = 'Deutsch';
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = include __DIR__."/../../de/d3DataWizard_translations.php";
// @codeCoverageIgnoreEnd

View File

@ -0,0 +1,25 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
declare(strict_types=1);
$sLangName = 'English';
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = include __DIR__."/../../en/d3DataWizard_translations.php";
// @codeCoverageIgnoreEnd

View File

@ -42,11 +42,11 @@ $aModule = [
'extend' => [],
'events' => [],
'templates' => [
'@' . Constants::OXID_MODULE_ID . '/admin/d3ExportWizard.tpl' => 'views/smarty/admin/tpl/d3ExportWizard.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3ActionWizard.tpl' => 'views/smarty/admin/tpl/d3ActionWizard.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3Wizards.tpl' => 'views/smarty/admin/tpl/inc/Wizards.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3ExportSubmit.tpl' => 'views/smarty/admin/tpl/inc/exportSubmit.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3ActionSubmit.tpl' => 'views/smarty/admin/tpl/inc/actionSubmit.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3ExportWizard.tpl' => 'views/smarty/admin/d3ExportWizard.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3ActionWizard.tpl' => 'views/smarty/admin/d3ActionWizard.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3Wizards.tpl' => 'views/smarty/admin/inc/Wizards.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3ExportSubmit.tpl' => 'views/smarty/admin/inc/exportSubmit.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/inc/d3ActionSubmit.tpl' => 'views/smarty/admin/inc/actionSubmit.tpl',
],
'settings' => [
[

View File

@ -0,0 +1,4 @@
{% set d3dw_backgroundimage %}linear-gradient(22.5deg, rgba(66, 66, 66, 0.02) 0%, rgba(66, 66, 66, 0.02) 11%,rgba(135, 135, 135, 0.02) 11%, rgba(135, 135, 135, 0.02) 24%,rgba(29, 29, 29, 0.02) 24%, rgba(29, 29, 29, 0.02) 38%,rgba(15, 15, 15, 0.02) 38%, rgba(15, 15, 15, 0.02) 50%,rgba(180, 180, 180, 0.02) 50%, rgba(180, 180, 180, 0.02) 77%,rgba(205, 205, 205, 0.02) 77%, rgba(205, 205, 205, 0.02) 100%),linear-gradient(67.5deg, rgba(10, 10, 10, 0.02) 0%, rgba(10, 10, 10, 0.02) 22%,rgba(52, 52, 52, 0.02) 22%, rgba(52, 52, 52, 0.02) 29%,rgba(203, 203, 203, 0.02) 29%, rgba(203, 203, 203, 0.02) 30%,rgba(69, 69, 69, 0.02) 30%, rgba(69, 69, 69, 0.02) 75%,rgba(231, 231, 231, 0.02) 75%, rgba(231, 231, 231, 0.02) 95%,rgba(138, 138, 138, 0.02) 95%, rgba(138, 138, 138, 0.02) 100%),linear-gradient(112.5deg, rgba(221, 221, 221, 0.02) 0%, rgba(221, 221, 221, 0.02) 17%,rgba(190, 190, 190, 0.02) 17%, rgba(190, 190, 190, 0.02) 39%,rgba(186, 186, 186, 0.02) 39%, rgba(186, 186, 186, 0.02) 66%,rgba(191, 191, 191, 0.02) 66%, rgba(191, 191, 191, 0.02) 68%,rgba(16, 16, 16, 0.02) 68%, rgba(16, 16, 16, 0.02) 70%,rgba(94, 94, 94, 0.02) 70%, rgba(94, 94, 94, 0.02) 100%),linear-gradient(90deg, #ffffff,#ffffff){% endset %}
{% set d3dw_noitemmessageid %}D3_DATAWIZARD_ERR_NOACTION_INSTALLED{% endset %}
{% include "@d3datawizard/admin/inc/Wizards.html.twig" with {submit: "@d3datawizard/admin/inc/actionSubmit.html.twig"} %}

View File

@ -0,0 +1,4 @@
{% set d3dw_backgroundimage %}linear-gradient(339deg, rgba(47, 47, 47,0.02) 0%, rgba(47, 47, 47,0.02) 42%,transparent 42%, transparent 99%,rgba(17, 17, 17,0.02) 99%, rgba(17, 17, 17,0.02) 100%),linear-gradient(257deg, rgba(65, 65, 65,0.02) 0%, rgba(65, 65, 65,0.02) 11%,transparent 11%, transparent 92%,rgba(53, 53, 53,0.02) 92%, rgba(53, 53, 53,0.02) 100%),linear-gradient(191deg, rgba(5, 5, 5,0.02) 0%, rgba(5, 5, 5,0.02) 1%,transparent 1%, transparent 45%,rgba(19, 19, 19,0.02) 45%, rgba(19, 19, 19,0.02) 100%),linear-gradient(29deg, rgba(28, 28, 28,0.02) 0%, rgba(28, 28, 28,0.02) 33%,transparent 33%, transparent 40%,rgba(220, 220, 220,0.02) 40%, rgba(220, 220, 220,0.02) 100%),linear-gradient(90deg, rgb(255,255,255),rgb(255,255,255)){% endset %}
{% set d3dw_noitemmessageid %}D3_DATAWIZARD_ERR_NOEXPORT_INSTALLED{% endset %}
{% include "@d3datawizard/admin/inc/Wizards.html.twig" with {submit: "@d3datawizard/admin/inc/exportSubmit.html.twig"} %}

View File

@ -0,0 +1,136 @@
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
{{ style({ include: "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" }) }}
{{ script({ include: "https://code.jquery.com/jquery-3.2.1.slim.min.js", dynamic: __oxid_include_dynamic }) }}
{{ script({ include: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js", dynamic: __oxid_include_dynamic }) }}
{{ script({ include: "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js", dynamic: __oxid_include_dynamic }) }}
{{ style({ include: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css" }) }}
<style>
button {
margin: 1em 1em 1em 5em;
}
html {
font-size: 0.8em;
}
/* Image courtesy of gradientmagic.com */
body {
background-image: {{ d3dw_backgroundimage }};
}
h4 .btn {
font-size: 1.3rem;
}
h5.card-header {
font-size: 1.1rem;
}
.formElements label {
display: inline-block;
margin: .5rem 0;
}
</style>
{% capture name = "d3script" %}{% apply spaceless %}
function startTask(id, format = '') {
let elements = document.getElementsByClassName('errorbox');
for (var i = 0; i < elements.length; i++){
elements[i].style.display = 'none';
}
setTimeout(function(){
document.getElementById('mask').className='';
document.getElementById('popup2').className='d3loader-2';
}, 3000);
document.getElementById('mask').className='on';
document.getElementById('popup2').className='d3loader-2 on';
document.getElementById('taskid').value = id;
document.getElementById('format').value = format;
document.getElementById('myedit').submit();
}
{% endapply %}{% endcapture %}
{{ script({ add: d3script, dynamic: __oxid_include_dynamic }) }}
<form name="myedit" id="myedit" action="{{ oViewConf.getSelfLink() }}" method="post" style="padding: 0;margin: 0;height:0;">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="cl" value="{{ oViewConf.getActiveClassName() }}">
<input type="hidden" name="fnc" value="runTask">
<input type="hidden" name="taskid" id="taskid" value="">
<input type="hidden" name="format" id="format" value="CSV">
{% set groups = oView.getGroups() %}
{% if groups|length %}
<div id="accordion">
{% for group in oView.getGroups() %}
<div class="card mb-2">
<div class="card-header p-1" id="heading{{ group }}">
<h4 class="mb-0">
<span class="btn p-1" data-toggle="collapse" data-target="#collapse{{ group }}" aria-expanded="false" aria-controls="collapse{{ group }}">
{{ translate({ ident: group }) }}
</span>
</h4>
</div>
<div id="collapse{{ group }}" class="collapse" aria-labelledby="heading{{ group }}" data-parent="#accordion">
<div class="card-body pb-0">
<div class="row">
{% for id, item in oView.getGroupTasks(group) %}
<div class="col-sm-6 col-md-4 col-lg-3 pb-4">
<div class="card">
<h5 class="card-header">
{{ item.getTitle() }}
</h5>
<div class="card-body">
{% if item.getDescription() %}
{% set description = item.getDescription() %}
{% set sectionlength = "100" %}
{% if description|length <= sectionlength %}
<p class="card-text">{{ description }}</p>
{% else %}
{% set shorttext = description|truncate(sectionlength, '') %}
<p class="card-text" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample" style="cursor: pointer">
{{ shorttext }}...
</p>
<p class="card-text collapse" id="collapseExample">
...{{ description|replace(shorttext, '') }}
</p>
{% endif %}
{% endif %}
{% if item.hasFormElements() %}
{% for formElement in item.getFormElements() %}
{{ formElement }}
{% endfor %}
{% endif %}
{% block exportSubmit %}
{% include submit %}
{% endblock %}
</div>
</div>
</div>
{% endfor %}
</div>
<div class="clear"></div>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="alert alert-primary" role="alert">
{{ translate({ ident: d3dw_noitemmessageid }) }}
</div>
{% endif %}
</form>
<div id="mask" class=""></div>
<div id="popup2" class="d3loader-2">
<div class="d3loader-spinner">
<div class="d3loader-circle-1"></div>
<div class="d3loader-circle-2"></div>
<div class="d3loader-circle-3"></div>
</div>
</div>
{% include "@d3modcfg_lib/admin/inc/inc.html.twig" %}

View File

@ -0,0 +1,8 @@
{% block submitElements %}
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="if (confirm('{{ translate({ ident: "D3_DATAWIZARD_ACTION_SUBMIT_CONFIRM" }) }}') === true) {startTask('{{ id }}')}">)
<i class="fas fa-fw fa-magic"></i>
{{ translate({ ident: item.getButtonText() }) }}
</button>
</div>
{% endblock %}

View File

@ -0,0 +1,24 @@
{% block submitElements %}
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="startTask('{{ id }}', 'CSV')">
<i class="fas fa-fw fa-magic"></i>
{{ translate({ ident: item.getButtonText() }) }}
</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">
<i class="fas fa-fw fa-magic"></i>
{{ translate({ ident: item.getButtonText() }) }}
</span>
</button>
<div class="dropdown-menu">
{% block dataWizardFormat %}
{% set rendererBridge = item.getRendererBridge() %}
{% for key, translationId in rendererBridge.getTranslatedRendererIdList() %}
<button class="dropdown-item" onclick="startTask('{{ id }}', '{{ key }}')">
{{ translate({ ident: translationId }) }}
</button>
{% endfor %}
{% endblock %}
</div>
</div>
{% endblock %}