You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/03/26 22:02:53 UTC

[19/22] git commit: [#2835] ticket:303 Add option to use standard parser

[#2835] ticket:303 Add option to use standard parser


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e3b30ad7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e3b30ad7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e3b30ad7

Branch: refs/heads/master
Commit: e3b30ad7427e6a91c17c9a1fbc7fbe785cf85f2f
Parents: 975b209
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Mar 15 09:23:56 2013 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Mar 26 20:57:38 2013 +0000

----------------------------------------------------------------------
 .../templates/blog_widgets/preview_post.html       |    2 +-
 .../templates/blog_widgets/view_post.html          |    2 +-
 ForgeWiki/forgewiki/templates/wiki/page_view.html  |    4 ++--
 ForgeWiki/forgewiki/wiki_main.py                   |    7 ++++++-
 4 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3b30ad7/ForgeBlog/forgeblog/templates/blog_widgets/preview_post.html
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/templates/blog_widgets/preview_post.html b/ForgeBlog/forgeblog/templates/blog_widgets/preview_post.html
index 549aa03..36f9ebc 100644
--- a/ForgeBlog/forgeblog/templates/blog_widgets/preview_post.html
+++ b/ForgeBlog/forgeblog/templates/blog_widgets/preview_post.html
@@ -17,7 +17,7 @@
   <em class="grid-19">
     <strong>Labels:</strong>
     {% for l in value.labels %}
-      <span><a href="{{c.app.url}}search?q=labels_t:{{l}}">{{l}}</a> </span>
+      <span><a href="{{c.app.url}}search?q=labels_t:{{l}}&parser=standard">{{l}}</a> </span>
     {% endfor %}
   </em>
   {% endif %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3b30ad7/ForgeBlog/forgeblog/templates/blog_widgets/view_post.html
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/templates/blog_widgets/view_post.html b/ForgeBlog/forgeblog/templates/blog_widgets/view_post.html
index 40f367f..8c1e747 100644
--- a/ForgeBlog/forgeblog/templates/blog_widgets/view_post.html
+++ b/ForgeBlog/forgeblog/templates/blog_widgets/view_post.html
@@ -15,7 +15,7 @@
 <em class="grid-19">
   <strong>Labels:</strong>
   {% for l in value.labels %}
-    <span><a href="{{c.app.url}}search?q=labels_t:{{l}}">{{l}}</a> </span>
+    <span><a href="{{c.app.url}}search?q=labels_t:{{l}}&parser=standard">{{l}}</a> </span>
   {% endfor %}
 </em>
 {% endif %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3b30ad7/ForgeWiki/forgewiki/templates/wiki/page_view.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/page_view.html b/ForgeWiki/forgewiki/templates/wiki/page_view.html
index 1a32fa1..8c18bda 100644
--- a/ForgeWiki/forgewiki/templates/wiki/page_view.html
+++ b/ForgeWiki/forgewiki/templates/wiki/page_view.html
@@ -47,7 +47,7 @@
     <label class="simple">Labels: </label>
     {% for label in page.labels %}
       {% if label != '' %}
-        <span><a href="{{c.app.url}}search/?q=labels_t:{{label}}">{{label}} ({{page.artifacts_labeled_with(label, page.app_config).count()}})</a></span>
+        <span><a href="{{c.app.url}}search/?q=labels_t:{{label}}&parser=standard">{{label}} ({{page.artifacts_labeled_with(label, page.app_config).count()}})</a></span>
       {% endif %}
     {% endfor %}
   </div>
@@ -57,7 +57,7 @@
     {% for author in page.authors() %}
       <a href="{{author.url()}}">
         {{lib.gravatar(author, size=16)}}
-      </a>  
+      </a>
     {% endfor %}
   </div>
   {% if page.attachments %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e3b30ad7/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 15f86ec..be11731 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -301,7 +301,8 @@ class RootController(BaseController, DispatchIndex):
             redirect(c.project.url() + 'search?' + urlencode(dict(q=q, history=history)))
         search_error = None
         results = []
-        count=0
+        count = 0
+        parser = kw.pop('parser', None)
         limit, page, start = g.handle_paging(limit, page, default=25)
         if not q:
             q = ''
@@ -325,6 +326,10 @@ class RootController(BaseController, DispatchIndex):
             }
             if not history:
                search_params['fq'].append('is_history_b:False')
+            if parser == 'standard':
+                search_params.pop('qt', None)
+                search_params.pop('qf', None)
+                search_params.pop('pf', None)
             try:
                 results = search(
                     q, short_timeout=True, ignore_errors=False,