Moving CSS to less. Using recess to compile and compress to awx.min.css

This commit is contained in:
chouseknecht 2013-08-08 11:39:27 -04:00
parent efbdb67c33
commit 5cc6f799fe
7 changed files with 961 additions and 202 deletions

1
awx/ui/static/css/awx.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -193,12 +193,13 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
var generator = GenerateForm;
var form = InventoryForm;
var defaultUrl=GetBasePath('inventory');
var scope = generator.inject(form, {mode: 'edit', related: true});
generator.reset();
var scope = generator.inject(form, {mode: 'edit', related: true, buildTree: true});
var base = $location.path().replace(/^\//,'').split('/')[0];
var id = $routeParams.id;
ParseTypeChange(scope,'inventory_variables', 'inventoryParseType');
$('#inventory-tabs a:first').tab('show'); //activate the groups tab
scope.inventoryParseType = 'yaml';
scope['inventory_id'] = id;
@ -433,10 +434,13 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
var type = node.attr('type');
var url;
scope['selectedNode'] = node;
scope['selectedNodeName'] = node.attr('name');
$('#tree-view').jstree('open_node',node);
if (type == 'group') {
url = node.attr('all');
scope.groupAddHide = false;
scope.groupAddHide = false;
scope.groupEditHide =false;
scope.groupDeleteHide = false;
scope.createButtonShow = true;
@ -455,10 +459,13 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
scope.groupTitle = '<h4>All Hosts</h4>';
scope.group_id = null;
}
if (!scope.$$phase) {
scope.$digest();
}
HostsReload({ scope: scope, inventory_id: scope['inventory_id'], group_id: scope['group_id'] });
});
scope.addGroup = function() {

View File

@ -0,0 +1,752 @@
/*********************************************
* Copyright (c) 2013 AnsibleWorks, Inc.
*
* ansible-ui.css
*
* custom styles for ansible-ui
*
*/
html {
background-color: #171717;
}
body {
padding-top: 100px;
color: #171717;
}
.tooltip {
z-index: 1050;
}
.text-center {
text-align: center !important;
}
hr {
border-color: #e3e3e3;
}
.nowrap {
white-space: nowrap;
}
.tab-content {
padding-top: 20px;
}
.btn .caret {
border-top-color: #696969;
}
.dropdown-toggle,
.btn-default {
color: #333;
background-color: #ccc;
border-color: #ccc;
}
.dropdown-toggle:hover,
.btn-default:hover {
color: #333;
background-color: #bbb;
border-color: #bbb;
}
.btn-light {
color: #333;
background-color: #ddd;
border-color: #ddd;
}
.btn-light:hover {
color: #333;
background-color: #ccc;
border-color: #ccc;
}
/* Use code-breakable in pop-over text to indent and wrap code segments */
.code-breakable {
padding-left: 10px;
word-wrap: break-word;
}
.break {
word-wrap: break-word;
}
.login-alert {
margin-bottom: 25px;
font-size: 14px;
font-weight: normal;
color: #0088cc;
text-align: center;
}
.controls {
min-height: 15px;
}
.main-container {
min-height: 700px;
}
.main-menu {
background-color: #171717;
}
.main-menu .nav {
margin-top: 15px;
}
.main-menu .nav > li > a {
color: #A9A9A9;
}
.main-menu .nav > li > a:hover,
.main-menu .nav > li > a:focus {
color: #2078be;
}
/* Using inline-block rather than block keeps
brand img from right aligning into the collapse button
on mobile screens */
.main-menu .navbar-brand {
display: inline-block;
padding: 0;
}
.main-menu .navbar-brand img {
max-width: 260px;
}
a:hover {
text-decoration: none;
}
.help-link,
.help-link:active,
.help-link:visited {
color: #49afcd;
text-decoration: none;
}
.help-link:hover {
color: #1778c3;
text-decoration: none;
}
.site-footer {
width: 100%;
padding-top: 20px;
padding-bottom: 40px;
margin-top: 60px;
color: #A9A9A9;
text-align: center;
background-color: #171717;
}
.copyright {
display: inline-block;
font-size: 11px;
font-weight: normal;
text-align: center;
}
.site-footer a,
.site-footer a:active,
.site-footer a:hover,
.site-footer a:visited {
margin-right: 15px;
font-size: 18px;
color: #A9A9A9;
}
.site-footer .social {
display: inline-block;
margin-left: 50px;
}
.site-footer .logo {
display: inline-block;
margin-right: 35px;
}
.site-footer .logo img {
max-width: 125px;
}
.login-header {
text-align: center;
}
.login-header img {
max-width: 100px;
}
/* Outline required fields in Red when focused */
.form-control[required]:focus {
border-color: rgba(204, 0, 0, 0.8);
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 5px rgba(204, 0, 0, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 5px rgba(204, 0, 0, 0.6);
}
/* For some reason TB 3 RC1 does not provide an input-mini */
.input-mini {
height: 26px;
padding: 3px 8px;
font-size: 12px;
border-radius: 3px;
}
.error {
margin-top: 5px;
font-size: 12px;
line-height: normal;
color: #FF0000;
}
.xsmall {
font-size: 12px;
}
.note {
padding-top: 15px;
font-size: 12px;
}
legend {
font-size: medium;
font-weight: bold;
}
.navigation {
margin: 15px 0 15px 0;
}
.page-number {
display: inline-block;
padding: 0;
margin: 0;
}
.page-number-small {
display: inline-block;
margin-left: 10px;
font-size: 11px;
}
.footer-navigation {
margin: 10px 0 10px 0;
}
.lookup-navigation {
margin: 15px 0 0 0;
/*padding-top: 20px;*/
}
.related-footer {
margin: 10px 0 0 0;
}
.page-size {
font-size: 10.5px;
line-height: normal;
}
.page-size-label {
margin-left: 15px;
font-size: 10.5px;
font-weight: normal;
}
.accordion-heading {
font-weight: bold;
color: #0088CC;
}
.accordion-heading i {
margin-right: 5px;
}
.status-actions {
display: inline-block;
height: 25px;
margin-bottom: 20px;
}
.status-spin {
display: inline-block;
margin-left: 15px;
font-size: 22px;
vertical-align: middle;
}
.search-widget {
margin-bottom: 20px;
}
.search-widget label {
display: inline-block;
padding-right: 15px;
vertical-align: middle;
}
.nav-path {
padding: 5px 0 10px 0;
margin-right: 5px;
margin-bottom: 25px;
font-size: 14px;
font-weight: bold;
background-color: #f5f5f5;
border: 1px solid #d8d8d8;
border-radius: 6px;
box-shadow: 3px 3px 4px 0 #808080;
}
.nav-path ul {
padding-bottom: 0;
padding-left: 0;
margin-bottom: 0;
margin-left: 10px;
}
.greeting {
padding-right: 22px;
}
.breadcrumb .active {
color: #171717;
}
.nav-tabs > li > a {
font-weight: bold;
}
input[type="text"].field-mini-height {
height: 12px;
font-size: 10.5px;
}
select.field-mini-height {
height: 22px;
font-size: 10.5px;
}
.ask-checkbox {
margin-left: 10px;
}
.tree-container {
padding: 0;
margin: 5px 0 15px 0;
}
.no-padding {
padding: 0;
margin: 0;
}
/* Display list actions next to search widget */
.list-actions {
display: inline-block;
padding-bottom: 22px;
margin-left: 10px;
vertical-align: top;
}
.list-actions .btn {
margin-right: 3px;
}
.btn-help {
margin-left: 15px;
}
/* End Display list actions */
.well {
padding-bottom: 0;
}
/* Enable table-hover to work when table is in a well */
.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th {
background-color: #fff;
}
.table-hover-inverse tbody tr:hover > td,
.table-hover-inverse tbody tr:hover > th {
background-color: #dff0d8;
}
/* Jobs pages */
.job-error,
.job-failed,
.license-expired,
.license-invalid,
.active-failures-true,
.active-failures-true a,
.active-failures-true a:active,
input[type="text"].job-failed,
input[type="text"].job-error {
color: #da4f49;
}
.active-failures-true a:hover {
color: #FF0000;
}
.job-failures-true {
padding-top: 5px;
color: #da4f49;
}
.job-event-status,
.license-status {
padding-top: 5px;
}
.job-new,
input[type="text"].job-new,
.job-canceled,
input[type="text"].job-canceled {
color: #778899;
}
.job-pending,
.job-running,
.job-success,
.job-successful,
.active-failures-false,
.license-valid,
input[type="text"].job-success,
input[type="text"].job-successful {
color: #5bb75b;
}
.field-success {
color: #5bb75b;
}
.field-success input {
border-color: #5bb75b;
}
.field-failure {
color: #FF0000;
}
.field-failure input {
border-color: #FF0000;
}
.job-changed,
.license-warning,
.license-demo {
color: #FF9900;
}
.job-detail-status {
display: inline-block;
margin-top: 5px;
font-size: 15px;
font-weight: bold;
}
.form-items .search-widget {
margin-top: 15px;
}
.form-items .item-count {
display: inline-block;
margin-top: 25px;
font-size: small;
}
.child-event a {
color: #171717;
cursor: default;
}
.level-1 {
padding-left: 24px;
}
.level-2 {
padding-left: 48px;
}
.level-3 {
padding-left: 72px;
}
.level-3-detail {
padding-left: 72px;
}
#job_events .control-group {
margin-top: 0;
margin-bottom: 10px;
}
/* End Jobs Page */
/* Inventory detail */
.inventory-content {
padding: 15px;
border: 1px solid #ddd;
border-radius: 6px;
}
.groups-menu {
min-height: 30px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 6px;
}
.groups-menu .navbar-brand {
color: ;
}
.inventory-title {
margin-top: 15px;
font-weight: bold;
color: #0088cc;
}
.inventory-buttons {
text-align: right;
background-color: #f5f5f5;
border-top: 1px solid #e3e3e3;
border-right: 1px solid #e3e3e3;
border-left: 1px solid #e3e3e3;
-webkit-border-top-right-radius: 4px;
-moz-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-top-left-radius: 4px;
border-top-left-radius: 4px;
}
.inventory-buttons button {
margin: 5px 5px 3px 0;
}
.inventory-filter {
padding: 0 3px 3px 3px;
text-align: right;
background-color: #f5f5f5;
border-right: 1px solid #e3e3e3;
border-bottom: 1px solid #e3e3e3;
border-left: 1px solid #e3e3e3;
-webkit-border-bottom-right-radius: 4px;
-moz-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.inventory-filter label {
margin-right: 10px;
}
.hosts-well {
padding-top: 5px;
}
.hosts-title p {
font-size: 12px;
}
.hosts-title h4 {
margin: 5px 0;
}
.hosts-well .search-widget {
margin-top: 10px;
}
.hosts-well .list-actions {
padding-top: 10px;
}
.parse-selection {
display: inline-block;
margin: 5px 0 8px 0;
font-size: 12px;
line-height: normal;
}
.parse-selection input {
margin-left: 5px;
}
.parse-select .parse-label {
margin-left: 3px;
}
#tree-view {
min-height: 100px;
}
.slider {
display: inline-block;
width: 100px;
margin: 0 10px;
vertical-align: middle;
}
/* Sort link styles */
.list-header:hover {
cursor: pointer;
}
.list-header i {
margin-left: 10px;
}
.list-header .icon-sort {
color: #ccc;
}
.list-header .icon-sort-down,
.list-header .icon-sort-up {
color: #171717;
}
/* job_events syles */
tr td i {
float: none;
padding-top: 3px;
padding-left: 0;
margin-right: 10px;
margin-left: 0;
}
tr td button i {
padding-top: 0;
margin-right: 0;
}
.event-form {
margin-top: 10px;
margin-bottom: 5px;
}
.event-detail-host {
padding-top: 10px;
padding-bottom: 5px;
}
.form-section-title {
width: 100%;
margin-top: 0;
margin-bottom: 10px;
font-weight: bold;
border-bottom: 1px solid #d8d8d8;
}
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.6;
filter: alpha(opacity=60);
}
.modal-body .ui-accordion .ui-accordion-content {
padding: 10px;
}
/* overrides to TB modal */
.modal-header {
padding: 15px 10px;
color: #2078be;
border-bottom: 1px solid #eee;
-webkit-border-top-right-radius: 3px;
-moz-border-top-right-radius: 3px;
border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
-moz-border-top-left-radius: 3px;
border-top-left-radius: 3px;
}
.modal {
border: 1px solid #171717;
}
.close {
color: #A9A9A9;
opacity: .7;
filter: alpha(opacity=70);
}
.modal-header h3 {
margin: 0;
font-size: 22px;
font-weight: bold;
text-rendering: optimizeLegibility;
}
.modal-body {
padding-top: 30px;
}
#prompt-modal .modal-body {
padding-bottom: 30px;
}
.skinny-modal .modal-body {
padding: 5px 10px 0 10px;
}
/* form navigation */
.navigation-buttons {
height: 40px;
}
/* Large desktop */
@media (min-width: 1200px) {
}
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) {
}
/* Landscape phone to portrait tablet */
@media (max-width: 767px) {
/* Job events */
.level-1,
.level-2,
.level-3,
.level-3-detail {
padding-left: 0;
}
table {
word-wrap: break-word;
table-layout: fixed;
}
}

View File

@ -46,27 +46,34 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
this.mode = options.mode;
this.modal = (options.modal) ? true : false;
this.setForm(form);
element.html(this.build(options)); // Inject the html
// Inject the html
if (options.buildTree) {
element.html(this.buildTree(options));
}
else {
element.html(this.build(options));
}
this.scope = element.scope(); // Set scope specific to the element we're compiling, avoids circular reference
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
$compile(element)(this.scope);
// Reset the scope to prevent displaying old data from our last visit to this form
for (var fld in form.fields) {
this.scope[fld] = null;
}
for (var set in form.related) {
this.scope[set] = null;
}
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
this.addListeners();
}
if (options.mode == 'add') {
this.applyDefaults();
if (options.buildTree == undefined || options.buildTree == false) {
// Reset the scope to prevent displaying old data from our last visit to this form
for (var fld in form.fields) {
this.scope[fld] = null;
}
for (var set in form.related) {
this.scope[set] = null;
}
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
this.addListeners();
}
if (options.mode == 'add') {
this.applyDefaults();
}
}
// Remove any lingering tooltip <div> elements
@ -622,6 +629,22 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
return html;
},
breadCrumbs: function(options) {
var html = '';
html += "<div class=\"nav-path\">\n";
html += "<ul class=\"breadcrumb\">\n";
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n";
html += "<li class=\"active\">";
if (options.mode == 'edit') {
html += this.form.editTitle;
}
else {
html += this.form.addTitle;
}
html += "</li>\n</ul>\n</div>\n";
return html;
},
build: function(options) {
//
// Generate HTML. Do NOT call this function directly. Called by inject(). Returns an HTML
@ -630,18 +653,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
var html = '';
if (!this.modal) {
//Breadcrumbs
html += "<div class=\"nav-path\">\n";
html += "<ul class=\"breadcrumb\">\n";
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n";
html += "<li class=\"active\">";
if (options.mode == 'edit') {
html += this.form.editTitle;
}
else {
html += this.form.addTitle;
}
html += "</li>\n</ul>\n</div>\n";
html += this.breadCrumbs(options);
}
if ((!this.modal && this.form.statusFields)) {
@ -872,14 +884,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += "</div><!-- well -->\n";
}
}
if (this.form.name == 'inventory' && options.mode == 'edit') {
html += this.buildTree(options);
}
else {
if ((!this.modal) && options.related && this.form.related) {
html += this.buildCollections(options);
}
if ((!this.modal) && options.related && this.form.related) {
html += this.buildCollections(options);
}
return html;
@ -890,163 +897,155 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
//
// Used to create the inventory detail view
//
var idx = 1;
var form = this.form;
var itm = "groups";
/* var html = "<div class=\"accordion-group\">\n";
html += "<div class=\"accordion-heading\">\n";
html += "<a id=\"" + form.name + "-collapse-2\" class=\"accordion-toggle\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse2\">";
html += "<i class=\"icon-angle-up icon-white\"></i>Inventory Content</a>\n";
html += "</div>\n";
html += "<div id=\"collapse2\" class=\"accordion-body collapse in\">\n";
html += "<div class=\"accordion-inner\">\n";
*/
html = "<div id=\"" + this.form.name + "-collapse-2\" data-open=\"true\" class=\"jqui-accordion\">\n";
html += "<h3>Inventory Content<h3>\n";
html += "<div class=\"row\">\n";
html = this.breadCrumbs(options);
for (var itm in form.related) {
if (form.related[itm].type == 'tree') {
html += "<div class=\"col-lg-5\">";
html += "<div class=\"inventory-buttons\">";
html += "<button ng-click=\"editGroup()\" ng-hide=\"groupEditHide\" id=\"inv-group-edit\" class=\"btn btn-default btn-mini\" " +
"aw-tool-tip=\"Edit the selected group\" data-placement=\"bottom\">" +
"<i class=\"icon-edit\"></i> Edit</button>";
html += "<button ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" id=\"inv-group-add\" " +
"class=\"btn btn-mini btn-success\" aw-tool-tip=\"Add a new group\" " +
"data-placement=\"bottom\"><i class=\"icon-plus\"></i> Add</button>";
html += "<button ng-click=\"deleteGroup()\" ng-hide=\"groupDeleteHide\" id=\"inv-group-delete\" " +
"aw-tool-tip=\"Delete the selected group\" data-placement=\"bottom\" " +
"class=\"btn btn-mini btn-danger\">" +
"<i class=\"icon-trash\"></i> Delete</button>";
html += "</div>\n";
html += "<div id=\"tree-view\" class=\"tree-container\"></div>\n";
html += "<div class=\" inventory-filter\">";
html += "<span ng-show=\"has_active_failures == true\"><label class=\"checkbox inline\">";
html += "<input ng-model=\"inventoryFailureFilter\" ng-change=\"filterInventory()\" type=\"checkbox\"" +
">Show only groups with failures</label></span></div>\n";
html += "</div>\n";
html += "<div class=\"inventory-content\">\n";
html += "<ul class=\"nav nav-tabs\" id=\"inventory-tabs\">\n";
html += "<li><a href=\"#inventory-groups\" data-toggle=\"tab\">Groups</a></li>\n";
html += "<li><a href=\"#inventory-hosts\" data-toggle=\"tab\">Hosts</a></li>\n";
html += "</ul>\n";
html += "<div class=\"tab-content\">\n";
html += "<div class=\"tab-pane active\" id=\"inventory-groups\">\n";
// build the groups tab
html += "<div class=\"navbar groups-menu\">\n";
html += "<a class=\"navbar-brand\" ng-bind=\"selectedNodeName\" href=\"\"></a>\n";
html += "<ul class=\"nav navbar-nav\">\n";
html += "<li><a href=\"\" ng-click=\"editGroup()\" ng-hide=\"groupEditHide\" " +
"aw-tool-tip=\"Edit the selected group\" data-placement=\"bottom\"><i class=\"icon-edit\"></i> Edit</a></li>\n";
html += "<li><a href=\"\" ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" " +
"aw-tool-tip=\"Add a new group\" data-placement=\"bottom\"><i class=\"icon-plus\"></i> Add</a></li>\n";
html += "<li><a href=\"\" ng-click=\"deleteGroup()\" ng-hide=\"groupDeleteHide\" " +
"aw-tool-tip=\"Delete the group\" data-placement=\"bottom\"><i class=\"icon-trash\"></i> Delete</a></li>\n";
html += "</ul>\n";
html += "</div><!-- navbar -->\n";
html += "<div id=\"tree-view\" class=\"tree-container\"></div>\n";
//html += "<span ng-show=\"has_active_failures == true\"><label class=\"checkbox inline\">";
//html += "<input ng-model=\"inventoryFailureFilter\" ng-change=\"filterInventory()\" type=\"checkbox\"" +
// ">Show only groups with failures</label></span></div>\n";
html += "</div><!-- inventory-groups -->\n";
// build the hosts tab
itm = "hosts";
html += "<div class=\"tab-pane\" id=\"inventory-hosts\">\n";
html += "<div class=\"hosts-well well\">\n";
html += "<div class=\"hosts-title\" ng-bind-html-unsafe=\"" + form.related[itm].title + "\"></div>\n";
html += SearchWidget({ iterator: form.related[itm].iterator, template: form.related[itm], mini: true, size: 'col-lg-6'});
// Add actions(s)
for (var action in form.related[itm].actions) {
html += "<button type=\"button\" class=\"btn btn-mini ";
html += (form.related[itm].actions[action]['class']) ? form.related[itm].actions[action]['class'] : "btn-success";
html += "\" ";
html += (form.related[itm]['actions'][action].id) ? this.attr(form.related[itm]['actions'][action],'id') : "";
html += this.attr(form.related[itm]['actions'][action],'ngClick');
html += (form.related[itm]['actions'][action].awToolTip) ? this.attr(form.related[itm]['actions'][action],'awToolTip') : "";
html += (form.related[itm]['actions'][action].awToolTip) ? "data-placement=\"top\" " : "";
html += (form.related[itm]['actions'][action].ngHide) ? this.attr(form.related[itm]['actions'][action],'ngHide') : "";
html += "><i class=\"" + form.related[itm]['actions'][action].icon + "\"></i>";
html += (form.related[itm]['actions'][action].label) ? " " + form.related[itm]['actions'][action].label : "";
html += "</button>\n";
}
html += "</div><!-- row -->\n";
// Start the list
html += "<div class=\"list\">\n";
html += "<table class=\"" + form.related[itm].iterator + " table table-condensed table-hover\">\n";
html += "<thead>\n";
html += "<tr>\n";
html += "<th>#</th>\n";
for (var fld in form.related[itm].fields) {
html += "<th class=\"list-header\" id=\"" + form.related[itm].iterator + '-' + fld + "-header\" " +
"ng-click=\"sort('" + form.related[itm].iterator + "', '" + fld + "')\">" +
form.related[itm]['fields'][fld].label;
html += " <i class=\"";
if (form.related[itm].fields[fld].key) {
if (form.related[itm].fields[fld].desc) {
html += "icon-sort-down";
}
else {
html += "icon-sort-up";
}
}
else {
html += "<div id=\"group-view\" class=\"col-lg-7\">\n";
html += "<div class=\"hosts-well well\">\n";
html += "<div class=\"hosts-title\" ng-bind-html-unsafe=\"" + form.related[itm].title + "\"></div>\n";
html += SearchWidget({ iterator: form.related[itm].iterator, template: form.related[itm], mini: true, size: 'col-lg-6'});
// Add actions(s)
//html += "<div class=\"list-actions\">\n";
html += "<div class=\"col-lg-5\">\n";
for (var action in form.related[itm].actions) {
html += "<button type=\"button\" class=\"btn btn-mini ";
html += (form.related[itm].actions[action]['class']) ? form.related[itm].actions[action]['class'] : "btn-success";
html += "\" ";
html += (form.related[itm]['actions'][action].id) ? this.attr(form.related[itm]['actions'][action],'id') : "";
html += this.attr(form.related[itm]['actions'][action],'ngClick');
html += (form.related[itm]['actions'][action].awToolTip) ? this.attr(form.related[itm]['actions'][action],'awToolTip') : "";
html += (form.related[itm]['actions'][action].awToolTip) ? "data-placement=\"top\" " : "";
html += (form.related[itm]['actions'][action].ngHide) ? this.attr(form.related[itm]['actions'][action],'ngHide') : "";
html += "><i class=\"" + form.related[itm]['actions'][action].icon + "\"></i>";
html += (form.related[itm]['actions'][action].label) ? " " + form.related[itm]['actions'][action].label : "";
html += "</button>\n";
}
html += "</div>\n";
html += "</div><!-- row -->\n";
// Start the list
html += "<div class=\"list\">\n";
html += "<table class=\"" + form.related[itm].iterator + " table table-condensed table-hover\">\n";
html += "<thead>\n";
html += "<tr>\n";
html += "<th>#</th>\n";
for (var fld in form.related[itm].fields) {
html += "<th class=\"list-header\" id=\"" + form.related[itm].iterator + '-' + fld + "-header\" " +
"ng-click=\"sort('" + form.related[itm].iterator + "', '" + fld + "')\">" +
form.related[itm]['fields'][fld].label;
html += " <i class=\"";
if (form.related[itm].fields[fld].key) {
if (form.related[itm].fields[fld].desc) {
html += "icon-sort-down";
}
else {
html += "icon-sort-up";
}
}
else {
html += "icon-sort";
}
html += "\"></i></a></th>\n";
}
html += "<th></th>\n";
html += "</tr>\n";
html += "</thead>";
html += "<tbody>\n";
html += "<tr ng-repeat=\"" + form.related[itm].iterator + " in " + itm + "\" >\n";
html += "<td>{{ $index + (" + form.related[itm].iterator + "Page * " +
form.related[itm].iterator + "PageSize) + 1 }}.</td>\n";
var cnt = 1;
var rfield;
var base = (form.related[itm].base) ? form.related[itm].base : itm;
base = base.replace(/^\//,'');
for (var fld in form.related[itm].fields) {
cnt++;
rfield = form.related[itm].fields[fld];
html += Column({ list: form.related[itm], fld: fld, options: options, base: base })
}
// Row level actions
html += "<td class=\"actions\">";
for (action in form.related[itm].fieldActions) {
html += "<button class=\"btn btn-mini";
html += (form.related[itm]['fieldActions'][action]['class']) ?
" " + form.related[itm]['fieldActions'][action]['class'] : "";
html += "\" ";
html += (form.related[itm]['fieldActions'][action].awToolTip) ? this.attr(form.related[itm]['fieldActions'][action],'awToolTip') : "";
html += (form.related[itm]['fieldActions'][action].ngHide) ? this.attr(form.related[itm]['fieldActions'][action],'ngHide') : "";
html += this.attr(form.related[itm]['fieldActions'][action],'ngClick') +
">" + this.icon(form.related[itm]['fieldActions'][action].icon);
html += (form.related[itm].fieldActions[action].label) ? " " + form.related[itm].fieldActions[action].label : "";
html += "</button> ";
}
html += "</td>";
html += "</tr>\n";
// Message for when a related collection is empty
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == false && (" + itm + " == null || " + itm + ".length == 0)\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">No records matched your search.</div></td>\n";
html += "</tr>\n";
// Message for loading
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == true\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">Loading...</div></td>\n";
html += "</tr>\n";
// End List
html += "</tbody>\n";
html += "</table>\n";
// Failure filter checkbox
html += "<div class=\"host-filter\">\n";
html += "<span ng-show=\"has_active_failures == true\">";
html += "<label class=\"checkbox inline\">";
html += "<input ng-model=\"hostFailureFilter\" ng-change=\"filterHosts()\" type=\"checkbox\"" +
">Show only hosts with failures</label></span>\n"
html += "</div>\n";
html += "</div>\n"; // close well
html += "</div>\n"; // close group-view
html += PaginateWidget({ set: itm, iterator: form.related[itm].iterator, mini: true });
html += "icon-sort";
}
idx++;
}
html += "</div>\n";
html += "</div>\n";
//html += "</div>\n";
return html;
},
html += "\"></i></a></th>\n";
}
html += "<th></th>\n";
html += "</tr>\n";
html += "</thead>";
html += "<tbody>\n";
html += "<tr ng-repeat=\"" + form.related[itm].iterator + " in " + itm + "\" >\n";
html += "<td>{{ $index + (" + form.related[itm].iterator + "Page * " +
form.related[itm].iterator + "PageSize) + 1 }}.</td>\n";
var cnt = 1;
var rfield;
var base = (form.related[itm].base) ? form.related[itm].base : itm;
base = base.replace(/^\//,'');
for (var fld in form.related[itm].fields) {
cnt++;
rfield = form.related[itm].fields[fld];
html += Column({ list: form.related[itm], fld: fld, options: options, base: base })
}
// Row level actions
html += "<td class=\"actions\">";
for (action in form.related[itm].fieldActions) {
html += "<button class=\"btn btn-mini";
html += (form.related[itm]['fieldActions'][action]['class']) ?
" " + form.related[itm]['fieldActions'][action]['class'] : "";
html += "\" ";
html += (form.related[itm]['fieldActions'][action].awToolTip) ? this.attr(form.related[itm]['fieldActions'][action],'awToolTip') : "";
html += (form.related[itm]['fieldActions'][action].ngHide) ? this.attr(form.related[itm]['fieldActions'][action],'ngHide') : "";
html += this.attr(form.related[itm]['fieldActions'][action],'ngClick') +
">" + this.icon(form.related[itm]['fieldActions'][action].icon);
html += (form.related[itm].fieldActions[action].label) ? " " + form.related[itm].fieldActions[action].label : "";
html += "</button> ";
}
html += "</td>";
html += "</tr>\n";
// Message for when a related collection is empty
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == false && (" + itm + " == null || " + itm + ".length == 0)\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">No records matched your search.</div></td>\n";
html += "</tr>\n";
// Message for loading
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == true\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">Loading...</div></td>\n";
html += "</tr>\n";
// End List
html += "</tbody>\n";
html += "</table>\n";
// Failure filter checkbox
//html += "<div class=\"host-filter\">\n";
//html += "<span ng-show=\"has_active_failures == true\">";
//html += "<label class=\"checkbox inline\">";
//html += "<input ng-model=\"hostFailureFilter\" ng-change=\"filterHosts()\" type=\"checkbox\"" +
// ">Show only hosts with failures</label></span>\n"
//html += "</div>\n";
html += "</div>\n"; // close list
html += "</div>\n"; // close well
html += PaginateWidget({ set: itm, iterator: form.related[itm].iterator, mini: true });
html += "</div><!-- inventory-hosts -->\n";
html += "</div><!-- tab-content -->\n";
html += "</div><!-- inventory-content -->\n";
return html;
},
buildCollections: function(options) {
//

View File

@ -266,20 +266,20 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
html += (useMini) ? " related-footer" : "";
html += "\">\n";
html += "<form class=\"form-inline\">\n";
html += "<button class=\"previous btn";
html += "<button class=\"previous btn btn-light";
html += (useMini) ? " btn-mini\" " : "\" ";
html += "ng-click=\"prevSet('" + set + "','" + iterator + "')\" " +
"ng-disabled=\"" + iterator + "PrevUrl == null || " + iterator + "PrevUrl == undefined\"><i class=\"icon-chevron-left\"></i> Prev</button>\n";
html += "<button class=\"next btn btn";
"ng-disabled=\"" + iterator + "PrevUrl == null || " + iterator + "PrevUrl == undefined\"><i class=\"icon-caret-left\"></i> Prev</button>\n";
html += "<button class=\"next btn btn-light";
html += (useMini) ? " btn-mini\" " : "\" ";
html += " ng-click=\"nextSet('" + set + "','" + iterator + "')\"" +
"ng-disabled=\"" + iterator + "NextUrl == null || " + iterator + "NextUrl == undefined\">Next <i class=\"icon-chevron-right\"></i></button>\n";
"ng-disabled=\"" + iterator + "NextUrl == null || " + iterator + "NextUrl == undefined\">Next <i class=\"icon-caret-right\"></i></button>\n";
if (mode != 'lookup') {
html += "<label class=\"page-size-label\">Rows per page:</label>\n";
html += "<label class=\"page-size-label\">Rows per page: </label>\n";
html += "<select ng-model=\"" + iterator + "PageSize\" ng-change=\"changePageSize('" +
set + "'," + "'" + iterator + "')\" class=\"input-mini";
html += (useMini) ? " field-mini-height" : "";
//html += (useMini) ? " field-mini-height" : "";
html += " page-size\">\n";
html += "<option value=\"10\" selected>10</option>\n";
html += "<option value=\"20\" selected>20</option>\n";
@ -289,7 +289,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
html += "</select>\n";
}
html += "<div class=\"page-number-small\" ng-show=\"" + iterator + "PageCount > 0\" ";
html += "<div class=\"page-number-small pull-right\" ng-show=\"" + iterator + "PageCount > 0\" ";
html += ">Page: {{ " + iterator + "Page + 1 }} of {{ " + iterator + "PageCount }}</div>\n";
html += "</form>\n";
html += "</div>\n";

View File

@ -6,13 +6,13 @@
#tree-view {
margin: 0;
padding: 0;
padding: 15px;
}
.jstree-ansible {
background-color: #f5f5f5;
border-left: 1px solid #e3e3e3;
border-right: 1px solid #e3e3e3;
border: 1px solid #e3e3e3;
border-radius: 6px;
}
.jstree-ansible li,

View File

@ -7,7 +7,7 @@
<link rel="stylesheet" href="{{ STATIC_URL }}css/custom-theme/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.min.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/font-awesome.min.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/ansible-ui.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/awx.min.css" />
<link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico" />
<script src="{{ STATIC_URL }}js/config.js"></script>
@ -94,7 +94,7 @@
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar navbar-inverse navbar-fixed-top main-menu">
<div class="container">
<a class="navbar-brand" href="#organizations"><img class="logo" src="{{ STATIC_URL }}img/logo.png" /></a>