]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1901 from wallabag/spanish
authorNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 10 Apr 2016 13:43:40 +0000 (15:43 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 10 Apr 2016 13:43:40 +0000 (15:43 +0200)
Update Spanish translation

docs/fr/user/installation.rst
docs/pt-br/conf.py [deleted file]
docs/pt-br/index.rst [deleted file]
docs/pt-br/requirements.txt [deleted file]
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Controller/EntryController.php

index e8f72717d6d2b1df843104a036232c68db430b3f..4220887190f45c2db3d2b5ba5d6867c184724b3b 100644 (file)
@@ -152,4 +152,4 @@ Après que vous ayez rechargé/redémarré Nginx, vous devriez pouvoir avoir acc
 
 .. note::
 
-    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``.
+    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 (file)
index 582ad11..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# wallabag documentation build configuration file, created by
-# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
-
-import sys
-import os
-
-extensions = []
-templates_path = ['_templates']
-source_suffix = '.rst'
-master_doc = 'index'
-project = u'wallabag-pt'
-copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
-version = '2.0.0'
-release = version
-exclude_patterns = ['_build']
-pygments_style = 'sphinx'
-html_theme = 'default'
-html_static_path = ['_static']
-htmlhelp_basename = 'wallabagfrdoc'
-
-latex_elements = {
-}
-
-latex_documents = [
-  ('index', 'wallabag-pt.tex', u'wallabag Documentation',
-   u'Nicolas Lœuillet', 'manual'),
-]
-
-man_pages = [
-    ('index', 'wallabagpt', u'wallabag Documentation',
-     [u'Nicolas Lœuillet'], 1)
-]
-
-texinfo_documents = [
-  ('index', 'wallabag', u'wallabag Documentation',
-   u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
-   'Miscellaneous'),
-]
-
-##### Guzzle sphinx theme
-
-import guzzle_sphinx_theme
-html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
-html_theme_path = guzzle_sphinx_theme.html_theme_path()
-html_theme = 'guzzle_sphinx_theme'
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {
-    '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
-}
-
-# Register the theme as an extension to generate a sitemap.xml
-extensions.append("guzzle_sphinx_theme")
diff --git a/docs/pt-br/index.rst b/docs/pt-br/index.rst
deleted file mode 100644 (file)
index c0076d2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-wallabag documentation
-======================
-
-.. image:: ../img/wallabag.png
-   :alt: wallabag logo
-   :align: center
-
-**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.
-
-A documentação principal desta aplicação é organizada em duas seções:
-
-* :ref:`doc-usuario`
-* :ref:`doc-desenvolvedor`
-
-.. _user-docs:
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Documentação do usuário
-
-   user/criar_conta
-   user/login
-   user/configuração
-   user/primeiro_artigo
-   user/importar
-   user/baixar_artigos
-   user/filtros
-   user/tags
-
-.. _dev-docs:
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Documentação do desenvolvedor
-
-   developer/docker
diff --git a/docs/pt-br/requirements.txt b/docs/pt-br/requirements.txt
deleted file mode 100644 (file)
index 06fc897..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Sphinx>=1.3.0,<1.4.0
-guzzle_sphinx_theme>=0.7.0,<0.8.0
index 744e1a601547b3d968c060dc3657007b1c3c6ce5..da671a61469a910020dce34811c603b4432cb9f2 100644 (file)
@@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController
     {
         $this->validateAuthentication();
 
-        $isArchived = (int) $request->query->get('archive');
-        $isStarred = (int) $request->query->get('starred');
+        $isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
+        $isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
         $sort = $request->query->get('sort', 'created');
         $order = $request->query->get('order', 'desc');
         $page = (int) $request->query->get('page', 1);
@@ -52,7 +52,7 @@ class WallabagRestController extends FOSRestController
 
         $pager = $this->getDoctrine()
             ->getRepository('WallabagCoreBundle:Entry')
-            ->findEntries($this->getUser()->getId(), (bool) $isArchived, (bool) $isStarred, $sort, $order);
+            ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order);
 
         $pager->setCurrentPage($page);
         $pager->setMaxPerPage($perPage);
index fa6330314209c36872e1b1b9d2100ea1f05d074c..cba58858a16f68d868b5f09e8604e1c41cf4de3f 100644 (file)
@@ -49,8 +49,7 @@ class EntryController extends Controller
         $form->handleRequest($request);
 
         if ($form->isValid()) {
-            // check for existing entry, if it exists, redirect to it with a message
-            $existingEntry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
+            $existingEntry = $this->checkIfEntryAlreadyExists($entry);
 
             if (false !== $existingEntry) {
                 $this->get('session')->getFlashBag()->add(
@@ -86,7 +85,10 @@ class EntryController extends Controller
     {
         $entry = new Entry($this->getUser());
         $entry->setUrl($request->get('url'));
-        $this->updateEntry($entry);
+
+        if (false === $this->checkIfEntryAlreadyExists($entry)) {
+            $this->updateEntry($entry);
+        }
 
         return $this->redirect($this->generateUrl('homepage'));
     }
@@ -420,4 +422,16 @@ class EntryController extends Controller
             throw $this->createAccessDeniedException('You can not access this entry.');
         }
     }
+
+    /**
+     * Check for existing entry, if it exists, redirect to it with a message.
+     *
+     * @param $entry
+     *
+     * @return array|bool
+     */
+    private function checkIfEntryAlreadyExists($entry)
+    {
+        return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
+    }
 }