1
1
{% comment %}
2
- Copyright (C) 2020 Gitcoin Core
2
+ Copyright (C) 2020 Gitcoin Core
3
3
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as published
6
- by the Free Software Foundation, either version 3 of the License, or
7
- (at your option) any later version.
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as published
6
+ by the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
8
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see < http: //www.gnu.org/licenses/> .
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
16
13
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see < http: //www.gnu.org/licenses/> .
17
16
{% endcomment %}
18
- {% load i18n static email_obfuscator add_url_schema avatar_tags %}
17
+ {% load i18n static email_obfuscator add_url_schema avatar_tags compress %}
19
18
<!DOCTYPE html>
20
- < html lang ="en ">
19
+ < html lang ="en ">
21
20
22
21
< head >
23
22
{% include 'shared/head.html' %}
24
23
{% include 'shared/cards.html' %}
25
- < link rel ="stylesheet " href ={% static "v2/css/users.css" %} />
26
- < link rel ="stylesheet " href ={% static "v2/css/tag.css" %} />
27
- < link rel ="stylesheet " href ={% static "v2/css/rating.css" %} />
28
- < link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /default-innersearch-theme.min.css "
>
24
+ {% compress css file search %}
25
+ < link rel ="stylesheet " type ="text/x-scss " href ={% static "v2/scss/users.scss" %} />
26
+ < link rel ="stylesheet " type ="text/x-scss " href ={% static "v2/scss/tag.scss" %} />
27
+ < link rel ="stylesheet " type ="text/x-scss " href ={% static "v2/scss/rating.scss" %} />
28
+ < link rel ="stylesheet " type ="text/x-scss " href ={% static "v2/scss/vue-innersearch.scss" %}>
29
+ {% endcompress %}
29
30
</ head >
30
31
31
32
< body id ="{{ explore }} " class ="interior {{active}} g-font-muli ">
38
39
< h2 > Search</ h2 >
39
40
40
41
< form method ="get " action ="">
41
- < table >
42
- {{ form.as_table }}
43
- < tr >
44
- < td > </ td >
45
- < td >
46
- < input type ="submit " value ="Search ">
47
- </ td >
48
- </ tr >
49
- </ table >
50
-
51
- {% if query %}
52
- < h3 > Results</ h3 >
53
-
54
- {% for result in page.object_list %}
55
- < p >
56
- < a href ="{{ result.object.get_absolute_url }} "> {{ result.object.title }}</ a >
57
- </ p >
58
- {% empty %}
59
- < p > No results found.</ p >
60
- {% endfor %}
61
-
62
- {% if page.has_previous or page.has_next %}
63
- < div >
64
- {% if page.has_previous %}< a href ="?q={{ query }}&page={{ page.previous_page_number }} "> {% endif %}« Previous{% if page.has_previous %}</ a > {% endif %}
65
- |
66
- {% if page.has_next %}< a href ="?q={{ query }}&page={{ page.next_page_number }} "> {% endif %}Next »{% if page.has_next %}</ a > {% endif %}
67
- </ div >
68
- {% endif %}
69
- {% else %}
70
- {# Show some example queries to run, maybe query syntax, something else? #}
42
+ < table >
43
+ {{ form.as_table }}
44
+ < tr >
45
+ < td > </ td >
46
+ < td >
47
+ < input type ="submit " value ="Search ">
48
+ </ td >
49
+ </ tr >
50
+ </ table >
51
+
52
+ {% if query %}
53
+ < h3 > Results</ h3 >
54
+
55
+ {% for result in page.object_list %}
56
+ < p >
57
+ < a href ="{{ result.object.get_absolute_url }} "> {{ result.object.title }}</ a >
58
+ </ p >
59
+ {% empty %}
60
+ < p > No results found.</ p >
61
+ {% endfor %}
62
+
63
+ {% if page.has_previous or page.has_next %}
64
+ < div >
65
+ {% if page.has_previous %}< a href ="?q={{ query }}&page={{ page.previous_page_number }} "> {% endif %}« Previous{% if page.has_previous %}</ a > {% endif %}
66
+ |
67
+ {% if page.has_next %}< a href ="?q={{ query }}&page={{ page.next_page_number }} "> {% endif %}Next »{% if page.has_next %}</ a > {% endif %}
68
+ </ div >
71
69
{% endif %}
70
+ {% else %}
71
+ {# Show some example queries to run, maybe query syntax, something else? #}
72
+ {% endif %}
72
73
</ form >
73
- {% endblock %}
74
+ {% endblock %}
74
75
< div id ="gc-users-directory " v-cloak >
75
76
76
77
< section >
@@ -79,71 +80,71 @@ <h1 class='is-title'>Hacky User Directory</h1>
79
80
< hr class ='is-line ' />
80
81
81
82
< div class ="filters " style ="width : 90%; margin : 0 auto; ">
82
- < tag-filter :for ="'searchbox' "> </ tag-filter >
83
- < tag-filter :for ="'searchdatalist' ">
84
- < template slot-scope ="{ data } ">
85
- [[ data._source.keywords ]]
86
- </ template >
87
- </ tag-filter >
88
- < tag-filter :for ="'nlf' ">
89
- < template slot-scope ="{ data } ">
83
+ < tag-filter :for ="'searchbox' "> </ tag-filter >
84
+ < tag-filter :for ="'searchdatalist' ">
85
+ < template slot-scope ="{ data } ">
86
+ [[ data._source.keywords ]]
87
+ </ template >
88
+ </ tag-filter >
89
+ < tag-filter :for ="'nlf' ">
90
+ < template slot-scope ="{ data } ">
90
91
Number of Hacks Joined: [[ data._source.keywords ]]
91
92
</ template >
92
- </ tag-filter >
93
+ </ tag-filter >
93
94
</ div >
94
95
95
96
< div class ="is-columns ">
96
- < div class ="is-column is-one-fifth ">
97
- < div >
98
- < numeric-list-filter :id ="'nlf' " :field ="'num_hacks_joined' ">
99
- < template slot ="header ">
100
- < h3 class ="is-nlf-title "> Number of Hacks Joined : </ h3 >
101
- </ template >
102
- </ numeric-list-filter >
103
- </ div >
97
+ < div class ="is-column is-one-fifth ">
98
+ < div >
99
+ < numeric-list-filter :id ="'nlf' " :field ="'num_hacks_joined' ">
100
+ < template slot ="header ">
101
+ < h3 class ="is-nlf-title "> Number of Hacks Joined : </ h3 >
102
+ </ template >
103
+ </ numeric-list-filter >
104
+ </ div >
105
+ </ div >
106
+ < div class ="is-column ">
107
+ < div >
108
+ < searchbox :id ="'searchbox' " :autofocus ="true " :realtime ="true " :timeout ="200 " :field ="['keywords', 'handle', 'persona'] " :placeholder ="'Search by keyword' "> </ searchbox >
109
+ < search-datalist :id ="'searchdatalist' " :realtime ="true " :field ="'keywords' " :suggestion ="['keywords'] ">
110
+ < template slot ="items " slot-scope ="{ item, value } ">
111
+ [[ value ]] [[ item._source.keywords ]]
112
+ </ template >
113
+
114
+ < template slot ="nosuggestion " slot-scope ="{ value } ">
115
+ Sorry, "[[ value ]]" doesn't exist... :(
116
+ </ template >
117
+
118
+ < template slot ="suggestions " slot-scope ="{ suggestion } ">
119
+ < span v-html ="suggestion.highlight.first_name ? suggestion.highlight.first_name[0] : suggestion._source.first_name "> </ span >
120
+ < span v-html ="suggestion.highlight.last_name ? suggestion.highlight.last_name[0] : suggestion._source.last_name "> </ span >
121
+ < span v-html ="suggestion.highlight.handle ? suggestion.highlight.handle[0] : suggestion._source.handle "> </ span >
122
+ < span v-html ="suggestion.highlight.persona ? suggestion.highlight.persona[0] : suggestion._source.persona "> </ span >
123
+ </ template >
124
+ </ search-datalist >
125
+
126
+ < div style ="margin: 20px auto;width: 90% ">
127
+ < search-button > </ search-button >
128
+ < reset-button :emptyHits ="false "> </ reset-button >
129
+ </ div >
130
+ < hits >
131
+ < template slot ="hits " slot-scope ="{ hits } ">
132
+ < div class ="is-score is-hits ">
133
+ < strong v-if ="hits.score === 0 "> No result found</ strong >
134
+ < strong v-else-if ="hits.score === 1 "> 1 result found</ strong >
135
+ < strong v-else-if ="hits.score > 1 "> [[ hits.score ]] results found</ strong >
136
+ </ div >
137
+ < div v-for ="item in hits.items " :item ="item ">
138
+ < div > < strong > Identity (firstname, lastname) :</ strong > ([[ item._source.first_name ]] [[ item._source.last_name ]] )</ div >
139
+ </ div >
140
+ </ template >
141
+ </ hits >
142
+
143
+ < paginate :previousText ="'⮜ Previous page' " :nextText ="'Next page ⮞' " :size ="10 "> </ paginate >
104
144
</ div >
105
- < div class ="is-column ">
106
- < div >
107
- < searchbox :id ="'searchbox' " :autofocus ="true " :realtime ="true " :timeout ="200 " :field ="['keywords', 'handle', 'persona'] " :placeholder ="'Search by keyword' "> </ searchbox >
108
- < search-datalist :id ="'searchdatalist' " :realtime ="true " :field ="'keywords' " :suggestion ="['keywords'] ">
109
- < template slot ="items " slot-scope ="{ item, value } ">
110
- [[ value ]] [[ item._source.keywords ]]
111
- </ template >
112
-
113
- < template slot ="nosuggestion " slot-scope ="{ value } ">
114
- Sorry, "[[ value ]]" doesn't exist... :(
115
- </ template >
116
-
117
- < template slot ="suggestions " slot-scope ="{ suggestion } ">
118
- < span v-html ="suggestion.highlight.first_name ? suggestion.highlight.first_name[0] : suggestion._source.first_name "> </ span >
119
- < span v-html ="suggestion.highlight.last_name ? suggestion.highlight.last_name[0] : suggestion._source.last_name "> </ span >
120
- < span v-html ="suggestion.highlight.handle ? suggestion.highlight.handle[0] : suggestion._source.handle "> </ span >
121
- < span v-html ="suggestion.highlight.persona ? suggestion.highlight.persona[0] : suggestion._source.persona "> </ span >
122
- </ template >
123
- </ search-datalist >
124
-
125
- < div style ="margin: 20px auto;width: 90% ">
126
- < search-button > </ search-button >
127
- < reset-button :emptyHits ="false "> </ reset-button >
128
- </ div >
129
- < hits >
130
- < template slot ="hits " slot-scope ="{ hits } ">
131
- < div class ="is-score is-hits ">
132
- < strong v-if ="hits.score === 0 "> No result found</ strong >
133
- < strong v-else-if ="hits.score === 1 "> 1 result found</ strong >
134
- < strong v-else-if ="hits.score > 1 "> [[ hits.score ]] results found</ strong >
135
- </ div >
136
- < div v-for ="item in hits.items " :item ="item ">
137
- < div > < strong > Identity (firstname, lastname) :</ strong > ([[ item._source.first_name ]] [[ item._source.last_name ]] )</ div >
138
- </ div >
139
- </ template >
140
- </ hits >
141
-
142
- < paginate :previousText ="'⮜ Previous page' " :nextText ="'Next page ⮞' " :size ="10 "> </ paginate >
143
- </ div >
144
- </ div >
145
+ </ div >
145
146
</ div >
146
- </ section >
147
+ </ section >
147
148
</ div >
148
149
149
150
< script type ="text/x-template " id ="select2-template ">
@@ -154,7 +155,7 @@ <h3 class="is-nlf-title">Number of Hacks Joined : </h3>
154
155
155
156
{% csrf_token %}
156
157
{% include 'shared/analytics.html' %}
157
- {% include 'shared/footer_scripts.html' %}
158
+ {% include 'shared/footer_scripts.html' with slim=1 %}
158
159
{% include 'shared/footer.html' %}
159
160
< script src ="
https://cdn.jsdelivr.net/npm/[email protected] /innersearch.min.js "
> </ script >
160
161
0 commit comments