Merge "Fixing v1 Dashboard"
This commit is contained in:
commit
aebc15bce5
|
@ -13,6 +13,7 @@
|
|||
# under the License.
|
||||
from django.core import urlresolvers
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
from horizon import messages
|
||||
from horizon import tables
|
||||
|
@ -84,13 +85,25 @@ class DeleteDomain(tables.BatchAction):
|
|||
|
||||
'''Batch action for deleting domains.'''
|
||||
name = "delete"
|
||||
action_present = _("Delete")
|
||||
action_past = _("Deleted")
|
||||
data_type_singular = _("Domain")
|
||||
data_type_plural = _("Domains")
|
||||
classes = ('btn-danger', 'btn-delete')
|
||||
policy_rules = (("dns", "delete_domain"),)
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
u"Delete Domain",
|
||||
u"Delete Domains",
|
||||
count
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
u"Deleted Domain",
|
||||
u"Deleted Domains",
|
||||
count
|
||||
)
|
||||
|
||||
def action(self, request, domain_id):
|
||||
api.designate.domain_delete(request, domain_id)
|
||||
|
||||
|
@ -132,9 +145,24 @@ class EditRecord(tables.LinkAction):
|
|||
class DeleteRecord(tables.DeleteAction):
|
||||
|
||||
'''Link action for navigating to the UpdateRecord view.'''
|
||||
data_type_singular = _("Record")
|
||||
policy_rules = (("dns", "delete_record"),)
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
u"Delete Record",
|
||||
u"Delete Records",
|
||||
count
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
u"Deleted Record",
|
||||
u"Deleted Records",
|
||||
count
|
||||
)
|
||||
|
||||
def delete(self, request, record_id):
|
||||
domain_id = self.table.kwargs['domain_id']
|
||||
return api.designate.record_delete(request, domain_id, record_id)
|
||||
|
@ -148,12 +176,25 @@ class BatchDeleteRecord(tables.BatchAction):
|
|||
'''Batch action for deleting domain records.'''
|
||||
|
||||
name = "delete"
|
||||
action_present = _("Delete")
|
||||
action_past = _("Deleted")
|
||||
data_type_singular = _("Record")
|
||||
classes = ('btn-danger', 'btn-delete')
|
||||
policy_rules = (("dns", "delete_record"),)
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
u"Delete Record",
|
||||
u"Delete Records",
|
||||
count
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
u"Deleted Record",
|
||||
u"Deleted Records",
|
||||
count
|
||||
)
|
||||
|
||||
def action(self, request, record_id):
|
||||
domain_id = self.table.kwargs['domain_id']
|
||||
api.designate.record_delete(request, domain_id, record_id)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "horizon/common/_modal_form.html" %}
|
||||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block form_id %}update_domain_form{% endblock %}
|
||||
{% block form_action %}{% url 'horizon:project:dns_domains:update_domain' domain.id %}{% endblock %}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "project/dns_domains/_create_record.html" %}
|
||||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block form_id %}update_record_form{% endblock %}
|
||||
{% block form_action %}{% url 'horizon:project:dns_domains:update_record' record.domain_id record.id %}{% endblock %}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from django.conf.urls import url, patterns # noqa
|
||||
from django.conf.urls import url # noqa
|
||||
|
||||
from .views import CreateDomainView # noqa
|
||||
from .views import CreateRecordView # noqa
|
||||
|
@ -23,8 +23,7 @@ from .views import UpdateRecordView # noqa
|
|||
from .views import ViewRecordDetailsView # noqa
|
||||
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
urlpatterns = [
|
||||
url(r'^$',
|
||||
IndexView.as_view(),
|
||||
name='index'),
|
||||
|
@ -49,4 +48,4 @@ urlpatterns = patterns(
|
|||
url(r'^(?P<domain_id>[^/]+)/records/(?P<record_id>[^/]+)/$',
|
||||
ViewRecordDetailsView.as_view(),
|
||||
name='view_record'),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -19,11 +19,10 @@ from horizon import forms
|
|||
from horizon import tables
|
||||
from horizon.views import HorizonTemplateView # noqa
|
||||
|
||||
from openstack_dashboard.api.network import tenant_floating_ip_list
|
||||
from openstack_dashboard.api.neutron import tenant_floating_ip_list
|
||||
from openstack_dashboard.api.nova import server_list
|
||||
|
||||
from designatedashboard import api
|
||||
from designatedashboard.api import rest # noqa
|
||||
|
||||
from .forms import DomainCreate # noqa
|
||||
from .forms import DomainUpdate # noqa
|
||||
|
|
Loading…
Reference in New Issue