diff --git a/app/Resources/views/Banlists/banlists.html.twig b/app/Resources/views/Banlists/banlists.html.twig index e9c9dcb6..7e3ff4cb 100644 --- a/app/Resources/views/Banlists/banlists.html.twig +++ b/app/Resources/views/Banlists/banlists.html.twig @@ -23,16 +23,16 @@ @@ -80,6 +80,9 @@ async function buildBanlistsView() { // Remove the loading indicator $('.temp-loading').remove(); + const query_format = {% if format %}'{{ format | e('js') }}'{% else %}null{% endif %}; + const query_restriction = {% if restriction %}'{{ restriction | e('js') }}'{% else %}null{% endif %}; + // Add each format to the page formats.forEach(f => { const jqPane = $(`#tab-pane-${f.id}`); @@ -144,6 +147,11 @@ async function buildBanlistsView() { Object.keys(runnerUFC).sort().reverse().forEach(p => { jqRunner.append(generateList(`+${p} Universal Influence`, runnerUFC[p])); }); if (runnerPen.length > 0) { jqRunner.append(generateList('Identity Influence Reduction', runnerPen)); } Object.keys(runnerPts).sort().reverse().forEach(p => { jqRunner.append(generateList(`${p} ${p == 1 ? 'Point' : 'Points'}`, runnerPts[p])); }); + + // Fill in searchbox specific format/restriction pair passed in. + if (f.id == query_format && query_restriction) { + jqPane.find('.panel-search input').val(query_restriction).keyup(); + } }); } }); diff --git a/app/Resources/views/Formats/formats.html.twig b/app/Resources/views/Formats/formats.html.twig index 9f1e71fd..99aeb935 100644 --- a/app/Resources/views/Formats/formats.html.twig +++ b/app/Resources/views/Formats/formats.html.twig @@ -76,7 +76,7 @@ async function buildFormatsView() { $(`#${format.id}`).append(`

Current Ban List

`); if (format.attributes.restriction_id) { const r = restrictions.get(format.attributes.restriction_id); - $(`#${format.id}`).append(`

${r.attributes.name}
active as of ${r.attributes.date_start}

`); + $(`#${format.id}`).append(`

${r.attributes.name}
active as of ${r.attributes.date_start}

`); } else { $(`#${format.id}`).append(`

None
 

`); } diff --git a/app/Resources/views/Scripts/panels.html.twig b/app/Resources/views/Scripts/panels.html.twig index 6b750b5c..1e618965 100644 --- a/app/Resources/views/Scripts/panels.html.twig +++ b/app/Resources/views/Scripts/panels.html.twig @@ -1,225 +1,225 @@ - - - + + + diff --git a/src/AppBundle/Controller/BanlistsController.php b/src/AppBundle/Controller/BanlistsController.php index 01c6bfbd..120acb47 100644 --- a/src/AppBundle/Controller/BanlistsController.php +++ b/src/AppBundle/Controller/BanlistsController.php @@ -4,15 +4,21 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\HttpFoundation\Request; class BanlistsController extends Controller { /** + * @param Request $request + * @param EntityManagerInterface $entityManager + * * @return \Symfony\Component\HttpFoundation\Response */ - public function getAction(EntityManagerInterface $entityManager) + public function getAction(Request $request, EntityManagerInterface $entityManager) { return $this->render('/Banlists/banlists.html.twig', [ + 'format' => $request->query->get('format'), + 'restriction' => $request->query->get('restriction'), 'pagetitle' => "Ban Lists", ]); }