Migrate first level template references to new notation

This commit is contained in:
Yassine Guedidi 2022-04-29 00:47:22 +02:00
parent 10f1bc5506
commit 9549a90e76
32 changed files with 50 additions and 50 deletions

View file

@ -39,7 +39,7 @@ twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form_themes:
- "LexikFormFilterBundle:Form:form_div_layout.html.twig"
- "@LexikFormFilter/Form/form_div_layout.html.twig"
exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
globals:
registration_enabled: '%fosuser_registration%'
@ -212,13 +212,13 @@ scheb_two_factor:
google:
enabled: "%twofactor_auth%"
issuer: "%server_name%"
template: WallabagUserBundle:Authentication:form.html.twig
template: "@WallabagUser/Authentication/form.html.twig"
email:
enabled: "%twofactor_auth%"
sender_email: "%twofactor_sender%"
digits: 6
template: WallabagUserBundle:Authentication:form.html.twig
template: "@WallabagUser/Authentication/form.html.twig"
mailer: Wallabag\UserBundle\Mailer\AuthCodeMailer
kphoen_rulerz:

View file

@ -223,7 +223,7 @@ class ConfigController extends Controller
return $this->redirect($this->generateUrl('config') . '#set6');
}
return $this->render('WallabagCoreBundle:Config:index.html.twig', [
return $this->render('@WallabagCore/Config/index.html.twig', [
'form' => [
'config' => $configForm->createView(),
'feed' => $feedForm->createView(),
@ -354,7 +354,7 @@ class ConfigController extends Controller
'flashes.config.notice.otp_enabled'
);
return $this->render('WallabagCoreBundle:Config:otp_app.html.twig', [
return $this->render('@WallabagCore/Config/otp_app.html.twig', [
'backupCodes' => $backupCodes,
'qr_code' => $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user),
'secret' => $secret,

View file

@ -133,7 +133,7 @@ class EntryController extends Controller
return $this->showEntries('search', $request, $page);
}
return $this->render('WallabagCoreBundle:Entry:search_form.html.twig', [
return $this->render('@WallabagCore/Entry/search_form.html.twig', [
'form' => $form->createView(),
'currentRoute' => $currentRoute,
]);
@ -176,7 +176,7 @@ class EntryController extends Controller
return $this->redirect($this->generateUrl('homepage'));
}
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', [
return $this->render('@WallabagCore/Entry/new_form.html.twig', [
'form' => $form->createView(),
]);
}
@ -212,7 +212,7 @@ class EntryController extends Controller
*/
public function addEntryAction()
{
return $this->render('WallabagCoreBundle:Entry:new.html.twig');
return $this->render('@WallabagCore/Entry/new.html.twig');
}
/**
@ -243,7 +243,7 @@ class EntryController extends Controller
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', [
return $this->render('@WallabagCore/Entry/edit.html.twig', [
'form' => $form->createView(),
]);
}
@ -374,7 +374,7 @@ class EntryController extends Controller
$this->checkUserAction($entry);
return $this->render(
'WallabagCoreBundle:Entry:entry.html.twig',
'@WallabagCore/Entry/entry.html.twig',
['entry' => $entry]
);
}
@ -666,7 +666,7 @@ class EntryController extends Controller
->countUntaggedEntriesByUser($this->getUser()->getId());
return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig', [
'@WallabagCore/Entry/entries.html.twig', [
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page,

View file

@ -20,7 +20,7 @@ class ExceptionController extends BaseExceptionController
// For error pages, try to find a template for the specific HTTP status code and format
if (!$showException) {
$template = sprintf('WallabagCoreBundle:Exception:%s.%s.twig', $name, $format);
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
if ($this->templateExists($template)) {
return $template;
}

View file

@ -24,7 +24,7 @@ class IgnoreOriginInstanceRuleController extends Controller
{
$rules = $this->get(IgnoreOriginInstanceRuleRepository::class)->findAll();
return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:index.html.twig', [
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/index.html.twig', [
'rules' => $rules,
]);
}
@ -56,7 +56,7 @@ class IgnoreOriginInstanceRuleController extends Controller
return $this->redirectToRoute('ignore_origin_instance_rules_index');
}
return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:new.html.twig', [
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/new.html.twig', [
'rule' => $ignoreOriginInstanceRule,
'form' => $form->createView(),
]);
@ -88,7 +88,7 @@ class IgnoreOriginInstanceRuleController extends Controller
return $this->redirectToRoute('ignore_origin_instance_rules_index');
}
return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:edit.html.twig', [
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/edit.html.twig', [
'rule' => $ignoreOriginInstanceRule,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),

View file

@ -28,7 +28,7 @@ class SiteCredentialController extends Controller
$credentials = $this->get(SiteCredentialRepository::class)->findByUser($this->getUser());
return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [
return $this->render('@WallabagCore/SiteCredential/index.html.twig', [
'credentials' => $credentials,
]);
}
@ -65,7 +65,7 @@ class SiteCredentialController extends Controller
return $this->redirectToRoute('site_credentials_index');
}
return $this->render('WallabagCoreBundle:SiteCredential:new.html.twig', [
return $this->render('@WallabagCore/SiteCredential/new.html.twig', [
'credential' => $credential,
'form' => $form->createView(),
]);
@ -104,7 +104,7 @@ class SiteCredentialController extends Controller
return $this->redirectToRoute('site_credentials_index');
}
return $this->render('WallabagCoreBundle:SiteCredential:edit.html.twig', [
return $this->render('@WallabagCore/SiteCredential/edit.html.twig', [
'credential' => $siteCredential,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),

View file

@ -49,7 +49,7 @@ class TagController extends Controller
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [
return $this->render('@WallabagCore/Tag/new_form.html.twig', [
'form' => $form->createView(),
'entry' => $entry,
]);
@ -98,7 +98,7 @@ class TagController extends Controller
$renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView();
}
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
return $this->render('@WallabagCore/Tag/tags.html.twig', [
'tags' => $tags,
'renameForms' => $renameForms,
'nbEntriesUntagged' => $nbEntriesUntagged,
@ -135,7 +135,7 @@ class TagController extends Controller
}
}
return $this->render('WallabagCoreBundle:Entry:entries.html.twig', [
return $this->render('@WallabagCore/Entry/entries.html.twig', [
'form' => null,
'entries' => $entries,
'currentPage' => $page,

View file

@ -37,6 +37,6 @@ class ChromeController extends BrowserController
*/
protected function getImportTemplate()
{
return 'WallabagImportBundle:Chrome:index.html.twig';
return '@WallabagImport/Chrome/index.html.twig';
}
}

View file

@ -70,7 +70,7 @@ class DeliciousController extends Controller
);
}
return $this->render('WallabagImportBundle:Delicious:index.html.twig', [
return $this->render('@WallabagImport/Delicious/index.html.twig', [
'form' => $form->createView(),
'import' => $delicious,
]);

View file

@ -37,6 +37,6 @@ class ElcuratorController extends WallabagController
*/
protected function getImportTemplate()
{
return 'WallabagImportBundle:Elcurator:index.html.twig';
return '@WallabagImport/Elcurator/index.html.twig';
}
}

View file

@ -37,6 +37,6 @@ class FirefoxController extends BrowserController
*/
protected function getImportTemplate()
{
return 'WallabagImportBundle:Firefox:index.html.twig';
return '@WallabagImport/Firefox/index.html.twig';
}
}

View file

@ -14,7 +14,7 @@ class ImportController extends Controller
*/
public function importAction()
{
return $this->render('WallabagImportBundle:Import:index.html.twig', [
return $this->render('@WallabagImport/Import/index.html.twig', [
'imports' => $this->get(ImportChain::class)->getAll(),
]);
}
@ -31,7 +31,7 @@ class ImportController extends Controller
$rabbitNotInstalled = false;
if (!$this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
return $this->render('WallabagImportBundle:Import:check_queue.html.twig');
return $this->render('@WallabagImport/Import/check_queue.html.twig');
}
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
@ -71,7 +71,7 @@ class ImportController extends Controller
}
}
return $this->render('WallabagImportBundle:Import:check_queue.html.twig', [
return $this->render('@WallabagImport/Import/check_queue.html.twig', [
'nbRedisMessages' => $nbRedisMessages,
'nbRabbitMessages' => $nbRabbitMessages,
'redisNotInstalled' => $redisNotInstalled,

View file

@ -70,7 +70,7 @@ class InstapaperController extends Controller
);
}
return $this->render('WallabagImportBundle:Instapaper:index.html.twig', [
return $this->render('@WallabagImport/Instapaper/index.html.twig', [
'form' => $form->createView(),
'import' => $instapaper,
]);

View file

@ -70,7 +70,7 @@ class PinboardController extends Controller
);
}
return $this->render('WallabagImportBundle:Pinboard:index.html.twig', [
return $this->render('@WallabagImport/Pinboard/index.html.twig', [
'form' => $form->createView(),
'import' => $pinboard,
]);

View file

@ -24,7 +24,7 @@ class PocketController extends Controller
])
->getForm();
return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
return $this->render('@WallabagImport/Pocket/index.html.twig', [
'import' => $this->getPocketImportService(),
'has_consumer_key' => '' === trim($this->getUser()->getConfig()->getPocketConsumerKey()) ? false : true,
'form' => $form->createView(),

View file

@ -70,7 +70,7 @@ class ReadabilityController extends Controller
);
}
return $this->render('WallabagImportBundle:Readability:index.html.twig', [
return $this->render('@WallabagImport/Readability/index.html.twig', [
'form' => $form->createView(),
'import' => $readability,
]);

View file

@ -37,6 +37,6 @@ class WallabagV1Controller extends WallabagController
*/
protected function getImportTemplate()
{
return 'WallabagImportBundle:WallabagV1:index.html.twig';
return '@WallabagImport/WallabagV1/index.html.twig';
}
}

View file

@ -37,6 +37,6 @@ class WallabagV2Controller extends WallabagController
*/
protected function getImportTemplate()
{
return 'WallabagImportBundle:WallabagV2:index.html.twig';
return '@WallabagImport/WallabagV2/index.html.twig';
}
}

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans|raw }}</blockquote>

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans }}</blockquote>

View file

@ -1,3 +1,3 @@
{% extends "WallabagImportBundle:WallabagV1:index.html.twig" %}
{% extends "@WallabagImport/WallabagV1/index.html.twig" %}
{% block title %}{{ 'import.elcurator.page_title'|trans }}{% endblock %}

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans|raw }}</blockquote>

View file

@ -12,7 +12,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
{{ 'import.page_description'|trans }}
<ul>

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans }}</blockquote>

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans }}</blockquote>

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
{% if not has_consumer_key %}
<div class="card-panel red white-text">

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans }}</blockquote>

View file

@ -6,7 +6,7 @@
<div class="row">
<div class="col s12">
<div class="card-panel settings">
{% include 'WallabagImportBundle:Import:_information.html.twig' %}
{% include '@WallabagImport/Import/_information.html.twig' %}
<div class="row">
<blockquote>{{ import.description|trans }}</blockquote>

View file

@ -1,3 +1,3 @@
{% extends "WallabagImportBundle:WallabagV1:index.html.twig" %}
{% extends "@WallabagImport/WallabagV1/index.html.twig" %}
{% block title %}{{ 'import.wallabag_v2.page_title'|trans }}{% endblock %}

View file

@ -49,7 +49,7 @@ class ManageController extends Controller
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
}
return $this->render('WallabagUserBundle:Manage:new.html.twig', [
return $this->render('@WallabagUser/Manage/new.html.twig', [
'user' => $user,
'form' => $form->createView(),
]);
@ -94,7 +94,7 @@ class ManageController extends Controller
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
}
return $this->render('WallabagUserBundle:Manage:edit.html.twig', [
return $this->render('@WallabagUser/Manage/edit.html.twig', [
'user' => $user,
'edit_form' => $form->createView(),
'delete_form' => $deleteForm->createView(),
@ -162,7 +162,7 @@ class ManageController extends Controller
}
}
return $this->render('WallabagUserBundle:Manage:index.html.twig', [
return $this->render('@WallabagUser/Manage/index.html.twig', [
'searchForm' => $form->createView(),
'users' => $pagerFanta,
]);

View file

@ -77,7 +77,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
*/
public function sendAuthCode(TwoFactorInterface $user): void
{
$template = $this->twig->loadTemplate('WallabagUserBundle:TwoFactor:email_auth_code.html.twig');
$template = $this->twig->loadTemplate('@WallabagUser/TwoFactor/email_auth_code.html.twig');
$subject = $template->renderBlock('subject', []);
$bodyHtml = $template->renderBlock('body_html', [

View file

@ -29,7 +29,7 @@ class AuthCodeMailerTest extends TestCase
{% block body_text %}text body {{ support_url }}{% endblock %}
TWIG;
$this->twig = new Environment(new ArrayLoader(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate]));
$this->twig = new Environment(new ArrayLoader(['@WallabagUser/TwoFactor/email_auth_code.html.twig' => $twigTemplate]));
}
public function testSendEmail()