views.py
1.86 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
# -*- coding:utf-8 -*-
from django.conf import settings
from haystack.views import SearchView
class ColabSearchView(SearchView):
def extra_context(self, *args, **kwargs):
# Retornar todos os campos de cada tipo a serem filtrados
# retornar os nomes dos campos
# retornar os ícones dos tipos
# a critical point on the system
types = {
'wiki': {
'icon': 'file',
'fields': [
'title', 'description', 'author', 'collaborators',
'created', 'modified',
],
},
'discussion': {
'icon': 'thread',
'fields': [
'title', 'description', 'created', 'modified', 'author',
'tag',
],
},
'ticket': {
'icon': 'ticket',
'fields': [
'title', 'description', 'milestone', 'priority',
'component', 'version', 'severity', 'reporter', 'author',
'status', 'keywords', 'collaborators', 'created',
'modified',
],
},
'changeset': {
'icon': 'changeset',
'fields': [
'title', 'author', 'description', 'repository_name',
'created', 'modified',
],
},
'user': {
'icon': 'user',
'fields': [
'title', 'description', 'username', 'name',
'email', 'institution', 'role', 'google_talk', 'webpage',
],
},
}
types = self.form.cleaned_data['type']
return dict(
types=types.split(),
types_str=types,
order_data=settings.ORDERING_DATA
)