Add templates for modal forms
Modal forms need to use templates which extend the default modal form template of Horizon. New templates have a description paragraph too. Task: 23260 Story: 2003138 Closes-Bug: 1749249 Change-Id: Ia2451892d5bf84e1a4bdfea808b9275cba669a17
This commit is contained in:
		@@ -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 %}
 | 
			
		||||
@@ -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 %}
 | 
			
		||||
@@ -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, it’s what triggers calculation." %}</p>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -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 %}
 | 
			
		||||
@@ -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 %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/hashmap/_field_create.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/hashmap/_group_create.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/hashmap/_mapping_create.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/hashmap/_service_create.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/hashmap/_threshold_create.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -87,7 +87,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
 | 
			
		||||
@@ -110,7 +110,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'
 | 
			
		||||
 | 
			
		||||
@@ -137,7 +137,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'
 | 
			
		||||
 | 
			
		||||
@@ -192,7 +192,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'
 | 
			
		||||
 | 
			
		||||
@@ -246,7 +246,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'
 | 
			
		||||
 | 
			
		||||
@@ -277,7 +277,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'
 | 
			
		||||
 | 
			
		||||
@@ -331,7 +331,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'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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 %}
 | 
			
		||||
@@ -0,0 +1,6 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
    {% include 'admin/rating_modules/_priority_edit.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -60,7 +60,7 @@ class PriorityModuleEditView(forms.ModalFormView):
 | 
			
		||||
    page_title = _("Edit priority module")
 | 
			
		||||
    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(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user