aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/fr/user/installation.rst2
-rw-r--r--docs/pt-br/conf.py55
-rw-r--r--docs/pt-br/index.rst36
-rw-r--r--docs/pt-br/requirements.txt2
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php6
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php20
6 files changed, 21 insertions, 100 deletions
diff --git a/docs/fr/user/installation.rst b/docs/fr/user/installation.rst
index e8f72717..42208871 100644
--- a/docs/fr/user/installation.rst
+++ b/docs/fr/user/installation.rst
@@ -152,4 +152,4 @@ Après que vous ayez rechargé/redémarré Nginx, vous devriez pouvoir avoir acc
152 152
153.. note:: 153.. note::
154 154
155 Si vous voulez importer un fichier important dans wallabag, vous debez ajouter cette ligne dans votre configuration nginx ``client_max_body_size XM; # allows file uploads up to X megabytes``. 155 Si vous voulez importer un fichier important dans wallabag, vous devez ajouter cette ligne dans votre configuration nginx ``client_max_body_size XM; # allows file uploads up to X megabytes``.
diff --git a/docs/pt-br/conf.py b/docs/pt-br/conf.py
deleted file mode 100644
index 582ad114..00000000
--- a/docs/pt-br/conf.py
+++ /dev/null
@@ -1,55 +0,0 @@
1# -*- coding: utf-8 -*-
2#
3# wallabag documentation build configuration file, created by
4# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
5
6import sys
7import os
8
9extensions = []
10templates_path = ['_templates']
11source_suffix = '.rst'
12master_doc = 'index'
13project = u'wallabag-pt'
14copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
15version = '2.0.0'
16release = version
17exclude_patterns = ['_build']
18pygments_style = 'sphinx'
19html_theme = 'default'
20html_static_path = ['_static']
21htmlhelp_basename = 'wallabagfrdoc'
22
23latex_elements = {
24}
25
26latex_documents = [
27 ('index', 'wallabag-pt.tex', u'wallabag Documentation',
28 u'Nicolas Lœuillet', 'manual'),
29]
30
31man_pages = [
32 ('index', 'wallabagpt', u'wallabag Documentation',
33 [u'Nicolas Lœuillet'], 1)
34]
35
36texinfo_documents = [
37 ('index', 'wallabag', u'wallabag Documentation',
38 u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
39 'Miscellaneous'),
40]
41
42##### Guzzle sphinx theme
43
44import guzzle_sphinx_theme
45html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
46html_theme_path = guzzle_sphinx_theme.html_theme_path()
47html_theme = 'guzzle_sphinx_theme'
48
49# Custom sidebar templates, maps document names to template names.
50html_sidebars = {
51 '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
52}
53
54# Register the theme as an extension to generate a sitemap.xml
55extensions.append("guzzle_sphinx_theme")
diff --git a/docs/pt-br/index.rst b/docs/pt-br/index.rst
deleted file mode 100644
index c0076d25..00000000
--- a/docs/pt-br/index.rst
+++ /dev/null
@@ -1,36 +0,0 @@
1wallabag documentation
2======================
3
4.. image:: ../img/wallabag.png
5 :alt: wallabag logo
6 :align: center
7
8**wallabag** É uma aplicação "leia mais tarde": Ele salva páginas da web mantendo apenas o conteúdo. Elementos como ícones de navegação ou propaganda são deletedos.
9
10A documentação principal desta aplicação é organizada em duas seções:
11
12* :ref:`doc-usuario`
13* :ref:`doc-desenvolvedor`
14
15.. _user-docs:
16
17.. toctree::
18 :maxdepth: 2
19 :caption: Documentação do usuário
20
21 user/criar_conta
22 user/login
23 user/configuração
24 user/primeiro_artigo
25 user/importar
26 user/baixar_artigos
27 user/filtros
28 user/tags
29
30.. _dev-docs:
31
32.. toctree::
33 :maxdepth: 2
34 :caption: Documentação do desenvolvedor
35
36 developer/docker
diff --git a/docs/pt-br/requirements.txt b/docs/pt-br/requirements.txt
deleted file mode 100644
index 06fc8973..00000000
--- a/docs/pt-br/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
1Sphinx>=1.3.0,<1.4.0
2guzzle_sphinx_theme>=0.7.0,<0.8.0
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 744e1a60..da671a61 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController
43 { 43 {
44 $this->validateAuthentication(); 44 $this->validateAuthentication();
45 45
46 $isArchived = (int) $request->query->get('archive'); 46 $isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
47 $isStarred = (int) $request->query->get('starred'); 47 $isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
48 $sort = $request->query->get('sort', 'created'); 48 $sort = $request->query->get('sort', 'created');
49 $order = $request->query->get('order', 'desc'); 49 $order = $request->query->get('order', 'desc');
50 $page = (int) $request->query->get('page', 1); 50 $page = (int) $request->query->get('page', 1);
@@ -52,7 +52,7 @@ class WallabagRestController extends FOSRestController
52 52
53 $pager = $this->getDoctrine() 53 $pager = $this->getDoctrine()
54 ->getRepository('WallabagCoreBundle:Entry') 54 ->getRepository('WallabagCoreBundle:Entry')
55 ->findEntries($this->getUser()->getId(), (bool) $isArchived, (bool) $isStarred, $sort, $order); 55 ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order);
56 56
57 $pager->setCurrentPage($page); 57 $pager->setCurrentPage($page);
58 $pager->setMaxPerPage($perPage); 58 $pager->setMaxPerPage($perPage);
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index fa633031..cba58858 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -49,8 +49,7 @@ class EntryController extends Controller
49 $form->handleRequest($request); 49 $form->handleRequest($request);
50 50
51 if ($form->isValid()) { 51 if ($form->isValid()) {
52 // check for existing entry, if it exists, redirect to it with a message 52 $existingEntry = $this->checkIfEntryAlreadyExists($entry);
53 $existingEntry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
54 53
55 if (false !== $existingEntry) { 54 if (false !== $existingEntry) {
56 $this->get('session')->getFlashBag()->add( 55 $this->get('session')->getFlashBag()->add(
@@ -86,7 +85,10 @@ class EntryController extends Controller
86 { 85 {
87 $entry = new Entry($this->getUser()); 86 $entry = new Entry($this->getUser());
88 $entry->setUrl($request->get('url')); 87 $entry->setUrl($request->get('url'));
89 $this->updateEntry($entry); 88
89 if (false === $this->checkIfEntryAlreadyExists($entry)) {
90 $this->updateEntry($entry);
91 }
90 92
91 return $this->redirect($this->generateUrl('homepage')); 93 return $this->redirect($this->generateUrl('homepage'));
92 } 94 }
@@ -420,4 +422,16 @@ class EntryController extends Controller
420 throw $this->createAccessDeniedException('You can not access this entry.'); 422 throw $this->createAccessDeniedException('You can not access this entry.');
421 } 423 }
422 } 424 }
425
426 /**
427 * Check for existing entry, if it exists, redirect to it with a message.
428 *
429 * @param $entry
430 *
431 * @return array|bool
432 */
433 private function checkIfEntryAlreadyExists($entry)
434 {
435 return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
436 }
423} 437}