Merge "Update Twitter Bootstrap to version 3"

This commit is contained in:
Jenkins 2014-07-28 22:17:55 +00:00 committed by Gerrit Code Review
commit 9690232e99
290 changed files with 9965 additions and 5464 deletions

View File

@ -148,41 +148,16 @@ similar way, add the new column definition and then use the ``Meta``
Button Icons
============
Horizon provides hooks for customizing the look and feel of each class of
button on the site. The following classes are used to identify each type of
button:
Horizon uses font icons (glyphicons) from Twitter Bootstrap to add icons to buttons.
Please see http://bootstrapdocs.com/v3.1.1/docs/components/#glyphicons for instructions
how to use icons in the code.
* Generic Classes
* btn-search
* btn-delete
* btn-upload
* btn-download
* btn-create
* btn-edit
* btn-list
* btn-copy
* btn-camera
* btn-stats
* btn-enable
* btn-disable
To add icon to Table Action, use icon property. Example:
* Floating IP-specific Classes
* btn-allocate
* btn-release
* btn-associate
* btn-disassociate
* Instance-specific Classes
* btn-launch
* btn-terminate
* btn-reboot
* btn-pause
* btn-suspend
* btn-console
* btn-log
* Volume-specific classes
* btn-detach
class CreateSnapshot(tables.LinkAction):
name = "snapshot"
verbose_name = _("Create Snapshot")
icon = "camera"
Additionally, the site-wide default button classes can be configured by
setting ``ACTION_CSS_CLASSES`` to a tuple of the classes you wish to appear

View File

@ -411,8 +411,8 @@ dashboards::
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -127,11 +127,11 @@
<form class="form-horizontal"
id="linechart_general_form">
<div class="control-group">
<label for="meter" class="control-label">{% trans "Metric" %}:&nbsp;</label>
<div class="controls">
<div class="form-group">
<label for="meter" class="control-label col-sm-2">{% trans "Metric" %}:&nbsp;</label>
<div class="col-sm-10">
<select data-line-chart-command="select_box_change"
name="meter" id="meter" class="span2 example">
name="meter" id="meter" class="col-sm-w form-control example">
{% for meter in meters %}
<option value="{{ meter }}" data-unit="{{ meter }}">
{{ meter }}
@ -149,11 +149,11 @@
Example:
<form class="form-horizontal"
id="linechart_general_form">
<div class="control-group" id="date_from">
<label for="date_from" class="control-label">{% trans "From" %}:&nbsp;</label>
<div class="controls">
<div class="form-group" id="date_from">
<label for="date_from" class="control-label col-sm-2">{% trans "From" %}:&nbsp;</label>
<div class="col-sm-10">
<input data-line-chart-command="date_picker_change"
type="text" id="date_from" name="date_from" class="span2 example"/>
type="text" id="date_from" name="date_from" class="form-control example"/>
</div>
</div>
</form>

View File

@ -122,8 +122,8 @@ horizon.firewalls = {
}
updateForm();
});
if ($("#ruleListId > div.control-group.error").length > 0) {
var errortext = $("#ruleListId > div.control-group.error").find("span.help-inline").text();
if ($("#ruleListId > div.form-group.error").length > 0) {
var errortext = $("#ruleListId > div.form-group.error").find("span.help-block").text();
$("#selected_rule_h4").before($('<div class="dynamic-error">').html(errortext));
}
$(".rulelist").sortable({

View File

@ -197,10 +197,10 @@ horizon.addInitFunction(function () {
data = $input.data(slug + "-" + val);
if (typeof data === "undefined" || !visible) {
$input.closest('.form-field').hide();
$input.closest('.form-group').hide();
} else {
$('label[for=' + $input.attr('id') + ']').html(data);
$input.closest('.form-field').show();
$input.closest('.form-group').show();
}
});
});
@ -220,9 +220,9 @@ horizon.addInitFunction(function () {
$this.find("option").each(function () {
if (this.value !== base_type) {
$("#id_" + this.value).closest(".control-group").hide();
$("#id_" + this.value).closest(".form-group").hide();
} else {
$("#id_" + this.value).closest(".control-group").show();
$("#id_" + this.value).closest(".form-group").show();
}
});
}
@ -240,19 +240,19 @@ horizon.addInitFunction(function () {
// Apply standard handler for everything but checkboxes.
$(document).tooltip({
selector: "div.form-field .help-icon",
selector: "div.form-group .help-icon",
placement: function (tip, input) {
// Position to the right unless this is a "split" for in which case put
// the tooltip below so it doesn't block the next field.
return $(input).closest("form[class*='split']").length ? "bottom" : 'right';
},
title: function () {
return $(this).closest('div.form-field').children('.help-block').text();
return $(this).closest('div.form-group').children('.help-block').text();
}
});
// Hide the tooltip upon interaction with the field for select boxes.
// We use mousedown and keydown since those "open" the select dropdown.
$(document).on('mousedown keydown', '.form-field select', function (evt) {
$(document).on('mousedown keydown', '.form-group select', function (evt) {
$(this).tooltip('hide');
});
// Hide the tooltip after escape button pressed
@ -263,5 +263,5 @@ horizon.addInitFunction(function () {
});
// Hide the help text for js-capable browsers
$('span.help-block').hide();
$('p.help-block').hide();
});

View File

@ -53,7 +53,7 @@ horizon.formset_table = (function () {
// if there are extra empty rows, add the button for new rows
if (add_label) {
var button = $('<a href="#" class="btn btn-small pull-right">' +
var button = $('<a href="#" class="btn btn-primary btn-sm pull-right">' +
add_label + '</a>');
table.find('tfoot td').append(button);
button.click(function () {

View File

@ -126,8 +126,8 @@ horizon.instances = {
}
updateForm();
});
if ($("#networkListId > div.control-group.error").length > 0) {
var errortext = $("#networkListId > div.control-group.error").find("span.help-inline").text();
if ($("#networkListId > div.form-group.error").length > 0) {
var errortext = $("#networkListId > div.form-group.error").find("span.help-block").text();
$("#selected_network_label").before($('<div class="dynamic-error">').html(errortext));
}
$(".networklist").sortable({
@ -164,29 +164,29 @@ horizon.addInitFunction(function () {
var $this = $(field),
base_type = $this.val();
$this.closest(".control-group").nextAll().hide();
$this.closest(".form-group").nextAll().hide();
switch(base_type) {
case "image_id":
$("#id_image_id").closest(".control-group").show();
$("#id_image_id").closest(".form-group").show();
break;
case "instance_snapshot_id":
$("#id_instance_snapshot_id").closest(".control-group").show();
$("#id_instance_snapshot_id").closest(".form-group").show();
break;
case "volume_id":
$("#id_volume_id, #id_delete_on_terminate").closest(".control-group").show();
$("#id_volume_id, #id_delete_on_terminate").closest(".form-group").show();
break;
case "volume_image_id":
$("#id_image_id, #id_volume_size, #id_device_name, #id_delete_on_terminate")
.closest(".control-group").show();
.closest(".form-group").show();
break;
case "volume_snapshot_id":
$("#id_volume_snapshot_id, #id_device_name, #id_delete_on_terminate")
.closest(".control-group").show();
.closest(".form-group").show();
break;
}
}

View File

@ -21,7 +21,7 @@ horizon.alert = function (type, message, extra_tags) {
};
horizon.clearErrorMessages = function() {
$('#main_content .messages .alert.alert-error').remove();
$('#main_content .messages .alert.alert-danger').remove();
};
horizon.clearSuccessMessages = function() {

View File

@ -54,7 +54,7 @@ horizon.modals.modal_spinner = function (text) {
horizon.modals.spinner = $(template.render({text: text}));
horizon.modals.spinner.appendTo("#modal_wrapper");
horizon.modals.spinner.modal({backdrop: 'static'});
horizon.modals.spinner.spin(horizon.conf.spinner_options.modal);
horizon.modals.spinner.find(".modal-body").spin(horizon.conf.spinner_options.modal);
};
horizon.modals.init_wizard = function () {
@ -69,11 +69,11 @@ horizon.modals.init_wizard = function () {
}
// Clear old errors.
$form.find('td.actions div.alert-error').remove();
$form.find('.control-group.error').each(function () {
$form.find('td.actions div.alert-danger').remove();
$form.find('.form-group.error').each(function () {
var $group = $(this);
$group.removeClass('error');
$group.find('span.help-inline.error').remove();
$group.find('span.help-block.error').remove();
});
// Send the data for validation.
@ -103,7 +103,7 @@ horizon.modals.init_wizard = function () {
// Add global errors.
$.each(errors, function (index, error) {
$fieldset.find('td.actions').prepend(
'<div class="alert alert-message alert-error">' +
'<div class="alert alert-message alert-danger">' +
error + '</div>');
});
$fieldset.find('input, select, textarea').first().focus();
@ -111,10 +111,10 @@ horizon.modals.init_wizard = function () {
}
// Add field errors.
$field = $fieldset.find('[name="' + field + '"]');
$field.closest('.control-group').addClass('error');
$field.closest('.form-group').addClass('error');
$.each(errors, function (index, error) {
$field.before(
'<span class="help-inline error">' +
'<span class="help-block error">' +
error + '</span>');
});
// Focus the first invalid field.
@ -235,14 +235,14 @@ horizon.addInitFunction(function() {
location.href = jqXHR.getResponseHeader("X-Horizon-Location");
} else {
$form.closest(".modal").modal("hide");
horizon.alert("error", gettext("There was an error submitting the form. Please try again."));
horizon.alert("danger", gettext("There was an error submitting the form. Please try again."));
}
}
});
});
// Position modal so it's in-view even when scrolled down.
$(document).on('show', '.modal', function (evt) {
$(document).on('show.bs.modal', '.modal', function (evt) {
// Filter out indirect triggers of "show" from (for example) tabs.
if ($(evt.target).hasClass("modal")) {
var scrollShift = $('body').scrollTop() || $('html').scrollTop(),
@ -297,7 +297,7 @@ horizon.addInitFunction(function() {
else {
if (!horizon.ajax.get_messages(jqXHR)) {
// Generic error handler. Really generic.
horizon.alert("error", gettext("An error occurred. Please try again later."));
horizon.alert("danger", gettext("An error occurred. Please try again later."));
}
}
},
@ -321,7 +321,7 @@ horizon.addInitFunction(function() {
/* Manage the modal "stack" */
// When a new modal is opened, hide any that are already in the stack.
$(document).on("show", ".modal", function () {
$(document).on("show.bs.modal", ".modal", function () {
var container = $("#modal_wrapper"),
modal_stack = container.find(".modal"),
$this = $(this);
@ -334,7 +334,7 @@ horizon.addInitFunction(function() {
// Note: the modal should only be removed if it is the "top" of the stack of
// modals, e.g. it's the one currently being interacted with and isn't just
// temporarily being hidden.
$(document).on('hidden', '.modal', function () {
$(document).on('hidden.bs.modal', '.modal', function () {
var $this = $(this),
modal_stack = $("#modal_wrapper .modal");
if ($this[0] === modal_stack.last()[0] || $this.hasClass("loading")) {

View File

@ -428,7 +428,7 @@ horizon.datatables.set_table_query_filter = function (parent) {
return false;
}
});
input.next('button.btn-search').on('click keypress', function (evt) {
input.next('button.btn span.glyphicon-search').on('click keypress', function (evt) {
return false;
});

View File

@ -15,7 +15,7 @@ horizon.user = {
check_passwords_match: function() {
var row = $("label[for='id_confirm_password']");
var error_id = "id_confirm_password_error";
var msg = "<span id='" + error_id + "' class='help-inline'>" + gettext("Passwords do not match.") + "</span>";
var msg = "<span id='" + error_id + "' class='help-block'>" + gettext("Passwords do not match.") + "</span>";
var password = $("#id_password").val();
var confirm_password = $("#id_confirm_password").val();

View File

@ -4870,7 +4870,7 @@ function $TemplateCacheProvider() {
* should be done in a linking function rather than in a compile function.
* </div>
*
* <div class="alert alert-error">
* <div class="alert alert-danger">
* **Note:** The `transclude` function that is passed to the compile function is deperecated, as it
* e.g. does not know about the right outer scope. Please use the transclude function that is passed
* to the link function instead.
@ -18166,7 +18166,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
* The `ngInit` directive allows you to evaluate an expression in the
* current scope.
*
* <div class="alert alert-error">
* <div class="alert alert-danger">
* The only appropriate use of `ngInit` for aliasing special properties of
* {@link api/ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below. Besides this case, you
* should use {@link guide/controller controllers} rather than `ngInit`

View File

@ -13,13 +13,13 @@ horizon.addInitFunction(function () {
test("Multiple Alerts", function () {
message = horizon.alert("error", "An error!");
ok(message.hasClass("alert-error"), 'Verify the first message has the "alert-error" class.');
ok(message.hasClass("alert-danger"), 'Verify the first message has the "alert-danger" class.');
message2 = horizon.alert("success", "Another message");
equal($('#main_content .messages .alert').length, 2, "Verify two messages have been added to the DOM.");
horizon.clearErrorMessages();
equal($('#main_content .messages .alert-error').length, 0, "Verify our error message was removed.");
equal($('#main_content .messages .alert-danger').length, 0, "Verify our error message was removed.");
equal($('#main_content .messages .alert').length, 1, "Verify one message remains.");
horizon.clearSuccessMessages();
equal($('#main_content .messages .alert-success').length, 0, "Verify our success message was removed.");

View File

@ -36,7 +36,7 @@ from horizon.utils import html
LOG = logging.getLogger(__name__)
# For Bootstrap integration; can be overridden in settings.
ACTION_CSS_CLASSES = ("btn", "btn-small")
ACTION_CSS_CLASSES = ("btn", "btn-default", "btn-sm")
STRING_SEPARATOR = "__"
@ -147,7 +147,7 @@ class BaseAction(html.HTMLElement):
def get_default_classes(self):
"""Returns a list of the default classes for the action. Defaults to
``["btn", "btn-small"]``.
``["btn", "btn-default", "btn-sm"]``.
"""
return getattr(settings, "ACTION_CSS_CLASSES", ACTION_CSS_CLASSES)
@ -263,6 +263,7 @@ class Action(BaseAction):
self.verbose_name_plural = kwargs.get('verbose_name_plural',
"%ss" % self.verbose_name)
self.allowed_data_types = kwargs.get('allowed_data_types', [])
self.icon = kwargs.get('icon', None)
if attrs:
self.attrs.update(attrs)
@ -347,6 +348,7 @@ class LinkAction(BaseAction):
self.verbose_name = kwargs.get('verbose_name', self.name.title())
self.url = kwargs.get('url', None)
self.allowed_data_types = kwargs.get('allowed_data_types', [])
self.icon = kwargs.get('icon', None)
if not kwargs.get('verbose_name', None):
raise NotImplementedError('A LinkAction object must have a '
@ -443,6 +445,7 @@ class FilterAction(BaseAction):
self.filter_type = kwargs.get('filter_type', "query")
self.needs_preloading = kwargs.get('needs_preloading', False)
self.param_name = kwargs.get('param_name', 'q')
self.icon = "search"
def get_param_name(self):
"""Returns the full query parameter name for this action.
@ -452,11 +455,6 @@ class FilterAction(BaseAction):
"""
return "__".join([self.table.name, self.name, self.param_name])
def get_default_classes(self):
classes = super(FilterAction, self).get_default_classes()
classes += ("btn-search",)
return classes
def assign_type_string(self, table, data, type_string):
for datum in data:
setattr(datum, table._meta.data_type_name, type_string)
@ -722,6 +720,7 @@ class DeleteAction(BatchAction):
self.name = kwargs.get('name', self.name)
self.action_present = kwargs.get('action_present', _("Delete"))
self.action_past = kwargs.get('action_past', _("Deleted"))
self.icon = "remove"
def action(self, request, obj_id):
return self.delete(request, obj_id)
@ -731,7 +730,7 @@ class DeleteAction(BatchAction):
def get_default_classes(self):
classes = super(DeleteAction, self).get_default_classes()
classes += ("btn-danger", "btn-delete")
classes += ("btn-danger",)
return classes

View File

@ -36,7 +36,7 @@ class FormsetCell(horizon_tables.Cell):
else:
if self.field.errors:
self.attrs['class'] = (self.attrs.get('class', '') +
' error control-group')
' error form-group')
self.attrs['title'] = ' '.join(
unicode(error) for error in self.field.errors)

View File

@ -11,16 +11,16 @@
{% block modal-body %}
<fieldset>
{% if request.user.is_authenticated and 'next' in request.GET %}
<div class="control-group clearfix error">
<span class="help-inline"><p>{% trans "You do not have permission to access the resource:" %}</p>
<div class="form-group clearfix error">
<span class="help-block"><p>{% trans "You do not have permission to access the resource:" %}</p>
<p><b>{{ request.GET.next }}</b></p>
<p>{% url 'horizon:user_home' as home_url %}{% blocktrans %}Login as different user or go back to <a href="{{ home_url }}"> home page</a>{% endblocktrans %}</p>
</span>
</div>
{% endif %}
{% if request.COOKIES.logout_reason %}
<div class="control-group clearfix error">
<span class="help-inline"><p>{{ request.COOKIES.logout_reason }}</p></span>
<div class="form-group clearfix error">
<span class="help-block"><p>{{ request.COOKIES.logout_reason }}</p></span>
</div>
{% endif %}
{% if next %}<input type="hidden" name="{{ redirect_field_name }}" value="{{ next }}" />{% endif %}

View File

@ -2,25 +2,25 @@
<div class="messages">
{% for message in messages %}
{% if "info" in message.tags %}
<div class="alert alert-block alert-info fade in">
<div class="alert alert-info alert-dismissable fade in">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<p><strong>{% trans "Info: " %}</strong>{{ message }}</p>
</div>
{% endif %}
{% if "warning" in message.tags %}
<div class="alert alert-block alert-warning fade in">
<div class="alert alert-warning alert-dismissable fade in">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<p><strong>{% trans "Warning: " %}</strong>{{ message }}</p>
</div>
{% endif %}
{% if "success" in message.tags %}
<div class="alert alert-block alert-success fade in">
<div class="alert alert-success alert-dismissable fade in">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<p><strong>{% trans "Success: " %}</strong>{{ message }}</p>
</div>
{% endif %}
{% if "error" in message.tags %}
<div class="alert alert-block alert-error fade in">
<div class="alert alert-danger alert-dismissable fade in">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<p><strong>{% trans "Error: " %}</strong>{{ message }}</p>
</div>

View File

@ -4,7 +4,7 @@
{% block id %}alert_message_template{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="alert alert-block fade in alert-[[type]]">
<div class="alert alert-dismissable fade in alert-[[type]]">
<a class="close" data-dismiss="alert" href="#">&times;</a>
<p>
<strong>[[type_display]]</strong>

View File

@ -4,7 +4,13 @@
{% block id %}spinner-modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="modal loading hide">
<div class="modal loading">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<p>[[text]]&hellip;</p>
</div>
</div>
</div>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}

View File

@ -4,7 +4,9 @@
{% block id %}modal_template{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="modal hide">
<div class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class='modal-header'>
<a class='close' data-dismiss='modal'>&times;</a>
<h3>[[title]]</h3>
@ -14,7 +16,9 @@
</div>
<div class='modal-footer'>
<a href='#' class='btn btn-primary'>[[confirm]]</a>
<a href='#' class='btn cancel' data-dismiss='modal'>[[cancel]]</a>
<a href='#' class='btn btn-default cancel' data-dismiss='modal'>[[cancel]]</a>
</div>
</div>
</div>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}

View File

@ -0,0 +1,59 @@
{% load bootstrap_form_field %}
<div class="form-group{% if field.errors %} has-error{% endif %} {{ field.css_classes }}">
{% if field|is_checkbox %}
<div class="{{ classes.single_value }}">
<div class="checkbox">
{% if field.auto_id %}
<label {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}>
{{ field }} <span>{{ field.label }}</span>
</label>
{% if field.help_text %}
<span class="help-icon" data-toggle="tooltip" data-placement="top" title="{{ field.help_text|safe }}"><span class="glyphicon glyphicon-question-sign"></span></span>
{% endif %}
{% endif %}
{% for error in field.errors %}
<span class="help-block alert alert-danger {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
</div>
</div>
{% elif field|is_radio %}
{% if field.auto_id %}
<label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label>
{% if field.help_text %}
<span class="help-icon" data-toggle="tooltip" data-placement="top" title="{{ field.help_text|safe }}"><span class="glyphicon glyphicon-question-sign"></span></span>
{% endif %}
{% endif %}
<div class="{{ classes.value }}">
{% for choice in field %}
<div class="radio">
<label>
{{ choice.tag }}
{{ choice.choice_label }}
</label>
</div>
{% endfor %}
{% for error in field.errors %}
<span class="help-block alert alert-danger {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
</div>
{% else %}
{% if field.auto_id %}
<label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
{% if field.help_text %}
<span class="help-icon" data-toggle="tooltip" data-placement="top" title="{{ field.help_text|safe }}"><span class="glyphicon glyphicon-question-sign"></span></span>
{% endif %}
{% endif %}
<div class="{{ classes.value }} {% if field|is_multiple_checkbox %}multiple-checkbox{% endif %}">
{{ field }}
{% for error in field.errors %}
<span class="help-block alert alert-danger {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
</div>
{% endif %}
</div>

View File

@ -13,7 +13,7 @@
name="action"
value="" type="submit">
</button>
<button class="inline-edit-cancel btn secondary cancel"></button>
<button class="inline-edit-cancel btn btn-default secondary cancel"></button>
</div>
<div class="inline-edit-status inline-edit-mod"></div>
</div>
@ -26,7 +26,7 @@
{%if cell.wrap_list %}<ul>{% endif %}{{ cell.value }}{%if cell.wrap_list %}</ul>{% endif %}
</div>
<div class="table_cell_action">
<button class="ajax-inline-edit btn-edit"></button>
<button class="ajax-inline-edit"><span class="glyphicon glyphicon-pencil"></span></button>
</div>
<div class="inline-edit-status"></div>
</div>

View File

@ -6,7 +6,7 @@
{% for action in row_actions %}
{% if forloop.first %}
{% include "horizon/common/_data_table_row_action.html" %}
<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
<a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
{% trans "More" %}
<span class="caret"></span>
</a>

View File

@ -1,5 +1,11 @@
{% if action.method != "GET" %}
<button {{ action.attr_string|safe }} name="action" value="{{ action.get_param_name }}" type="submit">{% if action.handles_multiple %}{{ action.verbose_name_plural }}{% else %}{{ action.verbose_name }}{% endif %}</button>
<button {{ action.attr_string|safe }} name="action" value="{{ action.get_param_name }}" type="submit">
{% if action.icon != None %}<span class="glyphicon glyphicon-{{ action.icon }}"></span> {% endif %}
{% if action.handles_multiple %}{{ action.verbose_name_plural }}{% else %}{{ action.verbose_name }}{% endif %}
</button>
{% else %}
<a href='{{ action.get_link_url }}' title='{{ action.verbose_name }}' {{ action.attr_string|safe }}>{{ action.verbose_name }}</a>
<a href='{{ action.get_link_url }}' title='{{ action.verbose_name }}' {{ action.attr_string|safe }}>
{% if action.icon != None %}<span class="glyphicon glyphicon-{{ action.icon }}"></span> {% endif %}
{{ action.verbose_name }}
</a>
{% endif %}

View File

@ -4,22 +4,25 @@
{% if filter.filter_type == 'fixed' %}
<div class="table_filter btn-group" data-toggle="buttons-radio">
{% for button in filter.fixed_buttons %}
<button name="{{ filter.get_param_name }}" type="submit" value="{{ button.value }}" class="btn btn-small{% ifequal button.value filter.filter_string %} active{% endifequal %}">{% if button.icon %}<i class="{{ button.icon }}"></i> {% endif %}{{ button.text }}{% if button.count >= 0 %} ({{ button.count }}){% endif %}</button>
<button name="{{ filter.get_param_name }}" type="submit" value="{{ button.value }}" class="btn btn-default btn-sm{% ifequal button.value filter.filter_string %} active{% endifequal %}">{% if button.icon %}<i class="{{ button.icon }}"></i> {% endif %}{{ button.text }}{% if button.count >= 0 %} ({{ button.count }}){% endif %}</button>
{% endfor %}
</div>
{% elif filter.filter_type == 'query' %}
<div class="table_search client">
<input class="span3 example" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
<div class="form-group has-feedback">
<input class="form-control" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
<span class="glyphicon glyphicon-search form-control-feedback"></span>
</div>
<button type="submit" {{ filter.attr_string|safe }}>{% trans "Filter" %}</button>
</div>
{% elif filter.filter_type == 'server' %}
<div class="table_search">
<select name="{{ filter.get_param_name }}_field" class="span2">
<select name="{{ filter.get_param_name }}_field" class="form-control">
{% for choice in filter.filter_choices %}
<option value="{{ choice.0 }}" {% if choice.0 == filter.filter_field %} selected{% endif %}>{{ choice.1 }}</option>
{% endfor %}
</select>
<input class="span3 example" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
<input class="form-control" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
<button type="submit" {{ filter.attr_string|safe }}>{% trans "Filter" %}</button>
</div>
{% endif %}

View File

@ -1,3 +1,5 @@
{% load bootstrap_form_field %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
@ -7,19 +9,19 @@
</div>
{% endif %}
{% if form.non_field_errors %}
<div class="alert alert-message alert-error">
<div class="alert alert-message alert-danger">
{{ form.non_field_errors }}
</div>
{% endif %}
{% for field in form.visible_fields %}
<div class="control-group form-field clearfix{% if field.errors %} error{% endif %} {{ field.css_classes }}">
<!-- <div class="form-group form-field clearfix{% if field.errors %} has-error{% endif %} {{ field.css_classes }}">
{{ field.label_tag }}
{% if field.help_text %}
<span class="help-icon"><i class="icon-question-sign"></i></span>
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span class="help-inline">{{ error }}</span>
<p class="help-block">{{ error }}</p>
{% endfor %}
{% endif %}
{% comment %}
@ -28,8 +30,8 @@
Note: the spaces are necessary here.
{% endcomment %}
<span class="help-block">{% filter force_escape %} {{ field.help_text }} {% endfilter %} </span>
<div class="input">
{{ field }}
</div>
</div>
-->
{{ field|bootstrap_form_field }}
{% endfor %}

View File

@ -19,7 +19,7 @@
{% with table.get_formset as formset %}
{{ formset.management_form }}
{% if formset.non_field_errors %}
<div class="alert alert-error">
<div class="alert alert-danger">
{{ formset.non_field_errors }}
</div>
{% endif %}

View File

@ -10,11 +10,11 @@
{% for field in row.form.hidden_fields %}
{{ field }}
{% for error in field.errors %}
<span class="help-inline">{{ field.name }}: {{ error }}</span>
<span class="help-block">{{ field.name }}: {{ error }}</span>
{% endfor %}
{% endfor %}
{% if row.form.non_field_errors %}
<div class="alert alert-error">
<div class="alert alert-danger">
{{ row.form.non_field_errors }}
</div>
{% endif %}

View File

@ -1,4 +1,6 @@
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal{% else %}static_page{% endif %}{% endblock %}">
<div class="{% if hide %}modal-dialog{% endif %}">
<div class="{% if hide %}modal-content{% endif %}">
<div class="modal-header">
{% if hide %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{% block modal-header %}{% endblock %}</h3>
@ -8,3 +10,5 @@
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</div>
</div>
</div>

View File

@ -1,4 +1,6 @@
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal{% else %}static_page{% endif %}{% endblock %}">
<div class="{% if hide %}modal-dialog{% endif %}">
<div class="{% if hide %}modal-content{% endif %}">
<div class="modal-header">
{% if hide %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{% block modal-header %}{% endblock %}</h3>
@ -26,6 +28,8 @@
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</form>
</div>
</div>
</div>
{% block modal-js %}
{% endblock %}
</div>

View File

@ -3,15 +3,18 @@
<h3 class="quota-heading">{% trans "Usage Summary" %}</h3>
</div>
<div class="usage_info_wrapper">
<form action="?" method="get" id="date_form" class="form-horizontal">
<form action="?" method="get" id="date_form" class="form-inline">
<h3>{% trans "Select a period of time to query its usage" %}: </h3>
<div class="datepicker">
{% blocktrans with start=form.start end=form.end %}<span>From: {{ start }} </span><span>To: {{ end }} </span>{% endblocktrans %}
<div class="datepicker form-group">
{% blocktrans with start=form.start end=form.end %}
<label>From:</label> {{ start }}
</div>
<div class="datepicker form-group">
<label>To:</label>{{ end }}{% endblocktrans %}
</div>
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
<small>{% trans "The date should be in YYYY-mm-dd format." %}</small>
</div>
</form>
<p id="activity">
<span><strong>{% trans "Active Instances" %}:</strong> {{ usage.summary.instances|default:'0' }}</span>
<span><strong>{% trans "Active RAM" %}:</strong> {{ usage.summary.memory_mb|mbformat|default:'0' }}</span>

View File

@ -3,6 +3,8 @@
<div class="workflow {{ layout|join:' ' }}">
<form {{ workflow.attr_string|safe }} action="{{ workflow.get_absolute_url }}" {% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} method="POST"{% if workflow.multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
{% if REDIRECT_URL %}<input type="hidden" name="{{ workflow.redirect_param_name }}" value="{{ REDIRECT_URL }}"/>{% endif %}
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
{% block modal-header %}
{% if modal %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
@ -33,21 +35,23 @@
<div class="modal-footer">
{% block modal-footer %}
{% if workflow.wizard %}
<div class="row-fluid">
<div class="span6 back">
<button type="button" class="btn button-previous">&laquo; {% trans "Back" %}</button>
<div class="row">
<div class="col-sm-6 back">
<button type="button" class="btn btn-default button-previous">&laquo; {% trans "Back" %}</button>
</div>
<div class="span6 next">
<div class="col-sm-6 next">
<button type="button" class="btn btn-primary button-next">{% trans "Next" %} &raquo;</button>
<button type="submit" class="btn btn-primary button-final">{{ workflow.finalize_button_name }}</button>
</div>
</div>
{% else %}
<input class="btn btn-primary pull-right" type="submit" value="{{ workflow.finalize_button_name }}" />
{% if modal %}<a class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% if modal %}<a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% endif %}
{% endblock %}
</div>
</div>
</div>
</form>
</div>
{% endwith %}

View File

@ -8,13 +8,13 @@
<div class="left">
<div class="fake_table fake_table_header fake_{{ step.slug }}_table">
<span class="members_title">{{ step.available_list_title }}</span>
<input type="text" name="available_{{ step.slug }}_filter" id="available_{{ step.slug }}" class="filter {{ step.slug }}_filter" placeholder="{% trans "Filter" %}">
<input type="text" name="available_{{ step.slug }}_filter form-control input-sm" id="available_{{ step.slug }}" class="filter {{ step.slug }}_filter" placeholder="{% trans "Filter" %}">
</div>
</div>
<div class="right">
<div class="fake_table fake_table_header fake_{{ step.slug }}_table">
<span class="members_title">{{ step.members_list_title }}</span>
<input type="text" name="{{ step.slug }}_members_filter" id="{{ step.slug }}_members" class="filter {{ step.slug }}_filter" placeholder="{% trans "Filter" %}">
<input type="text" name="{{ step.slug }}_members_filter" id="{{ step.slug }}_members" class="filter {{ step.slug }}_filter form-control input-sm" placeholder="{% trans "Filter" %}">
</div>
</div>
</div>

View File

@ -0,0 +1,47 @@
from django import forms
from django.template import Context
from django.template.loader import get_template
from django import template
register = template.Library()
@register.filter
def bootstrap_form_field(element):
markup_classes = {'label': '', 'value': '', 'single_value': ''}
return render(element, markup_classes)
def add_input_classes(field):
if not is_checkbox(field) and not is_multiple_checkbox(field) and not is_radio(field) \
and not is_file(field):
field_classes = field.field.widget.attrs.get('class', '')
field_classes += ' form-control'
field.field.widget.attrs['class'] = field_classes
def render(element, markup_classes):
add_input_classes(element)
template = get_template("horizon/common/_bootstrap_form_field.html")
context = Context({'field': element, 'classes': markup_classes})
return template.render(context)
@register.filter
def is_checkbox(field):
return isinstance(field.field.widget, forms.CheckboxInput)
@register.filter
def is_multiple_checkbox(field):
return isinstance(field.field.widget, forms.CheckboxSelectMultiple)
@register.filter
def is_radio(field):
return isinstance(field.field.widget, forms.RadioSelect)
@register.filter
def is_file(field):
return isinstance(field.field.widget, forms.FileInput)

View File

@ -103,7 +103,7 @@ class WorkflowView(generic.TemplateView):
the workflow characteristics
"""
if self.request.is_ajax():
layout = ['modal', 'hide', ]
layout = ['modal', ]
if self.workflow_class.fullscreen:
layout += ['fullscreen', ]
else:

View File

@ -33,21 +33,24 @@ class CreateAggregateAction(tables.LinkAction):
name = "create"
verbose_name = _("Create Host Aggregate")
url = constants.AGGREGATES_CREATE_URL
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
class ManageHostsAction(tables.LinkAction):
name = "manage"
verbose_name = _("Manage Hosts")
url = constants.AGGREGATES_MANAGE_HOSTS_URL
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
class UpdateAggregateAction(tables.LinkAction):
name = "update"
verbose_name = _("Edit Host Aggregate")
url = constants.AGGREGATES_UPDATE_URL
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
class AggregateFilterAction(tables.FilterAction):

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url 'horizon:admin:aggregates:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:aggregates:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -36,7 +36,8 @@ class ViewGroupsLink(tables.LinkAction):
name = "groups"
verbose_name = _("Modify Groups")
url = "horizon:admin:domains:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
def get_link_url(self, domain):
step = 'update_group_members'
@ -49,7 +50,8 @@ class CreateDomainLink(tables.LinkAction):
name = "create"
verbose_name = _("Create Domain")
url = constants.DOMAINS_CREATE_URL
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (('identity', 'identity:create_domain'),)
def allowed(self, request, domain):
@ -60,7 +62,8 @@ class EditDomainLink(tables.LinkAction):
name = "edit"
verbose_name = _("Edit")
url = constants.DOMAINS_UPDATE_URL
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (('identity', 'identity:update_domain'),)
def allowed(self, request, domain):

View File

@ -33,7 +33,8 @@ class ExtraSpecCreate(tables.LinkAction):
name = "create"
verbose_name = _("Create")
url = "horizon:admin:flavors:extras:create"
classes = ("btn-create", "ajax-modal")
classes = ("ajax-modal",)
icon = "plus"
def get_link_url(self, extra_spec=None):
return reverse(self.url, args=[self.table.kwargs['id']])
@ -43,7 +44,8 @@ class ExtraSpecEdit(tables.LinkAction):
name = "edit"
verbose_name = _("Edit")
url = "horizon:admin:flavors:extras:edit"
classes = ("btn-edit", "ajax-modal")
classes = ("ajax-modal",)
icon = "pencil"
def get_link_url(self, extra_spec):
return reverse(self.url, args=[self.table.kwargs['id'],

View File

@ -38,28 +38,31 @@ class CreateFlavor(tables.LinkAction):
name = "create"
verbose_name = _("Create Flavor")
url = "horizon:admin:flavors:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
class UpdateFlavor(tables.LinkAction):
name = "update"
verbose_name = _("Edit Flavor")
url = "horizon:admin:flavors:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
class ViewFlavorExtras(tables.LinkAction):
name = "extras"
verbose_name = _("View Extra Specs")
url = "horizon:admin:flavors:extras:index"
classes = ("btn-edit",)
icon = "pencil"
class ModifyAccess(tables.LinkAction):
name = "projects"
verbose_name = _("Modify Access")
url = "horizon:admin:flavors:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
def get_link_url(self, flavor):
step = 'update_flavor_access'

View File

@ -23,6 +23,6 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -23,6 +23,6 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

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

View File

@ -37,7 +37,8 @@ class CreateGroupLink(tables.LinkAction):
name = "create"
verbose_name = _("Create Group")
url = constants.GROUPS_CREATE_URL
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("identity", "identity:create_group"),)
def allowed(self, request, group):
@ -48,7 +49,8 @@ class EditGroupLink(tables.LinkAction):
name = "edit"
verbose_name = _("Edit Group")
url = constants.GROUPS_UPDATE_URL
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("identity", "identity:update_group"),)
def allowed(self, request, group):
@ -73,7 +75,7 @@ class ManageUsersLink(tables.LinkAction):
name = "users"
verbose_name = _("Modify Users")
url = constants.GROUPS_MANAGE_URL
classes = ("btn-edit")
icon = "pencil"
policy_rules = (("identity", "identity:get_group"),
("identity", "identity:list_users"),)
@ -144,7 +146,8 @@ class RemoveMembers(tables.DeleteAction):
class AddMembersLink(tables.LinkAction):
name = "add_user_link"
verbose_name = _("Add...")
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
url = constants.GROUPS_ADD_MEMBER_URL
policy_rules = (("identity", "identity:list_users"),
("identity", "identity:add_user_to_group"),)
@ -181,7 +184,7 @@ class AddMembers(tables.BatchAction):
action_past = _("Added")
data_type_singular = _("User")
data_type_plural = _("Users")
classes = ("btn-create", )
icon = "plus"
requires_input = True
success_url = constants.GROUPS_MANAGE_URL
policy_rules = (("identity", "identity:add_user_to_group"),)

View File

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

View File

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

View File

@ -21,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Group" %}" />
<a href="{% url 'horizon:admin:groups:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:groups:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -31,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Image" %}" />
<a href="{% url 'horizon:admin:images:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:images:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" />
<a href="{% url 'horizon:admin:images:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:images:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -7,8 +7,8 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
<div class="version_label">
{% blocktrans with version_info=version %}Version: {{version_info}}

View File

@ -21,5 +21,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:instances:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -2,11 +2,11 @@
<div id="ceilometer-report">
<form class="form-horizontal" action="{% url 'horizon:admin:metering:report' %}" method="POST">
{% csrf_token %}
<div class="control-group">
<label for="report_date_options" class="control-label">{% trans "Period" %}:&nbsp;</label>
<div class="controls">
<div class="form-group">
<label for="report_date_options" class="control-label col-sm-2">{% trans "Period" %}:&nbsp;</label>
<div class="col-sm-10">
<select data-line-chart-command="select_box_change"
id="report_date_options" name="date_options" class="span2">
id="report_date_options" name="date_options" class="form-control">
<option value="1">{% trans "Last day" %}</option>
<option value="7" selected="selected">{% trans "Last week" %}</option>
<option value="{% now 'j' %}">{% trans "Month to date" %}</option>
@ -17,27 +17,31 @@
</select>
</div>
</div>
<div class="control-group" id="report_date_from">
<label for="date_from" class="control-label">{% trans "From" %}:&nbsp;</label>
<div class="controls">
<div class="form-group" id="report_date_from">
<label for="date_from" class="control-label col-sm-2">{% trans "From" %}:&nbsp;</label>
<div class="col-sm-10">
<input data-line-chart-command="date_picker_change"
type="text" id="date_from" name="date_from" class="span2 example"/>
type="text" id="date_from" name="date_from" class="form-control example"/>
</div>
</div>
<div class="control-group" id="report_date_to">
<label for="date_to" class="control-label">{% trans "To" %}:&nbsp;</label>
<div class="controls">
<div class="form-group" id="report_date_to">
<label for="date_to" class="control-label col-sm-2">{% trans "To" %}:&nbsp;</label>
<div class="col-sm-10">
<input data-line-chart-command="date_picker_change"
type="text" name="date_to" class="span2 example"/>
type="text" name="date_to" class="form-control example"/>
</div>
</div>
<div class="control-group">
<label for="limit" class="control-label">{% trans "Limit project count" %}:&nbsp;</label>
<div class="controls">
<input type="text" name="limit" class="span2 example" value="20"/>
<div class="form-group">
<label for="limit" class="control-label col-sm-2">{% trans "Limit project count" %}:&nbsp;</label>
<div class="col-sm-10">
<input type="text" name="limit" class="form-control example" value="20"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default btn-sm">{% trans 'Generate Report' %}</button>
</div>
</div>
<button type="submit" class="btn btn-small">{% trans 'Generate Report' %}</button>
</form>
</div>
<script type="text/javascript">
@ -55,7 +59,7 @@
// want to refresh, but show hide the date fields
if ($(this).find("option:selected").val() == "other"){
evt.stopPropagation();
$("#date_from .controls input, #date_to .controls input").val('');
$("#date_from input, #date_to input").val('');
$("#report_date_from, #report_date_to").show();
} else {
$("#report_date_from, #report_date_to").hide();

View File

@ -7,8 +7,8 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

View File

@ -9,8 +9,8 @@
{% block main %}
<div class="table_actions">
<a href="{{ csv_url }}"><button class="btn btn-small btn-download" >{% trans 'Download CSV Summary' %}</button></a>
<a href="{% url 'horizon:admin:metering:index' %}"><button class="btn btn-small">{% trans 'Back' %}</button></a>
<a href="{{ csv_url }}"><button class="btn btn-default btn-sm" ><span class="glyphicon glyphicon-download"></span>{% trans 'Download CSV Summary' %}</button></a>
<a href="{% url 'horizon:admin:metering:index' %}"><button class="btn btn-default btn-sm">{% trans 'Back' %}</button></a>
</div>
{% for table in tables %}
{{ table.render }}

View File

@ -6,11 +6,11 @@
<form class="form-horizontal"
id="linechart_general_form">
<div class="control-group">
<label for="meter" class="control-label">{% trans "Metric" %}:&nbsp;</label>
<div class="controls line_chart_time_picker">
<div class="form-group">
<label for="meter" class="col-sm-2 control-label">{% trans "Metric" %}:&nbsp;</label>
<div class="col-sm-10 line_chart_time_picker">
<select data-line-chart-command="select_box_change"
name="meter" id="meter" class="span2 example">
name="meter" id="meter" class="form-control example">
{% if nova_meters %}
<optgroup label='{% trans "Compute (Nova)" %}'>
@ -75,21 +75,21 @@
</div>
</div>
<div class="control-group">
<label for="group_by" class="control-label">{% trans "Group by" %}:&nbsp;</label>
<div class="controls">
<div class="form-group">
<label for="group_by" class="col-sm-2 control-label">{% trans "Group by" %}:&nbsp;</label>
<div class="col-sm-10">
<select data-line-chart-command="select_box_change"
id="group_by" name="group_by" class="span2">
id="group_by" name="group_by" class="form-control">
<option value="" selected="selected">{% trans "--" %}</option>
<option selected="selected" value="project" selected>{% trans "Project" %}</option>
</select>
</div>
</div>
<div class="control-group">
<label for="stats_attr" class="control-label">{% trans "Value" %}:&nbsp;</label>
<div class="controls">
<div class="form-group">
<label for="stats_attr" class="col-sm-2 control-label">{% trans "Value" %}:&nbsp;</label>
<div class="col-sm-10">
<select data-line-chart-command="select_box_change"
id="stats_attr" name="stats_attr" class="span2">
id="stats_attr" name="stats_attr" class="form-control">
<option selected="selected" value="avg">{% trans "Avg." %}</option>
<option value="min">{% trans "Min." %}</option>
@ -98,11 +98,11 @@
</select>
</div>
</div>
<div class="control-group">
<label for="date_options" class="control-label">{% trans "Period" %}:&nbsp;</label>
<div class="controls">
<div class="form-group">
<label for="date_options" class="col-sm-2 control-label">{% trans "Period" %}:&nbsp;</label>
<div class="col-sm-10">
<select data-line-chart-command="select_box_change"
id="date_options" name="date_options" class="span2">
id="date_options" name="date_options" class="form-control">
<option value="1">{% trans "Last day" %}</option>
<option value="7" selected="selected">{% trans "Last week" %}</option>
<option value="{% now 'j' %}">{% trans "Month to date" %}</option>
@ -113,30 +113,30 @@
</select>
</div>
</div>
<div class="control-group" id="date_from">
<label for="date_from" class="control-label">{% trans "From" %}:&nbsp;</label>
<div class="controls">
<div class="form-group" id="date_from">
<label for="date_from" class="col-sm-2 control-label">{% trans "From" %}:&nbsp;</label>
<div class="col-sm-10">
<input data-line-chart-command="date_picker_change"
type="text" id="date_from" name="date_from" class="span2 example"/>
type="text" id="date_from" name="date_from" class="form-control example"/>
</div>
</div>
<div class="control-group" id="date_to">
<label for="date_to" class="control-label">{% trans "To" %}:&nbsp;</label>
<div class="controls">
<div class="form-group" id="date_to">
<label for="date_to" class="col-sm-2 control-label">{% trans "To" %}:&nbsp;</label>
<div class="col-sm-10">
<input data-line-chart-command="date_picker_change"
type="text" name="date_to" class="span2 example"/>
type="text" name="date_to" class="form-control example"/>
</div>
</div>
</form>
</div>
<div class="info row-fluid detail">
<div class="span12">
<div class="info row detail">
<div class="col-sm-12">
<h4>{% trans "Statistics of all resources" %}</h4>
<hr class="header_rule" />
<div class="info row-fluid detail">
<div class="span9 chart_container">
<div class="info row detail">
<div class="col-sm-9 chart_container">
<div class="chart"
data-chart-type="line_chart"
data-url="{% url 'horizon:admin:metering:samples'%}"
@ -146,7 +146,7 @@
data-slider-selector="#slider">
</div>
<div id="slider"></div>
<div class="span3 legend_container">
<div class="col-sm-3 legend_container">
<div id="smoother" title="Smoothing"></div>
<div id="legend"></div>
</div>
@ -175,7 +175,7 @@
// want to refresh, but show hide the date fields
if ($(this).find("option:selected").val() == "other"){
evt.stopPropagation();
$("#date_from .controls input, #date_to .controls input").val('');
$("#date_from input, #date_to input").val('');
$("#date_from, #date_to").show();
} else {
$("#date_from, #date_to").hide();

View File

@ -55,7 +55,8 @@ class CreatePort(tables.LinkAction):
name = "create"
verbose_name = _("Create Port")
url = "horizon:admin:networks:addport"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("network", "create_port"),)
def get_link_url(self, datum=None):
@ -67,7 +68,8 @@ class UpdatePort(tables.LinkAction):
name = "update"
verbose_name = _("Edit Port")
url = "horizon:admin:networks:editport"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("network", "update_port"),)
def get_policy_target(self, request, datum=None):

View File

@ -54,7 +54,8 @@ class CreateSubnet(tables.LinkAction):
name = "create"
verbose_name = _("Create Subnet")
url = "horizon:admin:networks:addsubnet"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("network", "create_subnet"),)
def get_policy_target(self, request, datum=None):
@ -73,7 +74,8 @@ class UpdateSubnet(tables.LinkAction):
name = "update"
verbose_name = _("Edit Subnet")
url = "horizon:admin:networks:editsubnet"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("network", "update_subnet"),)
def get_policy_target(self, request, datum=None):

View File

@ -54,7 +54,8 @@ class CreateNetwork(tables.LinkAction):
name = "create"
verbose_name = _("Create Network")
url = "horizon:admin:networks:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("network", "create_network"),)
@ -62,7 +63,8 @@ class EditNetwork(tables.LinkAction):
name = "update"
verbose_name = _("Edit Network")
url = "horizon:admin:networks:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("network", "update_network"),)
def get_policy_target(self, request, datum=None):

View File

@ -22,5 +22,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url 'horizon:admin:networks:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Port" %}" />
<a href="{% url 'horizon:admin:networks:detail' network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:detail' network.id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -26,5 +26,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url 'horizon:admin:networks:detail' network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:detail' network_id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -28,7 +28,8 @@ class ViewMembersLink(tables.LinkAction):
name = "users"
verbose_name = _("Modify Users")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("identity", "identity:list_users"),
("identity", "identity:list_roles"))
@ -43,7 +44,8 @@ class ViewGroupsLink(tables.LinkAction):
name = "groups"
verbose_name = _("Modify Groups")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
def allowed(self, request, project):
return keystone.VERSIONS.active >= 3
@ -59,7 +61,7 @@ class UsageLink(tables.LinkAction):
name = "usage"
verbose_name = _("View Usage")
url = "horizon:admin:projects:usage"
classes = ("btn-stats",)
icon = "stats"
policy_rules = (("compute", "compute_extension:simple_tenant_usage:show"),)
@ -78,7 +80,8 @@ class UpdateProject(tables.LinkAction):
name = "update"
verbose_name = _("Edit Project")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (('identity', 'identity:update_project'),)
def allowed(self, request, project):
@ -89,7 +92,8 @@ class ModifyQuotas(tables.LinkAction):
name = "quotas"
verbose_name = _("Modify Quotas")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (('compute', "compute_extension:quotas:update"),)
def get_link_url(self, project):

View File

@ -244,12 +244,17 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
self.assertTemplateUsed(res, views.WorkflowView.template_name)
if django.VERSION >= (1, 6):
self.assertContains(res, '<input id="id_subnet" min="-1" '
'name="subnet" type="number" value="10" />',
html=True)
self.assertContains(res, '''
<input class=" form-control"
id="id_subnet" min="-1"
name="subnet" type="number" value="10" />
''', html=True)
else:
self.assertContains(res, '<input name="subnet" id="id_subnet" '
'value="10" type="text" />', html=True)
self.assertContains(res, '''
<input class=" form-control"
name="subnet" id="id_subnet"
value="10" type="text" />
''', html=True)
workflow = res.context['workflow']
self.assertEqual(res.context['workflow'].name,

View File

@ -23,7 +23,8 @@ class CreateRoleLink(tables.LinkAction):
name = "create"
verbose_name = _("Create Role")
url = "horizon:admin:roles:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("identity", "identity:create_role"),)
def allowed(self, request, role):
@ -34,7 +35,8 @@ class EditRoleLink(tables.LinkAction):
name = "edit"
verbose_name = _("Edit")
url = "horizon:admin:roles:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("identity", "identity:update_role"),)
def allowed(self, request, role):

View File

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

View File

@ -21,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Role" %}" />
<a href="{% url 'horizon:admin:roles:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:roles:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -8,8 +8,8 @@
{% block main %}
{% include "admin/routers/_detail_overview.html" %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

View File

@ -27,7 +27,8 @@ class CreateUserLink(tables.LinkAction):
name = "create"
verbose_name = _("Create User")
url = "horizon:admin:users:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (('identity', 'identity:create_grant'),
("identity", "identity:create_user"),
("identity", "identity:list_roles"),
@ -41,7 +42,8 @@ class EditUserLink(tables.LinkAction):
name = "edit"
verbose_name = _("Edit")
url = "horizon:admin:users:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
policy_rules = (("identity", "identity:update_user"),
("identity", "identity:list_projects"),)

View File

@ -31,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create User" %}" />
<a href="{% url 'horizon:admin:users:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:users:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -31,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update User" %}" />
<a href="{% url 'horizon:admin:users:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:users:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,7 +22,8 @@ class CreateVolumeType(tables.LinkAction):
name = "create"
verbose_name = _("Create Volume Type")
url = "horizon:admin:volumes:create_type"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("volume", "volume_extension:types_manage"),)

View File

@ -26,5 +26,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Volume Type" %}" />
<a href="{% url 'horizon:admin:volumes:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:volumes:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -7,8 +7,8 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

View File

@ -32,7 +32,7 @@ class DownloadEC2(tables.LinkAction):
name = "download_ec2"
verbose_name = _("Download EC2 Credentials")
verbose_name_plural = _("Download EC2 Credentials")
classes = ("btn-download",)
icon = "download"
url = "horizon:project:access_and_security:api_access:ec2"
policy_rules = (("compute", "compute_extension:certificates"),)
@ -44,7 +44,7 @@ class DownloadOpenRC(tables.LinkAction):
name = "download_openrc"
verbose_name = _("Download OpenStack RC File")
verbose_name_plural = _("Download OpenStack RC File")
classes = ("btn-download",)
icon = "download"
url = "horizon:project:access_and_security:api_access:openrc"

View File

@ -39,7 +39,8 @@ POLICY_CHECK = getattr(settings, "POLICY_CHECK_FUNCTION", lambda p, r: True)
class AllocateIP(tables.LinkAction):
name = "allocate"
verbose_name = _("Allocate IP To Project")
classes = ("ajax-modal", "btn-allocate")
classes = ("ajax-modal",)
icon = "download-alt"
url = "horizon:project:access_and_security:floating_ips:allocate"
def single(self, data_table, request, *args):
@ -72,7 +73,8 @@ class ReleaseIPs(tables.BatchAction):
action_past = _("Released")
data_type_singular = _("Floating IP")
data_type_plural = _("Floating IPs")
classes = ('btn-danger', 'btn-release')
classes = ('btn-danger',)
icon = "arrow-up"
def allowed(self, request, fip=None):
if api.base.is_service_enabled(request, "network"):
@ -91,7 +93,8 @@ class AssociateIP(tables.LinkAction):
name = "associate"
verbose_name = _("Associate")
url = "horizon:project:access_and_security:floating_ips:associate"
classes = ("ajax-modal", "btn-associate")
classes = ("ajax-modal",)
icon = "link"
def allowed(self, request, fip):
if api.base.is_service_enabled(request, "network"):

View File

@ -34,7 +34,8 @@ class ImportKeyPair(tables.LinkAction):
name = "import"
verbose_name = _("Import Key Pair")
url = "horizon:project:access_and_security:keypairs:import"
classes = ("ajax-modal", "btn-upload")
classes = ("ajax-modal",)
icon = "upload"
policy_rules = (("compute", "compute_extension:keypairs:create"),)
@ -42,7 +43,8 @@ class CreateKeyPair(tables.LinkAction):
name = "create"
verbose_name = _("Create Key Pair")
url = "horizon:project:access_and_security:keypairs:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
policy_rules = (("compute", "compute_extension:keypairs:create"),)
def allowed(self, request, keypair=None):

View File

@ -58,7 +58,8 @@ class CreateGroup(tables.LinkAction):
name = "create"
verbose_name = _("Create Security Group")
url = "horizon:project:access_and_security:security_groups:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
def allowed(self, request, security_group=None):
if api.base.is_service_enabled(request, "network"):
@ -73,7 +74,8 @@ class EditGroup(tables.LinkAction):
name = "edit"
verbose_name = _("Edit Security Group")
url = "horizon:project:access_and_security:security_groups:update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
def get_policy_target(self, request, datum=None):
project_id = None
@ -100,7 +102,7 @@ class ManageRules(tables.LinkAction):
name = "manage_rules"
verbose_name = _("Manage Rules")
url = "horizon:project:access_and_security:security_groups:detail"
classes = ("btn-edit")
icon = "pencil"
def get_policy_target(self, request, datum=None):
project_id = None
@ -136,7 +138,8 @@ class CreateRule(tables.LinkAction):
name = "add_rule"
verbose_name = _("Add Rule")
url = "horizon:project:access_and_security:security_groups:add_rule"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
def allowed(self, request, security_group_rule=None):
if api.base.is_service_enabled(request, "network"):

View File

@ -40,5 +40,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Allocate IP" %}" />
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -7,8 +7,8 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Key Pair" %}" />
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -27,5 +27,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Import Key Pair" %}" />
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -25,5 +25,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add" %}" />
<a href="{% url 'horizon:project:access_and_security:security_groups:detail' security_group_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:security_groups:detail' security_group_id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Security Group" %}" />
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Edit Security Group" %}" />
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -54,7 +54,7 @@ class ViewContainer(tables.LinkAction):
class MakePublicContainer(tables.Action):
name = "make_public"
verbose_name = _("Make Public")
classes = ("btn-edit", )
icon = "pencil"
def allowed(self, request, container):
# Container metadata have not been loaded
@ -80,7 +80,7 @@ class MakePublicContainer(tables.Action):
class MakePrivateContainer(tables.Action):
name = "make_private"
verbose_name = _("Make Private")
classes = ("btn-edit", )
icon = "pencil"
def allowed(self, request, container):
# Container metadata have not been loaded
@ -136,14 +136,15 @@ class CreateContainer(tables.LinkAction):
name = "create"
verbose_name = _("Create Container")
url = "horizon:project:containers:create"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
class ListObjects(tables.LinkAction):
name = "list_objects"
verbose_name = _("View Container")
url = "horizon:project:containers:index"
classes = ("btn-list",)
icon = "list"
def get_link_url(self, datum=None):
container_name = http.urlquote(datum.name)
@ -155,7 +156,8 @@ class CreatePseudoFolder(tables.LinkAction):
name = "create_pseudo_folder"
verbose_name = _("Create Pseudo-folder")
url = "horizon:project:containers:create_pseudo_folder"
classes = ("ajax-modal", "btn-create")
classes = ("ajax-modal",)
icon = "plus"
def get_link_url(self, datum=None):
# Usable for both the container and object tables
@ -183,7 +185,8 @@ class UploadObject(tables.LinkAction):
name = "upload"
verbose_name = _("Upload Object")
url = "horizon:project:containers:object_upload"
classes = ("ajax-modal", "btn-upload")
classes = ("ajax-modal",)
icon = "upload"
def get_link_url(self, datum=None):
# Usable for both the container and object tables
@ -305,7 +308,8 @@ class UpdateObject(tables.LinkAction):
name = "update_object"
verbose_name = _("Edit")
url = "horizon:project:containers:object_update"
classes = ("ajax-modal", "btn-edit")
classes = ("ajax-modal",)
icon = "pencil"
allowed_data_types = ("objects",)
def get_link_url(self, obj):
@ -341,7 +345,8 @@ class CopyObject(tables.LinkAction):
name = "copy"
verbose_name = _("Copy")
url = "horizon:project:containers:object_copy"
classes = ("ajax-modal", "btn-copy")
classes = ("ajax-modal",)
icon = "circle-arrow-right"
allowed_data_types = ("objects",)
def get_link_url(self, obj):
@ -354,7 +359,7 @@ class DownloadObject(tables.LinkAction):
name = "download"
verbose_name = _("Download")
url = "horizon:project:containers:object_download"
classes = ("btn-download",)
icon = "download"
allowed_data_types = ("objects",)
def get_link_url(self, obj):

View File

@ -5,7 +5,7 @@
{% block modal-header %}{% trans "Container Details" %}{% endblock %}
{% block modal-body %}
<div class="info row-fluid detail clearfix">
<div class="info row detail clearfix">
<dl>
<dt>{% trans "Container Name" %}</dt>
<dd>{{ container.name }}</dd>
@ -26,5 +26,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:containers:index' %}" class="btn secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
{% endblock %}

View File

@ -21,5 +21,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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -22,5 +22,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,5 +21,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -5,7 +5,7 @@
{% block modal-header %}{% trans "Object Details" %}{% endblock %}
{% block modal-body %}
<div class="info row-fluid detail">
<div class="info row detail">
<dl>
<dt>{% trans "Name" %}</dt>
<dd>{{ object.name }}</dd>
@ -22,5 +22,5 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url 'horizon:project:containers:index' %}" class="btn secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
{% endblock %}

View File

@ -25,5 +25,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -24,5 +24,5 @@
{% 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 secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -2,7 +2,7 @@
<h3>{% trans "Data Processing Plugin Overview" %}</h3>
<div class="status row-fluid detail">
<div class="status row detail">
<h4>{% trans "Info" %}</h4>
<hr class="header_rule">
<dl>

View File

@ -7,8 +7,8 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>

View File

@ -36,14 +36,16 @@ class LaunchLink(tables.LinkAction):
name = "create"
verbose_name = _("Create Backup")
url = "horizon:project:database_backups:create"
classes = ("btn-launch", "ajax-modal")
classes = ("ajax-modal", "btn-launch")
icon = "cloud-upload"
class RestoreLink(tables.LinkAction):
name = "restore"
verbose_name = _("Restore Backup")
url = "horizon:project:databases:launch"
classes = ("btn-launch", "ajax-modal")
classes = ("ajax-modal",)
icon = "cloud-upload"
def allowed(self, request, backup=None):
return backup.status == 'COMPLETED'
@ -77,7 +79,8 @@ class DeleteBackup(tables.BatchAction):
action_past = _("Scheduled deletion of %(data_type)s")
data_type_singular = _("Backup")
data_type_plural = _("Backups")
classes = ('btn-danger', 'btn-terminate')
classes = ("ajax-modal",)
icon = "remove"
def action(self, request, obj_id):
api.trove.backup_delete(request, obj_id)

View File

@ -7,11 +7,11 @@
{% endblock page_header %}
{% block main %}
<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="col-sm-12">
<h3>{% trans "Backup Overview" %}</h3>
<div class="status row-fluid detail">
<div class="status row detail">
<h4>{% trans "Info" %}</h4>
<hr class="header_rule">
<dl>
@ -57,7 +57,7 @@
{% endif %}
{% if instance %}
<div class="addresses row-fluid detail">
<div class="addresses row detail">
<h4>{% trans "Database Info" %}</h4>
<hr class="header_rule">
<dl>

View File

@ -35,7 +35,8 @@ class TerminateInstance(tables.BatchAction):
action_past = _("Scheduled termination of %(data_type)s")
data_type_singular = _("Instance")
data_type_plural = _("Instances")
classes = ('btn-danger', 'btn-terminate')
classes = ("ajax-modal",)
icon = "off"
def action(self, request, obj_id):
api.trove.instance_delete(request, obj_id)
@ -93,14 +94,16 @@ class LaunchLink(tables.LinkAction):
name = "launch"
verbose_name = _("Launch Instance")
url = "horizon:project:databases:launch"
classes = ("btn-launch", "ajax-modal")
classes = ("ajax-modal", "btn-launch")
icon = "cloud-upload"
class CreateBackup(tables.LinkAction):
name = "backup"
verbose_name = _("Create Backup")
url = "horizon:project:database_backups:create"
classes = ("ajax-modal", "btn-camera")
classes = ("ajax-modal",)
icon = "camera"
def allowed(self, request, instance=None):
return (instance.status in ACTIVE_STATES and

View File

@ -2,7 +2,7 @@
<h3>{% trans "Instance Overview" %}</h3>
<div class="status row-fluid detail">
<div class="status row detail">
<h4>{% trans "Info" %}</h4>
<hr class="header_rule">
<dl>
@ -40,3 +40,18 @@
{% block connection_info %}
{% endblock %}
<div class="addresses row detail">
<h4>{% trans "Connection Info" %}</h4>
<hr class="header_rule">
<dl>
{% with instance.host as host %}
<dt>{% trans "Host" %}</dt>
<dd>{{ host }}</dd>
<dt>{% trans "Database Port" %}</dt>
<dd>3306</dd> {# TODO: This should be a config #}
<dt>{% trans "Connection Examples" %}</dt>
<dd>mysql -h {{ host }} -u USERNAME -p</dd>
<dd>mysql://USERNAME:PASSWORD@{{ host }}:3306/DATABASE</dd>
{% endwith %}
</dl>
</div>

Some files were not shown because too many files have changed in this diff Show More