Commit 676d5a95 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing template editor layout

parent 7b8985c4
......@@ -290,10 +290,8 @@ class MailTemplateService {
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
public function sendEmail($isPreview = FALSE) {
if (!$this->pid) {
return FALSE;
}
$siteRootId = BackendService::getSiteRoot($this->pid);
$pageUid = (int) GeneralUtility::_GP('id');
$siteRootId = BackendService::getSiteRoot($pageUid);
/** @var Template $template */
$template = $this->templateRepository->findOneByTemplate(
......
<p>
<h3>{f:translate(key:'backend.no_site_root')}</h3>
</p>
<div class="row">
<p>
<h3>{f:translate(key:'backend.no_site_root')}</h3>
</p>
</div>
......@@ -6,214 +6,221 @@
</f:section>
<f:section name="content">
<f:flashMessages />
<br />
<f:if condition="{selectedTemplate}">
<f:then>
<div class="form-group col-md-6">
<p>{templateDescription}</p>
</div>
<div class="form-group col-md-2 col-md-offset-3">
<f:link.action class="reset-btn reset-all-btn btn-danger btn form-group" action="reset" arguments="{template: selectedTemplateKey, extensionKey: selectedTemplate.extension}">{f:translate(key:'backend.button_reset_all')}</f:link.action>
</div>
<div class="col-md-12">
<table class="table table-hover">
<thead>
<tr>
<th><f:translate key="backend.marker" /></th>
<th><f:translate key="backend.type" /></th>
<th><f:translate key="backend.value" /></th>
<th><f:translate key="backend.usage" /></th>
<th><f:translate key="backend.description" /></th>
</tr>
</thead>
<f:for each="{selectedTemplate.marker}" as="marker">
<tr>
<td>{marker.marker}</td>
<td>
<f:if condition="{marker.type}">
<f:then>
<f:translate key="{marker.type}">{marker.type}</f:translate>
</f:then>
<f:else>
<f:translate key="backend.marker.type.string" />
</f:else>
</f:if>
</td>
<td>
<f:if condition="{sgm:isArray(value: '{marker.value}')}">
<f:then>
<f:for each="{marker.value}" as="value" key="key">
{key}: {value}
<br />
</f:for>
</f:then>
<f:else>
<f:translate key="{marker.value}">{marker.value}</f:translate>
</f:else>
</f:if>
</td>
<td>
<f:if condition="{marker.usage}">
<f:then>
{marker.usage}
</f:then>
<f:else>
<![CDATA[{]]>{marker.marker}<![CDATA[}]]>
</f:else>
</f:if>
</td>
<td>
<f:translate key="{marker.description}">{marker.description}</f:translate>
</td>
</tr>
</f:for>
</table>
</div>
<f:form class="col-md-12" method="post" controller="Mail" action="sendTestMail">
<div class="col-md-12 form-group">
<f:form.submit class="btn-primary btn form-group" value="{f:translate(key:'backend.send_test')}" />
<f:form.textfield name="parameters[emailAddress]" type="email" required="TRUE" class="email-input form-group" value="{beUserMail}" />
<f:form.hidden name="parameters[selectedLanguageLeft]" value="{selectedLanguageLeft}" />
<f:form.hidden name="parameters[selectedLanguageRight]" value="{selectedLanguageRight}" />
<f:form.hidden name="parameters[selectedTemplate]" value="{selectedTemplateKey}" />
<f:form.hidden name="parameters[selectedExtensionKey]" value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedExtension]" value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedTemplateKey]" value="{selectedTemplateKey}" />
<div class="row form-group col-md-12">
<div class=" col-md-8">
<p>{templateDescription}</p>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="">{f:translate(key:'backend.select_language')}</label>
<f:be.menus.actionMenu>
<f:for each="{languages}" as="language">
<sgm:extendedIf condition="{language} == {selectedLanguageLeft}">
<f:then>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: language, selectedLanguageRight: selectedLanguageRight, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: language, selectedLanguageRight: selectedLanguageRight, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}" />
</f:else>
</sgm:extendedIf>
</f:for>
</f:be.menus.actionMenu>
</div>
<div class="form-group">
<f:link.action class="reset-btn btn-danger btn form-group" action="reset" arguments="{template: selectedTemplateKey, language: selectedLanguageLeft, extensionKey: selectedTemplate.extension}">{f:translate(key:'backend.button_reset')}</f:link.action>
</div>
<div class="form-group">
<label for="parameters[fromNameLeft]" class="">{f:translate(key:'backend.fromName')}</label>
<f:form.textfield type="text" class="form-control" value="{fromNameLeft}" name="parameters[fromNameLeft]" />
</div>
<div class="form-group">
<label for="parameters[fromMailLeft]" class="">{f:translate(key:'backend.fromMail')}</label>
<f:form.textfield type="email" class="form-control" value="{fromMailLeft}" name="parameters[fromMailLeft]" />
</div>
<div class="form-group">
<label for="parameters[ccLeft]" class="">{f:translate(key:'backend.cc')}</label>
<f:form.textfield type="text" class="form-control" value="{ccLeft}" name="parameters[ccLeft]" />
</div>
<div class="form-group">
<label for="parameters[bccLeft]" class="">{f:translate(key:'backend.bcc')}</label>
<f:form.textfield type="text" class="form-control" value="{bccLeft}" name="parameters[bccLeft]" />
</div>
<div class="form-group">
<label for="parameters[replyToLeft]" class="">{f:translate(key:'backend.replyTo')}</label>
<f:form.textfield type="text" class="form-control" value="{replyToLeft}" name="parameters[replyToLeft]" />
</div>
<div class="form-group">
<label for="parameters[subjectLeft]" class="">{f:translate(key:'backend.subject')}</label>
<f:form.textfield type="text" class="form-control" value="{subjectLeft}" name="parameters[subjectLeft]" />
</div>
<label for="parameters[contentLeft]" class="">{f:translate(key:'backend.content')}</label>
<f:form.textarea class="form-control" rows="25" name="parameters[contentLeft]" value="{contentLeft}" />
<div class=" col-md-4">
<f:link.action class="reset-btn reset-all-btn btn-danger btn" style="width: 100%;" action="reset" arguments="{template: selectedTemplateKey, extensionKey: selectedTemplate.extension}">{f:translate(key:'backend.button_reset_all')}</f:link.action>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="">{f:translate(key:'backend.select_language')}</label>
<f:be.menus.actionMenu>
<f:for each="{languages}" as="language">
<sgm:extendedIf condition="{language} == {selectedLanguageRight}">
<f:then>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: selectedLanguageLeft, selectedLanguageRight: language, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: selectedLanguageLeft, selectedLanguageRight: language, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}" />
</f:else>
</sgm:extendedIf>
</div>
<div class="col-md-12 row">
<div class="col-md-12">
<div class="form-group">
<table class="table table-hover">
<thead>
<tr>
<th><f:translate key="backend.marker" /></th>
<th><f:translate key="backend.type" /></th>
<th><f:translate key="backend.value" /></th>
<th><f:translate key="backend.usage" /></th>
<th><f:translate key="backend.description" /></th>
</tr>
</thead>
<f:for each="{selectedTemplate.marker}" as="marker">
<tr>
<td>{marker.marker}</td>
<td>
<f:if condition="{marker.type}">
<f:then>
<f:translate key="{marker.type}">{marker.type}</f:translate>
</f:then>
<f:else>
<f:translate key="backend.marker.type.string" />
</f:else>
</f:if>
</td>
<td>
<f:if condition="{sgm:isArray(value: '{marker.value}')}">
<f:then>
<f:for each="{marker.value}" as="value" key="key">
{key}: {value}
<br />
</f:for>
</f:then>
<f:else>
<f:translate key="{marker.value}">{marker.value}</f:translate>
</f:else>
</f:if>
</td>
<td>
<f:if condition="{marker.usage}">
<f:then>
{marker.usage}
</f:then>
<f:else>
<![CDATA[{]]>{marker.marker}<![CDATA[}]]>
</f:else>
</f:if>
</td>
<td>
<f:translate key="{marker.description}">{marker.description}</f:translate>
</td>
</tr>
</f:for>
</f:be.menus.actionMenu>
</table>
</div>
<div class="form-group">
<f:link.action class="reset-btn btn-danger btn form-group" action="reset" arguments="{template: selectedTemplateKey, language: selectedLanguageRight, extensionKey: selectedTemplate.extension}">{f:translate(key:'backend.button_reset')}</f:link.action>
</div>
<div class="form-group">
<label for="parameters[fromNameRight]" class="">{f:translate(key:'backend.fromName')}</label>
<f:form.textfield type="text" class="form-control" value="{fromNameRight}" name="parameters[fromNameRight]" />
</div>
<div class="form-group">
<label for="parameters[fromMailRight]" class="">{f:translate(key:'backend.fromMail')}</label>
<f:form.textfield type="email" class="form-control" value="{fromMailRight}" name="parameters[fromMailRight]" />
</div>
<div class="form-group">
<label for="parameters[ccRight]" class="">{f:translate(key:'backend.cc')}</label>
<f:form.textfield type="text" class="form-control" value="{ccRight}" name="parameters[ccRight]" />
</div>
<div class="form-group">
<label for="parameters[bccRight]" class="">{f:translate(key:'backend.bcc')}</label>
<f:form.textfield type="text" class="form-control" value="{bccRight}" name="parameters[bccRight]" />
</div>
<div class="form-group">
<label for="parameters[replyToRight]" class="">{f:translate(key:'backend.replyTo')}</label>
<f:form.textfield type="text" class="form-control" value="{replyToRight}" name="parameters[replyToRight]" />
</div>
<div class="form-group">
<label for="parameters[subjectRight]" class="">{f:translate(key:'backend.subject')}</label>
<f:form.textfield type="text" class=" form-control" value="{subjectRight}" name="parameters[subjectRight]" />
</div>
<label for="parameters[contentRight]" class="">{f:translate(key:'backend.content')}</label>
<f:form.textarea class="form-control" rows="25" name="parameters[contentRight]" value="{contentRight}" />
</div>
<div class="col-md-2">
<div class="form-group">
<f:form.submit class="btn-primary btn form-group btn-save-backend " value="{f:translate(key:'backend.send_test')}" />
</div>
<div class="row col-md-12">
<f:form method="post" controller="Mail" action="sendTestMail">
<div class="col-md-12 form-group">
<f:form.submit class="btn-primary btn form-group" value="{f:translate(key:'backend.send_test')}" />
<f:form.textfield name="parameters[emailAddress]" type="email" required="TRUE" class="email-input form-group" value="{beUserMail}" />
<f:form.hidden name="parameters[selectedLanguageLeft]" value="{selectedLanguageLeft}" />
<f:form.hidden name="parameters[selectedLanguageRight]" value="{selectedLanguageRight}" />
<f:form.hidden name="parameters[selectedTemplate]" value="{selectedTemplateKey}" />
<f:form.hidden name="parameters[selectedExtensionKey]" value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedExtension]" value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedTemplateKey]" value="{selectedTemplateKey}" />
</div>
<div class="col-md-6">
<div class="form-group">
<label class="">{f:translate(key:'backend.select_language')}</label>
<f:be.menus.actionMenu>
<f:for each="{languages}" as="language">
<sgm:extendedIf condition="{language} == {selectedLanguageLeft}">
<f:then>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: language, selectedLanguageRight: selectedLanguageRight, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{selectedLanguageLeft: language, selectedLanguageRight: selectedLanguageRight, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}" />
</f:else>
</sgm:extendedIf>
</f:for>
</f:be.menus.actionMenu>
</div>
<div class="form-group">
<label for="parameters[fromNameLeft]" class="">{f:translate(key:'backend.fromName')}</label>
<f:form.textfield type="text" class="form-control" value="{fromNameLeft}" name="parameters[fromNameLeft]" />
</div>
<div class="form-group">
<label for="parameters[fromMailLeft]" class="">{f:translate(key:'backend.fromMail')}</label>
<f:form.textfield type="email" class="form-control" value="{fromMailLeft}" name="parameters[fromMailLeft]" />
</div>
<div class="form-group">
<label for="parameters[ccLeft]" class="">{f:translate(key:'backend.cc')}</label>
<f:form.textfield type="text" class="form-control" value="{ccLeft}" name="parameters[ccLeft]" />
</div>
<div class="form-group">
<label for="parameters[bccLeft]" class="">{f:translate(key:'backend.bcc')}</label>
<f:form.textfield type="text" class="form-control" value="{bccLeft}" name="parameters[bccLeft]" />
</div>
<div class="form-group">
<label for="parameters[replyToLeft]" class="">{f:translate(key:'backend.replyTo')}</label>
<f:form.textfield type="text" class="form-control" value="{replyToLeft}" name="parameters[replyToLeft]" />
</div>
<div class="form-group">
<label for="parameters[subjectLeft]" class="">{f:translate(key:'backend.subject')}</label>
<f:form.textfield type="text" class="form-control" value="{subjectLeft}" name="parameters[subjectLeft]" />
</div>
<label for="parameters[contentLeft]" class="">{f:translate(key:'backend.content')}</label>
<f:form.textarea class="form-control" rows="25" name="parameters[contentLeft]" value="{contentLeft}" />
</div>
</div>
</f:form>
<div class="col-md-6">
<div class="form-group">
<label class="">{f:translate(key:'backend.select_language')}</label>
<f:be.menus.actionMenu>
<f:for each="{languages}" as="language">
<sgm:extendedIf condition="{language} == {selectedLanguageRight}">
<f:then>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{parmselectedLanguageLeft: selectedLanguageLeft, selectedLanguageRight: language, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{language}"
controller="Mail"
action="index"
arguments="{parameters: {selectedLanguageLeft: selectedLanguageLeft, selectedLanguageRight: language, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}}" />
arguments="{selectedLanguageLeft: selectedLanguageLeft, selectedLanguageRight: language, selectedTemplate: selectedTemplateKey, selectedExtensionKey: selectedTemplate.extension, selectedExtension: selectedTemplate.extension, selectedTemplateKey: selectedTemplateKey}" />
</f:else>
</sgm:extendedIf>
</f:for>
</f:be.menus.actionMenu>
</div>
<div class="form-group">
<label for="parameters[fromNameRight]" class="">{f:translate(key:'backend.fromName')}</label>
<f:form.textfield type="text" class="form-control" value="{fromNameRight}" name="parameters[fromNameRight]" />
</div>
<div class="form-group">
<label for="parameters[fromMailRight]" class="">{f:translate(key:'backend.fromMail')}</label>
<f:form.textfield type="email" class="form-control" value="{fromMailRight}" name="parameters[fromMailRight]" />
</div>
<div class="form-group">
<label for="parameters[ccRight]" class="">{f:translate(key:'backend.cc')}</label>
<f:form.textfield type="text" class="form-control" value="{ccRight}" name="parameters[ccRight]" />
</div>
<div class="form-group">
<label for="parameters[bccRight]" class="">{f:translate(key:'backend.bcc')}</label>
<f:form.textfield type="text" class="form-control" value="{bccRight}" name="parameters[bccRight]" />
</div>
<div class="form-group">
<label for="parameters[replyToRight]" class="">{f:translate(key:'backend.replyTo')}</label>
<f:form.textfield type="text" class="form-control" value="{replyToRight}" name="parameters[replyToRight]" />
</div>
<div class="form-group">
<label for="parameters[subjectRight]" class="">{f:translate(key:'backend.subject')}</label>
<f:form.textfield type="text" class=" form-control" value="{subjectRight}" name="parameters[subjectRight]" />
</div>
<label for="parameters[contentRight]" class="">{f:translate(key:'backend.content')}</label>
<f:form.textarea class="form-control" rows="25" name="parameters[contentRight]" value="{contentRight}" />
</div>
<div class="col-md-2">
<div class="form-group">
<f:form.submit class="btn-primary btn form-group btn-save-backend " value="{f:translate(key:'backend.send_test')}" />
</div>
</div>
</f:form>
</div>
</f:then>
<f:else>
<f:render partial="Mail/Empty" />
</f:else>
</f:if>
<f:if condition="{pages}">
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="pages" class="table table-striped table-hover">
<tbody>
<f:for each="{pages}" as="page">
<tr data-uid="{page.pid}">
<td nowrap="nowrap" class="col-title">
<a href="#" onclick="sgMailGoToPage({page.uid}); return false;">
<sgm:backend.icon table="pages" row="{page}" clickMenu="0" />
{page._thePathFull}
</a>
</td>
</tr>
</f:for>
</tbody>
</table>
<div class="row">
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="pages" class="table table-striped table-hover">
<tbody>
<f:for each="{pages}" as="page">
<tr data-uid="{page.pid}">
<td nowrap="nowrap" class="col-title">
<a href="#" onclick="sgMailGoToPage({page.uid}); return false;">
<sgm:backend.icon table="pages" row="{page}" clickMenu="0" />
{page._thePathFull}
</a>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
</div>
</div>
</f:if>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment