Skip to content

Commit

Permalink
fix: Fixed CacheController twig template
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jul 12, 2024
1 parent 0513183 commit 1d9d203
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 44 deletions.
3 changes: 2 additions & 1 deletion lib/Rozier/src/Controllers/CacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function deleteDoctrineCache(Request $request): Response
*/
return $this->redirectToRoute('adminHomePage');
}

$this->prepareBaseAssignation();
$this->assignation['form'] = $form->createView();

return $this->render('@RoadizRozier/cache/deleteDoctrine.html.twig', $this->assignation);
Expand Down Expand Up @@ -77,6 +77,7 @@ public function deleteAssetsCache(Request $request): Response
return $this->redirectToRoute('adminHomePage');
}

$this->prepareBaseAssignation();
$this->assignation['form'] = $form->createView();

return $this->render('@RoadizRozier/cache/deleteAssets.html.twig', $this->assignation);
Expand Down
70 changes: 27 additions & 43 deletions lib/Rozier/src/Resources/views/cache/deleteDoctrine.html.twig
Original file line number Diff line number Diff line change
@@ -1,62 +1,46 @@
{% if not head.ajax %}{% set baseTemplate = '@RoadizRozier/simple.html.twig' %}{% else %}{% set baseTemplate = '@RoadizRozier/ajaxBase.html.twig' %}{% endif %}{% extends baseTemplate %}
{% extends '@RoadizRozier/simple.html.twig' %}

{% block title %}{% trans %}purge.cache{% endtrans %} | {{ parent() }}{% endblock %}

{% block content %}
{% if not head.ajax %}
<section id="purge-caches" {% if error %}class="uk-animation-shake"{% endif %}>
<div class="purge-inner">
<div id="login-infos">
<div id="login-logo">
{% if themeServices.adminImage %}
{{ themeServices.adminImage|display({width:150}) }}
{% else %}
<i class="uk-icon-rz-roadiz-icon"></i>
{% endif %}
</div>
{# Make this block overidable from themes. #}
{% include '@RoadizRozier/admin/blocks/loginImage.html.twig' %}
<div id="login-credit">
<i class="uk-icon-rz-roadiz-icon"></i>
<span id="login-version">{{ cms_prefix }} {{ cms_version }}</span>
</div>
</div>
<div id="login-formGlobal">
<header class="content-header header-cache header-cache-purge">
<h1 class="content-title cache-purge-title">{% trans %}purge.cache{% endtrans %}</h1>
</header>

{% else %}
<section class="content-global purge-cache">
{% endif %}

<header class="content-header header-cache header-cache-purge">
<h1 class="content-title cache-purge-title">{% trans %}purge.cache{% endtrans %}</h1>
</header>

<article class="content content-delete content-no-action-menu">
<div class="content-table-cont">
<table class="content-table uk-table">
{% for key, cache in cachesInfo %}
<tr>
<th>{{ key|trans }}</th>
<td>{% if cache %}<i class="uk-icon-check"></i> {{ cache }}{% else %}<i class="uk-icon-close"></i> {% trans %}no.cache.available{% endtrans %}{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>

{% form_theme form '@RoadizRozier/forms.html.twig' %}
{{ form_start(form) }}
{{ form_widget(form) }}
<fieldset data-uk-margin>
<legend class="uk-alert uk-alert-danger"><i class="uk-icon uk-icon-warning"></i> {% trans %}are_you_sure.purge.cache{% endtrans %}</legend>
<a href="{{ path('adminHomePage') }}" class="uk-button"><i class="uk-icon-rz-back-parent"></i> {% trans %}cancel{% endtrans %}</a>
<button class="uk-button uk-button-danger" type="submit"><i class="uk-icon-rz-trash-o"></i> {% trans %}clear{% endtrans %}</button>
</fieldset>
{{ form_end(form) }}
</article>
<article class="content content-delete content-no-action-menu">
<div class="content-table-cont">
<table class="content-table uk-table">
{% for key, cache in cachesInfo %}
<tr>
<th>{{ key|trans }}</th>
<td>{% if cache %}<i class="uk-icon-check"></i> {{ cache }}{% else %}<i class="uk-icon-close"></i> {% trans %}no.cache.available{% endtrans %}{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>

{% if not head.ajax %}
{% form_theme form '@RoadizRozier/forms.html.twig' %}
{{ form_start(form) }}
{{ form_widget(form) }}
<fieldset data-uk-margin>
<legend class="uk-alert uk-alert-danger"><i class="uk-icon uk-icon-warning"></i> {% trans %}are_you_sure.purge.cache{% endtrans %}</legend>
<a href="{{ path('adminHomePage') }}" class="uk-button"><i class="uk-icon-rz-back-parent"></i> {% trans %}cancel{% endtrans %}</a>
<button class="uk-button uk-button-danger" type="submit"><i class="uk-icon-rz-trash-o"></i> {% trans %}clear{% endtrans %}</button>
</fieldset>
{{ form_end(form) }}
</article>
</div>
</div>
</section>
{% else %}
</section>
{% endif %}
{% endblock %}

0 comments on commit 1d9d203

Please sign in to comment.