]> git.0d.be Git - panikweb.git/commitdiff
news: fix search
authorFrédéric Péters <fpeters@0d.be>
Sun, 22 Sep 2013 15:05:51 +0000 (17:05 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 22 Sep 2013 15:05:51 +0000 (17:05 +0200)
panikweb/paniktags/templatetags/paniktags.py
panikweb_templates/static/js/specifics.js
panikweb_templates/templates/news/archives.html
panikweb_templates/templates/news/nav.html

index 0409694c02fc7f9a3256edc1835c53bd98c69bf3..9877b3ba498f9053e714a073cb454f1bb149abfe 100644 (file)
@@ -45,6 +45,7 @@ def news_nav(context, date=None, klass=None):
         'newsitem': context.get('newsitem'),
         'categories': context.get('categories'),
         'news': context.get('news'),
+        'search_query': context.get('search_query'),
     }
 
 @register.inclusion_tag('emissions/nav.html', takes_context=True)
index 966b4ebadd17fa1bd541fa9c337b0385450e3900..5f93cb7b31c4e4a26d432a73a2b2c9056f68bd67 100644 (file)
@@ -281,7 +281,8 @@ $(function() {
                $("#search-form").unbind('submit').on('submit', function(event) {
                        event.preventDefault();
                        $(this).addClass('loading');
-                       loadPage($(this).attr('action') + '/?' + $(this).serialize());
+                        console.log('action:', $(this).attr('action') + '?' + $(this).serialize());
+                       loadPage($(this).attr('action') + '?' + $(this).serialize());
                });
                $(".tabs").each(function() {
                        var self = $(this);
index 8efe0863a0ff968bd0d6c002d73d899ed18a163e..84511f2a36853a725b928fe44c4ac946cfa06a85 100644 (file)
@@ -8,15 +8,6 @@
 
 {% block main %}
 
-       <form method="get" action="." class="padded center" id="search-form">
-               <div class="big ">
-                       <label for="id_q">Rechercher :</label>
-                       <input id="id_q" name="q" type="text" {% if search_query %}value="{{ search_query }}{% endif %}">
-                       <button class="icon-search"></button>
-               </div>
-       </form>
-
-
 <div class="wrapper {% if results %}sided{% endif %}">
 
        {% if search_query and not results %}
index cae4f49c75cbf87ba4a41542da03c04bb29881b7..d28154d6b15d7708fb850cb16263c623cbc43d1e 100644 (file)
@@ -1,8 +1,10 @@
 <div class="mainSub">
     <div class="wrapper">
         <nav>
-        <form method="get" action="." class="big marged" id="search-form">
-                <label for="id_q">Rechercher:</label><input id="id_q" name="q" type="text"><button class="icon-search"></button>
+        <form method="get" action="{% url 'newsArchives' %}" class="big marged" id="search-form">
+                <label for="id_q">Rechercher :</label>
+                <input id="id_q" name="q" type="text" {% if search_query %}value="{{ search_query }}"{% endif %}>
+                <button class="icon-search"></button>
         </form>
         </nav>
     </div>