Added fields to admin interface. Minor changes with UI datatables
authorLeonidas Poulopoulos <leopoul@noc.grnet.gr>
Tue, 6 Dec 2011 10:28:35 +0000 (12:28 +0200)
committerLeonidas Poulopoulos <leopoul@noc.grnet.gr>
Tue, 6 Dec 2011 10:28:35 +0000 (12:28 +0200)
flowspec/admin.py
flowspec/models.py
templates/user_routes.html

index f6131d3..7ca2534 100644 (file)
@@ -17,7 +17,8 @@ class RouteAdmin(admin.ModelAdmin):
         self.message_user(request, "Added request %s to job que. Check in a while for result" % response)
     deactivate.short_description = "Remove selected routes from network"
 
-    list_display = ('name', 'status', 'applier' , 'applier_peer', 'get_match', 'get_then', 'response')
+    list_display = ('name', 'status', 'applier' , 'applier_peer', 'get_match', 'get_then', 'response', "expires", "comments")
+
     fieldsets = [
         (None,               {'fields': ['name','applier']}),
         ("Match",               {'fields': ['source', 'sourceport', 'destination', 'destinationport', 'port']}),
index b1f5ac5..9abea82 100644 (file)
@@ -107,6 +107,8 @@ class Route(models.Model):
     
     class Meta:
         db_table = u'route'
+        verbose_name = "Rule"
+        verbose_name_plural = "Rules"
     
     def save(self, *args, **kwargs):
         if not self.pk:
index 73ced25..efd48c9 100644 (file)
@@ -140,7 +140,7 @@ function delete_route(route){
        <th>{% trans "Name" %}</th>
        <th>{% trans "Match" %}</th>
        <th style="text-align: center;">{% trans "Then" %}</th>
-       <th style="text-align: center;">{% trans "Status" %}</th>
+       <th style="text-align: center; ">{% trans "Status" %}</th>
        {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %}
        <th style="text-align: center;">{% trans "Applier" %}</th>
        <th style="text-align: center;">{% trans "Expires" %}</th>
@@ -157,12 +157,12 @@ function delete_route(route){
        <td>{{ route.name }}</td>
        <td>{{ route.get_match|safe|escape }}</td>
        <td style="text-align: center;">{{route.get_then|safe|escape}}</td>
-       <td style="text-align: center;">{{route.status}}</td>
+       <td style="text-align: center; ">{{route.status}}</td>
        {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
        <td style="text-align: center;">{{ route.applier }}</td>
        <td style="text-align: center;">{{ route.expires }}</td>
        <td style="text-align: center;">{{ route.response }}</td>
-       <td style="text-align: center; width:140px;">
+       <td style="text-align: center; width:150px;">
                {% ifequal route.status 'ACTIVE' %}
                <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Edit</a> 
                <button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Del</button>