mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-17 17:08:37 +00:00
Merge pull request #1546 from wallabag/v2-reload-content
v2 – Ability to reload an entry
This commit is contained in:
commit
5432f61509
9 changed files with 109 additions and 36 deletions
|
@ -266,6 +266,33 @@ class EntryController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload an entry.
|
||||
* Refetch content from the website and make it readable again.
|
||||
*
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function reloadAction(Entry $entry)
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
$message = 'Entry reloaded';
|
||||
if (false === $this->updateEntry($entry)) {
|
||||
$message = 'Failed to reload entry';
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
$message
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes read status for an entry.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue