From 3f5efc4f7886cc32fddc38107aa2646c90d8a5fc Mon Sep 17 00:00:00 2001 From: ChiuchiuSorin Date: Tue, 7 Nov 2023 12:12:44 +0200 Subject: [PATCH] Blank space on top of dashboard items #22 * Removed html tag from macros and templates * Added html tag where the script is calling the template --- .../templates/configurationTemplate.vm | 4 +- .../templates/filesSectionTemplate.vm | 4 +- .../resources/templates/securityTemplate.vm | 4 +- .../main/resources/AdminTools/Code/Macros.xml | 195 +++++++++--------- .../src/main/resources/AdminTools/WebHome.xml | 8 +- 5 files changed, 104 insertions(+), 111 deletions(-) diff --git a/application-admintools-default/src/main/resources/templates/configurationTemplate.vm b/application-admintools-default/src/main/resources/templates/configurationTemplate.vm index 09d790c6..b167aca2 100644 --- a/application-admintools-default/src/main/resources/templates/configurationTemplate.vm +++ b/application-admintools-default/src/main/resources/templates/configurationTemplate.vm @@ -20,7 +20,6 @@ #set ($discard = $xwiki.jsx.use('AdminTools.Code.AdminToolsJS')) #includeMacros("AdminTools.Code.Macros") #viewLastNLinesMoldal("configuration") -{{html clean='false'}} #if ($configuration['serverFound'] == 'true')

$services.icon.renderHTML('world') @@ -77,5 +76,4 @@ $escapetool.xml($services.localization.render('adminTools.dashboard.section.backend.supportedServers.error')) + ':' + $stringtool.join($services.admintools.getSupportedServers(), ', ')) #warning($warningMessage) -#end -{{/html}} \ No newline at end of file +#end \ No newline at end of file diff --git a/application-admintools-default/src/main/resources/templates/filesSectionTemplate.vm b/application-admintools-default/src/main/resources/templates/filesSectionTemplate.vm index a05de3c4..75c06c74 100644 --- a/application-admintools-default/src/main/resources/templates/filesSectionTemplate.vm +++ b/application-admintools-default/src/main/resources/templates/filesSectionTemplate.vm @@ -22,7 +22,6 @@ #set($adminToolsFilesPath = "$request.getContextPath()/rest/admintools/files") #viewLastNLinesMoldal("files") #downloadArchiveModal() -{{html clean='false'}} #if ($found)

$services.icon.renderHTML('download') @@ -65,5 +64,4 @@ $escapetool.xml($services.localization.render('adminTools.dashboard.section.backend.supportedServers.error')) + $stringtool.join($services.admintools.getSupportedServers(), ', ')) #warning($warningMessage) -#end -{{/html}} \ No newline at end of file +#end \ No newline at end of file diff --git a/application-admintools-default/src/main/resources/templates/securityTemplate.vm b/application-admintools-default/src/main/resources/templates/securityTemplate.vm index fa334e4e..7c04c5d1 100644 --- a/application-admintools-default/src/main/resources/templates/securityTemplate.vm +++ b/application-admintools-default/src/main/resources/templates/securityTemplate.vm @@ -17,7 +17,6 @@ ## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ## 02110-1301 USA, or see the FSF site: http://www.fsf.org. ## --------------------------------------------------------------------------- -{{html clean='false'}} #if($security['serverFound'] == 'true')

$services.icon.renderHTML('lock') @@ -48,5 +47,4 @@ #else #set($warningMessage = $escapetool.xml($services.localization.render('adminTools.dashboard.section.security.error'))) #warning($warningMessage) -#end -{{/html}} \ No newline at end of file +#end \ No newline at end of file diff --git a/application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml b/application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml index ede8020d..1d746496 100644 --- a/application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml +++ b/application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml @@ -38,123 +38,118 @@ {{velocity output='false'}} #macro (viewLastNLinesMoldal $id) #set ($modalId = $id + 'ViewLastNLinesModal') - {{html clean='false'}} - <div class="modal fade" id="${modalId}" tabindex="-1" role="dialog" aria-labelledby="${modalId}Label"> - <div class="modal-dialog modal-sm" role="document"> - <div class="modal-content"> - <div class="logs-modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"> - <span aria-hidden="true">&times;</span></button> - <h1 class="modal-title"> - $escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.title')) - </h1> - </div> - <div class="modal-body"> - <form class="xform" action="$request.getContextPath()/rest/admintools/files/logs"> - <dl> - <dt> - <label for="noLines">$escapetool.xml($services.localization.render( - 'adminTools.dashboard.logs.modal.nLines.label')) </label> - <span class="xHint">$escapetool.xml($services.localization.render( - 'adminTools.dashboard.logs.modal.nLines.hint'))</span> - </dt> - <dd><input type="number" name="noLines" placeholder="1000"></dd> - </dl> - </form> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-primary"> - $escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.submit'))</button> - <button type="button" class="btn btn-default" data-dismiss="modal"> - $escapetool.xml($services.localization.render('cancel'))</button> - </div> - </div> - </div> - </div> - </div> - {{/html}} -#end -#macro (downloadArchiveModal) - - {{html clean='false'}} - <div class="modal fade" id="downloadFilesModal" tabindex="-1" role="dialog" aria-labelledby= - "downloadFilesModalLabel"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> + <div class="modal fade" id="${modalId}" tabindex="-1" role="dialog" aria-labelledby="${modalId}Label"> + <div class="modal-dialog modal-sm" role="document"> + <div class="modal-content"> + <div class="logs-modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span></button> <h1 class="modal-title"> - $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.title')) + $escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.title')) </h1> </div> <div class="modal-body"> - <form class="xform" action="$request.getContextPath()/rest/admintools/files"> - <div class="download-modal-content"> - <dl> - <dt><label><input type="checkbox" name="files" value="xwikiConfig" checked> - $escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.xwikiConfig.title')) - </label> - </dt> - <dt><label><input type="checkbox" name="files" value="xwikiProperties" checked> - $escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.xwikiProperties.title')) - </label> - </dt> - <dt> - <label><input type="checkbox" name="files" value="dataProvider" checked> - $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.provided')) - </label> - </dt> - <dt> - <label><input type="checkbox" name="files" value="logs" checked> - $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.logs.title')) - </label> - </dt> - <dt> - <div class="dateFields"> - #set ($defaultDateFormat = 'dd-MM-yyyy') - #set ($dateFormat = $xwiki.getXWikiPreference('dateformat', $defaultDateFormat)) - <label for="downloadFilesModalFromDate">$escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.date.from')) - </label> - #set ($dateFromParams = { - 'id': "downloadFilesModalFromDate", - 'name': 'from', - 'data-format': $dateFormat, - 'placeholder': $escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.logs.filter.placeholder.from')) - }) - #dateTimePicker($dateFromParams) - <label for="downloadFilesModalToDate">$escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.date.to')) - </label> - #set ($dateToParams = { - 'id': "downloadFilesModalToDate", - 'name': 'to', - 'data-format': $dateFormat, - 'placeholder': $escapetool.xml($services.localization.render( - 'adminTools.dashboard.download.modal.logs.filter.placeholder.to')) - }) - #dateTimePicker($dateToParams) - </div> - </dt> - </dl> - </div> + <form class="xform" action="$request.getContextPath()/rest/admintools/files/logs"> + <dl> + <dt> + <label for="noLines">$escapetool.xml($services.localization.render( + 'adminTools.dashboard.logs.modal.nLines.label')) </label> + <span class="xHint">$escapetool.xml($services.localization.render( + 'adminTools.dashboard.logs.modal.nLines.hint'))</span> + </dt> + <dd><input type="number" name="noLines" placeholder="1000"></dd> + </dl> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary"> - $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.button'))</button> + $escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.submit'))</button> <button type="button" class="btn btn-default" data-dismiss="modal"> $escapetool.xml($services.localization.render('cancel'))</button> </div> </div> </div> </div> - {{/html}} + </div> +#end +#macro (downloadArchiveModal) + <div class="modal fade" id="downloadFilesModal" tabindex="-1" role="dialog" aria-labelledby= + "downloadFilesModalLabel"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">&times;</span></button> + <h1 class="modal-title"> + $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.title')) + </h1> + </div> + <div class="modal-body"> + <form class="xform" action="$request.getContextPath()/rest/admintools/files"> + <div class="download-modal-content"> + <dl> + <dt><label><input type="checkbox" name="files" value="xwikiConfig" checked> + $escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.xwikiConfig.title')) + </label> + </dt> + <dt><label><input type="checkbox" name="files" value="xwikiProperties" checked> + $escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.xwikiProperties.title')) + </label> + </dt> + <dt> + <label><input type="checkbox" name="files" value="dataProvider" checked> + $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.provided')) + </label> + </dt> + <dt> + <label><input type="checkbox" name="files" value="logs" checked> + $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.logs.title')) + </label> + </dt> + <dt> + <div class="dateFields"> + #set ($defaultDateFormat = 'dd-MM-yyyy') + #set ($dateFormat = $xwiki.getXWikiPreference('dateformat', $defaultDateFormat)) + <label for="downloadFilesModalFromDate">$escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.date.from')) + </label> + #set ($dateFromParams = { + 'id': "downloadFilesModalFromDate", + 'name': 'from', + 'data-format': $dateFormat, + 'placeholder': $escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.logs.filter.placeholder.from')) + }) + #dateTimePicker($dateFromParams) + <label for="downloadFilesModalToDate">$escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.date.to')) + </label> + #set ($dateToParams = { + 'id': "downloadFilesModalToDate", + 'name': 'to', + 'data-format': $dateFormat, + 'placeholder': $escapetool.xml($services.localization.render( + 'adminTools.dashboard.download.modal.logs.filter.placeholder.to')) + }) + #dateTimePicker($dateToParams) + </div> + </dt> + </dl> + </div> + </form> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-primary"> + $escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.button'))</button> + <button type="button" class="btn btn-default" data-dismiss="modal"> + $escapetool.xml($services.localization.render('cancel'))</button> + </div> + </div> + </div> + </div> #end {{/velocity}} \ No newline at end of file diff --git a/application-admintools-ui/src/main/resources/AdminTools/WebHome.xml b/application-admintools-ui/src/main/resources/AdminTools/WebHome.xml index b8ea0073..535f86e6 100644 --- a/application-admintools-ui/src/main/resources/AdminTools/WebHome.xml +++ b/application-admintools-ui/src/main/resources/AdminTools/WebHome.xml @@ -90,7 +90,9 @@ {{velocity}} -$services.admintools.getConfigurationData('configuration') +{{html clean='false'}} + $services.admintools.getConfigurationData('configuration') +{{/html}} {{/velocity}} @@ -155,7 +157,9 @@ $services.admintools.getConfigurationData('configuration') {{velocity}} -$services.admintools.getFilesSection() +{{html clean='false'}} + $services.admintools.getFilesSection() +{{/html}} {{/velocity}}