Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Respect My Net
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
piks3l
Respect My Net
Commits
dccf375b
Commit
dccf375b
authored
Feb 15, 2016
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nice colour for the map, and removing unnecessary code in bt/views.py, fix #21
parent
86ea74e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
17 deletions
+2
-17
bt/views.py
bt/views.py
+1
-10
nnmon/media/js/map.js
nnmon/media/js/map.js
+1
-7
No files found.
bt/views.py
View file @
dccf375b
...
@@ -234,13 +234,9 @@ def filter_violations(request, country, operator=None):
...
@@ -234,13 +234,9 @@ def filter_violations(request, country, operator=None):
violations
=
Violation
.
objects
.
filter
(
activationid
=
''
,
country
=
country
,
operator_ref__name
=
operator
)
violations
=
Violation
.
objects
.
filter
(
activationid
=
''
,
country
=
country
,
operator_ref__name
=
operator
)
if
not
request
.
GET
.
get
(
'all'
):
if
not
request
.
GET
.
get
(
'all'
):
violations
=
violations
.
exclude
(
state__in
=
[
'duplicate'
,
'closed'
])
violations
=
violations
.
exclude
(
state__in
=
[
'duplicate'
,
'closed'
])
countries
=
sorted
([(
i
[
'total'
],
i
[
'country'
])
for
i
in
Violation
.
objects
.
values
(
'country'
).
filter
(
activationid
=
''
,
country
=
country
).
exclude
(
state__in
=
[
'duplicate'
,
'closed'
]).
annotate
(
total
=
Count
(
'country'
))],
reverse
=
True
)
countryweights
=
json
.
dumps
([{
'iso2'
:
y
,
'w'
:
x
}
for
x
,
y
in
countries
])
return
render_to_response
(
'list.html'
,
return
render_to_response
(
'list.html'
,
{
"violations"
:
violations
,
{
"violations"
:
violations
,
"country"
:
country
,
"country"
:
country
,
"status"
:
STATUS
},
"status"
:
STATUS
},
context_instance
=
RequestContext
(
request
))
context_instance
=
RequestContext
(
request
))
...
@@ -252,11 +248,6 @@ def list_violations(request):
...
@@ -252,11 +248,6 @@ def list_violations(request):
for
i
in
Violation
.
objects
.
values
(
'country'
).
filter
(
activationid
=
''
).
exclude
(
state__in
=
[
'duplicate'
,
'closed'
]).
annotate
(
total
=
Count
(
'country'
))],
for
i
in
Violation
.
objects
.
values
(
'country'
).
filter
(
activationid
=
''
).
exclude
(
state__in
=
[
'duplicate'
,
'closed'
]).
annotate
(
total
=
Count
(
'country'
))],
reverse
=
True
)
reverse
=
True
)
countryweights
=
json
.
dumps
([{
'iso2'
:
y
,
'w'
:
x
}
for
x
,
y
in
countries
])
countryweights
=
json
.
dumps
([{
'iso2'
:
y
,
'w'
:
x
}
for
x
,
y
in
countries
])
#countrycolors=json.dumps(dict([(c.lower(),"#ff%02x00" % (w*768/(countries[0][0]+1)%256)) for w,c in countries]))
#confirms=sorted([(i['total'],i['country'])
# for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('confirmation'))
# if i['total']>1],
# reverse=True)
return
render_to_response
(
'list.html'
,
return
render_to_response
(
'list.html'
,
{
"violations"
:
violations
,
{
"violations"
:
violations
,
"countries"
:
dict
([(
y
,
x
)
for
x
,
y
in
countries
]),
"countries"
:
dict
([(
y
,
x
)
for
x
,
y
in
countries
]),
...
...
nnmon/media/js/map.js
View file @
dccf375b
...
@@ -17,13 +17,7 @@ $(document).ready(function() {
...
@@ -17,13 +17,7 @@ $(document).ready(function() {
dataset
[
iso
]
=
{
numberOfCases
:
value
,
fillColor
:
paletteScale
(
value
)};
dataset
[
iso
]
=
{
numberOfCases
:
value
,
fillColor
:
paletteScale
(
value
)};
});
});
/* We want to highlight a country if we've selected one */
if
(
country
)
{
var
url_segments
=
window
.
location
.
pathname
.
split
(
'
/
'
);
url_segments
.
pop
();
//This one is empty
var
country
=
url_segments
.
pop
(),
page
=
url_segments
.
pop
();
if
(
page
===
'
list
'
)
{
dataset
[
country
]
=
{
fillColor
:
'
#02386F
'
};
dataset
[
country
]
=
{
fillColor
:
'
#02386F
'
};
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment