Move User templates to Core

This commit is contained in:
Yassine Guedidi 2023-12-30 23:58:23 +01:00
parent c7bf98923e
commit 0234aa1acf
10 changed files with 7 additions and 7 deletions

View file

@ -194,13 +194,13 @@ scheb_two_factor:
google: google:
enabled: true enabled: true
issuer: "%server_name%" issuer: "%server_name%"
template: "@WallabagUser/Authentication/form.html.twig" template: "@WallabagCore/Authentication/form.html.twig"
email: email:
enabled: true enabled: true
sender_email: "%twofactor_sender%" sender_email: "%twofactor_sender%"
digits: 6 digits: 6
template: "@WallabagUser/Authentication/form.html.twig" template: "@WallabagCore/Authentication/form.html.twig"
mailer: Wallabag\CoreBundle\Mailer\AuthCodeMailer mailer: Wallabag\CoreBundle\Mailer\AuthCodeMailer
rulerz: rulerz:

View file

@ -67,7 +67,7 @@ class UserController extends AbstractController
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]); return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
} }
return $this->render('@WallabagUser/User/new.html.twig', [ return $this->render('@WallabagCore/User/new.html.twig', [
'user' => $user, 'user' => $user,
'form' => $form->createView(), 'form' => $form->createView(),
]); ]);
@ -108,7 +108,7 @@ class UserController extends AbstractController
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]); return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
} }
return $this->render('@WallabagUser/User/edit.html.twig', [ return $this->render('@WallabagCore/User/edit.html.twig', [
'user' => $user, 'user' => $user,
'edit_form' => $form->createView(), 'edit_form' => $form->createView(),
'delete_form' => $deleteForm->createView(), 'delete_form' => $deleteForm->createView(),
@ -173,7 +173,7 @@ class UserController extends AbstractController
} }
} }
return $this->render('@WallabagUser/User/index.html.twig', [ return $this->render('@WallabagCore/User/index.html.twig', [
'searchForm' => $form->createView(), 'searchForm' => $form->createView(),
'users' => $pagerFanta, 'users' => $pagerFanta,
]); ]);

View file

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

View file

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