Revision 2e52e8a5

b/flowspec/views.py
98 98
        messages.add_message(request, messages.WARNING,
99 99
                             "Insufficient rights to edit rule %s" %(route_slug))
100 100
        return HttpResponseRedirect(reverse("group-routes"))
101
    if route_edit.status == "ADMININACTIVE" :
102
        messages.add_message(request, messages.WARNING,
103
                             "Administrator has disabled editing of rule %s" %(route_slug))
104
        return HttpResponseRedirect(reverse("group-routes"))
105
    if route_edit.status == "EXPIRED" :
106
        messages.add_message(request, messages.WARNING,
107
                             "Cannot edit the expired rule %s. Contact helpdesk to enable it" %(route_slug))
108
        return HttpResponseRedirect(reverse("group-routes"))
101
#    if route_edit.status == "ADMININACTIVE" :
102
#        messages.add_message(request, messages.WARNING,
103
#                             "Administrator has disabled editing of rule %s" %(route_slug))
104
#        return HttpResponseRedirect(reverse("group-routes"))
105
#    if route_edit.status == "EXPIRED" :
106
#        messages.add_message(request, messages.WARNING,
107
#                             "Cannot edit the expired rule %s. Contact helpdesk to enable it" %(route_slug))
108
#        return HttpResponseRedirect(reverse("group-routes"))
109 109
    if route_edit.status == "PENDING" :
110 110
        messages.add_message(request, messages.WARNING,
111 111
                             "Cannot edit a pending rule: %s." %(route_slug))
b/templates/user_routes.html
11 11
$(document).ready(function(){
12 12
    $("#hid_mid").val('');
13 13
    $('#dialog').dialog({
14
        height: 220,
15
        width: 300,
14
        height: 250,
15
        width: 340,
16 16
        modal: true,
17 17
        autoOpen: false,
18 18
        buttons: {
19
            'Delete': function(){
19
            'Suspend': function(){
20 20
                route = $('#route_to_delete').text();
21 21
                route_url_id = '#del_route_' + route;
22 22
                url = $(route_url_id).attr('href');
......
133 133
        return false;
134 134
    });
135 135
    
136
	$(".statustootipclass").tooltip();
136 137
    $(".expiresclass").tooltip();
137 138
	$(".commentclass").tooltip();
138 139
    var reg_exp = '';
......
224 225
<table cellpadding="0" cellspacing="0" border="0" class="display" style='width:200px;'>
225 226
				<tbody>
226 227
					<tr>
227
				        <th>ACTIVE</th><th>SUSPENDED</th><th>EXPIRED</th><th>ADMINDISABLED</th><th>ERROR</th><th>PENDING</th>
228
				        <th>ACTIVE</th><th>SUSPENDED</th><th>OUTOFSYNC</th><th>ERROR</th><th>PENDING</th>
228 229
					</tr>
229 230
					<tr class="on_off">
230 231
				        <td>
......
236 237
				        </td>
237 238
				   
238 239
				        <td>
239
				            <input type="checkbox" class="onoff" name="status_filter" value="EXPIRED" id="show_expired"/>
240
				        </td>
241
				    
242
				        <td>
243
				            <input type="checkbox" class="onoff" name="status_filter" value="ADMINDISABLED" id="show_admininactive"/>
240
				            <input type="checkbox" class="onoff" name="status_filter" value="OUTOFSYNC" id="show_outofsync"/>
244 241
				        </td>
245 242
				    
246 243
				        <td>
......
283 280
		{% endif %}>{{ route.name }}</span></td>
284 281
	<td>{{ route.get_match|safe|escape }}</td>
285 282
	<td style="text-align: center;">{{route.get_then|safe|escape}}</td>
286
	<td style="text-align: center; ">{% ifequal route.status 'INACTIVE' %}SUSPENDED{% else %}{% ifequal route.status 'ADMININACTIVE' %}ADMINDISABLED{% else %}{{route.status}}{% endifequal %}{% endifequal %}</td>
283
	<td style="text-align: center; "><span 
284
		{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}
285
	    class="statustootipclass" 
286
		style="border-bottom:1px dotted red;" 
287
		title = "{% ifequal route.status 'INACTIVE' %}Suspended by user{% else %}{% ifequal route.status 'ADMININACTIVE' %}Suspended by administrator{% else %}{% ifequal route.status 'EXPIRED' %}Suspended due to expiration{% endifequal %}{% endifequal %}{% endifequal %}"{% endif %}>{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}SUSPENDED{% else %}{{route.status}}{% endif %}</span></td>
287 288
	{% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
288 289
	<td style="text-align: center;">{{ route.applier }}</td>
289 290
	<td style="text-align: center;"><span {% if route.days_to_expire %}
......
298 299
		<button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Suspend</button>
299 300
		<a href="{% url delete-route route.name %}" style="display:none" id="del_route_{{route.name}}"></a>
300 301
		{% else %}
301
		{% ifequal route.status 'INACTIVE' %}
302
		{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}
302 303
		<a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Reactivate</a>
303 304
		{% else %}
304 305
		{% ifequal route.status 'OUTOFSYNC' %}
......
306 307
		{% else %}
307 308
		-
308 309
		{% endifequal %}
309
		{% endifequal %}
310
		{% endif %}
310 311
		{% endifequal %}
311 312
		</td>
312 313
</tr>
......
315 316
</tbody>
316 317
</table>
317 318

  
318
<div id="dialog" title="Delete Route">
319
		<p>You are about to delete rule <strong><span id="route_to_delete"></span></strong></p>
320
		<p>Deleting the rule will automatically remove the configuration from the network and mark this route as inactive.</p>
319
<div id="dialog" title="Suspend Rule">
320
		<p>You are about to suspend rule <strong><span id="route_to_delete"></span></strong></p>
321
		<p>Suspending the rule will automatically remove the configuration from the network and mark this rule as inactive.</p>
321 322
		<p>Are you sure you want to proceed?</p>
322 323
</div>
323 324
<div id="console" title="Console">

Also available in: Unified diff