~ubuntu-branches/ubuntu/utopic/horizon/utopic-updates

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/admin/networks/agents/tables.py

  • Committer: Package Import Robot
  • Author(s): James Page, Chris Johnston, James Page
  • Date: 2014-10-03 17:54:18 UTC
  • mfrom: (0.4.1) (1.1.44) (70.1.2 utopic)
  • Revision ID: package-import@ubuntu.com-20141003175418-1jomx0azdvnl5fxz
Tags: 1:2014.2~rc1-0ubuntu1
[ Chris Johnston ]
* d/theme/css/ubuntu.css: Fix Ubuntu theme for Instances "more" dropdown
  (LP: #1308651).

[ James Page ]
* New upstream release candidate:
  - d/p/*: Refresh.
* d/watch: Use tarballs.openstack.org for upstream releases. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from django.core.urlresolvers import reverse
21
21
from django.template import defaultfilters as filters
22
22
from django.utils.translation import ugettext_lazy as _
 
23
from django.utils.translation import ungettext_lazy
23
24
 
24
25
from horizon import exceptions
25
26
from horizon import tables
32
33
 
33
34
 
34
35
class DeleteDHCPAgent(tables.DeleteAction):
35
 
    data_type_singular = _("DHCP Agent")
36
 
    data_type_plural = _("DHCP Agents")
 
36
    @staticmethod
 
37
    def action_present(count):
 
38
        return ungettext_lazy(
 
39
            u"Delete DHCP Agent",
 
40
            u"Delete DHCP Agents",
 
41
            count
 
42
        )
 
43
 
 
44
    @staticmethod
 
45
    def action_past(count):
 
46
        return ungettext_lazy(
 
47
            u"Deleted DHCP Agent",
 
48
            u"Deleted DHCP Agents",
 
49
            count
 
50
        )
 
51
 
37
52
    policy_rules = (("network", "delete_agent"),)
38
53
 
39
54
    def delete(self, request, obj_id):
74
89
 
75
90
 
76
91
class DHCPAgentsTable(tables.DataTable):
77
 
    id = tables.Column('id', verbose_name=_('Id'), hidden=True)
 
92
    id = tables.Column('id', verbose_name=_('ID'), hidden=True)
78
93
    host = tables.Column('host', verbose_name=_('Host'))
79
94
    status = tables.Column(get_agent_status, verbose_name=_('Status'))
80
95
    state = tables.Column(get_agent_state, verbose_name=_('Admin State'))