Merge "Add templates for modal forms"

This commit is contained in:
Zuul 2018-09-07 09:36:39 +00:00 committed by Gerrit Code Review
commit 836adf1733
14 changed files with 90 additions and 8 deletions

View File

@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "A field is referring to a metadata field of a resource. " %}</p>
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "A group is a way to group calculations of mappings." %}</p>
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "A mapping is the final object, its what triggers calculation." %}</p>
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "A service is a way to map the rule to the type of data collected." %}</p>
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "A threshold entry is used to apply rating rules base on level. Its behaviour is similar to a mapping except that it applies the cost base on the level." %}</p>
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/hashmap/_field_create.html' %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/hashmap/_group_create.html' %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/hashmap/_mapping_create.html' %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/hashmap/_service_create.html' %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/hashmap/_threshold_create.html' %}
{% endblock %}

View File

@ -86,7 +86,7 @@ class ServiceCreateView(forms.ModalFormView):
page_title = _("Create Service")
success_url = reverse_lazy('horizon:admin:hashmap:index')
submit_url = reverse_lazy('horizon:admin:hashmap:service_create')
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/service_create.html'
def get_object_id(self, obj):
return obj.service_id
@ -109,7 +109,7 @@ class FieldCreateView(forms.ModalFormView):
form_id = "create_field"
modal_header = _("Create Field")
page_title = _("Create Field")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/field_create.html'
success_url = 'horizon:admin:hashmap:service'
submit_url = 'horizon:admin:hashmap:field_create'
@ -136,7 +136,7 @@ class ServiceMappingCreateView(forms.ModalFormView):
form_id = "create_mapping"
modal_header = _("Create Mapping")
page_title = _("Create Mapping")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/mapping_create.html'
success_url = 'horizon:admin:hashmap:service'
submit_url = 'horizon:admin:hashmap:service_mapping_create'
@ -191,7 +191,7 @@ class FieldMappingCreateView(forms.ModalFormView):
form_id = "create_field_mapping"
modal_header = _("Create Field Mapping")
page_title = _("Create field Mapping")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/mapping_create.html'
submit_url = 'horizon:admin:hashmap:field_mapping_create'
success_url = 'horizon:admin:hashmap:field_mapping_create'
@ -245,7 +245,7 @@ class GroupCreateView(forms.ModalFormView):
form_id = "create_group"
modal_header = _("Create Group")
page_title = _("Create Group")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/group_create.html'
submit_url = 'horizon:admin:hashmap:group_create'
success_url = 'horizon:admin:hashmap:group_create'
@ -276,7 +276,7 @@ class ServiceThresholdCreateView(forms.ModalFormView):
form_id = "create_service_threshold"
modal_header = _("Create Service Threshold")
page_title = _("Create Service Threshold")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/threshold_create.html'
success_url = 'horizon:admin:hashmap:service'
submit_url = 'horizon:admin:hashmap:service_threshold_create'
@ -330,7 +330,7 @@ class FieldThresholdCreateView(forms.ModalFormView):
form_id = "create_field_threshold"
modal_header = _("Create Field Threshold")
page_title = _("Create Field Threshold")
template_name = 'horizon/common/modal_form.html'
template_name = 'admin/hashmap/threshold_create.html'
success_url = 'horizon:admin:hashmap:field'
submit_url = 'horizon:admin:hashmap:field_threshold_create'

View File

@ -0,0 +1,11 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>
{% blocktrans with module_id=module_id %}
Edit the priority for the <i>{{ module_id }}</i> module.
{% endblocktrans %}
</p>
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block main %}
{% include 'admin/rating_modules/_priority_edit.html' %}
{% endblock %}

View File

@ -60,7 +60,7 @@ class PriorityModuleEditView(forms.ModalFormView):
page_title = _("Edit module priority")
submit_url = "horizon:admin:rating_modules:edit_priority"
success_url = "horizon:admin:rating_modules:edit_priority"
template_name = "horizon/common/modal_form.html"
template_name = "admin/rating_modules/priority_edit.html"
def get_initial(self):
module = api.cloudkittyclient(self.request).rating.get_module(