Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21C2710645 for ; Wed, 24 Apr 2013 22:30:28 +0000 (UTC) Received: (qmail 16395 invoked by uid 500); 24 Apr 2013 22:30:28 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 16377 invoked by uid 500); 24 Apr 2013 22:30:28 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 16368 invoked by uid 99); 24 Apr 2013 22:30:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Apr 2013 22:30:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C1141880715; Wed, 24 Apr 2013 22:30:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Wed, 24 Apr 2013 22:30:43 -0000 Message-Id: <1a9259282b6e48b8bf4330282f2a6654@git.apache.org> In-Reply-To: <8ecb9c585e5543e78aafd52fbeca9f3f@git.apache.org> References: <8ecb9c585e5543e78aafd52fbeca9f3f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/50] git commit: [#2835] ticket:290 Use get_first helper and fix title displaying [#2835] ticket:290 Use get_first helper and fix title displaying Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0d092368 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0d092368 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0d092368 Branch: refs/heads/cj/5655 Commit: 0d09236816af17ed92a824a9201472c6f14b3e2e Parents: 46db582 Author: Igor Bondarenko Authored: Tue Mar 19 10:42:34 2013 +0000 Committer: Dave Brondsema Committed: Wed Apr 24 16:34:40 2013 +0000 ---------------------------------------------------------------------- .../allura/templates/widgets/search_results.html | 6 +++++- ForgeWiki/forgewiki/wiki_main.py | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d092368/Allura/allura/templates/widgets/search_results.html ---------------------------------------------------------------------- diff --git a/Allura/allura/templates/widgets/search_results.html b/Allura/allura/templates/widgets/search_results.html index e33fded..7eb577d 100644 --- a/Allura/allura/templates/widgets/search_results.html +++ b/Allura/allura/templates/widgets/search_results.html @@ -59,7 +59,11 @@

- {{- doc.title_match|safe or h.get_first(doc, 'title') or h.get_first(doc, 'title_s') -}} {#- title_s is legacy -#} + {% if doc.title_match %} + {{ doc.title_match|safe }} + {% else %} + {{ h.get_first(doc, 'title') or h.get_first(doc, 'title_s') -}} {#- title_s is legacy -#} + {% endif %} {% if doc['type_s'] %}{{ '(%s)' % doc['type_s'] }}{% endif %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d092368/ForgeWiki/forgewiki/wiki_main.py ---------------------------------------------------------------------- diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py index 3e8d815..4a47b3b 100644 --- a/ForgeWiki/forgewiki/wiki_main.py +++ b/ForgeWiki/forgewiki/wiki_main.py @@ -367,10 +367,10 @@ class RootController(BaseController, DispatchIndex): return doc def add_matches(doc): m = matches.get(doc['id'], {}) - doc['title_match'] = m.get('title', [''])[0] - doc['text_match'] = m.get('text', [''])[0] + doc['title_match'] = h.get_first(m, 'title') + doc['text_match'] = h.get_first(m, 'text') if not doc['text_match']: - doc['text_match'] = doc.get('text', [''])[0] + doc['text_match'] = h.get_first(doc, 'text') return doc results = imap(historize_urls, results) results = imap(add_matches, results)