From fdeeb7f35f8d531955999e2b9210cdac3612c712 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Fri, 4 Aug 2017 17:34:49 +0200
Subject: [PATCH] [TASK] Cleanup and improved styles for the unsent mails

---
 Resources/Private/Templates/Queue/Index.html | 35 ++++++++------------
 Resources/Public/Scripts/Backend.js          |  5 +--
 Resources/Public/StyleSheets/backend.css     | 10 ++++--
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/Resources/Private/Templates/Queue/Index.html b/Resources/Private/Templates/Queue/Index.html
index e3be7c02..96664ad1 100644
--- a/Resources/Private/Templates/Queue/Index.html
+++ b/Resources/Private/Templates/Queue/Index.html
@@ -35,13 +35,11 @@
 											<tr data-uid="{mail.uid}">
 										</f:then>
 										<f:else>
-											<tr data-uid="{mail.uid}" style="background-color: #7C7C7C;">
+											<tr data-uid="{mail.uid}" class="recordlist-mail-unsent">
 										</f:else>
 									</f:if>
 									<td nowrap="nowrap" class="col-icon">
-										<f:format.raw>
-											<sgm:backend.icon table="tx_sgmail_domain_model_mail" row="{mail}" />
-										</f:format.raw>
+										<f:format.raw><sgm:backend.icon table="tx_sgmail_domain_model_mail" row="{mail}" /></f:format.raw>
 									</td>
 									<td>
 										<span>{mail.from_address}</span>
@@ -74,29 +72,26 @@
 										</f:if>
 									</td>
 									<td nowrap="nowrap" class="col-control">
-										<f:format.raw>
-											<sgm:backend.control table="tx_sgmail_domain_model_mail" row="{mail}" />
-										</f:format.raw>
+										<f:format.raw><sgm:backend.control table="tx_sgmail_domain_model_mail" row="{mail}" /></f:format.raw>
 									</td>
 									<td>
 										<f:link.action class="btn btn-default btn-send-now" controller="Queue" action="sendMail" arguments="{uid: mail.uid, selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}">
-													<span class="t3js-icon icon icon-size-small icon-state-default actions-document-import-t3d">
-														<span class="icon-markup">
-															<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-import-t3d.svg" width="16" height="16">
-														</span>
-													</span>
+											<span class="t3js-icon icon icon-size-small icon-state-default actions-document-import-t3d">
+												<span class="icon-markup">
+													<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-import-t3d.svg" width="16" height="16">
+												</span>
+											</span>
 											<f:translate key="backend.send_now" />
 										</f:link.action>
 										<a class="btn btn-default btn-toggle" data-uid="{mail.uid}">
-																							<span class="t3js-icon icon icon-size-small icon-state-default actions-document-view">
-																								<span class="icon-markup">
-																									<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-view.svg" width="16" height="16">
-																								</span>
-																							</span>
+											<span class="t3js-icon icon icon-size-small icon-state-default actions-document-view">
+												<span class="icon-markup">
+													<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-view.svg" width="16" height="16">
+												</span>
+											</span>
 											<f:translate key="backend.showBody" />
 										</a>
 									</td>
-									</tr><!-- Modal -->
 									<div class="modal fade" id="toggle-{mail.uid}" tabindex="-1" role="dialog" aria-labelledby="login-modal-label">
 										<div class="modal-dialog" role="document">
 											<div class="modal-content">
@@ -107,9 +102,7 @@
 												</div>
 												<div class="modal-body" id="login-modal-body">
 													<div class="modalcol modalcol-left">
-														<f:format.html>
-															{mail.mail_body}
-														</f:format.html>
+														<f:format.html>{mail.mail_body}</f:format.html>
 													</div>
 												</div>
 											</div>
diff --git a/Resources/Public/Scripts/Backend.js b/Resources/Public/Scripts/Backend.js
index cdb58547..71a161d4 100644
--- a/Resources/Public/Scripts/Backend.js
+++ b/Resources/Public/Scripts/Backend.js
@@ -36,7 +36,8 @@
 		$('.btn-send-now').on('click', sendMailListener);
 		$('.btn-resend').on('click', resendMailListener);
 		$('.btn-toggle').on('click', toggleMailBody);
-		$('#filter-reset-btn').on('click', function() {
+		$('#filter-reset-btn').on('click', function(event) {
+			event.preventDefault();
 			this.form.reset();
 			$(this).closest('form').find('select').each(function() {
 				this.selectedIndex = 0;
@@ -94,4 +95,4 @@ function gotToPageCallback(path) {
 	if (node) {
 		top.TYPO3.Components.PageTree.Actions.singleClick(node, top.TYPO3.Components.PageTree.Tree);
 	}
-}
\ No newline at end of file
+}
diff --git a/Resources/Public/StyleSheets/backend.css b/Resources/Public/StyleSheets/backend.css
index ae0200b4..2f2c479a 100644
--- a/Resources/Public/StyleSheets/backend.css
+++ b/Resources/Public/StyleSheets/backend.css
@@ -15,8 +15,8 @@
 .f3-widget-paginator {
 	display: inline-block;
 	border-radius: 4px;
-	margin: 20px 0px;
-	padding-left: 0px;
+	margin: 20px 0;
+	padding-left: 0;
 	background-color: red;
 }
 
@@ -45,7 +45,7 @@
 
 .f3-widget-paginator > li:first-child > a,
 .f3-widget-paginator > li.current:first-child {
-	margin-left: 0px;
+	margin-left: 0;
 	border-top-left-radius: 4px;
 	border-bottom-left-radius: 4px;
 }
@@ -70,3 +70,7 @@
 	margin: 5px 0;
 	border-top: 1px solid #EAEAEA;
 }
+
+.recordlist-mail-unsent {
+	background-color: #CCC !important;
+}
-- 
GitLab