Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(52)

Side by Side Diff: MoinMoin/templates/ajaxsearch.html

Issue 236490043: already existing ticket suggestions
Patch Set: ajax now activates on change instead of pressing spacebar Created 8 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « MoinMoin/static/js/search.js ('k') | MoinMoin/templates/ticket/base.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% if results is defined %} 1 {% if results is defined %}
2 {% if omitted_words %} 2 {% if is_ticket %}
3 <p>{{ _("Common words in query: %(termlist)s", termlist=omitted_words) } }</p>
4 {% endif %}
5 {% if results is defined %}
6 {% if word_suggestions %}
7 <p class="moin-suggestions">{{ _("Input suggestions : ") }}</p><p cl ass="moin-suggestion-terms">{{ _(" %(termlist)s", termlist=word_suggestions) }}< /p><br>
8 {% endif %}
9 {% if name_suggestions or content_suggestions %}
10 <p class="moin-suggestions">{{ _("Name term suggestions : ") }}</p>< p class="moin-suggestion-terms">{{ _( " %(termlist)s", termlist=name_suggestions ) }}</p><br>
11 <p class="moin-suggestions">{{ _("Content term suggestions : ") }}</ p><p class="moin-suggestion-terms">{{ _(" %(termlist)s", termlist=content_sugges tions) }}</p><br><br>
12 {% endif %}
13 <p class="searchstats">
14 {% if results %}
15 {{ _("%(result_len)d results found (%(runtime).3f secs).",
16 result_len=results|length, runtime=results.runtime
17 )
18 }}
19 {% else %}
20 {{ _("No results found (%(runtime).3f secs).", runtime=results.r untime) }}
21 {% endif %}
22 </p>
23 {% if results %} 3 {% if results %}
24 <div class="searchresults"> 4 <div id="ticket-results">
25 <table> 5 <table>
26 {% for result in results %} 6 {% for result in results %}
27 {% if result['wikiname'] == cfg.interwikiname %} 7 {% if result['wikiname'] == cfg.interwikiname and result ['itemtype'] == 'ticket' %}
28 <tr>
29 <td class="moin-wordbreak">
30 {% if result['name'] %}
31 {% if history %}
32 <a href="{{ url_for_item(item_name=r esult['revid'], wiki_name='Self', namespace=result['namespace'], field='revid') }}"><b>{{ result['name'] | join(' | ') }}</b></a>
33 {% else %}
34 <a href="{{ url_for_item(item_name=r esult['name'][0], wiki_name='Self', namespace=result['namespace']) }}"><b>{{ res ult['name'] | join(' | ') }}</b></a>
35 {% endif %}
36 {% else %}
37 <a href="{{ url_for_item(item_name=resul t['revid'], wiki_name='Self', namespace=result['namespace'], field='revid') }}"> <b>Item ID : {{ result['itemid'] }}</b></a>
38 {% endif %}
39 </td>
40 </tr>
41 {% if result['summary'] %}
42 <tr>
43 <td>
44 <p class="info searchhitinfobar">{{ _("S ummary: %(summary)s", summary=result['summary']) }}</p>
45 </td>
46 </tr>
47 {% endif %}
48 <tr class="moin-search-meta">
49 <td>
50 <p class="info searchhitinfobar">{{ _("Revis ion: %(revid)s - %(size)s - %(mtime)s - %(type)s", type=(result['contenttype']|s horten_ctype), mtime=result['mtime']|datetimeformat, size=result['size']|filesiz eformat, revid=result['revid']|shorten_id) }}</p>
51 </td>
52 </tr>
53 <tr> 8 <tr>
54 <td> 9 <td>
55 {% if user.may.read(get_fqname(item_name=res ults['itemid'],field='ITEMID',namespace=results['namespace'])) %} 10 <a href="{{ url_for_item(item_name=result['r evid'], wiki_name='Self', namespace=result['namespace'], field='revid') }}"><b>{ { result['itemid'][:4] }}</b></a>
56 <p class="info foundtext">{{ result.high lights('content')|safe }}</p><br>
57 {% else %}
58 <p class="info foundtext">{{ _("You don' t have read permission for this item.") }}</p><br>
59 {% endif %}
60 </td> 11 </td>
61 </tr> 12 <td>
62 {% else %} 13 <p class="info searchhitinfobar">{{ _("%(sum mary)s", summary=result['summary']) }}</p>
63 <tr>
64 <td class="moin-wordbreak">
65 <a class="moin-interwiki" href="{{ url_for_i tem(item_name=result['name'], wiki_name=result['wikiname'], rev=result['revid']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
66 </td> 14 </td>
67 </tr> 15 </tr>
68 {% endif %} 16 {% endif %}
69 {% endfor %} 17 {% endfor %}
70 </table> 18 </table>
71 </div> 19 </div>
72 {% endif %} 20 {% endif %}
21 {% else %}
22 {% if omitted_words %}
23 <p>{{ _("Common words in query: %(termlist)s", termlist=omitted_word s) }}</p>
24 {% endif %}
25 {% if results is defined %}
26 {% if word_suggestions %}
27 <p class="moin-suggestions">{{ _("Input suggestions : ") }}</p>< p class="moin-suggestion-terms">{{ _(" %(termlist)s", termlist=word_suggestions) }}</p><br>
28 {% endif %}
29 {% if name_suggestions or content_suggestions %}
30 <p class="moin-suggestions">{{ _("Name term suggestions : ") }}< /p><p class="moin-suggestion-terms">{{ _( " %(termlist)s", termlist=name_suggest ions) }}</p><br>
31 <p class="moin-suggestions">{{ _("Content term suggestions : ") }}</p><p class="moin-suggestion-terms">{{ _(" %(termlist)s", termlist=content_su ggestions) }}</p><br><br>
32 {% endif %}
33 <p class="searchstats">
34 {% if results %}
35 {{ _("%(result_len)d results found (%(runtime).3f secs).",
36 result_len=results|length, runtime=results.runtime
37 )
38 }}
39 {% else %}
40 {{ _("No results found (%(runtime).3f secs).", runtime=resul ts.runtime) }}
41 {% endif %}
42 </p>
43 {% if results %}
44 <div class="searchresults">
45 <table>
46 {% for result in results %}
47 {% if result['wikiname'] == cfg.interwikiname %}
48 <tr>
49 <td class="moin-wordbreak">
50 {% if result['name'] %}
51 {% if history %}
52 <a href="{{ url_for_item(item_na me=result['revid'], wiki_name='Self', namespace=result['namespace'], field='revi d') }}"><b>{{ result['name'] | join(' | ') }}</b></a>
53 {% else %}
54 <a href="{{ url_for_item(item_na me=result['name'][0], wiki_name='Self', namespace=result['namespace']) }}"><b>{{ result['name'] | join(' | ') }}</b></a>
55 {% endif %}
56 {% else %}
57 <a href="{{ url_for_item(item_name=r esult['revid'], wiki_name='Self', namespace=result['namespace'], field='revid') }}"><b>Item ID : {{ result['itemid'] }}</b></a>
58 {% endif %}
59 </td>
60 </tr>
61 {% if result['summary'] %}
62 <tr>
63 <td>
64 <p class="info searchhitinfobar">{{ _("Summary: %(summary)s", summary=result['summary']) }}</p>
65 </td>
66 </tr>
67 {% endif %}
68 <tr class="moin-search-meta">
69 <td>
70 <p class="info searchhitinfobar">{{ _("R evision: %(revid)s - %(size)s - %(mtime)s - %(type)s", type=(result['contenttype ']|shorten_ctype), mtime=result['mtime']|datetimeformat, size=result['size']|fil esizeformat, revid=result['revid']|shorten_id) }}</p>
71 </td>
72 </tr>
73 <tr>
74 <td>
75 {% if user.may.read(get_fqname(item_name =results['itemid'],field='ITEMID',namespace=results['namespace'])) %}
76 <p class="info foundtext">{{ result. highlights('content')|safe }}</p><br>
77 {% else %}
78 <p class="info foundtext">{{ _("You don't have read permission for this item.") }}</p><br>
79 {% endif %}
80 </td>
81 </tr>
82 {% else %}
83 <tr>
84 <td class="moin-wordbreak">
85 <a class="moin-interwiki" href="{{ url_f or_item(item_name=result['name'], wiki_name=result['wikiname'], rev=result['revi d']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
86 </td>
87 </tr>
88 {% endif %}
89 {% endfor %}
90 </table>
91 </div>
92 {% endif %}
93 {% endif %}
73 {% endif %} 94 {% endif %}
74 {% endif %} 95 {% endif %}
Thomas.J.Waldmann 2015/06/23 15:52:46 changes like above are impossible to review... (j
OLDNEW
« no previous file with comments | « MoinMoin/static/js/search.js ('k') | MoinMoin/templates/ticket/base.html » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b