Commit 0669487d authored by stef's avatar stef
Browse files

[enh] added featured cases handling with details on main page

parent 5e4bc14f
......@@ -16,3 +16,7 @@ admin.site.register(models.Attachment, AttachmentAdmin)
class ConfirmationAdmin(admin.ModelAdmin):
pass
admin.site.register(models.Confirmation, ConfirmationAdmin)
class FeaturedCaseAdmin(admin.ModelAdmin):
pass
admin.site.register(models.FeaturedCase, FeaturedCaseAdmin)
......@@ -113,3 +113,12 @@ class ViolationModerator(CommentModerator):
if Violation not in moderator._registry:
moderator.register(Violation, ViolationModerator)
class FeaturedCase(models.Model):
case = models.OneToOneField(Violation)
class Admin:
pass
def __unicode__(self):
return u"*%s*" % self.case
......@@ -159,9 +159,11 @@ def add(request):
else:
form = AddViolation()
v_list = Violation.objects.filter(activationid='',featuredcase__isnull=False).order_by('id').reverse()[:3]
return render_to_response(
'index.html',
{ 'form': form, },
{ 'form': form,
'violations': v_list },
context_instance=RequestContext(request))
def ajax(request, country=None, operator=None):
......@@ -171,7 +173,7 @@ def ajax(request, country=None, operator=None):
return HttpResponse(json.dumps(sorted(list(set([x.contract for x in Violation.objects.filter(country=country,activationid='',operator=operator)])))))
def index(request):
v_list = Violation.objects.filter(activationid='').order_by('id').reverse()[:3]
v_list = Violation.objects.filter(activationid='',featuredcase__isnull=False).order_by('id').reverse()[:3]
form = AddViolation()
return render_to_response(
......
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
{% load babel %}
{% block styles %}
<link rel="stylesheet" type="text/css" media="all" href="{% media_url %}/css/jquery.autocomplete.css" />
{% endblock %}
......@@ -118,7 +119,7 @@ $(document).ready(function(){
<h2>{% trans "On Internet, you decide what you do, right? Not anymore!" %}</h2>
<p>{% trans "We all rely more and more on our access to Internet to do serious things like find jobs and fun things like chat with friends. But telco's are increasingly trying to control your behavior online, by restricting the things you are doing on the internet. Now you have a chance to do something about that!" %}</p>
<p>{% trans "Help us chart all the ways that internet providers are violating our online freedom: Is your operator blocking or throttling your Internet communications, for instance by making it impossible to use chat programs or charging extra for Internet telephony? Let us know by filling up this form (it takes less than two minutes!). We will make sure that the relevant authorities are informed, so that we can put an end to this." %}</p>
<h2>{% trans "Latest Infringements" %}</h2>
<h2>{% trans "Featured Infringements" %}</h2>
<table>
<thead>
<tr>
......@@ -145,6 +146,17 @@ $(document).ready(function(){
<td class='align-right'><input type="button" class="confirm button" value="confirm" />
</td>
</tr>
<tr>
<td colspan="3">
<div id="description" class='round-box'>
{%for c in violation.comment_set.all%}
<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|datetimefmt:"short" }}</span>
</div>
{%endfor%}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
......
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