diff --git a/app/config/routing.yml b/app/config/routing.yml index 5fa28fba8..f0f8f4b6f 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -15,16 +15,6 @@ doc-api: resource: "@NelmioApiDocBundle/Resources/config/routing.yml" prefix: /api/doc -#login: -# pattern: /login -# defaults: { _controller: WallabagCoreBundle:Security:login } -# -#login_check: -# pattern: /login_check -# -#logout: -# path: /logout - rest : type : rest resource : "routing_rest.yml" diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index ddd4f7d98..2390bfe17 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -79,7 +79,7 @@ class Config /* * @param User $user */ - public function __construct(Wallabag\UserBundle\Entity\User $user) + public function __construct(\Wallabag\UserBundle\Entity\User $user) { $this->user = $user; } diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f6206a09f..4fd74001b 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -143,7 +143,7 @@ class Entry /* * @param User $user */ - public function __construct(Wallabag\UserBundle\Entity\User $user) + public function __construct(\Wallabag\UserBundle\Entity\User $user) { $this->user = $user; $this->tags = new ArrayCollection(); diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 6067360f9..5b571823f 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -46,7 +46,7 @@ class Tag */ private $user; - public function __construct(User $user) + public function __construct(\Wallabag\UserBundle\Entity\User $user) { $this->user = $user; $this->entries = new ArrayCollection(); diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php index 137c097ca..df94fad25 100644 --- a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php +++ b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php @@ -9,8 +9,8 @@ use Symfony\Component\HttpFoundation\Response; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Event\FilterUserResponseEvent; use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; -use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Entity\Config; +use Wallabag\UserBundle\Entity\User; class RegistrationConfirmedListenerTest extends KernelTestCase { diff --git a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php index 756525a97..e5096528c 100644 --- a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php +++ b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php @@ -21,7 +21,7 @@ abstract class WallabagCoreTestCase extends WebTestCase public function logInAs($username) { $crawler = $this->client->request('GET', '/login'); - $form = $crawler->filter('input[type=submit]')->form(); + $form = $crawler->filter('button[type=submit]')->form(); $data = array( '_username' => $username, '_password' => 'mypassword', diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php similarity index 100% rename from src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php rename to src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php diff --git a/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig b/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig deleted file mode 100644 index 4ce626e9b..000000000 --- a/src/Wallabag/UserBundle/Resources/views/Default/index.html.twig +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig new file mode 100644 index 000000000..d765c851b --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register.html.twig @@ -0,0 +1,32 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}create an account{% endtrans %}{% endblock %} + +{% block body_class %}register{% endblock %} + +{% block menu %}{% endblock %} +{% block messages %}{% endblock %} + +{% block content %} +
+
+
+
wallabag logo
+ + {% include "FOSUserBundle:Registration:register_content.html.twig" %} + +
+ +
+
+ +{% endblock %} + +{% block footer %} +{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig new file mode 100644 index 000000000..26a91433c --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig @@ -0,0 +1,14 @@ +{% trans_default_domain 'FOSUserBundle' %} + +
+
+ {{ form_widget(form) }} + +
+
+ +
+
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig new file mode 100644 index 000000000..8f698e170 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/checkEmail.html.twig @@ -0,0 +1,27 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %} + +{% block body_class %}login{% endblock %} + +{% block menu %}{% endblock %} + +{% block content %} +
+
+

{% trans %}Forgot password{% endtrans %}

+
+
+ +

{{ 'An email has been sent to %email%. It contains a link you must click to reset your password.'|trans({'%email%': email}) }}

+
+
+
+
+
+ +{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig new file mode 100644 index 000000000..9750f8bae --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/forgotPassword.html.twig @@ -0,0 +1,59 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %} + +{% block body_class %}login{% endblock %} + +{% block menu %}{% endblock %} + +{% block content %} +
+
+

{% trans %}Forgot password{% endtrans %}

+
+
+
+ +

{% trans %}Enter your email address below and we'll send you password reset instructions.{% endtrans %}

+ + {% if form_errors(form) %} + {{ form_errors(form) }} + {% endif %} + + {% for flashMessage in app.session.flashbag.get('notice') %} +

{{ flashMessage }}

+ {% endfor %} + + {% if form_errors(form.email) %} + {{ form_errors(form.email) }} + {% endif %} + +
+ {{ form_label(form.email) }} + {{ form_widget(form.email) }} +
+ +
+
+ +
+ {{ form_rest(form) }} +
+
+ +
+
+ +{% endblock %} + +{% block footer %} +{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig new file mode 100644 index 000000000..e95320377 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/login.html.twig @@ -0,0 +1,69 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}login to your wallabag{% endtrans %}{% endblock %} + +{% block body_class %}login{% endblock %} + +{% block menu %}{% endblock %} +{% block messages %}{% endblock %} + +{% block content %} +
+
+
+
wallabag logo
+
+
+ + {% if error %} + {{ error.message }} + {% endif %} + + {% for flashMessage in app.session.flashbag.get('notice') %} +

{{ flashMessage }}

+ {% endfor %} + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + + {% trans %}Register{% endtrans %} +
+
+
+ +
+
+ +{% endblock %} + +{% block footer %} +{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig new file mode 100644 index 000000000..09d0b634e --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Security/reset.html.twig @@ -0,0 +1,57 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Change password{% endtrans %}{% endblock %} + +{% block body_class %}login{% endblock %} + +{% block menu %}{% endblock %} + +{% block content %} +
+
+
+
+
+ +

{% trans %}Change password{% endtrans %}

+ + {% if form_errors(form) %} + {{ form_errors(form) }} + {% endif %} + + {% if form_errors(form.new_password.first) %} + {{ form_errors(form.new_password.first) }} + {% endif %} + + {% if form_errors(form.new_password.second) %} + {{ form_errors(form.new_password.second) }} + {% endif %} + +
+ {{ form_label(form.new_password.first) }} + {{ form_widget(form.new_password.first) }} +
+ +
+ {{ form_label(form.new_password.second) }} + {{ form_widget(form.new_password.second) }} +
+ +
+
+ +
+ {{ form_rest(form) }} +
+
+
+
+ +{% endblock %} diff --git a/src/Wallabag/UserBundle/WallabagUserBundle.php b/src/Wallabag/UserBundle/WallabagUserBundle.php index e6e650423..d9180b3bd 100644 --- a/src/Wallabag/UserBundle/WallabagUserBundle.php +++ b/src/Wallabag/UserBundle/WallabagUserBundle.php @@ -6,4 +6,8 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class WallabagUserBundle extends Bundle { + public function getParent() + { + return 'FOSUserBundle'; + } }