Skip to content

Commit

Permalink
Blank space on top of dashboard items xwikisas#22
Browse files Browse the repository at this point in the history
* Removed html tag from macros and templates
* Added html tag where the script is calling the template
  • Loading branch information
ChiuchiuSorin committed Nov 7, 2023
1 parent 6e859bd commit 3f5efc4
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
<div class="adminToolsDashboardItem">
<h2>$services.icon.renderHTML('world')
Expand Down Expand Up @@ -77,5 +76,4 @@
$escapetool.xml($services.localization.render('adminTools.dashboard.section.backend.supportedServers.error')) + ':'
+ $stringtool.join($services.admintools.getSupportedServers(), ', '))
#warning($warningMessage)
#end
{{/html}}
#end
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#set($adminToolsFilesPath = "$request.getContextPath()/rest/admintools/files")
#viewLastNLinesMoldal("files")
#downloadArchiveModal()
{{html clean='false'}}
#if ($found)
<div class="adminToolsDashboardItem">
<h2>$services.icon.renderHTML('download')
Expand Down Expand Up @@ -65,5 +64,4 @@
$escapetool.xml($services.localization.render('adminTools.dashboard.section.backend.supportedServers.error'))
+ $stringtool.join($services.admintools.getSupportedServers(), ', '))
#warning($warningMessage)
#end
{{/html}}
#end
Original file line number Diff line number Diff line change
Expand Up @@ -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')
<div class="adminToolsDashboardItem">
<h2>$services.icon.renderHTML('lock')
Expand Down Expand Up @@ -48,5 +47,4 @@
#else
#set($warningMessage = $escapetool.xml($services.localization.render('adminTools.dashboard.section.security.error')))
#warning($warningMessage)
#end
{{/html}}
#end
195 changes: 95 additions & 100 deletions application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,123 +38,118 @@
<content>{{velocity output='false'}}
#macro (viewLastNLinesMoldal $id)
#set ($modalId = $id + 'ViewLastNLinesModal')
{{html clean='false'}}
&lt;div class="modal fade" id="${modalId}" tabindex="-1" role="dialog" aria-labelledby="${modalId}Label">
&lt;div class="modal-dialog modal-sm" role="document">
&lt;div class="modal-content">
&lt;div class="logs-modal-content">
&lt;div class="modal-header">
&lt;button type="button" class="close" data-dismiss="modal" aria-label="Close">
&lt;span aria-hidden="true">&amp;times;&lt;/span>&lt;/button>
&lt;h1 class="modal-title">
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.title'))
&lt;/h1>
&lt;/div>
&lt;div class="modal-body">
&lt;form class="xform" action="$request.getContextPath()/rest/admintools/files/logs">
&lt;dl>
&lt;dt>
&lt;label for="noLines">$escapetool.xml($services.localization.render(
'adminTools.dashboard.logs.modal.nLines.label')) &lt;/label>
&lt;span class="xHint">$escapetool.xml($services.localization.render(
'adminTools.dashboard.logs.modal.nLines.hint'))&lt;/span>
&lt;/dt>
&lt;dd>&lt;input type="number" name="noLines" placeholder="1000">&lt;/dd>
&lt;/dl>
&lt;/form>
&lt;/div>
&lt;div class="modal-footer">
&lt;button type="button" class="btn btn-primary">
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.submit'))&lt;/button>
&lt;button type="button" class="btn btn-default" data-dismiss="modal">
$escapetool.xml($services.localization.render('cancel'))&lt;/button>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
{{/html}}
#end
#macro (downloadArchiveModal)

{{html clean='false'}}
&lt;div class="modal fade" id="downloadFilesModal" tabindex="-1" role="dialog" aria-labelledby=
"downloadFilesModalLabel">
&lt;div class="modal-dialog" role="document">
&lt;div class="modal-content">
&lt;div class="modal fade" id="${modalId}" tabindex="-1" role="dialog" aria-labelledby="${modalId}Label">
&lt;div class="modal-dialog modal-sm" role="document">
&lt;div class="modal-content">
&lt;div class="logs-modal-content">
&lt;div class="modal-header">
&lt;button type="button" class="close" data-dismiss="modal" aria-label="Close">
&lt;span aria-hidden="true">&amp;times;&lt;/span>&lt;/button>
&lt;h1 class="modal-title">
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.title'))
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.title'))
&lt;/h1>
&lt;/div>
&lt;div class="modal-body">
&lt;form class="xform" action="$request.getContextPath()/rest/admintools/files">
&lt;div class="download-modal-content">
&lt;dl>
&lt;dt>&lt;label>&lt;input type="checkbox" name="files" value="xwikiConfig" checked>
$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.xwikiConfig.title'))
&lt;/label>
&lt;/dt>
&lt;dt>&lt;label>&lt;input type="checkbox" name="files" value="xwikiProperties" checked>
$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.xwikiProperties.title'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;label>&lt;input type="checkbox" name="files" value="dataProvider" checked>
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.provided'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;label>&lt;input type="checkbox" name="files" value="logs" checked>
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.logs.title'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;div class="dateFields">
#set ($defaultDateFormat = 'dd-MM-yyyy')
#set ($dateFormat = $xwiki.getXWikiPreference('dateformat', $defaultDateFormat))
&lt;label for="downloadFilesModalFromDate">$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.date.from'))
&lt;/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)
&lt;label for="downloadFilesModalToDate">$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.date.to'))
&lt;/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)
&lt;/div>
&lt;/dt>
&lt;/dl>
&lt;/div>
&lt;form class="xform" action="$request.getContextPath()/rest/admintools/files/logs">
&lt;dl>
&lt;dt>
&lt;label for="noLines">$escapetool.xml($services.localization.render(
'adminTools.dashboard.logs.modal.nLines.label')) &lt;/label>
&lt;span class="xHint">$escapetool.xml($services.localization.render(
'adminTools.dashboard.logs.modal.nLines.hint'))&lt;/span>
&lt;/dt>
&lt;dd>&lt;input type="number" name="noLines" placeholder="1000">&lt;/dd>
&lt;/dl>
&lt;/form>
&lt;/div>
&lt;div class="modal-footer">
&lt;button type="button" class="btn btn-primary">
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.button'))&lt;/button>
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.submit'))&lt;/button>
&lt;button type="button" class="btn btn-default" data-dismiss="modal">
$escapetool.xml($services.localization.render('cancel'))&lt;/button>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
{{/html}}
&lt;/div>
#end
#macro (downloadArchiveModal)
&lt;div class="modal fade" id="downloadFilesModal" tabindex="-1" role="dialog" aria-labelledby=
"downloadFilesModalLabel">
&lt;div class="modal-dialog" role="document">
&lt;div class="modal-content">
&lt;div class="modal-header">
&lt;button type="button" class="close" data-dismiss="modal" aria-label="Close">
&lt;span aria-hidden="true">&amp;times;&lt;/span>&lt;/button>
&lt;h1 class="modal-title">
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.title'))
&lt;/h1>
&lt;/div>
&lt;div class="modal-body">
&lt;form class="xform" action="$request.getContextPath()/rest/admintools/files">
&lt;div class="download-modal-content">
&lt;dl>
&lt;dt>&lt;label>&lt;input type="checkbox" name="files" value="xwikiConfig" checked>
$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.xwikiConfig.title'))
&lt;/label>
&lt;/dt>
&lt;dt>&lt;label>&lt;input type="checkbox" name="files" value="xwikiProperties" checked>
$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.xwikiProperties.title'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;label>&lt;input type="checkbox" name="files" value="dataProvider" checked>
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.provided'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;label>&lt;input type="checkbox" name="files" value="logs" checked>
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.logs.title'))
&lt;/label>
&lt;/dt>
&lt;dt>
&lt;div class="dateFields">
#set ($defaultDateFormat = 'dd-MM-yyyy')
#set ($dateFormat = $xwiki.getXWikiPreference('dateformat', $defaultDateFormat))
&lt;label for="downloadFilesModalFromDate">$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.date.from'))
&lt;/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)
&lt;label for="downloadFilesModalToDate">$escapetool.xml($services.localization.render(
'adminTools.dashboard.download.modal.date.to'))
&lt;/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)
&lt;/div>
&lt;/dt>
&lt;/dl>
&lt;/div>
&lt;/form>
&lt;/div>
&lt;div class="modal-footer">
&lt;button type="button" class="btn btn-primary">
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.button'))&lt;/button>
&lt;button type="button" class="btn btn-default" data-dismiss="modal">
$escapetool.xml($services.localization.render('cancel'))&lt;/button>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
#end
{{/velocity}}</content>
</xwikidoc>
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
</class>
<property>
<content>{{velocity}}
$services.admintools.getConfigurationData('configuration')
{{html clean='false'}}
$services.admintools.getConfigurationData('configuration')
{{/html}}
{{/velocity}}</content>
</property>
<property>
Expand Down Expand Up @@ -155,7 +157,9 @@ $services.admintools.getConfigurationData('configuration')
</class>
<property>
<content>{{velocity}}
$services.admintools.getFilesSection()
{{html clean='false'}}
$services.admintools.getFilesSection()
{{/html}}
{{/velocity}}</content>
</property>
<property>
Expand Down

0 comments on commit 3f5efc4

Please sign in to comment.