Commit cc21e577 authored by Baptiste Jonglez's avatar Baptiste Jonglez
parents f79874b0 2b102307
......@@ -50,6 +50,14 @@ MEDIA = (
('fixed', _('Fixed')),
('mobile', _('Mobile')),
)
STATUS = (
('new', _('New')),
('duplicate', _('Duplicate')),
('closed', _('Closed')),
('verified', _('Verified')),
('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()
......
......@@ -24,18 +24,20 @@ li { list-style: none; }
#report dt {
float: left;
clear: left;
width: 160px;
width: 250px;
text-align: right;
font-weight: bold;
padding: 0 0 0.5em 0;
}
#report dt:after {
content: ":";
#report dd {
float: left;
margin-left: 1em;
}
#report dd {
margin: 0 0 0 170px;
padding: 0 0 0.5em 0;
#report dl:after {
content:''; display: block;
clear: both;
}
#report dd p { margin: 0;}
......@@ -387,6 +389,39 @@ div.comment {
padding: .8em 1em;
}
#report #icons {
float: right;
margin-right: 0.5em;
font-weight: bold;
font-size: 120%;
width: 100%;
text-align: right;
color: #eee;
}
#report #icons span {
padding: 0 0 2px 20px;
background-clip: pading-box;
background-repeat: no-repeat;
color: #000;
}
#report #icons span#confirmations { background-image: url(../img/plus_alt.png); }
#report #icons span#invalidations { background-image: url(../img/minus_alt.png); }
#report #icons span#verified { background-image: url(../img/eye.png); padding-left: 28px;}
#report #icons span.tooltip {
display: none;
font-weight: normal;
}
#description .description-node .attachs {
float: right;
padding: 0.5em;
text-align: right;
}
/* General inputs */
input[type=submit], input[type=button], .button, input[type="text"], textarea, select {
......@@ -629,3 +664,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; }
*/
......@@ -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 %}
......
......@@ -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>
......
......@@ -4,9 +4,11 @@
{% 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" src="{%media_url%}/js/tinymce/tiny_mce.js"></script>
<script type="text/javascript" charset="utf-8">
function bindPostCommentHandler() {
$('.toggle').click(function(){
......@@ -47,29 +49,6 @@ $(document).ready(function() {
}
return false;
});
tinyMCE.init({
mode : "textareas",
width : "400",
height : "300",
theme : "advanced",
theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_location : "top",
//theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,outdent,indent,blockquote,undo,",
theme_advanced_buttons1 : "",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
plugins : "paste",
paste_auto_cleanup_on_paste : true,
paste_strip_class_attributes: 'all',
paste_remove_styles: true,
//init_instance_callback: focushandlers,
valid_elements : "@[id|title|dir<ltr?rtl|lang|xml::lang],a[rel|rev|"
+ "charset|hreflang|name|href|title],strong/b,em/i,"
+ "strike,u,p,-ol,-ul,-li,br,-sub,-sup,-blockquote,"
+ ",-code,-pre,address,-h1,-h2,-h3,-h4,-h5,"
+ "-h6,hr[size|noshade],dd,dl,dt,cite,abbr,acronym,"
+ "del[datetime|cite],ins[datetime|cite]",
});
});
</script>
{% endblock %}
......@@ -78,9 +57,17 @@ $(document).ready(function() {
<div id='global'>
<h2>{{v.operator}} ({{v.country}}) {{v.contract}}</h2>
<div id="report">
<div id="icons">
<span id="verified_tooltip" class="tooltip">{% trans "This case was verified by the management team" %}</span>
<span id="confirmations_tooltip" class="tooltip">{%if v.confirmations == 0 %} {% trans "Nobody has yet confirmed the case. Feel free to do it" %} {%else%} {{v.confirmations}} {% trans "people confirmed this case" %} {%endif%}</span>
{% if v.state == 'verified' %}<span id="verified"></span> |{% endif %}
<span id="confirmations">{{v.confirmations}}</span> |
</div>
<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%}
......@@ -88,15 +75,19 @@ $(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%}
<div class="description-node">
<div class="description">{{c.comment|safe}}</div>
<span class="submitter">{%if c.submitter_name%}{{c.submitter_name}}{%else%}{{c.submitter_email}}{%endif%}</span> - <span class="comment_date">{{c.timestamp|date:"SHORT_DATE_FORMAT" }}</span>
{%if c.attachment_set.all%}
<div class="attachs">
{% trans "Attachments" %}
{%if c.attachment_set.all%}
<div class="attachs">
<h4>{% trans "Attachments" %}</h4>
<ul>
{%for a in c.attachment_set.all%}
<li><a href="/attach/{{a.id}}">{{a.name}}</a></li>
......@@ -104,6 +95,8 @@ $(document).ready(function() {
</ul>
</div>
{%endif%}
<div class="description">{{c.comment|safe}}</div>
<span class="submitter">{%if c.submitter_name%}{{c.submitter_name}}{%else%}{{c.submitter_email}}{%endif%}</span> - <span class="comment_date">{{c.timestamp|date:"SHORT_DATE_FORMAT" }}</span>
</div>
{%endfor%}
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment