From ad4d1caa9e744af57ca58a4e57576533eb682d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 23 Jan 2015 16:28:37 +0100 Subject: move WallabagBundle into Wallabag:CoreBundle --- .../CoreBundle/Controller/EntryController.php | 184 +++++++++++++++++ .../CoreBundle/Controller/StaticController.php | 20 ++ .../DependencyInjection/WallabagCoreExtension.php | 22 ++ src/Wallabag/CoreBundle/Entity/Config.php | 95 +++++++++ src/Wallabag/CoreBundle/Entity/Config.php~ | 95 +++++++++ src/Wallabag/CoreBundle/Entity/Entries.php | 230 +++++++++++++++++++++ src/Wallabag/CoreBundle/Entity/Entries.php~ | 215 +++++++++++++++++++ src/Wallabag/CoreBundle/Entity/Entry.php~ | 74 +++++++ src/Wallabag/CoreBundle/Entity/Tags.php | 65 ++++++ src/Wallabag/CoreBundle/Entity/Tags.php~ | 65 ++++++ src/Wallabag/CoreBundle/Entity/TagsEntries.php | 95 +++++++++ src/Wallabag/CoreBundle/Entity/TagsEntries.php~ | 95 +++++++++ src/Wallabag/CoreBundle/Entity/Users.php | 155 ++++++++++++++ src/Wallabag/CoreBundle/Entity/Users.php~ | 155 ++++++++++++++ src/Wallabag/CoreBundle/Entity/UsersConfig.php | 125 +++++++++++ src/Wallabag/CoreBundle/Entity/UsersConfig.php~ | 125 +++++++++++ .../CoreBundle/Repository/EntriesRepository.php | 79 +++++++ .../CoreBundle/Resources/config/routing.yml | 3 + .../CoreBundle/Resources/config/services.xml | 17 ++ .../Resources/views/Entry/entries.html.twig | 47 +++++ .../Resources/views/Entry/entry.html.twig | 104 ++++++++++ .../CoreBundle/Resources/views/Entry/new.html.twig | 11 + .../Resources/views/Static/about.html.twig | 51 +++++ .../Resources/views/_bookmarklet.html.twig | 3 + .../CoreBundle/Resources/views/_footer.html.twig | 3 + .../CoreBundle/Resources/views/_head.html.twig | 40 ++++ .../CoreBundle/Resources/views/_menu.html.twig | 15 ++ .../CoreBundle/Resources/views/_messages.html.twig | 0 .../Resources/views/_save_form.html.twig | 10 + .../Resources/views/_search_form.html.twig | 9 + .../CoreBundle/Resources/views/_top.html.twig | 5 + .../CoreBundle/Resources/views/layout.html.twig | 33 +++ .../Tests/Controller/DefaultControllerTest.php | 18 ++ .../Twig/Extension/WallabagExtension.php | 41 ++++ src/Wallabag/CoreBundle/WallabagCoreBundle.php | 9 + src/Wallabag/Wallabag/Database.php | 2 +- src/WallabagBundle/Controller/EntryController.php | 184 ----------------- src/WallabagBundle/Controller/StaticController.php | 20 -- .../DependencyInjection/WallabagExtension.php | 22 -- src/WallabagBundle/Entity/Config.php | 95 --------- src/WallabagBundle/Entity/Config.php~ | 95 --------- src/WallabagBundle/Entity/Entries.php | 230 --------------------- src/WallabagBundle/Entity/Entries.php~ | 215 ------------------- src/WallabagBundle/Entity/Entry.php~ | 74 ------- src/WallabagBundle/Entity/Tags.php | 65 ------ src/WallabagBundle/Entity/Tags.php~ | 65 ------ src/WallabagBundle/Entity/TagsEntries.php | 95 --------- src/WallabagBundle/Entity/TagsEntries.php~ | 95 --------- src/WallabagBundle/Entity/Users.php | 155 -------------- src/WallabagBundle/Entity/Users.php~ | 155 -------------- src/WallabagBundle/Entity/UsersConfig.php | 125 ----------- src/WallabagBundle/Entity/UsersConfig.php~ | 125 ----------- .../Repository/EntriesRepository.php | 79 ------- src/WallabagBundle/Resources/config/routing.yml | 3 - src/WallabagBundle/Resources/config/services.xml | 12 -- .../Resources/views/Entry/entries.html.twig | 47 ----- .../Resources/views/Entry/entry.html.twig | 104 ---------- .../Resources/views/Entry/new.html.twig | 11 - .../Resources/views/Static/about.html.twig | 51 ----- .../Resources/views/_bookmarklet.html.twig | 3 - .../Resources/views/_footer.html.twig | 3 - src/WallabagBundle/Resources/views/_head.html.twig | 40 ---- src/WallabagBundle/Resources/views/_menu.html.twig | 15 -- .../Resources/views/_messages.html.twig | 0 .../Resources/views/_save_form.html.twig | 10 - .../Resources/views/_search_form.html.twig | 9 - src/WallabagBundle/Resources/views/_top.html.twig | 5 - .../Resources/views/layout.html.twig | 33 --- .../Tests/Controller/DefaultControllerTest.php | 18 -- .../Twig/Extension/WallabagExtension.php | 41 ---- src/WallabagBundle/WallabagBundle.php | 9 - 71 files changed, 2314 insertions(+), 2309 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Controller/EntryController.php create mode 100644 src/Wallabag/CoreBundle/Controller/StaticController.php create mode 100644 src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php create mode 100644 src/Wallabag/CoreBundle/Entity/Config.php create mode 100644 src/Wallabag/CoreBundle/Entity/Config.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/Entries.php create mode 100644 src/Wallabag/CoreBundle/Entity/Entries.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/Entry.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/Tags.php create mode 100644 src/Wallabag/CoreBundle/Entity/Tags.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/TagsEntries.php create mode 100644 src/Wallabag/CoreBundle/Entity/TagsEntries.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/Users.php create mode 100644 src/Wallabag/CoreBundle/Entity/Users.php~ create mode 100644 src/Wallabag/CoreBundle/Entity/UsersConfig.php create mode 100644 src/Wallabag/CoreBundle/Entity/UsersConfig.php~ create mode 100644 src/Wallabag/CoreBundle/Repository/EntriesRepository.php create mode 100644 src/Wallabag/CoreBundle/Resources/config/routing.yml create mode 100644 src/Wallabag/CoreBundle/Resources/config/services.xml create mode 100644 src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig create mode 100755 src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/_footer.html.twig create mode 100755 src/Wallabag/CoreBundle/Resources/views/_head.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/_menu.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/_messages.html.twig create mode 100755 src/Wallabag/CoreBundle/Resources/views/_save_form.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/_search_form.html.twig create mode 100755 src/Wallabag/CoreBundle/Resources/views/_top.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/layout.html.twig create mode 100644 src/Wallabag/CoreBundle/Tests/Controller/DefaultControllerTest.php create mode 100644 src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php create mode 100644 src/Wallabag/CoreBundle/WallabagCoreBundle.php delete mode 100644 src/WallabagBundle/Controller/EntryController.php delete mode 100644 src/WallabagBundle/Controller/StaticController.php delete mode 100644 src/WallabagBundle/DependencyInjection/WallabagExtension.php delete mode 100644 src/WallabagBundle/Entity/Config.php delete mode 100644 src/WallabagBundle/Entity/Config.php~ delete mode 100644 src/WallabagBundle/Entity/Entries.php delete mode 100644 src/WallabagBundle/Entity/Entries.php~ delete mode 100644 src/WallabagBundle/Entity/Entry.php~ delete mode 100644 src/WallabagBundle/Entity/Tags.php delete mode 100644 src/WallabagBundle/Entity/Tags.php~ delete mode 100644 src/WallabagBundle/Entity/TagsEntries.php delete mode 100644 src/WallabagBundle/Entity/TagsEntries.php~ delete mode 100644 src/WallabagBundle/Entity/Users.php delete mode 100644 src/WallabagBundle/Entity/Users.php~ delete mode 100644 src/WallabagBundle/Entity/UsersConfig.php delete mode 100644 src/WallabagBundle/Entity/UsersConfig.php~ delete mode 100644 src/WallabagBundle/Repository/EntriesRepository.php delete mode 100644 src/WallabagBundle/Resources/config/routing.yml delete mode 100644 src/WallabagBundle/Resources/config/services.xml delete mode 100644 src/WallabagBundle/Resources/views/Entry/entries.html.twig delete mode 100644 src/WallabagBundle/Resources/views/Entry/entry.html.twig delete mode 100644 src/WallabagBundle/Resources/views/Entry/new.html.twig delete mode 100755 src/WallabagBundle/Resources/views/Static/about.html.twig delete mode 100644 src/WallabagBundle/Resources/views/_bookmarklet.html.twig delete mode 100644 src/WallabagBundle/Resources/views/_footer.html.twig delete mode 100755 src/WallabagBundle/Resources/views/_head.html.twig delete mode 100644 src/WallabagBundle/Resources/views/_menu.html.twig delete mode 100644 src/WallabagBundle/Resources/views/_messages.html.twig delete mode 100755 src/WallabagBundle/Resources/views/_save_form.html.twig delete mode 100644 src/WallabagBundle/Resources/views/_search_form.html.twig delete mode 100755 src/WallabagBundle/Resources/views/_top.html.twig delete mode 100644 src/WallabagBundle/Resources/views/layout.html.twig delete mode 100644 src/WallabagBundle/Tests/Controller/DefaultControllerTest.php delete mode 100644 src/WallabagBundle/Twig/Extension/WallabagExtension.php delete mode 100644 src/WallabagBundle/WallabagBundle.php (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php new file mode 100644 index 00000000..2ebb416c --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -0,0 +1,184 @@ +setUserId(1); + + $form = $this->createFormBuilder($entry) + ->add('url', 'url') + ->add('save', 'submit') + ->getForm(); + + $form->handleRequest($request); + + if ($form->isValid()) { + + $content = Tools::getPageContent(new Url($entry->getUrl())); + var_dump($content);die; + + $em = $this->getDoctrine()->getEntityManager(); + $em->persist($entry); + $em->flush(); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'Entry saved' + ); + + return $this->redirect($this->generateUrl('homepage')); + } + + return $this->render('WallabagCoreBundle:Entry:new.html.twig', array( + 'form' => $form->createView(), + )); + } + + /** + * Shows unread entries for current user + * + * @Route("/unread", name="unread") + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showUnreadAction() + { + $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entries'); + $entries = $repository->findUnreadByUser(1, 0); + + return $this->render( + 'WallabagCoreBundle:Entry:entries.html.twig', + array('entries' => $entries) + ); + } + + /** + * Shows read entries for current user + * + * @Route("/archive", name="archive") + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showArchiveAction() + { + $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entries'); + $entries = $repository->findArchiveByUser(1, 0); + + return $this->render( + 'WallabagCoreBundle:Entry:entries.html.twig', + array('entries' => $entries) + ); + } + + /** + * Shows starred entries for current user + * + * @Route("/starred", name="starred") + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showStarredAction() + { + $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entries'); + $entries = $repository->findStarredByUser(1, 0); + + return $this->render( + 'WallabagCoreBundle:Entry:entries.html.twig', + array('entries' => $entries) + ); + } + + /** + * Shows entry content + * + * @param Entries $entry + * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") + * @return \Symfony\Component\HttpFoundation\Response + */ + public function viewAction(Entries $entry) + { + return $this->render( + 'WallabagCoreBundle:Entry:entry.html.twig', + array('entry' => $entry) + ); + } + + /** + * Changes read status for an entry + * + * @param Request $request + * @param Entries $entry + * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function toggleArchiveAction(Request $request, Entries $entry) + { + $entry->toggleArchive(); + $this->getDoctrine()->getManager()->flush(); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'Entry archived' + ); + + return $this->redirect($request->headers->get('referer')); + } + + /** + * Changes favorite status for an entry + * + * @param Request $request + * @param Entries $entry + * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function toggleStarAction(Request $request, Entries $entry) + { + $entry->toggleStar(); + $this->getDoctrine()->getManager()->flush(); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'Entry starred' + ); + + return $this->redirect($request->headers->get('referer')); + } + + /** + * Deletes entry + * + * @param Request $request + * @param Entries $entry + * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function deleteEntryAction(Request $request, Entries $entry) + { + $em = $this->getDoctrine()->getEntityManager(); + $em->remove($entry); + $em->flush(); + + $this->get('session')->getFlashBag()->add( + 'notice', + 'Entry deleted' + ); + + return $this->redirect($request->headers->get('referer')); + } +} diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php new file mode 100644 index 00000000..0fd19d65 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php @@ -0,0 +1,20 @@ +render( + 'WallabagCoreBundle:Static:about.html.twig', + array() + ); + } +} diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php new file mode 100644 index 00000000..7cc4165e --- /dev/null +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -0,0 +1,22 @@ +load('services.xml'); + } + + public function getAlias() + { + return 'wallabag_core'; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php new file mode 100644 index 00000000..d60b2df0 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -0,0 +1,95 @@ +id; + } + + /** + * Set name + * + * @param string $name + * @return Config + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return Config + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Config.php~ b/src/Wallabag/CoreBundle/Entity/Config.php~ new file mode 100644 index 00000000..8b692cef --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Config.php~ @@ -0,0 +1,95 @@ +id; + } + + /** + * Set name + * + * @param string $name + * @return Config + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return Config + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php b/src/Wallabag/CoreBundle/Entity/Entries.php new file mode 100644 index 00000000..712ff126 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Entries.php @@ -0,0 +1,230 @@ +id; + } + + /** + * Set title + * + * @param string $title + * @return Entries + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set url + * + * @param string $url + * @return Entries + */ + public function setUrl($url) + { + $this->url = $url; + + return $this; + } + + /** + * Get url + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set isRead + * + * @param string $isRead + * @return Entries + */ + public function setIsRead($isRead) + { + $this->isRead = $isRead; + + return $this; + } + + /** + * Get isRead + * + * @return string + */ + public function getIsRead() + { + return $this->isRead; + } + + public function toggleArchive() + { + $this->isRead = $this->getIsRead() ^ 1; + return $this; + } + + /** + * Set isFav + * + * @param string $isFav + * @return Entries + */ + public function setIsFav($isFav) + { + $this->isFav = $isFav; + + return $this; + } + + /** + * Get isFav + * + * @return string + */ + public function getIsFav() + { + return $this->isFav; + } + + public function toggleStar() + { + $this->isFav = $this->getIsFav() ^ 1; + + return $this; + } + + /** + * Set content + * + * @param string $content + * @return Entries + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * Get content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Set userId + * + * @param string $userId + * @return Entries + */ + public function setUserId($userId) + { + $this->userId = $userId; + + return $this; + } + + /** + * Get userId + * + * @return string + */ + public function getUserId() + { + return $this->userId; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php~ b/src/Wallabag/CoreBundle/Entity/Entries.php~ new file mode 100644 index 00000000..69c6be0d --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Entries.php~ @@ -0,0 +1,215 @@ +id; + } + + /** + * Set title + * + * @param string $title + * @return Entries + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set url + * + * @param string $url + * @return Entries + */ + public function setUrl($url) + { + $this->url = $url; + + return $this; + } + + /** + * Get url + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set isRead + * + * @param string $isRead + * @return Entries + */ + public function setIsRead($isRead) + { + $this->isRead = $isRead; + + return $this; + } + + /** + * Get isRead + * + * @return string + */ + public function getIsRead() + { + return $this->isRead; + } + + /** + * Set isFav + * + * @param string $isFav + * @return Entries + */ + public function setIsFav($isFav) + { + $this->isFav = $isFav; + + return $this; + } + + /** + * Get isFav + * + * @return string + */ + public function getIsFav() + { + return $this->isFav; + } + + /** + * Set content + * + * @param string $content + * @return Entries + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * Get content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Set userId + * + * @param string $userId + * @return Entries + */ + public function setUserId($userId) + { + $this->userId = $userId; + + return $this; + } + + /** + * Get userId + * + * @return string + */ + public function getUserId() + { + return $this->userId; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php~ b/src/Wallabag/CoreBundle/Entity/Entry.php~ new file mode 100644 index 00000000..ebcdf53a --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Entry.php~ @@ -0,0 +1,74 @@ +id; + } + + /** + * Set value + * + * @param string $value + * @return Tags + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Tags.php~ b/src/Wallabag/CoreBundle/Entity/Tags.php~ new file mode 100644 index 00000000..c0c78ee5 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Tags.php~ @@ -0,0 +1,65 @@ +id; + } + + /** + * Set value + * + * @param string $value + * @return Tags + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/TagsEntries.php b/src/Wallabag/CoreBundle/Entity/TagsEntries.php new file mode 100644 index 00000000..ad01cf57 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/TagsEntries.php @@ -0,0 +1,95 @@ +id; + } + + /** + * Set entryId + * + * @param integer $entryId + * @return TagsEntries + */ + public function setEntryId($entryId) + { + $this->entryId = $entryId; + + return $this; + } + + /** + * Get entryId + * + * @return integer + */ + public function getEntryId() + { + return $this->entryId; + } + + /** + * Set tagId + * + * @param integer $tagId + * @return TagsEntries + */ + public function setTagId($tagId) + { + $this->tagId = $tagId; + + return $this; + } + + /** + * Get tagId + * + * @return integer + */ + public function getTagId() + { + return $this->tagId; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/TagsEntries.php~ b/src/Wallabag/CoreBundle/Entity/TagsEntries.php~ new file mode 100644 index 00000000..448c54fa --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/TagsEntries.php~ @@ -0,0 +1,95 @@ +id; + } + + /** + * Set entryId + * + * @param integer $entryId + * @return TagsEntries + */ + public function setEntryId($entryId) + { + $this->entryId = $entryId; + + return $this; + } + + /** + * Get entryId + * + * @return integer + */ + public function getEntryId() + { + return $this->entryId; + } + + /** + * Set tagId + * + * @param integer $tagId + * @return TagsEntries + */ + public function setTagId($tagId) + { + $this->tagId = $tagId; + + return $this; + } + + /** + * Get tagId + * + * @return integer + */ + public function getTagId() + { + return $this->tagId; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Users.php b/src/Wallabag/CoreBundle/Entity/Users.php new file mode 100644 index 00000000..3db4a3fd --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Users.php @@ -0,0 +1,155 @@ +id; + } + + /** + * Set username + * + * @param string $username + * @return Users + */ + public function setUsername($username) + { + $this->username = $username; + + return $this; + } + + /** + * Get username + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Set password + * + * @param string $password + * @return Users + */ + public function setPassword($password) + { + $this->password = $password; + + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Set name + * + * @param string $name + * @return Users + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set email + * + * @param string $email + * @return Users + */ + public function setEmail($email) + { + $this->email = $email; + + return $this; + } + + /** + * Get email + * + * @return string + */ + public function getEmail() + { + return $this->email; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Users.php~ b/src/Wallabag/CoreBundle/Entity/Users.php~ new file mode 100644 index 00000000..a48f2240 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Users.php~ @@ -0,0 +1,155 @@ +id; + } + + /** + * Set username + * + * @param string $username + * @return Users + */ + public function setUsername($username) + { + $this->username = $username; + + return $this; + } + + /** + * Get username + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Set password + * + * @param string $password + * @return Users + */ + public function setPassword($password) + { + $this->password = $password; + + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Set name + * + * @param string $name + * @return Users + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set email + * + * @param string $email + * @return Users + */ + public function setEmail($email) + { + $this->email = $email; + + return $this; + } + + /** + * Get email + * + * @return string + */ + public function getEmail() + { + return $this->email; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/UsersConfig.php b/src/Wallabag/CoreBundle/Entity/UsersConfig.php new file mode 100644 index 00000000..26fb44ee --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/UsersConfig.php @@ -0,0 +1,125 @@ +id; + } + + /** + * Set userId + * + * @param string $userId + * @return UsersConfig + */ + public function setUserId($userId) + { + $this->userId = $userId; + + return $this; + } + + /** + * Get userId + * + * @return string + */ + public function getUserId() + { + return $this->userId; + } + + /** + * Set name + * + * @param string $name + * @return UsersConfig + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return UsersConfig + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/UsersConfig.php~ b/src/Wallabag/CoreBundle/Entity/UsersConfig.php~ new file mode 100644 index 00000000..8af283cc --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/UsersConfig.php~ @@ -0,0 +1,125 @@ +id; + } + + /** + * Set userId + * + * @param string $userId + * @return UsersConfig + */ + public function setUserId($userId) + { + $this->userId = $userId; + + return $this; + } + + /** + * Get userId + * + * @return string + */ + public function getUserId() + { + return $this->userId; + } + + /** + * Set name + * + * @param string $name + * @return UsersConfig + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return UsersConfig + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php new file mode 100644 index 00000000..5a71b9ef --- /dev/null +++ b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php @@ -0,0 +1,79 @@ +createQueryBuilder('e') + ->select('e') + ->setFirstResult($firstResult) + ->setMaxResults($maxResults) + ->where('e.isRead = 0') + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery(); + + $paginator = new Paginator($qb); + + return $paginator; + } + + /** + * Retrieves read entries for a user + * + * @param $userId + * @param $firstResult + * @param int $maxResults + * @return Paginator + */ + public function findArchiveByUser($userId, $firstResult, $maxResults = 12) + { + $qb = $this->createQueryBuilder('e') + ->select('e') + ->setFirstResult($firstResult) + ->setMaxResults($maxResults) + ->where('e.isRead = 1') + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery(); + + $paginator = new Paginator($qb); + + return $paginator; + } + + /** + * Retrieves starred entries for a user + * + * @param $userId + * @param $firstResult + * @param int $maxResults + * @return Paginator + */ + public function findStarredByUser($userId, $firstResult, $maxResults = 12) + { + $qb = $this->createQueryBuilder('e') + ->select('e') + ->setFirstResult($firstResult) + ->setMaxResults($maxResults) + ->where('e.isFav = 1') + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery(); + + $paginator = new Paginator($qb); + + return $paginator; + } +} diff --git a/src/Wallabag/CoreBundle/Resources/config/routing.yml b/src/Wallabag/CoreBundle/Resources/config/routing.yml new file mode 100644 index 00000000..327d49d8 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/config/routing.yml @@ -0,0 +1,3 @@ +_wllbg: + resource: "@WallabagCoreBundle/Controller/EntryController.php" + type: annotation \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Resources/config/services.xml b/src/Wallabag/CoreBundle/Resources/config/services.xml new file mode 100644 index 00000000..02308e6a --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/config/services.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig new file mode 100644 index 00000000..2f8423d7 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig @@ -0,0 +1,47 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title "Unread" %} + +{% block menu %} + {% include "WallabagCoreBundle::_menu.html.twig" %} +{% endblock %} + +{% block content %} + {% block pager %} + {% if entries is not empty %} +
+
{{ entries.count }} {% trans %}entries{% endtrans %}
+ +
+ {% endif %} + {% endblock %} + + {% if entries is empty %} +

{% trans %}No articles found.{% endtrans %}

+ {% else %} + {% for entry in entries %} +
+

{{ entry.title|raw }}

+ {% if entry.content| readingTime > 0 %} +
{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min
+ {% else %} +
{% trans %}estimated reading time :{% endtrans %} < 1 min
+ {% endif %} + + +

{{ entry.content|striptags|slice(0, 300) }}...

+
+ {% endfor %} + {% endif %} +{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig new file mode 100644 index 00000000..78dfa7c0 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig @@ -0,0 +1,104 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ entry.title|raw }} ({{ entry.url | e | domainName }}){% endblock %} + +{% block menu %} + {% include "WallabagCoreBundle::_menu.html.twig" %} +{% endblock %} + +{% block content %} +
+ +
+
+
+

{{ entry.title|raw }}

+
+ +
+ {{ entry.content | raw }} +
+
+ + +{% endblock %} \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig new file mode 100644 index 00000000..df6926a0 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig @@ -0,0 +1,11 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Save new entry{% endtrans %}{% endblock %} + +{% block menu %} + {% include "WallabagCoreBundle::_menu.html.twig" %} +{% endblock %} + +{% block content %} + {{ form(form) }} +{% endblock %} \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig b/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig new file mode 100755 index 00000000..0585ecca --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig @@ -0,0 +1,51 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}About{% endtrans %}{% endblock %} +{% block menu %} +{% include "WallabagCoreBundle::_menu.html.twig" %} +{% endblock %} +{% block content %} +

{% trans %}About wallabag{% endtrans %}

+ +
+
{% trans %}Project website{% endtrans %}
+
https://www.wallabag.org
+ +
{% trans %}Main developer{% endtrans %}
+
Nicolas Lœuillet{% trans %}website{% endtrans %}
+ +
{% trans %}Contributors ♥:{% endtrans %}
+
{% trans %}on Github{% endtrans %}
+ +
{% trans %}Bug reports{% endtrans %}
+
{% trans %}On our support website{% endtrans %} {% trans %}or{% endtrans %} {% trans %}on Github{% endtrans %}
+ +
{% trans %}License{% endtrans %}
+
MIT
+ +
{% trans %}Version{% endtrans %}
+
{{ version }}
+
+ +

{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}

+ +

{% trans %}Getting help{% endtrans %}

+ +
+
{% trans %}Documentation{% endtrans %}
+
Online documentation
+ +
{% trans %}Support{% endtrans %}
+
http://support.wallabag.org/
+
+ +

{% trans %}Helping wallabag{% endtrans %}

+ +

{% trans %}wallabag is free and opensource. You can help us:{% endtrans %}

+ +
+
{% trans %}via Paypal{% endtrans %}
+ +
{% trans %}via Flattr{% endtrans %}
+
+{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig b/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig new file mode 100644 index 00000000..d432909a --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig b/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig new file mode 100644 index 00000000..c897a97e --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Resources/views/_head.html.twig b/src/Wallabag/CoreBundle/Resources/views/_head.html.twig new file mode 100755 index 00000000..7ef79a2f --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_head.html.twig @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig b/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig new file mode 100644 index 00000000..d4560e84 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig @@ -0,0 +1,15 @@ + + + diff --git a/src/Wallabag/CoreBundle/Resources/views/_messages.html.twig b/src/Wallabag/CoreBundle/Resources/views/_messages.html.twig new file mode 100644 index 00000000..e69de29b diff --git a/src/Wallabag/CoreBundle/Resources/views/_save_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/_save_form.html.twig new file mode 100755 index 00000000..acaa5dbc --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_save_form.html.twig @@ -0,0 +1,10 @@ + diff --git a/src/Wallabag/CoreBundle/Resources/views/_search_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/_search_form.html.twig new file mode 100644 index 00000000..7eb1b67d --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_search_form.html.twig @@ -0,0 +1,9 @@ + diff --git a/src/Wallabag/CoreBundle/Resources/views/_top.html.twig b/src/Wallabag/CoreBundle/Resources/views/_top.html.twig new file mode 100755 index 00000000..34d925df --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/_top.html.twig @@ -0,0 +1,5 @@ +
+

+ {% block logo %}wallabag logo{% endblock %} +

+
diff --git a/src/Wallabag/CoreBundle/Resources/views/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/layout.html.twig new file mode 100644 index 00000000..83830a4a --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/layout.html.twig @@ -0,0 +1,33 @@ + + + + + + + + + + + {% block title %}{% endblock %} - wallabag + {% include "WallabagCoreBundle::_head.html.twig" %} + {% include "WallabagCoreBundle::_bookmarklet.html.twig" %} + + +{% include "WallabagCoreBundle::_top.html.twig" %} +
+ {% block menu %}{% endblock %} + {% block precontent %}{% endblock %} + {% for flashMessage in app.session.flashbag.get('notice') %} +
+ {{ flashMessage }} +
+ {% endfor %} +
+ {% block content %}{% endblock %} +
+
+{% include "WallabagCoreBundle::_footer.html.twig" %} + + \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Tests/Controller/DefaultControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 00000000..af20f31f --- /dev/null +++ b/src/Wallabag/CoreBundle/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,18 @@ +request('GET', '/app/index'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0); + } +} diff --git a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php new file mode 100644 index 00000000..0b004a30 --- /dev/null +++ b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php @@ -0,0 +1,41 @@ +setUserId(1); - - $form = $this->createFormBuilder($entry) - ->add('url', 'url') - ->add('save', 'submit') - ->getForm(); - - $form->handleRequest($request); - - if ($form->isValid()) { - - $content = Tools::getPageContent(new Url($entry->getUrl())); - var_dump($content);die; - - $em = $this->getDoctrine()->getEntityManager(); - $em->persist($entry); - $em->flush(); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Entry saved' - ); - - return $this->redirect($this->generateUrl('homepage')); - } - - return $this->render('WallabagBundle:Entry:new.html.twig', array( - 'form' => $form->createView(), - )); - } - - /** - * Shows unread entries for current user - * - * @Route("/unread", name="unread") - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showUnreadAction() - { - $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); - $entries = $repository->findUnreadByUser(1, 0); - - return $this->render( - 'WallabagBundle:Entry:entries.html.twig', - array('entries' => $entries) - ); - } - - /** - * Shows read entries for current user - * - * @Route("/archive", name="archive") - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showArchiveAction() - { - $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); - $entries = $repository->findArchiveByUser(1, 0); - - return $this->render( - 'WallabagBundle:Entry:entries.html.twig', - array('entries' => $entries) - ); - } - - /** - * Shows starred entries for current user - * - * @Route("/starred", name="starred") - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showStarredAction() - { - $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); - $entries = $repository->findStarredByUser(1, 0); - - return $this->render( - 'WallabagBundle:Entry:entries.html.twig', - array('entries' => $entries) - ); - } - - /** - * Shows entry content - * - * @param Entries $entry - * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") - * @return \Symfony\Component\HttpFoundation\Response - */ - public function viewAction(Entries $entry) - { - return $this->render( - 'WallabagBundle:Entry:entry.html.twig', - array('entry' => $entry) - ); - } - - /** - * Changes read status for an entry - * - * @param Request $request - * @param Entries $entry - * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - public function toggleArchiveAction(Request $request, Entries $entry) - { - $entry->toggleArchive(); - $this->getDoctrine()->getManager()->flush(); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Entry archived' - ); - - return $this->redirect($request->headers->get('referer')); - } - - /** - * Changes favorite status for an entry - * - * @param Request $request - * @param Entries $entry - * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - public function toggleStarAction(Request $request, Entries $entry) - { - $entry->toggleStar(); - $this->getDoctrine()->getManager()->flush(); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Entry starred' - ); - - return $this->redirect($request->headers->get('referer')); - } - - /** - * Deletes entry - * - * @param Request $request - * @param Entries $entry - * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - public function deleteEntryAction(Request $request, Entries $entry) - { - $em = $this->getDoctrine()->getEntityManager(); - $em->remove($entry); - $em->flush(); - - $this->get('session')->getFlashBag()->add( - 'notice', - 'Entry deleted' - ); - - return $this->redirect($request->headers->get('referer')); - } -} diff --git a/src/WallabagBundle/Controller/StaticController.php b/src/WallabagBundle/Controller/StaticController.php deleted file mode 100644 index aee2bb7e..00000000 --- a/src/WallabagBundle/Controller/StaticController.php +++ /dev/null @@ -1,20 +0,0 @@ -render( - 'WallabagBundle:Static:about.html.twig', - array() - ); - } -} diff --git a/src/WallabagBundle/DependencyInjection/WallabagExtension.php b/src/WallabagBundle/DependencyInjection/WallabagExtension.php deleted file mode 100644 index cfdb21fc..00000000 --- a/src/WallabagBundle/DependencyInjection/WallabagExtension.php +++ /dev/null @@ -1,22 +0,0 @@ -load('services.xml'); - } - - public function getAlias() - { - return 'wallabag'; - } -} diff --git a/src/WallabagBundle/Entity/Config.php b/src/WallabagBundle/Entity/Config.php deleted file mode 100644 index 8b692cef..00000000 --- a/src/WallabagBundle/Entity/Config.php +++ /dev/null @@ -1,95 +0,0 @@ -id; - } - - /** - * Set name - * - * @param string $name - * @return Config - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set value - * - * @param string $value - * @return Config - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Entity/Config.php~ b/src/WallabagBundle/Entity/Config.php~ deleted file mode 100644 index 8b692cef..00000000 --- a/src/WallabagBundle/Entity/Config.php~ +++ /dev/null @@ -1,95 +0,0 @@ -id; - } - - /** - * Set name - * - * @param string $name - * @return Config - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set value - * - * @param string $value - * @return Config - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Entity/Entries.php b/src/WallabagBundle/Entity/Entries.php deleted file mode 100644 index 5849a216..00000000 --- a/src/WallabagBundle/Entity/Entries.php +++ /dev/null @@ -1,230 +0,0 @@ -id; - } - - /** - * Set title - * - * @param string $title - * @return Entries - */ - public function setTitle($title) - { - $this->title = $title; - - return $this; - } - - /** - * Get title - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Set url - * - * @param string $url - * @return Entries - */ - public function setUrl($url) - { - $this->url = $url; - - return $this; - } - - /** - * Get url - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Set isRead - * - * @param string $isRead - * @return Entries - */ - public function setIsRead($isRead) - { - $this->isRead = $isRead; - - return $this; - } - - /** - * Get isRead - * - * @return string - */ - public function getIsRead() - { - return $this->isRead; - } - - public function toggleArchive() - { - $this->isRead = $this->getIsRead() ^ 1; - return $this; - } - - /** - * Set isFav - * - * @param string $isFav - * @return Entries - */ - public function setIsFav($isFav) - { - $this->isFav = $isFav; - - return $this; - } - - /** - * Get isFav - * - * @return string - */ - public function getIsFav() - { - return $this->isFav; - } - - public function toggleStar() - { - $this->isFav = $this->getIsFav() ^ 1; - - return $this; - } - - /** - * Set content - * - * @param string $content - * @return Entries - */ - public function setContent($content) - { - $this->content = $content; - - return $this; - } - - /** - * Get content - * - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Set userId - * - * @param string $userId - * @return Entries - */ - public function setUserId($userId) - { - $this->userId = $userId; - - return $this; - } - - /** - * Get userId - * - * @return string - */ - public function getUserId() - { - return $this->userId; - } -} diff --git a/src/WallabagBundle/Entity/Entries.php~ b/src/WallabagBundle/Entity/Entries.php~ deleted file mode 100644 index 69c6be0d..00000000 --- a/src/WallabagBundle/Entity/Entries.php~ +++ /dev/null @@ -1,215 +0,0 @@ -id; - } - - /** - * Set title - * - * @param string $title - * @return Entries - */ - public function setTitle($title) - { - $this->title = $title; - - return $this; - } - - /** - * Get title - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Set url - * - * @param string $url - * @return Entries - */ - public function setUrl($url) - { - $this->url = $url; - - return $this; - } - - /** - * Get url - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Set isRead - * - * @param string $isRead - * @return Entries - */ - public function setIsRead($isRead) - { - $this->isRead = $isRead; - - return $this; - } - - /** - * Get isRead - * - * @return string - */ - public function getIsRead() - { - return $this->isRead; - } - - /** - * Set isFav - * - * @param string $isFav - * @return Entries - */ - public function setIsFav($isFav) - { - $this->isFav = $isFav; - - return $this; - } - - /** - * Get isFav - * - * @return string - */ - public function getIsFav() - { - return $this->isFav; - } - - /** - * Set content - * - * @param string $content - * @return Entries - */ - public function setContent($content) - { - $this->content = $content; - - return $this; - } - - /** - * Get content - * - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Set userId - * - * @param string $userId - * @return Entries - */ - public function setUserId($userId) - { - $this->userId = $userId; - - return $this; - } - - /** - * Get userId - * - * @return string - */ - public function getUserId() - { - return $this->userId; - } -} diff --git a/src/WallabagBundle/Entity/Entry.php~ b/src/WallabagBundle/Entity/Entry.php~ deleted file mode 100644 index ebcdf53a..00000000 --- a/src/WallabagBundle/Entity/Entry.php~ +++ /dev/null @@ -1,74 +0,0 @@ -id; - } - - /** - * Set value - * - * @param string $value - * @return Tags - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Entity/Tags.php~ b/src/WallabagBundle/Entity/Tags.php~ deleted file mode 100644 index c0c78ee5..00000000 --- a/src/WallabagBundle/Entity/Tags.php~ +++ /dev/null @@ -1,65 +0,0 @@ -id; - } - - /** - * Set value - * - * @param string $value - * @return Tags - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Entity/TagsEntries.php b/src/WallabagBundle/Entity/TagsEntries.php deleted file mode 100644 index 448c54fa..00000000 --- a/src/WallabagBundle/Entity/TagsEntries.php +++ /dev/null @@ -1,95 +0,0 @@ -id; - } - - /** - * Set entryId - * - * @param integer $entryId - * @return TagsEntries - */ - public function setEntryId($entryId) - { - $this->entryId = $entryId; - - return $this; - } - - /** - * Get entryId - * - * @return integer - */ - public function getEntryId() - { - return $this->entryId; - } - - /** - * Set tagId - * - * @param integer $tagId - * @return TagsEntries - */ - public function setTagId($tagId) - { - $this->tagId = $tagId; - - return $this; - } - - /** - * Get tagId - * - * @return integer - */ - public function getTagId() - { - return $this->tagId; - } -} diff --git a/src/WallabagBundle/Entity/TagsEntries.php~ b/src/WallabagBundle/Entity/TagsEntries.php~ deleted file mode 100644 index 448c54fa..00000000 --- a/src/WallabagBundle/Entity/TagsEntries.php~ +++ /dev/null @@ -1,95 +0,0 @@ -id; - } - - /** - * Set entryId - * - * @param integer $entryId - * @return TagsEntries - */ - public function setEntryId($entryId) - { - $this->entryId = $entryId; - - return $this; - } - - /** - * Get entryId - * - * @return integer - */ - public function getEntryId() - { - return $this->entryId; - } - - /** - * Set tagId - * - * @param integer $tagId - * @return TagsEntries - */ - public function setTagId($tagId) - { - $this->tagId = $tagId; - - return $this; - } - - /** - * Get tagId - * - * @return integer - */ - public function getTagId() - { - return $this->tagId; - } -} diff --git a/src/WallabagBundle/Entity/Users.php b/src/WallabagBundle/Entity/Users.php deleted file mode 100644 index a48f2240..00000000 --- a/src/WallabagBundle/Entity/Users.php +++ /dev/null @@ -1,155 +0,0 @@ -id; - } - - /** - * Set username - * - * @param string $username - * @return Users - */ - public function setUsername($username) - { - $this->username = $username; - - return $this; - } - - /** - * Get username - * - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Set password - * - * @param string $password - * @return Users - */ - public function setPassword($password) - { - $this->password = $password; - - return $this; - } - - /** - * Get password - * - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Set name - * - * @param string $name - * @return Users - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set email - * - * @param string $email - * @return Users - */ - public function setEmail($email) - { - $this->email = $email; - - return $this; - } - - /** - * Get email - * - * @return string - */ - public function getEmail() - { - return $this->email; - } -} diff --git a/src/WallabagBundle/Entity/Users.php~ b/src/WallabagBundle/Entity/Users.php~ deleted file mode 100644 index a48f2240..00000000 --- a/src/WallabagBundle/Entity/Users.php~ +++ /dev/null @@ -1,155 +0,0 @@ -id; - } - - /** - * Set username - * - * @param string $username - * @return Users - */ - public function setUsername($username) - { - $this->username = $username; - - return $this; - } - - /** - * Get username - * - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Set password - * - * @param string $password - * @return Users - */ - public function setPassword($password) - { - $this->password = $password; - - return $this; - } - - /** - * Get password - * - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Set name - * - * @param string $name - * @return Users - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set email - * - * @param string $email - * @return Users - */ - public function setEmail($email) - { - $this->email = $email; - - return $this; - } - - /** - * Get email - * - * @return string - */ - public function getEmail() - { - return $this->email; - } -} diff --git a/src/WallabagBundle/Entity/UsersConfig.php b/src/WallabagBundle/Entity/UsersConfig.php deleted file mode 100644 index 8af283cc..00000000 --- a/src/WallabagBundle/Entity/UsersConfig.php +++ /dev/null @@ -1,125 +0,0 @@ -id; - } - - /** - * Set userId - * - * @param string $userId - * @return UsersConfig - */ - public function setUserId($userId) - { - $this->userId = $userId; - - return $this; - } - - /** - * Get userId - * - * @return string - */ - public function getUserId() - { - return $this->userId; - } - - /** - * Set name - * - * @param string $name - * @return UsersConfig - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set value - * - * @param string $value - * @return UsersConfig - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Entity/UsersConfig.php~ b/src/WallabagBundle/Entity/UsersConfig.php~ deleted file mode 100644 index 8af283cc..00000000 --- a/src/WallabagBundle/Entity/UsersConfig.php~ +++ /dev/null @@ -1,125 +0,0 @@ -id; - } - - /** - * Set userId - * - * @param string $userId - * @return UsersConfig - */ - public function setUserId($userId) - { - $this->userId = $userId; - - return $this; - } - - /** - * Get userId - * - * @return string - */ - public function getUserId() - { - return $this->userId; - } - - /** - * Set name - * - * @param string $name - * @return UsersConfig - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set value - * - * @param string $value - * @return UsersConfig - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php deleted file mode 100644 index 3eb1733d..00000000 --- a/src/WallabagBundle/Repository/EntriesRepository.php +++ /dev/null @@ -1,79 +0,0 @@ -createQueryBuilder('e') - ->select('e') - ->setFirstResult($firstResult) - ->setMaxResults($maxResults) - ->where('e.isRead = 0') - ->andWhere('e.userId =:userId')->setParameter('userId', $userId) - ->getQuery(); - - $paginator = new Paginator($qb); - - return $paginator; - } - - /** - * Retrieves read entries for a user - * - * @param $userId - * @param $firstResult - * @param int $maxResults - * @return Paginator - */ - public function findArchiveByUser($userId, $firstResult, $maxResults = 12) - { - $qb = $this->createQueryBuilder('e') - ->select('e') - ->setFirstResult($firstResult) - ->setMaxResults($maxResults) - ->where('e.isRead = 1') - ->andWhere('e.userId =:userId')->setParameter('userId', $userId) - ->getQuery(); - - $paginator = new Paginator($qb); - - return $paginator; - } - - /** - * Retrieves starred entries for a user - * - * @param $userId - * @param $firstResult - * @param int $maxResults - * @return Paginator - */ - public function findStarredByUser($userId, $firstResult, $maxResults = 12) - { - $qb = $this->createQueryBuilder('e') - ->select('e') - ->setFirstResult($firstResult) - ->setMaxResults($maxResults) - ->where('e.isFav = 1') - ->andWhere('e.userId =:userId')->setParameter('userId', $userId) - ->getQuery(); - - $paginator = new Paginator($qb); - - return $paginator; - } -} diff --git a/src/WallabagBundle/Resources/config/routing.yml b/src/WallabagBundle/Resources/config/routing.yml deleted file mode 100644 index ad79b1f0..00000000 --- a/src/WallabagBundle/Resources/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -_wllbg: - resource: "@WallabagBundle/Controller/EntryController.php" - type: annotation diff --git a/src/WallabagBundle/Resources/config/services.xml b/src/WallabagBundle/Resources/config/services.xml deleted file mode 100644 index 02d82643..00000000 --- a/src/WallabagBundle/Resources/config/services.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/src/WallabagBundle/Resources/views/Entry/entries.html.twig b/src/WallabagBundle/Resources/views/Entry/entries.html.twig deleted file mode 100644 index de343aa2..00000000 --- a/src/WallabagBundle/Resources/views/Entry/entries.html.twig +++ /dev/null @@ -1,47 +0,0 @@ -{% extends "WallabagBundle::layout.html.twig" %} - -{% block title "Unread" %} - -{% block menu %} - {% include "WallabagBundle::_menu.html.twig" %} -{% endblock %} - -{% block content %} - {% block pager %} - {% if entries is not empty %} -
-
{{ entries.count }} {% trans %}entries{% endtrans %}
- -
- {% endif %} - {% endblock %} - - {% if entries is empty %} -

{% trans %}No articles found.{% endtrans %}

- {% else %} - {% for entry in entries %} -
-

{{ entry.title|raw }}

- {% if entry.content| readingTime > 0 %} -
{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min
- {% else %} -
{% trans %}estimated reading time :{% endtrans %} < 1 min
- {% endif %} - - -

{{ entry.content|striptags|slice(0, 300) }}...

-
- {% endfor %} - {% endif %} -{% endblock %} diff --git a/src/WallabagBundle/Resources/views/Entry/entry.html.twig b/src/WallabagBundle/Resources/views/Entry/entry.html.twig deleted file mode 100644 index 8c08b2ef..00000000 --- a/src/WallabagBundle/Resources/views/Entry/entry.html.twig +++ /dev/null @@ -1,104 +0,0 @@ -{% extends "WallabagBundle::layout.html.twig" %} - -{% block title %}{{ entry.title|raw }} ({{ entry.url | e | domainName }}){% endblock %} - -{% block menu %} - {% include "WallabagBundle::_menu.html.twig" %} -{% endblock %} - -{% block content %} -
- -
-
-
-

{{ entry.title|raw }}

-
- -
- {{ entry.content | raw }} -
-
- - -{% endblock %} \ No newline at end of file diff --git a/src/WallabagBundle/Resources/views/Entry/new.html.twig b/src/WallabagBundle/Resources/views/Entry/new.html.twig deleted file mode 100644 index 78da791f..00000000 --- a/src/WallabagBundle/Resources/views/Entry/new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "WallabagBundle::layout.html.twig" %} - -{% block title %}{% trans %}Save new entry{% endtrans %}{% endblock %} - -{% block menu %} - {% include "WallabagBundle::_menu.html.twig" %} -{% endblock %} - -{% block content %} - {{ form(form) }} -{% endblock %} \ No newline at end of file diff --git a/src/WallabagBundle/Resources/views/Static/about.html.twig b/src/WallabagBundle/Resources/views/Static/about.html.twig deleted file mode 100755 index 752526e1..00000000 --- a/src/WallabagBundle/Resources/views/Static/about.html.twig +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "WallabagBundle::layout.html.twig" %} - -{% block title %}{% trans %}About{% endtrans %}{% endblock %} -{% block menu %} -{% include "WallabagBundle::_menu.html.twig" %} -{% endblock %} -{% block content %} -

{% trans %}About wallabag{% endtrans %}

- -
-
{% trans %}Project website{% endtrans %}
-
https://www.wallabag.org
- -
{% trans %}Main developer{% endtrans %}
-
Nicolas Lœuillet{% trans %}website{% endtrans %}
- -
{% trans %}Contributors ♥:{% endtrans %}
-
{% trans %}on Github{% endtrans %}
- -
{% trans %}Bug reports{% endtrans %}
-
{% trans %}On our support website{% endtrans %} {% trans %}or{% endtrans %} {% trans %}on Github{% endtrans %}
- -
{% trans %}License{% endtrans %}
-
MIT
- -
{% trans %}Version{% endtrans %}
-
{{ version }}
-
- -

{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}

- -

{% trans %}Getting help{% endtrans %}

- -
-
{% trans %}Documentation{% endtrans %}
-
Online documentation
- -
{% trans %}Support{% endtrans %}
-
http://support.wallabag.org/
-
- -

{% trans %}Helping wallabag{% endtrans %}

- -

{% trans %}wallabag is free and opensource. You can help us:{% endtrans %}

- -
-
{% trans %}via Paypal{% endtrans %}
- -
{% trans %}via Flattr{% endtrans %}
-
-{% endblock %} diff --git a/src/WallabagBundle/Resources/views/_bookmarklet.html.twig b/src/WallabagBundle/Resources/views/_bookmarklet.html.twig deleted file mode 100644 index d432909a..00000000 --- a/src/WallabagBundle/Resources/views/_bookmarklet.html.twig +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/WallabagBundle/Resources/views/_footer.html.twig b/src/WallabagBundle/Resources/views/_footer.html.twig deleted file mode 100644 index c897a97e..00000000 --- a/src/WallabagBundle/Resources/views/_footer.html.twig +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/WallabagBundle/Resources/views/_head.html.twig b/src/WallabagBundle/Resources/views/_head.html.twig deleted file mode 100755 index 7ef79a2f..00000000 --- a/src/WallabagBundle/Resources/views/_head.html.twig +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WallabagBundle/Resources/views/_menu.html.twig b/src/WallabagBundle/Resources/views/_menu.html.twig deleted file mode 100644 index 419a676b..00000000 --- a/src/WallabagBundle/Resources/views/_menu.html.twig +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/src/WallabagBundle/Resources/views/_messages.html.twig b/src/WallabagBundle/Resources/views/_messages.html.twig deleted file mode 100644 index e69de29b..00000000 diff --git a/src/WallabagBundle/Resources/views/_save_form.html.twig b/src/WallabagBundle/Resources/views/_save_form.html.twig deleted file mode 100755 index acaa5dbc..00000000 --- a/src/WallabagBundle/Resources/views/_save_form.html.twig +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/src/WallabagBundle/Resources/views/_search_form.html.twig b/src/WallabagBundle/Resources/views/_search_form.html.twig deleted file mode 100644 index 7eb1b67d..00000000 --- a/src/WallabagBundle/Resources/views/_search_form.html.twig +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/src/WallabagBundle/Resources/views/_top.html.twig b/src/WallabagBundle/Resources/views/_top.html.twig deleted file mode 100755 index 34d925df..00000000 --- a/src/WallabagBundle/Resources/views/_top.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -
-

- {% block logo %}wallabag logo{% endblock %} -

-
diff --git a/src/WallabagBundle/Resources/views/layout.html.twig b/src/WallabagBundle/Resources/views/layout.html.twig deleted file mode 100644 index 34d9b1b0..00000000 --- a/src/WallabagBundle/Resources/views/layout.html.twig +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - {% block title %}{% endblock %} - wallabag - {% include "WallabagBundle::_head.html.twig" %} - {% include "WallabagBundle::_bookmarklet.html.twig" %} - - -{% include "WallabagBundle::_top.html.twig" %} -
- {% block menu %}{% endblock %} - {% block precontent %}{% endblock %} - {% for flashMessage in app.session.flashbag.get('notice') %} -
- {{ flashMessage }} -
- {% endfor %} -
- {% block content %}{% endblock %} -
-
-{% include "WallabagBundle::_footer.html.twig" %} - - \ No newline at end of file diff --git a/src/WallabagBundle/Tests/Controller/DefaultControllerTest.php b/src/WallabagBundle/Tests/Controller/DefaultControllerTest.php deleted file mode 100644 index 64b389bb..00000000 --- a/src/WallabagBundle/Tests/Controller/DefaultControllerTest.php +++ /dev/null @@ -1,18 +0,0 @@ -request('GET', '/app/index'); - - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0); - } -} diff --git a/src/WallabagBundle/Twig/Extension/WallabagExtension.php b/src/WallabagBundle/Twig/Extension/WallabagExtension.php deleted file mode 100644 index 741fb191..00000000 --- a/src/WallabagBundle/Twig/Extension/WallabagExtension.php +++ /dev/null @@ -1,41 +0,0 @@ -