Update Twitter Bootstrap to version 3

Updated to bootstrap 3.2.0
back to v3.1.1
fix base-line-height variable
Revamped grid system
Replaced help-inline with help-block
Change .control-group to .form-group
Add column widths to horizontal form labels and .controls, remove .controls class
Datepicker form fix
Add btn-default to btn elements with no other color
Topbar switcher fix
Rename button sizes
Replace alert-error with alert-danger
Removed alert-block
Alerts fixing
Updated LinkAction and Action table actions to define icon, replaced btn-default icon with glyphicon
Replaced icons with glyphicons, removed btn-icon styling from horizon.scss
change Button Icons text in customizing docs
Fixed table header
Fix page_header h2 margin
Nav accordion fix
Tables fix
Modal fixes
added form-control class to input and selects
Forms fixes
Workflow modal fix
Fix quota bar
updated customizing docs
removed unused styling from horizon.scss
make datepicker form inline
fix table filter styling
added btn-danger to terminate instances button
fixed loading spinner
form fields and validations
Created bootstrap_form_field filter and template to render bootstrap forms properly
Style up the datepicker
Fixed failing test cases

Implements: blueprint bootstrap-update

Change-Id: Ic826849be1af7fc6bf06f97dd7a60fc54b862148
This commit is contained in:
Jiri Tomasek 2014-07-02 14:05:54 +02:00
parent b04f020fc1
commit 92146772b6
290 changed files with 9965 additions and 5464 deletions

View File

@ -15,7 +15,7 @@ The file ``local_settings.py`` can be found at the Horizon directory path of
Changing the Logo
=================
There are currently two places where the OpenStack logo is pulled in
There are currently two places where the OpenStack logo is pulled in
through ``horizon.less``. The first is shown at the login screen and the other
on top of the menu bar::
@ -52,7 +52,7 @@ This allows for common site-customization requirements such as:
To specify the python module containing your modifications, add the key
``customization_module`` to your ``HORIZON_CONFIG`` dictionary in
``local_settings.py``. The value should be a string containing the path to your
``local_settings.py``. The value should be a string containing the path to your
module in dotted python path notation. Example::
HORIZON_CONFIG = {
@ -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

@ -392,7 +392,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

@ -1723,10 +1723,10 @@ function setupModuleLoader(window) {
/* global
angularModule: true,
version: true,
$LocaleProvider,
$CompileProvider,
htmlAnchorDirective,
inputDirective,
inputDirective,
@ -3664,7 +3664,7 @@ function createInjector(modulesToLoad) {
*
* It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor.
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
*
*
* @example
<example>
<file name="index.html">
@ -3679,7 +3679,7 @@ function createInjector(modulesToLoad) {
// set the location.hash to the id of
// the element you wish to scroll to.
$location.hash('bottom');
// call $anchorScroll()
$anchorScroll();
}
@ -3767,7 +3767,7 @@ var $animateMinErr = minErr('$animate');
*/
var $AnimateProvider = ['$provide', function($provide) {
this.$$selectors = {};
@ -3885,7 +3885,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* @description Moves the position of the provided element within the DOM to be placed
* either after the `after` element or inside of the `parent` element. Once complete, the
* done() callback will be fired (if provided).
*
*
* @param {jQuery/jqLite element} element the element which will be moved around within the
* DOM
* @param {jQuery/jqLite element} parent the parent element where the element will be
@ -4197,7 +4197,7 @@ function Browser(window, document, $log, $sniffer) {
/**
* @name ng.$browser#baseHref
* @methodOf ng.$browser
*
*
* @description
* Returns current <base href>
* (always relative - without domain)
@ -4228,13 +4228,13 @@ function Browser(window, document, $log, $sniffer) {
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
*
*
* - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify
* it
* - cookies(name, value) -> set name to value, if value is undefined delete the cookie
* - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that
* way)
*
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
@ -4349,9 +4349,9 @@ function $BrowserProvider(){
*
* @description
* Factory that constructs cache objects and gives access to them.
*
*
* <pre>
*
*
* var cache = $cacheFactory('cacheId');
* expect($cacheFactory.get('cacheId')).toBe(cache);
* expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
@ -4360,8 +4360,8 @@ function $BrowserProvider(){
* cache.put("another key", "another value");
*
* // We've specified no options on creation
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
*
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
*
* </pre>
*
*
@ -4544,7 +4544,7 @@ function $CacheFactoryProvider() {
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
* can load templates directly into the cache in a `script` tag, or by consuming the
* `$templateCache` service directly.
*
*
* Adding via the `script` tag:
* <pre>
* <html ng-app>
@ -4556,29 +4556,29 @@ function $CacheFactoryProvider() {
* ...
* </html>
* </pre>
*
*
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
* the document, but it must be below the `ng-app` definition.
*
*
* Adding via the $templateCache service:
*
*
* <pre>
* var myApp = angular.module('myApp', []);
* myApp.run(function($templateCache) {
* $templateCache.put('templateId.html', 'This is the content of the template');
* });
* </pre>
*
*
* To retrieve the template later, simply use it in your HTML:
* <pre>
* <div ng-include=" 'templateId.html' "></div>
* </pre>
*
*
* or get it via Javascript:
* <pre>
* $templateCache.get('templateId.html')
* </pre>
*
*
* See {@link ng.$cacheFactory $cacheFactory}.
*
*/
@ -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.
@ -6677,12 +6677,12 @@ function $DocumentProvider(){
* Any uncaught exception in angular expressions is delegated to this service.
* The default implementation simply delegates to `$log.error` which logs it into
* the browser console.
*
*
* In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
* {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.
*
* ## Example:
*
*
* <pre>
* angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {
* return function (exception, cause) {
@ -6691,7 +6691,7 @@ function $DocumentProvider(){
* };
* });
* </pre>
*
*
* This example will override the normal action of `$exceptionHandler`, to make angular
* exceptions fail hard when they happen, instead of just logging to the console.
*
@ -6930,7 +6930,7 @@ function $HttpProvider() {
* will result in the success callback being called. Note that if the response is a redirect,
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
* called for such responses.
*
*
* # Calling $http from outside AngularJS
* The `$http` service will not actually send the request until the next `$digest()` is
* executed. Normally this is not an issue, since almost all the time your call to `$http` will
@ -8172,7 +8172,7 @@ function $IntervalProvider() {
promise = deferred.promise,
iteration = 0,
skipApply = (isDefined(invokeApply) && !invokeApply);
count = isDefined(count) ? count : 0,
promise.then(null, null, fn);
@ -8959,7 +8959,7 @@ function $LocationProvider(){
* @description
* Simple service for logging. Default implementation safely writes the message
* into the browser's console (if present).
*
*
* The main purpose of this service is to simplify debugging and troubleshooting.
*
* The default is not to log `debug` messages. You can use
@ -8996,7 +8996,7 @@ function $LocationProvider(){
function $LogProvider(){
var debug = true,
self = this;
/**
* @ngdoc property
* @name ng.$logProvider#debugEnabled
@ -9013,7 +9013,7 @@ function $LogProvider(){
return debug;
}
};
this.$get = ['$window', function($window){
return {
/**
@ -9055,12 +9055,12 @@ function $LogProvider(){
* Write an error message
*/
error: consoleLog('error'),
/**
* @ngdoc method
* @name ng.$log#debug
* @methodOf ng.$log
*
*
* @description
* Write a debug message
*/
@ -11124,7 +11124,7 @@ function $RootScopeProvider(){
// Using a listener function
// Using a listener function
var food;
scope.foodCounter = 0;
expect(scope.foodCounter).toEqual(0);
@ -11149,7 +11149,7 @@ function $RootScopeProvider(){
// Update food and run digest. Now the counter will increment
food = 'cheeseburger';
scope.$digest();
expect(scope.foodCounter).toEqual(1);
expect(scope.foodCounter).toEqual(1);
* </pre>
*
@ -11568,7 +11568,7 @@ function $RootScopeProvider(){
*
* - `string`: execute using the rules as defined in {@link guide/expression expression}.
* - `function(scope)`: execute the function with the current `scope` parameter.
*
*
* @param {(object)=} locals Local variables object, useful for overriding values in scope.
* @returns {*} The result of evaluating the expression.
*/
@ -12351,7 +12351,7 @@ function $SceDelegateProvider() {
* allowing only the files in a specific directory to do this. Ensuring that the internal API
* exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
*
* In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs}
* In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs}
* (and shorthand methods such as {@link ng.$sce#methods_trustAsHtml $sce.trustAsHtml}, etc.) to
* obtain values that will be accepted by SCE / privileged contexts.
*
@ -13100,7 +13100,7 @@ function $TimeoutProvider() {
* will invoke `fn` within the {@link ng.$rootScope.Scope#methods_$apply $apply} block.
* @returns {Promise} Promise that will be resolved when the timeout is reached. The value this
* promise will be resolved with is the return value of the `fn` function.
*
*
* @example
<doc:example module="time">
<doc:source>
@ -13459,7 +13459,7 @@ function $WindowProvider(){
*
* The filter function is registered with the `$injector` under the filter name suffix with
* `Filter`.
*
*
* <pre>
* it('should be the same instance', inject(
* function($filterProvider) {
@ -13535,7 +13535,7 @@ function $FilterProvider($provide) {
}];
////////////////////////////////////////
/* global
currencyFilter: false,
dateFilter: false,
@ -14254,9 +14254,9 @@ var uppercaseFilter = valueFn(uppercase);
* the value and sign (positive or negative) of `limit`.
*
* @param {Array|string} input Source array or string to be limited.
* @param {string|number} limit The length of the returned array or string. If the `limit` number
* @param {string|number} limit The length of the returned array or string. If the `limit` number
* is positive, `limit` number of items from the beginning of the source array/string are copied.
* If the number is negative, `limit` number of items from the end of the source array/string
* If the number is negative, `limit` number of items from the end of the source array/string
* are copied. The `limit` will be trimmed if it exceeds `array.length`
* @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
* had less than `limit` elements.
@ -14306,7 +14306,7 @@ var uppercaseFilter = valueFn(uppercase);
function limitToFilter(){
return function(input, limit) {
if (!isArray(input) && !isString(input)) return input;
limit = int(limit);
if (isString(input)) {
@ -14699,7 +14699,7 @@ var htmlAnchorDirective = valueFn({
</doc:example>
*
* @element INPUT
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
* then special attribute "disabled" will be set on the element
*/
@ -14730,7 +14730,7 @@ var htmlAnchorDirective = valueFn({
</doc:example>
*
* @element INPUT
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
* then special attribute "checked" will be set on the element
*/
@ -14761,7 +14761,7 @@ var htmlAnchorDirective = valueFn({
</doc:example>
*
* @element INPUT
* @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
* @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
* then special attribute "readonly" will be set on the element
*/
@ -14795,7 +14795,7 @@ var htmlAnchorDirective = valueFn({
</doc:example>
*
* @element OPTION
* @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
* @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
* then special attribute "selected" will be set on the element
*/
@ -14828,7 +14828,7 @@ var htmlAnchorDirective = valueFn({
</doc:example>
*
* @element DETAILS
* @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
* @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
* then special attribute "open" will be set on the element
*/
@ -16363,7 +16363,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
* It will update the $viewValue, then pass this value through each of the functions in `$parsers`,
* which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to
* `$modelValue` and the **expression** specified in the `ng-model` attribute.
*
*
* Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.
*
* Note that calling this function does not trigger a `$digest`.
@ -16869,14 +16869,14 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
*
* @example
Try it here: enter text in text box and watch the greeting change.
<example module="ngBindHtmlExample" deps="angular-sanitize.js">
<file name="index.html">
<div ng-controller="ngBindHtmlCtrl">
<p ng-bind-html="myHTML"></p>
</div>
</file>
<file name="script.js">
angular.module('ngBindHtmlExample', ['ngSanitize'])
@ -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`
@ -19920,7 +19920,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
// We now build up the list of options we need (we merge later)
for (index = 0; length = keys.length, index < length; index++) {
key = index;
if (keyName) {
key = keys[index];

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">
<p>[[text]]&hellip;</p>
<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,17 +4,21 @@
{% block id %}modal_template{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="modal hide">
<div class='modal-header'>
<a class='close' data-dismiss='modal'>&times;</a>
<h3>[[title]]</h3>
</div>
<div class='modal-body'>
[[body]]
</div>
<div class='modal-footer'>
<a href='#' class='btn btn-primary'>[[confirm]]</a>
<a href='#' class='btn cancel' data-dismiss='modal'>[[cancel]]</a>
<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>
</div>
<div class='modal-body'>
[[body]]
</div>
<div class='modal-footer'>
<a href='#' class='btn btn-primary'>[[confirm]]</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>
{{ field }}
</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,10 +1,14 @@
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
<div class="modal-header">
{% if hide %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{% block modal-header %}{% endblock %}</h3>
<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>
</div>
<div class="modal-body clearfix">
{% block modal-body %}{% endblock %}
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</div>
</div>
<div class="modal-body clearfix">
{% block modal-body %}{% endblock %}
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</div>

View File

@ -1,31 +1,35 @@
<div id="{% block modal_id %}{% endblock %}" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
<div class="modal-header">
{% if hide %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{% block modal-header %}{% endblock %}</h3>
</div>
{% if table %}
<div class="modal-body">
{{ table.render }}
</div>
<hr />
{% endif %}
<form id="{% block form_id %}{% endblock %}"
ng-controller="{% block ng_controller %}DummyCtrl{% endblock %}"
name="{% block form_name %}{% endblock %}"
autocomplete="{% block autocomplete %}{% endblock %}"
class="{% block form_class %}{% endblock %}"
action="{% block form_action %}{% endblock %}"
method="{% block form-method %}POST{% endblock %}"
{% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
<div class="modal-body clearfix">
{% block modal-body %}
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
{% 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>
</div>
{% if table %}
<div class="modal-body">
{{ table.render }}
</div>
<hr />
{% endif %}
<form id="{% block form_id %}{% endblock %}"
ng-controller="{% block ng_controller %}DummyCtrl{% endblock %}"
name="{% block form_name %}{% endblock %}"
autocomplete="{% block autocomplete %}{% endblock %}"
class="{% block form_class %}{% endblock %}"
action="{% block form_action %}{% endblock %}"
method="{% block form-method %}POST{% endblock %}"
{% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
<div class="modal-body clearfix">
{% block modal-body %}
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
{% endblock %}
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</form>
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</form>
</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 %}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
<small>{% trans "The date should be in YYYY-mm-dd format." %}</small>
<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>
</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,50 +3,54 @@
<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-header">
{% block modal-header %}
{% if modal %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{{ workflow.name }}</h3>
{% endblock %}
</div>
<div class="modal-body clearfix">
{% block modal-body %}
<ul class="nav nav-tabs{% if workflow.wizard %} wizard-tabs{% endif %}">
{% for step in workflow.steps %}
<li class="{% if entry_point == step.slug %}active{% endif %}{% if step.has_errors %} error{% endif %}{% if step.has_required_fields %} required{% endif %}">
<a href="#{{ step.get_id }}" data-toggle="tab" data-target="#{{ step.get_id }}">{{ step }}</a>
</li>
{% endfor %}
</ul>
<div class="tab-content">
{% for step in workflow.steps %}
<fieldset id="{{ step.get_id }}" class="js-tab-pane{% if entry_point == step.slug %} active{% endif %}">
{{ step.render }}
</fieldset>
{% if not forloop.last %}
<noscript><hr /></noscript>
<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 %}
<h3>{{ workflow.name }}</h3>
{% endblock %}
</div>
<div class="modal-body clearfix">
{% block modal-body %}
<ul class="nav nav-tabs{% if workflow.wizard %} wizard-tabs{% endif %}">
{% for step in workflow.steps %}
<li class="{% if entry_point == step.slug %}active{% endif %}{% if step.has_errors %} error{% endif %}{% if step.has_required_fields %} required{% endif %}">
<a href="#{{ step.get_id }}" data-toggle="tab" data-target="#{{ step.get_id }}">{{ step }}</a>
</li>
{% endfor %}
</ul>
<div class="tab-content">
{% for step in workflow.steps %}
<fieldset id="{{ step.get_id }}" class="js-tab-pane{% if entry_point == step.slug %} active{% endif %}">
{{ step.render }}
</fieldset>
{% if not forloop.last %}
<noscript><hr /></noscript>
{% endif %}
{% endfor %}
</div>
{% endblock %}
</div>
<div class="modal-footer">
{% block modal-footer %}
{% if workflow.wizard %}
<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="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 btn-default secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% endif %}
{% endfor %}
</div>
{% endblock %}
</div>
<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>
<div class="span6 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>
{% endblock %}
</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 %}
{% endif %}
{% endblock %}
</div>
</form>
</div>

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>
{% endblock %}
<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

@ -29,5 +29,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>
{% endblock %}
<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>
{% endblock %}
<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>
@ -22,4 +22,4 @@
</dd>
</dl>
</div>
</div>

View File

@ -7,9 +7,9 @@
{% 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>
{% endblock %}
{% endblock %}

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>
@ -41,7 +41,7 @@
</div>
{% 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>
@ -36,3 +36,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