]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
toggle archive / fav actions
authorNicolas Lœuillet <nicolas@loeuillet.org>
Fri, 23 Jan 2015 11:45:24 +0000 (12:45 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Fri, 23 Jan 2015 11:45:24 +0000 (12:45 +0100)
12 files changed:
bin/install
src/WallabagBundle/Controller/EntryController.php
src/WallabagBundle/Controller/StaticController.php [new file with mode: 0644]
src/WallabagBundle/Entity/Entries.php
src/WallabagBundle/Repository/EntriesRepository.php
src/WallabagBundle/Resources/views/Entry/entries.html.twig
src/WallabagBundle/Resources/views/Entry/entry.html.twig
src/WallabagBundle/Resources/views/Static/about.html.twig [new file with mode: 0755]
src/WallabagBundle/Resources/views/_menu.html.twig
src/WallabagBundle/Resources/views/_save_form.html.twig [new file with mode: 0755]
src/WallabagBundle/Resources/views/_search_form.html.twig [new file with mode: 0644]
src/WallabagBundle/Resources/views/layout.html.twig

index 5b93e46e3cd7bb06eba2e8ac00b695f5d59dda44..61ffcb658ee97ff7bac689e5c7c24c5682d77d87 100755 (executable)
@@ -67,8 +67,6 @@ $query  = executeQuery($handle, $sql, $params);
 
 echo 'wallabag is now installed';
 echo "\r\n";
-echo 'Just execute the following commands for using wallabag:';
+echo 'Just execute `php app/console server:run` for using wallabag:';
 echo "\r\n";
-echo 'cd web';
-echo "\r\n";
-echo 'php -S localhost:8000';
\ No newline at end of file
+echo 'http://localhost:8000';
\ No newline at end of file
index 233a6c32bcf37946368eaf570e78e69023c24680..fbbb76aa2054dbedc06ee391e3ca273c39de03f5 100644 (file)
@@ -4,67 +4,139 @@ namespace WallabagBundle\Controller;
 
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\HttpFoundation\Request;
 use WallabagBundle\Repository;
+use WallabagBundle\Entity\Entries;
 
 class EntryController extends Controller
 {
     /**
+     * Shows unread entries for current user
+     *
      * @Route("/unread", name="unread")
+     * @return \Symfony\Component\HttpFoundation\Response
      */
     public function showUnreadAction()
     {
         $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
-        $entries = $repository->findUnreadByUser(1);
+        $entries = $repository->findUnreadByUser(1, 0);
 
         return $this->render(
             'WallabagBundle:Entry:entries.html.twig',
             array('entries' => $entries)
         );
-
     }
 
     /**
+     * Shows read entries for current user
+     *
      * @Route("/archive", name="archive")
+     * @return \Symfony\Component\HttpFoundation\Response
      */
     public function showArchiveAction()
     {
         $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
-        $entries = $repository->findArchiveByUser(1);
+        $entries = $repository->findArchiveByUser(1, 0);
 
         return $this->render(
             'WallabagBundle:Entry:entries.html.twig',
             array('entries' => $entries)
         );
-
     }
 
     /**
+     * Shows starred entries for current user
+     *
      * @Route("/starred", name="starred")
+     * @return \Symfony\Component\HttpFoundation\Response
      */
     public function showStarredAction()
     {
         $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
-        $entries = $repository->findStarredByUser(1);
+        $entries = $repository->findStarredByUser(1, 0);
 
         return $this->render(
             'WallabagBundle:Entry:entries.html.twig',
             array('entries' => $entries)
         );
-
     }
 
     /**
+     * Shows entry content
+     *
+     * @param Entries $entry
      * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view")
+     * @return \Symfony\Component\HttpFoundation\Response
      */
-    public function viewAction($id)
+    public function viewAction(Entries $entry)
     {
-        $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
-        $entry = $repository->find($id);
-
         return $this->render(
             'WallabagBundle:Entry:entry.html.twig',
             array('entry' => $entry)
         );
+    }
+
+    /**
+     * Changes read status for an entry
+     *
+     * @param Request $request
+     * @param Entries $entry
+     * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
+     * @return \Symfony\Component\HttpFoundation\RedirectResponse
+     */
+    public function toggleArchiveAction(Request $request, Entries $entry)
+    {
+        $entry->toggleArchive();
+        $this->getDoctrine()->getManager()->flush();
+
+        $this->get('session')->getFlashBag()->add(
+            'notice',
+            'Entry archived'
+        );
+
+        return $this->redirect($request->headers->get('referer'));
+    }
+
+    /**
+     * Changes favorite status for an entry
+     *
+     * @param Request $request
+     * @param Entries $entry
+     * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
+     * @return \Symfony\Component\HttpFoundation\RedirectResponse
+     */
+    public function toggleStarAction(Request $request, Entries $entry)
+    {
+        $entry->toggleStar();
+        $this->getDoctrine()->getManager()->flush();
+
+        $this->get('session')->getFlashBag()->add(
+            'notice',
+            'Entry starred'
+        );
+
+        return $this->redirect($request->headers->get('referer'));
+    }
+
+    /**
+     * Deletes entry
+     *
+     * @param Request $request
+     * @param Entries $entry
+     * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
+     * @return \Symfony\Component\HttpFoundation\RedirectResponse
+     */
+    public function deleteEntryAction(Request $request, Entries $entry)
+    {
+        $em = $this->getDoctrine()->getEntityManager();
+        $em->remove($entry);
+        $em->flush();
+
+        $this->get('session')->getFlashBag()->add(
+            'notice',
+            'Entry deleted'
+        );
 
+        return $this->redirect($request->headers->get('referer'));
     }
 }
diff --git a/src/WallabagBundle/Controller/StaticController.php b/src/WallabagBundle/Controller/StaticController.php
new file mode 100644 (file)
index 0000000..aee2bb7
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+namespace WallabagBundle\Controller;
+
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class StaticController extends Controller
+{
+    /**
+     * @Route("/about", name="about")
+     */
+    public function aboutAction()
+    {
+        return $this->render(
+            'WallabagBundle:Static:about.html.twig',
+            array()
+        );
+    }
+}
index 69c6be0d75105c91aeed43686c7cb0e0123af6b3..b364e0c334258c0531b97493f6f31d6965df79a7 100644 (file)
@@ -144,6 +144,12 @@ class Entries
         return $this->isRead;
     }
 
+    public function toggleArchive()
+    {
+        $this->isRead = $this->getIsRead() ^ 1;
+        return $this;
+    }
+
     /**
      * Set isFav
      *
@@ -167,6 +173,13 @@ class Entries
         return $this->isFav;
     }
 
+    public function toggleStar()
+    {
+        $this->isFav = $this->getIsFav() ^ 1;
+
+        return $this;
+    }
+
     /**
      * Set content
      *
index c355a012c61dd51a68ccc0a1e914f4d9468e3a42..c4428a1d20046e6cf70d1d45c33a020716429cf7 100644 (file)
@@ -4,31 +4,31 @@ namespace WallabagBundle\Repository;
 
 use Doctrine\ORM\Query;
 use Doctrine\ORM\EntityRepository;
+use Doctrine\ORM\Tools\Pagination\Paginator;
 
-/**
- * EntriesRepository
- *
- * This class was generated by the Doctrine ORM. Add your own custom
- * repository methods below.
- */
 class EntriesRepository extends EntityRepository
 {
-    public function findUnreadByUser($userId)
+    public function findUnreadByUser($userId, $firstResult, $maxResults = 12)
     {
         $qb = $this->createQueryBuilder('e')
             ->select('e')
+            ->setFirstResult($firstResult)
+            ->setMaxResults($maxResults)
             ->where('e.isRead = 0')
             ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
-            ->getQuery()
-            ->getResult(Query::HYDRATE_ARRAY);
+            ->getQuery();
 
-        return $qb;
+        $pag = new Paginator($qb);
+
+        return $pag;
     }
 
-    public function findArchiveByUser($userId)
+    public function findArchiveByUser($userId, $firstResult, $maxResults = 12)
     {
         $qb = $this->createQueryBuilder('e')
             ->select('e')
+            ->setFirstResult($firstResult)
+            ->setMaxResults($maxResults)
             ->where('e.isRead = 1')
             ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
             ->getQuery()
@@ -37,10 +37,12 @@ class EntriesRepository extends EntityRepository
         return $qb;
     }
 
-    public function findStarredByUser($userId)
+    public function findStarredByUser($userId, $firstResult, $maxResults = 12)
     {
         $qb = $this->createQueryBuilder('e')
             ->select('e')
+            ->setFirstResult($firstResult)
+            ->setMaxResults($maxResults)
             ->where('e.isFav = 1')
             ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
             ->getQuery()
index 8117729801d6c105c60d07dd64e7c91ac2da1497..de343aa221d11e68d374f5aa4ab52a725cd52707 100644 (file)
@@ -7,6 +7,20 @@
 {% endblock %}
 
 {% block content %}
+    {% block pager %}
+    {% if entries is not empty %}
+        <div class="results">
+            <div class="nb-results">{{ entries.count }} {% trans %}entries{% endtrans %}</div>
+            <div class="pagination">
+                {% for p in range(1, entries.count) %}
+                    <li>
+                        <a href="{{ path(app.request.attributes.get('_route'), {'page': p}) }}">{{ p }}</a>
+                    </li>
+                {% endfor %}
+            </div>
+        </div>
+    {% endif %}
+    {% endblock %}
 
     {% if entries is empty %}
         <div class="messages warning"><p>{% trans %}No articles found.{% endtrans %}</p></div>
@@ -21,9 +35,9 @@
                 {% endif %}
 
                 <ul class="tools links">
-                    <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
-                    <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li>
-                    <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
+                    <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
+                    <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li>
+                    <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
                     <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | domainName }}</span></a></li>
                 </ul>
                 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
index 19d4650ea80d1a1abd8f0e422a255cf9aeff5c86..8c08b2ef09159aef64fbbe63118145f03fd56082 100644 (file)
@@ -11,9 +11,9 @@
         <ul class="links">
             <li class="topPosF"><a href="#top" title="{% trans %}Back to top{% endtrans %}" class="tool top icon icon-arrow-up-thick"><span>{% trans %}Back to top{% endtrans %}</span></a></li>
             <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | domainName }}</span></a></li>
-            <li><a title="{% trans %}Mark as read{% endtrans %}" class="tool icon icon-check {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
-            <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li>
-            <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans %}Delete{% endtrans %}</span></a></li>
+            <li><a title="{% trans %}Mark as read{% endtrans %}" class="tool icon icon-check {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
+            <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li>
+            <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li>
             {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %}
             {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
             {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %}
@@ -43,9 +43,9 @@
         $(document).ready(function() {
 
             // toggle read property of current article
-            $('#markAsRead').click(function(){
+          /*  $('#markAsRead').click(function(){
                 $("body").css("cursor", "wait");
-                $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done(
+                $.ajax( { url: '{{ path('archive_entry', { 'id': entry.id }) }}' }).done(
                         function( data ) {
                             if ( data == '1' ) {
                                 if ( $('#markAsRead').hasClass("archive-off") ) {
                             }
                         });
                 $("body").css("cursor", "auto");
-            });
+            });*/
 
             // toggle favorite property of current article
-            $('#setFav').click(function(){
+          /*  $('#setFav').click(function(){
                 $("body").css("cursor", "wait");
-                $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done(
+                $.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done(
                         function( data ) {
                             if ( data == '1' ) {
                                 if ( $('#setFav').hasClass("fav-off") ) {
@@ -84,7 +84,7 @@
                             }
                         });
                 $("body").css("cursor", "auto");
-            });
+            });*/
 
             $(window).scroll(function(e){
                 var scrollTop = $(window).scrollTop();
diff --git a/src/WallabagBundle/Resources/views/Static/about.html.twig b/src/WallabagBundle/Resources/views/Static/about.html.twig
new file mode 100755 (executable)
index 0000000..1a3c927
--- /dev/null
@@ -0,0 +1,84 @@
+{% extends "WallabagBundle::layout.html.twig" %}
+
+{% block title %}{% trans %}About{% endtrans %}{% endblock %}
+{% block menu %}
+{% include "WallabagBundle::_menu.html.twig" %}
+{% endblock %}
+{% block content %}
+    <h2>{% trans %}About wallabag{% endtrans %}</h2>
+
+    <dl>
+        <dt>{% trans %}Project website{% endtrans %}</dt>
+        <dd><a href="https://www.wallabag.org">https://www.wallabag.org</a></dd>
+
+        <dt>{% trans %}Main developer{% endtrans %}</dt>
+        <dd><a href="mailto:nicolas@loeuillet.org">Nicolas Lœuillet</a> — <a href="http://cdetc.fr">{% trans %}website{% endtrans %}</a></dd>
+
+        <dt>{% trans %}Contributors:{% endtrans %}</dt>
+        <dd><a href="https://github.com/wallabag/wallabag/graphs/contributors">{% trans %}on Github{% endtrans %}</a></dd>
+
+        <dt>{% trans %}Bug reports{% endtrans %}</dt>
+        <dd><a href="https://support.wallabag.org">{% trans %}On our support website{% endtrans %}</a> {% trans %}or{% endtrans %} <a href="https://github.com/wallabag/wallabag/issues">{% trans %}on Github{% endtrans %}</a></dd>
+
+        <dt>{% trans %}License{% endtrans %}</dt>
+        <dd><a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a></dd>
+
+        <dt>{% trans %}Version{% endtrans %}</dt>
+        <dd></dd>
+    </dl>
+
+    <p>{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}</p>
+
+    <h2>{% trans %}Getting help{% endtrans %}</h2>
+    
+    <dl>
+        <dt>{% trans %}Documentation{% endtrans %}</dt>
+        <dd><a href="docs/">Offline documentation</a> and <a href="https://doc.wallabag.org/">online documentation</a> (up to date)</dd>
+        
+        <dt>{% trans %}Support{% endtrans %}</dt>
+        <dd><a href="http://support.wallabag.org/">http://support.wallabag.org/</a></dd>
+    </dl>
+
+    <h2>{% trans %}Helping wallabag{% endtrans %}</h2>
+
+    <p>{% trans %}wallabag is free and opensource. You can help us:{% endtrans %}</p>
+
+    <dl>
+        <dt><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb">{% trans %}via Paypal{% endtrans %}</a></dt>
+
+        <dt><a href="https://flattr.com/thing/1265480">{% trans %}via Flattr{% endtrans %}</a></dt>
+    </dl>
+
+    <h2>{% trans %}Credits{% endtrans %}</h2>
+    <dl>
+        <dt>PHP Readability</dt>
+        <dd><a href="https://bitbucket.org/fivefilters/php-readability">https://bitbucket.org/fivefilters/php-readability</a></dd>
+
+        <dt>Full Text RSS</dt>
+        <dd><a href="http://code.fivefilters.org/full-text-rss/src">http://code.fivefilters.org/full-text-rss/src</a></dd>
+
+        <dt>logo by Maylis Agniel</dt>
+        <dd><a href="https://github.com/wallabag/logo">https://github.com/wallabag/logo</a></dd>
+
+        <dt>icons</dt>
+        <dd><a href="http://icomoon.io">http://icomoon.io</a></dd>
+
+        <dt>PHP Simple HTML DOM Parser</dt>
+        <dd><a href="http://simplehtmldom.sourceforge.net/">http://simplehtmldom.sourceforge.net/</a></dd>
+
+        <dt>Session</dt>
+        <dd><a href="https://github.com/tontof/kriss_feed/blob/master/src/class/Session.php">https://github.com/tontof/kriss_feed/blob/master/src/class/Session.php</a></dd>
+
+        <dt>Twig</dt>
+        <dd><a href="http://twig.sensiolabs.org">http://twig.sensiolabs.org</a></dd>
+
+        <dt>Flash messages</dt>
+        <dd><a href="https://github.com/plasticbrain/PHP-Flash-Messages">https://github.com/plasticbrain/PHP-Flash-Messages</a></dd>
+
+        <dt>Pagination</dt>
+        <dd><a href="https://github.com/daveismyname/pagination">https://github.com/daveismyname/pagination</a></dd>
+
+        <dt>PHPePub</dt>
+        <dd><a href="https://github.com/Grandt/PHPePub/">https://github.com/Grandt/PHPePub/</a></dd>
+    </dl> 
+{% endblock %}
index b001aec5206e4e62c80367ba594841477d9f6713..4c6a0a1b3f97efee022574a3b3fedfb45adbe8fb 100644 (file)
@@ -5,13 +5,13 @@
                 <li><a href="{{ path('archive') }}"}>{% trans %}archive{% endtrans %}</a></li>
                 <li><a href="./?view=tags">{% trans %}tags{% endtrans %}</a></li>
                 <li style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans %}save a link{% endtrans %}</a>
-
+                    {% include "WallabagBundle::_save_form.html.twig" %}
                 </li>
                 <li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans %}search{% endtrans %}</a>
-
+                    {% include "WallabagBundle::_search_form.html.twig" %}
                 </li>
                 <li><a href="./?view=config">{% trans %}config{% endtrans %}</a></li>
-                <li><a href="./?view=about">{% trans %}about{% endtrans %}</a></li>
+                <li><a href={{ path('about') }}>{% trans %}about{% endtrans %}</a></li>
                 <li><a class="icon icon-power" href="./?logout" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li>
             </ul>
 
diff --git a/src/WallabagBundle/Resources/views/_save_form.html.twig b/src/WallabagBundle/Resources/views/_save_form.html.twig
new file mode 100755 (executable)
index 0000000..acaa5db
--- /dev/null
@@ -0,0 +1,10 @@
+<div id="bagit-form" class="messages info popup-form">
+    <form method="get" action="index.php" target="_blank" id="bagit-form-form">
+        <h2>{% trans %}Save a link{% endtrans %}</h2>
+        <a href="javascript: void(null);" id="bagit-form-close" class="close-button--popup close-button">&times;</a>
+        <input type="hidden" name="autoclose" value="1" />
+        <input required placeholder="example.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
+        <span id="add-link-result"></span>
+        <input type="submit" value="{% trans %}save link!"{% endtrans %} />
+    </form>
+</div>
diff --git a/src/WallabagBundle/Resources/views/_search_form.html.twig b/src/WallabagBundle/Resources/views/_search_form.html.twig
new file mode 100644 (file)
index 0000000..7eb1b67
--- /dev/null
@@ -0,0 +1,9 @@
+<div id="search-form" class="messages info popup-form">
+<form method="get" action="index.php">
+       <h2>{% trans %}Search{% endtrans %}</h2>
+        <a href="javascript: void(null);" id="search-form-close" class="close-button--popup close-button">&times;</a>
+        <input type="hidden" name="view" value="search"></input>
+        <input required placeholder="{% trans %}Enter your search here{% endtrans %}" type="text" name="search" id="searchfield"><br>
+        <input id="submit-search" type="submit" value="{% trans %}Search{% endtrans %}"></input>
+</form>
+</div>
index 4a3f0f5cb0d5502705868b6c2cdc6916d5a8669b..34d9b1b0c57b49a83a5618b245a7ef83f52fd396 100644 (file)
 <div id="main">
     {% block menu %}{% endblock %}
     {% block precontent %}{% endblock %}
-    {% block messages %}
-        {% include "WallabagBundle::_messages.html.twig" %}
-    {% endblock %}
+    {% for flashMessage in app.session.flashbag.get('notice') %}
+        <div class="flash-notice">
+            {{ flashMessage }}
+        </div>
+    {% endfor %}
     <div id="content" class="w600p center">
         {% block content %}{% endblock %}
     </div>