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 @@, AttachmentAdmin)
class ConfirmationAdmin(admin.ModelAdmin):
pass, ConfirmationAdmin)
class FeaturedCaseAdmin(admin.ModelAdmin):
pass, 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:
def __unicode__(self):
return u"*%s*" %
......@@ -159,9 +159,11 @@ def add(request):
form = AddViolation()
v_list = Violation.objects.filter(activationid='',featuredcase__isnull=False).order_by('id').reverse()[:3]
return render_to_response(
{ 'form': form, },
{ 'form': form,
'violations': v_list },
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>
......@@ -145,6 +146,17 @@ $(document).ready(function(){
<td class='align-right'><input type="button" class="confirm button" value="confirm" />
<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>
{% endfor %}
Supports Markdown
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