]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1903 from wallabag/force-server-version
authorNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 10 Apr 2016 17:57:45 +0000 (19:57 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 10 Apr 2016 17:57:45 +0000 (19:57 +0200)
Force server version to avoid connexion error

.travis.yml
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Controller/EntryController.php
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml

index fc9a38c26b2d8c1c91997aa7902a6158cb6687b4..324b236abc49d124c936047070756846c4a7c78e 100644 (file)
@@ -58,4 +58,4 @@ script:
     - ant prepare-$DB
     - bin/phpunit -v
     - if [ "$CS_FIXER" = "run" ]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
-    - if [ "$VALIDATE_TRANSLATION_FILE" = "run" ]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations ; fi;
+    - if [ "$VALIDATE_TRANSLATION_FILE" = "run" ]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi;
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());
+    }
 }
index a8fcbcf66d0ed8a26681ac9aa4f54b1636c347ce..3e847b3519e0994f35987e447a4ac925036962ed 100644 (file)
@@ -19,9 +19,9 @@ menu:
         unread: 'Sin leer'
         starred: 'Favoritos'
         archive: 'Archivo'
-        all_articles: 'Todos los artículos'
+        all_articles: 'Todos artículos'
         config: 'Configuración'
-        tags: 'Tags'
+        tags: 'Etiquetas'
         internal_settings: 'Configuración interna'
         import: 'Importar'
         howto: 'Ayuda'
@@ -62,18 +62,18 @@ config:
         items_per_page_label: 'Número de artículos por página'
         language_label: 'Idioma'
         reading_speed:
-            # label: 'Reading speed'
-            # help_message: 'You can use online tools to estimate your reading speed:'
-            # 100_word: 'I read ~100 words per minute'
-            # 200_word: 'I read ~200 words per minute'
-            # 300_word: 'I read ~300 words per minute'
-            # 400_word: 'I read ~400 words per minute'
+            label: 'Velocidad de leer'
+            help_message: 'Se puede usar las técnicas para calcular su velocidad de leer:'
+            100_word: 'Leo ~100 palabras por minuto'
+            200_word: 'Leo ~200 palabras por minuto'
+            300_word: 'Leo ~300 palabras por minuto'
+            400_word: 'Leo ~400 palabras por minuto'
     form_rss:
         description: 'Los feeds RSS de wallabag permiten leer los artículos guardados con su lector RSS favorito. Necesita generar un token primero'
         token_label: 'RSS token'
         # no_token: 'No token'
         token_create: 'Crear token'
-        token_reset: 'Resetear token'
+        token_reset: 'Reiniciar token'
         rss_links: 'URL de su feed RSS'
         rss_link:
             unread: 'sin leer'
@@ -90,17 +90,17 @@ config:
         new_password_label: 'Nueva contraseña'
         repeat_new_password_label: 'Confirmar la nueva contraseña'
     form_rules:
-        # if_label: 'if'
-        # then_tag_as_label: 'then tag as'
-        # delete_rule_label: 'delete'
+        if_label: 'si'
+        then_tag_as_label: 'Etiquete como'
+        delete_rule_label: 'Borre'
         rule_label: 'Regla'
-        tags_label: 'Tags'
+        tags_label: 'Etiquetas'
         faq:
             title: 'FAQ'
             tagging_rules_definition_title: '¿Qué significa reglas de etiquetado autómaticas?'
-            tagging_rules_definition_description: 'Son las reglas usadas por Wallabag para etiquetar automáticamente los nuevos artículos.<br />Cáda vez que un nuevo artículo es añadido, todas las reglas de etiquetado automáticas serán usadas para etiquetarlo, ayudandote a clasificar automáticamente los artículos.'
+            tagging_rules_definition_description: 'Son las reglas usadas por Wallabag para etiquetar automáticamente los nuevos artículos.<br />Cada vez que un nuevo artículo sea añadido, todas las reglas de etiquetado automáticas serán usadas para etiquetarlo, ayudándole a clasificar automáticamente los artículos.'
             how_to_use_them_title: '¿Cómo se utilizan?'
-            # how_to_use_them_description: 'Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
+            how_to_use_them_description: 'Supongamos que quiere etiquetar nuevos artículos como « <i>lectura corta</i> » cuando el tiempo de leer sea menos de 3 minutos. <br /> En este caso, debe poner Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
             variables_available_title: '¿Qué variables y operadores se pueden utilizar para escribir las reglas?'
             variables_available_description: 'Las siguientes variables y operadores se pueden utilizar para crear las reglas de etiquetado automáticas:'
             meaning: 'Significado'
@@ -301,9 +301,9 @@ quickstart:
         gitter: 'En Gitter'
 
 tag:
-    page_title: 'Tags'
+    page_title: 'Etiquetas'
     list:
-        number_on_the_page: '{0} No hay ningun tag.|{1} Hay un tag.|]1,Inf[ Hay %count% tags.'
+        number_on_the_page: '{0} No hay ningun etiqueta.|{1} Hay un etiqueta.|]1,Inf[ Hay %count% etiquetas.'
 
 import:
     page_title: 'Importar'