Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
piks3l
Respect My Net
Commits
cdd266be
Commit
cdd266be
authored
Nov 14, 2011
by
stef
Browse files
[enh] added status/editorial see also #25
parent
502a0a39
Changes
5
Hide whitespace changes
Inline
Side-by-side
bt/models.py
View file @
cdd266be
...
...
@@ -50,6 +50,14 @@ MEDIA = (
(
'fixed'
,
_
(
'Fixed'
)),
(
'mobile'
,
_
(
'Mobile'
)),
)
STATUS
=
(
(
'new'
,
_
(
'New'
)),
(
'duplicate'
,
_
(
'Duplicate'
)),
(
'closed'
,
_
(
'Closed'
)),
(
'confirmed'
,
_
(
'Confirmed'
)),
(
'moreinfo'
,
_
(
'Need more info'
)),
(
'ooscope'
,
_
(
'Out of scope'
)),
)
class
Violation
(
models
.
Model
):
country
=
models
.
CharField
(
max_length
=
2
,
choices
=
COUNTRIES
)
...
...
@@ -64,6 +72,8 @@ class Violation(models.Model):
contract_excerpt
=
models
.
TextField
(
blank
=
True
)
loophole
=
models
.
BooleanField
()
activationid
=
models
.
CharField
(
max_length
=
128
,
blank
=
True
)
state
=
models
.
CharField
(
max_length
=
20
,
choices
=
STATUS
,
default
=
'new'
,
blank
=
True
)
editorial
=
models
.
TextField
(
blank
=
True
)
def
confirmations
(
self
):
return
self
.
confirmation_set
.
filter
(
key
=
''
).
count
()
...
...
media/css/style.css
View file @
cdd266be
...
...
@@ -629,3 +629,12 @@ ul.messages {
#legend
{
text-align
:
center
;
margin-bottom
:
.5em
;
font-size
:
.7em
;
}
#legend
li
{
padding
:
.1em
;
display
:
inline
;
}
#map
{
float
:
right
;
}
/*tr.new-status td { background: green !important; }
tr.duplicate-status td { background: #999 !important; }
tr.closed-status td { background: #888 !important; }
tr.confirmed-status td { background: #fff !important; }
tr.moreinfo-status td { background: yellow !important; }
tr.ooscope-status td { background: #aaa !important; }
*/
templates/base.html
View file @
cdd266be
...
...
@@ -29,6 +29,8 @@
<a
href=
"{%root_url%}/accounts/logout"
>
{% trans "Logout" %}
</a>
<span>
or
</span>
<a
href=
"{%root_url%}/admin/"
>
{% trans "Admin" %}
</a>
{% block adminext %}
{% endblock %}
{% else %}
<a
href=
"{%root_url%}/admin/"
id=
"login"
>
{% trans "Login" %}
</a>
{% endif %}
...
...
templates/list.html
View file @
cdd266be
...
...
@@ -26,8 +26,8 @@
$
(
'
#
'
+
key
+
'
path
'
).
css
(
'
fill
'
,
data
[
key
]);
}
$
(
"
#sortedlist
"
).
tablesorter
({
headers
:
{
7
:
{
sorter
:
false
},},
sortList
:
[[
0
,
0
],[
6
,
1
]],
headers
:
{
8
:
{
sorter
:
false
},},
sortList
:
[[
1
,
0
],[
7
,
1
]],
});
$
(
'
#sortedlist
'
).
tableFilter
();
$
(
'
.confirm_form
'
).
submit
(
function
()
{
...
...
@@ -245,6 +245,7 @@
<table
class=
"listing tablesorter zebra-striped"
id=
'sortedlist'
>
<thead>
<tr>
<th
filter-type=
'ddl'
>
{% trans "Status" %}
</th>
<th
filter-type=
'ddl'
>
{% trans "country" %}
</th>
<th
filter-type=
'ddl'
>
{% trans "operator" %}
</th>
<th
filter-type=
'ddl'
>
{% trans "contract" %}
</th>
...
...
@@ -257,7 +258,8 @@
</thead>
<tbody>
{% for violation in violations %}
<tr>
<tr
class=
"{%if violation.state%}{{violation.state}}{%else%}new{%endif%}-status"
>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{%if violation.state%}{{violation.state}}{%else%}new{%endif%}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.country|country }}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.operator }}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.contract }}
</a></td>
...
...
templates/view.html
View file @
cdd266be
...
...
@@ -4,6 +4,9 @@
{% load comments %}
{% block styles %}
{% endblock %}
{% block adminext %}
,
<a
href=
"{%root_url%}/admin/bt/violation/{{v.id}}/ "
>
{% trans "Edit" %}
</a>
{% endblock %}
{% block scripts %}
<script
type=
"text/javascript"
src=
"{%media_url%}/js/jquery.1.4.2.min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
>
...
...
@@ -57,6 +60,7 @@ $(document).ready(function() {
<dl>
{%if v.resource_name%}
<dt>
{% trans "Affected resource" %}
</dt><dd>
{{v.resource_name}}
</dd>
{%endif%}
{%if v.type%}
<dt>
{% trans "Type" %}
</dt><dd>
{{v.type}}
</dd>
{%endif%}
{%if v.media%}
<dt>
{% trans "Media" %}
</dt><dd>
{{v.media}}
</dd>
{%endif%}
{%if v.state%}
<dt>
{% trans "Status" %}
</dt><dd>
{{v.state}}
</dd>
{%endif%}
{%if v.temporary%}
<dt>
{% trans "Temporary restriction" %}
</dt><dd>
{{v.temporary}}
</dd>
{%endif%}
{%if v.loophole%}
<dt>
{% trans "Another offer provided by the same operator removes this restriction" %}
</dt><dd>
{% trans "yes" %}
</dd>
{%endif%}
{%if v.contractual%}
<dt>
{% trans "Contractual restriction" %}
</dt><dd>
{% trans "yes" %}
</dd>
{%endif%}
...
...
@@ -64,6 +68,12 @@ $(document).ready(function() {
{%if v.comment_set.all%}
</dl>
</div>
{% if v.editorial %}
<div
id=
"editorial"
class=
'round-box'
>
{{v.editorial}}
</div>
{% endif %}
<div
id=
"description"
class=
'round-box'
>
<h3>
{%trans "Description" %}
</h3>
{%for c in v.comment_set.all%}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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