diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-12-30 09:41:17 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-12-30 09:41:17 +0100 |
commit | 831b02aaf2709d632453a03ab8eb2663fb947497 (patch) | |
tree | 65ff2b6ecdb30ba8d6c5d742b0bf3e248e5c8ea6 /src/Wallabag/CoreBundle/Controller | |
parent | e6a228c43bf98f64d2d046314bae224c5b87399e (diff) | |
download | wallabag-831b02aaf2709d632453a03ab8eb2663fb947497.tar.gz wallabag-831b02aaf2709d632453a03ab8eb2663fb947497.tar.zst wallabag-831b02aaf2709d632453a03ab8eb2663fb947497.zip |
Ability to reload an entry
Could be useful when we want to update the content or when the content failed to be fetched.
Fix #1503
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 2f3fd6a9..041fe71c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -267,6 +267,33 @@ class EntryController extends Controller | |||
267 | } | 267 | } |
268 | 268 | ||
269 | /** | 269 | /** |
270 | * Reload an entry. | ||
271 | * Refetch content from the website and make it readable again. | ||
272 | * | ||
273 | * @param Entry $entry | ||
274 | * | ||
275 | * @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry") | ||
276 | * | ||
277 | * @return \Symfony\Component\HttpFoundation\RedirectResponse | ||
278 | */ | ||
279 | public function reloadAction(Entry $entry) | ||
280 | { | ||
281 | $this->checkUserAction($entry); | ||
282 | |||
283 | $message = 'Entry reloaded'; | ||
284 | if (false === $this->updateEntry($entry)) { | ||
285 | $message = 'Failed to reload entry'; | ||
286 | } | ||
287 | |||
288 | $this->get('session')->getFlashBag()->add( | ||
289 | 'notice', | ||
290 | $message | ||
291 | ); | ||
292 | |||
293 | return $this->redirect($this->generateUrl('view', array('id' => $entry->getId()))); | ||
294 | } | ||
295 | |||
296 | /** | ||
270 | * Changes read status for an entry. | 297 | * Changes read status for an entry. |
271 | * | 298 | * |
272 | * @param Request $request | 299 | * @param Request $request |