Remove the buttons from modal templates
Remove the button definitions from modal templates, and use the new horizon's mechanism of specifying the button labels instead. Change-Id: I2963148d725510abbdaeddc7d585b9c769e21a45
This commit is contained in:
@@ -19,8 +19,3 @@
|
|||||||
<p>{% trans "Modify different properties of an image." %}</p>
|
<p>{% trans "Modify different properties of an image." %}</p>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:images:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ class UpdateView(views.UpdateView):
|
|||||||
template_name = 'infrastructure/images/update.html'
|
template_name = 'infrastructure/images/update.html'
|
||||||
form_class = forms.UpdateImageForm
|
form_class = forms.UpdateImageForm
|
||||||
success_url = reverse_lazy('horizon:infrastructure:images:index')
|
success_url = reverse_lazy('horizon:infrastructure:images:index')
|
||||||
|
submit_label = _("Update Image")
|
||||||
|
|
||||||
@memoized.memoized_method
|
@memoized.memoized_method
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
|
|||||||
@@ -10,11 +10,3 @@
|
|||||||
{% block modal-body %}
|
{% block modal-body %}
|
||||||
{% include "formset_table/menu_formset.html" with formset=form form_template="infrastructure/nodes/_nodes_formset_form.html" %}
|
{% include "formset_table/menu_formset.html" with formset=form form_template="infrastructure/nodes/_nodes_formset_form.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary pull-right" type="submit"
|
|
||||||
value="{% trans "Register Nodes" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:nodes:index' %}"
|
|
||||||
class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,3 @@
|
|||||||
{% block modal-body %}
|
{% block modal-body %}
|
||||||
{% include "horizon/common/_form_fields.html" %}
|
{% include "horizon/common/_form_fields.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<button class="btn btn-primary pull-right" type="submit">
|
|
||||||
<i class="fa fa-upload"></i>
|
|
||||||
{% trans "Upload" %}
|
|
||||||
</button>
|
|
||||||
<a href="{% url 'horizon:infrastructure:nodes:index' %}"
|
|
||||||
class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class RegisterView(horizon_forms.ModalFormView):
|
|||||||
template_name = 'infrastructure/nodes/register.html'
|
template_name = 'infrastructure/nodes/register.html'
|
||||||
success_url = reverse_lazy(
|
success_url = reverse_lazy(
|
||||||
'horizon:infrastructure:nodes:index')
|
'horizon:infrastructure:nodes:index')
|
||||||
|
submit_label = _("Register Nodes")
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return []
|
return []
|
||||||
@@ -77,6 +78,7 @@ class UploadView(horizon_forms.ModalFormView):
|
|||||||
template_name = 'infrastructure/nodes/upload.html'
|
template_name = 'infrastructure/nodes/upload.html'
|
||||||
success_url = reverse_lazy(
|
success_url = reverse_lazy(
|
||||||
'horizon:infrastructure:nodes:index')
|
'horizon:infrastructure:nodes:index')
|
||||||
|
submit_label = _("Upload Nodes")
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
# This form's POST is handled in RegisterView.
|
# This form's POST is handled in RegisterView.
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ class IndexView(horizon.forms.ModalFormView, StackMixin):
|
|||||||
class DeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
class DeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
||||||
form_class = forms.DeployOvercloud
|
form_class = forms.DeployOvercloud
|
||||||
template_name = 'infrastructure/overview/deploy_confirmation.html'
|
template_name = 'infrastructure/overview/deploy_confirmation.html'
|
||||||
|
submit_label = _("Deploy")
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(DeployConfirmationView,
|
context = super(DeployConfirmationView,
|
||||||
@@ -253,6 +254,7 @@ class DeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
|||||||
class UndeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
class UndeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
||||||
form_class = forms.UndeployOvercloud
|
form_class = forms.UndeployOvercloud
|
||||||
template_name = 'infrastructure/overview/undeploy_confirmation.html'
|
template_name = 'infrastructure/overview/undeploy_confirmation.html'
|
||||||
|
submit_label = _("Undeploy")
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return reverse(INDEX_URL)
|
return reverse(INDEX_URL)
|
||||||
@@ -272,6 +274,7 @@ class UndeployConfirmationView(horizon.forms.ModalFormView, StackMixin):
|
|||||||
class PostDeployInitView(horizon.forms.ModalFormView, StackMixin):
|
class PostDeployInitView(horizon.forms.ModalFormView, StackMixin):
|
||||||
form_class = forms.PostDeployInit
|
form_class = forms.PostDeployInit
|
||||||
template_name = 'infrastructure/overview/post_deploy_init.html'
|
template_name = 'infrastructure/overview/post_deploy_init.html'
|
||||||
|
submit_label = _("Initialize")
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return reverse(INDEX_URL)
|
return reverse(INDEX_URL)
|
||||||
|
|||||||
@@ -24,9 +24,3 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary" type="submit" value="{% trans "Save Configuration" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:parameters:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
{% load form_helpers %}
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
import horizon.forms
|
import horizon.forms
|
||||||
from horizon import tabs as horizon_tabs
|
from horizon import tabs as horizon_tabs
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ class ServiceConfigView(horizon.forms.ModalFormView):
|
|||||||
template_name = "infrastructure/parameters/service_config.html"
|
template_name = "infrastructure/parameters/service_config.html"
|
||||||
form_class = forms.EditServiceConfig
|
form_class = forms.EditServiceConfig
|
||||||
success_url = reverse_lazy('horizon:infrastructure:parameters:index')
|
success_url = reverse_lazy('horizon:infrastructure:parameters:index')
|
||||||
|
submit_label = _("Save Configuration")
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
plan = api.tuskar.Plan.get_the_plan(self.request)
|
plan = api.tuskar.Plan.get_the_plan(self.request)
|
||||||
|
|||||||
@@ -19,8 +19,3 @@
|
|||||||
<p>{% trans "This operation cannot be undone. Are you sure you want to do that?" %}</p>
|
<p>{% trans "This operation cannot be undone. Are you sure you want to do that?" %}</p>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary" type="submit" value="{% trans "Deploy" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:overview:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
@@ -20,8 +20,3 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary" type="submit" value="{% trans "Initialize" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:overview:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
@@ -18,8 +18,3 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
|
||||||
<input class="btn btn-primary" type="submit" value="{% trans "Undeploy" %}" />
|
|
||||||
<a href="{% url 'horizon:infrastructure:overview:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user