Skip to content
Snippets Groups Projects
Commit 7824d833 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

Merge branch 'cleanup_BackendModule' into 'master'

Cleanup backend module

See merge request !45
parents c3f7e9c5 0c183a86
No related branches found
No related tags found
1 merge request!45Cleanup backend module
Showing
with 38 additions and 45 deletions
......@@ -177,8 +177,9 @@ class PreviewService {
*/
protected function createViewWithTemplate(string $templateName): StandaloneView {
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplateRootPaths(['EXT:sg_jobs/Resources/Private/Templates/Backend']);
$view->setPartialRootPaths(['EXT:sg_jobs/Resources/Private/Partials/Backend']);
$view->setTemplateRootPaths(['EXT:sg_jobs/Resources/Private/Backend/Templates/']);
$view->setPartialRootPaths(['EXT:sg_jobs/Resources/Private/Backend/Partials/']);
$view->setLayoutRootPaths(['EXT:sg_jobs/Resources/Private/Backend/Layouts/']);
if (!str_ends_with($templateName, '.html')) {
$templateName .= '.html';
}
......
......@@ -10,14 +10,6 @@
<small>
<f:format.raw><f:translate key="backend.filters.locations.description" /></f:format.raw>
</small>
<script>
var LocationEditLinks = {};
</script>
<f:for each="{locationOptions}" key="uid" as="location">
<script>
LocationEditLinks["{uid}"] = "{be:uri.editRecord(uid: location.uid, table: 'tx_sgjobs_domain_model_company')}";
</script>
</f:for>
</div>
</div>
<div class="col-xs-6 col-6 col-sm-6">
......
......@@ -42,25 +42,16 @@
<li class="page-item">
<span class="page-link">
<f:translate key="widget.pagination.page" />
<form id="paginator-form" onsubmit="goToPage(this); return false;" style="display:inline;">
<script type="text/javascript">
function goToPage(formObject) {
var page = formObject.elements['paginator-target-page'].value;
var url = '{f:uri.action(action: 'index', arguments: {currentPage: 987654321}) -> f:format.raw()}';
url = url.replace('987654321', page);
self.location.href = url;
}
</script>
<f:form.textfield id="paginator"
name="paginator-target-page"
additionalAttributes="{min: '1'}"
additionalAttributes="{
min: '1',
data-uri: '{f:uri.action(action: actionName, arguments: {currentPage: 987654321}) -> f:format.raw()}'
}"
class="form-control input-sm paginator-input"
size="5"
value="{pagination.currentPage}"
type="number" />
</form>
/ {pagination.lastPage}
</span>
</li>
......
<thead>
<tr>
<th scope="col" style="width: 50%">
<th scope="col">
<f:translate key="LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:backend.plugin.preview.settings"/>
</th>
<th scope="col" style="width: 50%">
<th scope="col">
<f:translate key="LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:backend.plugin.preview.values"/>
</th>
</tr>
......
......@@ -11,7 +11,10 @@
<f:for each="{pages}" as="page">
<tr data-uid="{page.uid}">
<td nowrap="nowrap" class="col-title">
<f:link.action class="sg-jobs_pageswitch" action="index" additionalParams="{id: page.uid}" additionalAttributes="{data-page: page.uid, data-path: page.path}">
<f:link.action class="sg-jobs_pageswitch"
action="index"
additionalParams="{id: page.uid}"
additionalAttributes="{data-page: page.uid, data-path: page.path}">
<core:iconForRecord table="pages" row="{page}" />
{page._thePathFull}
</f:link.action>
......
......@@ -44,7 +44,7 @@
<td nowrap="nowrap" class="col-icon">
<f:format.raw><sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" /></f:format.raw>
</td>
<td style="white-space: normal;">
<td>
<be:link.editRecord uid="{job.uid}" table="tx_sgjobs_domain_model_job">
<span>{job.title} - <sg:backend.companyLabel uid="{job.uid}" companyraw="{job.company}"></sg:backend.companyLabel> </span>
</be:link.editRecord>
......
{namespace be=TYPO3\CMS\Backend\ViewHelpers}
<style type="text/css">
.backend-preview-table > tbody > tr > th {
white-space: normal;
}
</style>
<f:asset.css identifier="sg_jobs-pluginpreview" href="EXT:sg_jobs/Resources/Public/StyleSheets/pluginpreview.css" />
<be:link.editRecord table="tt_content" uid="{uid}">
<br/>
<table class="table table-striped table-bordered backend-preview-table">
<table class="table table-striped table-bordered sg_jobs-backend-preview-table">
<f:render partial="PluginDataTableHeader"/>
<tbody>
......
{namespace be=TYPO3\CMS\Backend\ViewHelpers}
<style type="text/css">
.backend-preview-table > tbody > tr > th {
white-space: normal;
}
</style>
<f:asset.css identifier="sg_jobs-pluginpreview" href="EXT:sg_jobs/Resources/Public/StyleSheets/pluginpreview.css" />
<be:link.editRecord table="tt_content" uid="{uid}">
<br/>
<table class="table table-striped table-bordered backend-preview-table">
<table class="table table-striped table-bordered sg_jobs-backend-preview-table">
<f:render partial="PluginDataTableHeader"/>
<tbody>
......
{namespace be=TYPO3\CMS\Backend\ViewHelpers}
<style type="text/css">
.backend-preview-table > tbody > tr > th {
white-space: normal;
}
</style>
<f:asset.css identifier="sg_jobs-pluginpreview" href="EXT:sg_jobs/Resources/Public/StyleSheets/pluginpreview.css" />
<be:link.editRecord table="tt_content" uid="{uid}">
<br/>
<table class="table table-striped table-bordered backend-preview-table">
<table class="table table-striped table-bordered sg_jobs-backend-preview-table">
<f:render partial="PluginDataTableHeader"/>
<tbody>
......
......@@ -50,6 +50,17 @@ define([
});
});
const paginators = document.querySelectorAll('.paginator-input');
for (const paginator of paginators) {
paginator.addEventListener('keypress', (event) => {
if (event.keyCode === 13) {
event.preventDefault();
const page = event.currentTarget.value;
const url = event.currentTarget.dataset.uri;
self.location.href = url.replace('987654321', page);
}
})
}
},
/**
* Switch the page and select it in the pagetree
......
.sg_jobs-backend-preview-table > tbody > tr > th {
white-space: normal;
}
.sg_jobs-backend-preview-table > thead > tr > th {
width: 50%;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment