-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathsearchissues.html
70 lines (62 loc) · 2.43 KB
/
searchissues.html
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
---
layout: page
title: Ricerca
subtitle: Qui puoi vedere i risultati di una ricerca fatta nelle nostre segnalazioni
lang: it
---
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1 col-sm-12">
<form class="global-search" role="form" action="/searchissues" method="get">
<div class="input-group">
<input type="text" class="form-control" id="search-box" name="query" placeholder="Cosa cerchi?">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit"><span><i class="glyphicon glyphicon-search"></i> Cerca</span></button>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1 col-sm-12">
<h2>Risultati</h2>
</div>
</div>
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1 col-sm-12" id="search-results">
</div>
</div>
<script>
function urldecode(str) {
return decodeURIComponent((str+'').replace(/\+/g, '%20'));
}
window.store = {};
{% assign filteredissues = site.data.machgen.issuesjson %}
{% for member in filteredissues %}
window.store["{{site.url}}/issues/{{member.number}}"]={
"title": urldecode("{{ member.title | strip_html | url_encode }}"),
"label": {{member.issue.labels | join: ','}},
{% if member.issue.data.Descrizione != blank %}
"content": urldecode("{{ member.issue.data.Descrizione | url_encode }}"),
{% else %}
"content": "",
{% endif %}
{% if member.issue.created_at != blank %}
"date": "{{member.issue.created_at | date: '%-d/%m/%Y' }}",
"created_at": "{{member.issue.created_at | date: '%s' }}",
{% endif %}
{% if member.issue.provincia != blank %}
"provincia": "{{member.issue.provincia | url_encode}}",
{% endif %}
{% if member.issue.regione != blank %}
"regione": "{{member.issue.regione | url_encode}}",
{% endif %}
"url": "{{site.url}}/issues/{{member.number}}",
"state": "{{member.state}}"
};
{% endfor %}
</script>
<script src="//code.jquery.com/jquery-1.12.3.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/elasticlunr/0.9.5/elasticlunr.min.js"></script>
<script type="text/javascript" src="../js/lunr.stemmer.support.min.js"></script>
<script type="text/javascript" src="../js/lunr.it.min.js"></script>
<script type="text/javascript" src="../js/search.min.js"></script>