[f79788]: / Allura / allura / templates / widgets / search_results.html  Maximize  Restore  History

Download this file

91 lines (88 with data), 3.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
<form method="GET" action=".">
<div class="grid-10">
<input type="text" name="q" value="{{q}}" class="search-query" title="Search App"/>
</div>
<div class="grid-3">
<input type="submit" value="Search">
</div>
{% if c.help_modal %}
<div class="grid-6">
{{ g.icons['help'].render(extra_css='btn search_help_modal', show_title=True) }}
</div>
{% endif %}
<div style="clear:both"></div>
{% if not hide_app_project_switcher %}
<div class="grid-10">
{% set search_project = request.GET['project'] == '1' %}
<input type="radio" name="project" value="0" id="search-app" {% if not search_project %}checked{% endif %}>
<label for="search-app">Search {{c.app.config.options.mount_point or 'app'}}</label>
<input type="radio" name="project" value="1" id="search-project" {% if search_project %}checked{% endif %}>
<label for="search-project">Search entire project</label>
</div>
{% endif %}
<div class="grid-9">
{% if not search_comments_disable %}
{% set comments = request.GET['search_comments'] %}
<label for="search-comments">Search comments?</label>
<input id="search-comments" type="checkbox" name="search_comments"{% if comments %} checked{% endif %}>
{% endif %}
{% if not search_history_disable %}
<label for="search-history">Search history?</label>
<input id="search-history" type="checkbox" name="history"{% if history %} checked{% endif %}>
{% endif %}
</div>
</form>
<div style="clear:both">&nbsp;</div>
{% if search_error %}
<div class="grid-19">{{ search_error }}</div>
{% endif %}
<div class="grid-19">
{{widget.fields['page_list'].display(limit=limit, page=page, count=count)}}
</div>
{% for doc in results %}
<div class="grid-19">
<p>
<a href="{{doc['url_paginated'] or doc['url_s']}}" rel="nofollow">
{% if doc.title_match %}
{{ doc.title_match }}
{% else %}
{{ h.get_first(doc, 'title') or h.get_first(doc, 'title_s') -}} {#- title_s is legacy -#}
{% endif %}
</a>
{% if doc['type_s'] %}<span class="gray"><sup>{{ '(%s)' % doc['type_s'] }}</sup></span>{% endif %}
<br>
{% if doc.text_match %}
<span class="text-match">{{ doc.text_match }}</span><br>
{% endif %}
<span class="gray">Last updated: {{ h.ago_string(doc['mod_date_dt']) }}</span>
</p>
</div>
{% endfor %}
<div class="grid-19">
{{widget.fields['page_list'].display(limit=limit, page=page, count=count)}}
{{widget.fields['page_size'].display(limit=limit, count=count)}}
</div>
<div class="grid-19" style="clear:both">
<p>
Sort by
<a href="{{ sort_score_url }}" class="{{ 'strong' if sort_field == 'score' else '' }}">relevance</a> or
<a href="{{ sort_date_url }}" class="{{ 'strong' if sort_field == 'mod_date_dt' else '' }}">date</a>
</p>
</div>
{% if c.help_modal %}{{ c.help_modal.display() }}{% endif %}