Branding: Workflow cancel btn should be themable

Cancel buttons are quite hard coded in their styles, and most templates
are overriding the default modal-footer template.

This patch removes most of the straight duplications in the
modal-footer.

Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Closes-bug: #1551455
Change-Id: I496381e3f512856ad37619108b45af3c1da800a5
This commit is contained in:
Diana Whitten 2016-02-29 15:44:11 -07:00
parent 59c3d7bfe3
commit 2e793aa2dd
40 changed files with 38 additions and 130 deletions

View File

@ -13,7 +13,7 @@
name="action" value="" type="submit">
<span class="fa fa-fw fa-check"></span>
</button>
<button class="inline-edit-cancel btn btn-default btn-xs pull-right secondary cancel">
<button class="inline-edit-cancel btn btn-default btn-xs pull-right cancel">
<span class="fa fa-fw fa-times"></span>
</button>
</div>

View File

@ -54,8 +54,8 @@
</div>
</div>
{% else %}
<input class="btn btn-primary pull-right" type="submit" value="{{ workflow.finalize_button_name }}" />
{% if modal %}<a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% if modal %}<a class="btn btn-default cancel">{% trans "Cancel" %}</a>{% endif %}
<input class="btn btn-primary" type="submit" value="{{ workflow.finalize_button_name }}" />
{% endif %}
{% endblock %}
</div>

View File

@ -18,8 +18,3 @@
<p>{% trans "Host aggregates divide an availability zone into logical units by grouping together hosts. Edit the aggregate host to select hosts contained in it." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url 'horizon:admin:aggregates:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -28,6 +28,7 @@ class EvacuateHostView(forms.ModalFormView):
context_object_name = 'compute_host'
success_url = reverse_lazy("horizon:admin:hypervisors:index")
page_title = _("Evacuate Host")
submit_label = page_title
def get_context_data(self, **kwargs):
context = super(EvacuateHostView, self).get_context_data(**kwargs)
@ -60,6 +61,7 @@ class DisableServiceView(forms.ModalFormView):
context_object_name = 'compute_host'
success_url = reverse_lazy("horizon:admin:hypervisors:index")
page_title = _("Disable Service")
submit_label = page_title
def get_context_data(self, **kwargs):
context = super(DisableServiceView, self).get_context_data(**kwargs)
@ -78,6 +80,7 @@ class MigrateHostView(forms.ModalFormView):
context_object_name = 'compute_host'
success_url = reverse_lazy("horizon:admin:hypervisors:index")
page_title = _("Migrate Host")
submit_label = page_title
def get_context_data(self, **kwargs):
context = super(MigrateHostView, self).get_context_data(**kwargs)

View File

@ -17,8 +17,3 @@
<p>{% trans "Disable the compute service." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Disable Service" %}" />
<a href="{% url 'horizon:admin:hypervisors:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -17,8 +17,3 @@
<p>{% trans "Evacuate the servers from the selected down host to an active target host." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Evacuate Host" %}" />
<a href="{% url 'horizon:admin:hypervisors:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -16,8 +16,3 @@
<p>{% trans "Migrate all instances from a host with disabled nova-compute service. Optionally you can choose type of migration. All running instances of the host can be Live Migrated. Cold Migration is trying to use 'nova migrate' on each instance of migrated host." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Migrate Host" %}" />
<a href="{% url 'horizon:admin:hypervisors:index' %}" class="btn btn-default cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -17,8 +17,3 @@
<p>{% trans "Live migrate an instance to a specific host." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Live Migrate Instance" %}" />
<a href="{% url 'horizon:admin:instances:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -155,6 +155,7 @@ class LiveMigrateView(forms.ModalFormView):
context_object_name = 'instance'
success_url = reverse_lazy("horizon:admin:instances:index")
page_title = _("Live Migrate")
success_label = page_title
def get_context_data(self, **kwargs):
context = super(LiveMigrateView, self).get_context_data(**kwargs)

View File

@ -29,8 +29,3 @@
</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Import Namespace" %}" />
<a href="{% url 'horizon:admin:metadata_defs:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -75,10 +75,10 @@
{% block modal-footer %}
<div>
<input class="btn btn-primary pull-right" type="submit"
ng:click="ctrl.saveResourceTypes()" value="{% trans "Save" %}"/>
<a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a class="btn btn-default cancel">{% trans "Cancel" %}</a>
<input type="hidden" name="resource_types" ng-value="ctrl.resource_types"
ng-model="ctrl.resource_types">
<input class="btn btn-primary" type="submit"
ng:click="ctrl.saveResourceTypes()" value="{% trans "Save" %}"/>
</div>
{% endblock %}

View File

@ -84,6 +84,7 @@ class CreateView(forms.ModalFormView):
context_object_name = 'namespace'
success_url = reverse_lazy(constants.METADATA_INDEX_URL)
page_title = _("Create a Metadata Namespace")
submit_label = _("Import Namespace")
class DetailView(tabs.TabView):

View File

@ -19,11 +19,6 @@
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "View Usage Report" %}" />
<a href="{% url 'horizon:admin:metering:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% block modal-js %}
<script type="text/javascript">
if (typeof horizon.metering !== 'undefined') {

View File

@ -42,6 +42,7 @@ class CreateUsageReport(forms.ModalFormView):
template_name = 'admin/metering/daily.html'
success_url = reverse_lazy('horizon:admin:metering:index')
page_title = _("Modify Usage Report Parameters")
submit_label = _("View Usage Report")
class SamplesView(django.views.generic.TemplateView):

View File

@ -20,8 +20,3 @@
<p>{% trans "In addition, you can create an external network or a shared network by checking the corresponding checkbox."%}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" />
<a href="{% url 'horizon:admin:networks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -9,6 +9,6 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:admin:volumes:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:admin:volumes:index' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -10,5 +10,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:admin:volumes:volume_types_tab' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:admin:volumes:volume_types_tab' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -4,5 +4,5 @@
{% block modal-header %}{% trans "Add Group Assignment" %}{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:identity:groups:manage_members' group.id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:identity:groups:manage_members' group.id %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -65,5 +65,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -25,5 +25,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -20,5 +20,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Copy Object" %}" />
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -18,8 +18,3 @@
<p>{% trans "Note: A Public Container will allow anyone with the Public URL to gain access to your objects in the container." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Container" %}" />
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,6 +21,6 @@
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
<input class="btn btn-primary" type="submit" value="{% trans "Create" %}" />
{% endblock %}

View File

@ -21,5 +21,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -23,6 +23,6 @@
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" ng-disabled="updateForm.$invalid" value="{% trans "Update Object" %}" />
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
<input class="btn btn-primary" type="submit" ng-disabled="updateForm.$invalid" value="{% trans "Update Object" %}" />
{% endblock %}

View File

@ -24,6 +24,6 @@
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" ng-disabled="uploadForm.$invalid || uploadForm.$pristine" value="{% trans "Upload Object" %}" />
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
<input class="btn btn-primary" type="submit" ng-disabled="uploadForm.$invalid || uploadForm.$pristine" value="{% trans "Upload Object" %}" />
{% endblock %}

View File

@ -30,5 +30,5 @@
{% endif %}
{% endfor %}
<a href="{% url "horizon:project:instances:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url "horizon:project:instances:index" %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,9 +21,3 @@
{% endif %}
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Rebuild Instance" %}" />
<a href="{% url "horizon:project:instances:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -263,6 +263,7 @@ class RebuildView(forms.ModalFormView):
template_name = 'project/instances/rebuild.html'
success_url = reverse_lazy('horizon:project:instances:index')
page_title = _("Rebuild Instance")
submit_label = page_title
def get_context_data(self, **kwargs):
context = super(RebuildView, self).get_context_data(**kwargs)

View File

@ -14,8 +14,3 @@
</fieldset>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Router" %}" />
<a href="{% url 'horizon:project:network_topology:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -17,8 +17,3 @@
<p>{% trans "Select a name for your network."%}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" />
<a href="{% url 'horizon:project:networks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -4,13 +4,13 @@
{% block modal-footer %}
{% if workflow.wizard %}
<div class="row footer-row">
<a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a class="btn btn-default cancel">{% trans "Cancel" %}</a>
<button type="button" class="btn btn-default button-previous">{% trans "&laquo;&nbsp;Back" %}</button>
<button type="button" class="btn btn-primary button-next">{% trans "Next&nbsp;&raquo;" %}</button>
<button type="submit" class="btn btn-primary button-final">{{ workflow.finalize_button_name }}</button>
</div>
{% else %}
<input class="btn btn-primary pull-right" type="submit" value="{{ workflow.finalize_button_name }}" />
{% if modal %}<a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% if modal %}<a class="btn btn-default cancel">{% trans "Cancel" %}</a>{% endif %}
<input class="btn btn-primary" type="submit" value="{{ workflow.finalize_button_name }}" />
{% endif %}
{% endblock %}

View File

@ -21,8 +21,3 @@
</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add route" %}" />
<a href="{% url 'horizon:project:routers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,8 +21,3 @@
</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add rule" %}" />
<a href="{% url 'horizon:project:routers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -23,8 +23,3 @@
</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add interface" %}" />
<a href="{% url 'horizon:project:routers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -18,8 +18,3 @@
<p>{% trans "You can connect a specified external network to the router. The external network is regarded as a default route of the router and the router acts as a gateway for external connectivity." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Set Gateway" %}" />
<a href="{% url 'horizon:project:routers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -54,5 +54,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:stack:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:stack:index' %}" class="btn btn-default cancel">{% trans "Close" %}</a>
{% endblock %}

View File

@ -13,8 +13,8 @@
{% endblock %}
{% block modal-footer %}
{% if show_attach %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Attach Volume" %}" />
{% endif %}
<a href="{% url 'horizon:project:volumes:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:volumes:index' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
{% if show_attach %}
<input class="btn btn-primary" type="submit" value="{% trans "Attach Volume" %}" />
{% endif %}
{% endblock %}

View File

@ -8,10 +8,10 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:volumes:index' %}" class="btn btn-default cancel">{% trans "Cancel" %}</a>
{% if attached %}
<input class="btn btn-primary btn-warning pull-right" type="submit" value="{% trans "Create Volume Snapshot (Force)" %}" />
<input class="btn btn-warning" type="submit" value="{% trans "Create Volume Snapshot (Force)" %}" />
{% else %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Volume Snapshot" %}" />
<input class="btn btn-primary" type="submit" value="{% trans "Create Volume Snapshot" %}" />
{% endif %}
<a href="{% url 'horizon:project:volumes:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -40,24 +40,6 @@
margin-right: 0;
margin-left: 0;
}
a.close {
margin-top: 0;
margin-right: 5px;
font-size: $font-size-base;
line-height: $line-height-base;
color: #666;
font-weight: normal;
filter: alpha(opacity=100);
-khtml-opacity: 1;
-moz-opacity: 1;
opacity: 1;
}
a.close:hover {
color: #333;
text-decoration: none;
}
}
.modal-body {