Commits

xiaq committed bf840fa

On +index view, Use GET for filtering.

Comments (0)

Files changed (2)

MoinMoin/apps/frontend/views.py

     except AccessDenied:
         abort(403)
 
-    if request.method == 'GET':
-        form = IndexForm.from_defaults()
-        selected_groups = None
-    elif request.method == "POST":
-        form = IndexForm.from_flat(request.form)
-        selected_groups = [k.replace("_", " ") for k, v in form['contenttype'].iteritems() if v]
+    # XXX retain default values when some arg missing from request.args?
+    form = IndexForm.from_flat(request.args)
+
+    selected_groups = [k.replace("_", " ") for k, v in form['contenttype'].iteritems() if v]
 
     startswith = request.values.get("startswith")
 

MoinMoin/templates/index.html

             <div class="moin-contenttypes-wrapper">
                 <div class="ct-hide">{{ _("Filter by content type") }}</div>
                 {% set unknown_items_label = _("items having unknown mime types") %}
-                {{ gen.form.open(form, method="post", action=url_for('frontend.index', item_name=item_name)) }}
+                {{ gen.form.open(form, method="get", action=url_for('frontend.index', item_name=item_name)) }}
                 <ul>
                     <li>
                         <a href="#" class="filter-toggle">&raquo; {{ _("Toggle") }}</a>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.