diff options
author | Chris Church <chris@ninemoreminutes.com> | 2013-05-22 00:20:26 +0200 |
---|---|---|
committer | Chris Church <chris@ninemoreminutes.com> | 2013-05-22 00:20:26 +0200 |
commit | aeac739735f4b503e1e32acbbbe7356c49d212c2 (patch) | |
tree | ee771abca43d29c4cdb11654e69582b43136e935 /ansibleworks/templates | |
parent | Update to production settings to fail if no config found, updates to build sc... (diff) | |
download | awx-aeac739735f4b503e1e32acbbbe7356c49d212c2.tar.xz awx-aeac739735f4b503e1e32acbbbe7356c49d212c2.zip |
Major rename of package from lib to ansibleworks.
Diffstat (limited to 'ansibleworks/templates')
-rw-r--r-- | ansibleworks/templates/admin/base_site.html | 191 | ||||
-rw-r--r-- | ansibleworks/templates/rest_framework/api.html | 81 |
2 files changed, 272 insertions, 0 deletions
diff --git a/ansibleworks/templates/admin/base_site.html b/ansibleworks/templates/admin/base_site.html new file mode 100644 index 0000000000..c99e253c11 --- /dev/null +++ b/ansibleworks/templates/admin/base_site.html @@ -0,0 +1,191 @@ +{# Admin site customizations. #} +{% extends "admin/base.html" %} +{% load i18n %} + +{% block title %}{{ title }} | {% trans 'Ansible Commander Admin' %}{% endblock %} + +{% block extrastyle %} +{{ block.super }} +<link href="{{ STATIC_URL }}favicon.ico" rel="shortcut icon" /> +<style type="text/css"> +/* Heading and button background colors. */ +#header +{ + background: #1778C3 !important; +} +.module h2, +#content-related .module h2, +.module caption, +.inline-group h2, +.button.default, +input[type="submit"].default, +.submit-row input.default +{ + background: #2773ae !important; +} +body +{ + background-color: #f5f5f5; +} + +/* Heading and button foreground colors. */ +#branding h1 +{ + color: white !important; +} +.module h2, +.module h2 a, +#content-related .module h2, +.module caption, +.inline-group h2, +a.section, +a.section:link, +a.section:visited, +a.section:hover, +.button.default, +input[type="submit"].default, +.submit-row input.default +{ + color: white !important; +} + +/* Link color. */ +a, +a:link, +a:visited, +#changelist-filter a:hover, +a:hover +{ + color: #2773ae; +} + +/* Button border color. */ +.button.default, +input[type="submit"].default, +.submit-row input.default, +.selector h2 +{ + border-color: #074979 !important; +} +#header { + color: #ddd; + border-bottom: solid 2px #074979; +} + +a:hover, +a.section:hover +{ + text-decoration: underline; +} + +tr.row1 { + background-color: #f5f5f5; +} + +ul.messagelist li { + background-color: #ccddee; +} +.errornote { + border-color: #b22222 !important; + color: #b22222 !important; + background-color: #fdc !important; +} +.errorlist li { + border-color: #b22222 !important; + background-color: #d24242 !important; +} +.errors { + background-color: #fdc !important; +} +.errors input, +.errors select, +.errors textarea { + border: 1px solid #b22222 !important; +} +pre.json-display, pre.result-display { + display: inline-block; + margin: 0; + padding: 0; + font-size: 0.9em; +} +pre.result-display { + width: 75%; + border: 1px solid #ccc; + background: #444; + color: #eee; + max-height: 300px; + overflow: auto; +} +#job_host_summaries-group table td.original p { + display: none +} +#job_host_summaries-group table tr.has_original td { + padding-top: 5px; +} +</style> +{% endblock %} + +{% block extrahead %} +{{ block.super }} +{% endblock %} + +{% block blockbots %} +{{ block.super }} +<script type="text/javascript"> +var django = django || {}; +if (django.jQuery) { + (function($) { + window.refreshJobStatus = function() { + var status = $('.field-status p').text(); + if (status == 'Running' || status == 'Pending') { + var url = '{{ request.path }}'; + $.get(url, function(data) { + var selectors = [ + '.form-row.field-status', + '.field-get_result_stdout_display pre', + '.field-get_result_stderr_display pre', + '.field-get_result_traceback_display pre', + '.field-get_result_stdout_display pre', + '#job_host_summaries-group', + '#job_events-group', + ] + $.each(selectors, function(index, selector) { + $(selector).html($(data).find(selector).html()); + }); + setTimeout('window.refreshJobStatus()', 5000); + }); + } + } + // Update playbook list based on project selected. + function onProjectChange() { + var project_pk = $('select[name="project"]').val() || 0; + $('select[name="playbook"] span option').unwrap(); + $('select[name="playbook"] option:not(.project-' + project_pk + '):not([value=""])').wrap('<span/>'); + } + $(function() { + $('select[name="project"]').each(onProjectChange).change(onProjectChange); + }) + setTimeout('window.refreshJobStatus()', 2000); + })(django.jQuery); +} +</script> +{% endblock %} + +{% block branding %} +<h1 id="site-name">{% trans 'Ansible Commander Admin' %}</h1> +{% endblock %} + +{% block userlinks %} +{{ block.super }} +{% endblock %} + +{% block nav-global %} +{% if user.is_active and user.is_staff and not is_popup %} +{# Placeholder for version/hostname info. #} +{% endif %} +{{ block.super }} +{% endblock %} + +{% block content_title %} +{{ block.super }} +{% endblock %} diff --git a/ansibleworks/templates/rest_framework/api.html b/ansibleworks/templates/rest_framework/api.html new file mode 100644 index 0000000000..61057cdc14 --- /dev/null +++ b/ansibleworks/templates/rest_framework/api.html @@ -0,0 +1,81 @@ +{% extends 'rest_framework/base.html' %} +{% load i18n %} + +{% block title %}{% trans 'Ansible Commander API' %}{% endblock %} + +{% block style %} +{{ block.super }} +<link href="{{ STATIC_URL }}favicon.ico" rel="shortcut icon" /> +<style type="text/css"> +html body { + background: #ddd; +} +html body .navbar .navbar-inner { + background: #1778c3; + border-top: none; + border-bottom: solid 3px #074979; + height: 20px; +} +html body .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, +html body .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, +html body .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { + background-color: #074979; +} +html body .navbar-inverse .brand a, +span.powered-by .version { + color: #ddd; +} +span.powered-by { + font-size: 75%; + color: #ddd; +} +html body .navbar .navbar-inner .dropdown-menu li a, +html body .navbar .navbar-inner .dropdown-menu li, +html body .hero-unit h2, +html body .hero-unit h1, +html body a, +html body a { + color: #2773ae; +} +html body .navbar .navbar-inner .dropdown-menu li a:hover, +html body a:hover { + color: #074979; +} +html body .str, +html body .atv { + color: #1778c3; +} +html body .str a { + text-decoration: underline; +} +</style> +{% endblock %} + +{% block branding %} + {% trans 'Ansible Commander API' %} + <span class="powered-by">({% trans 'powered by' %} {{ block.super }})</span> +{% endblock %} + +{% block userlinks %} + {% if user.is_authenticated %} + <li> + <a href="/api/v1/me/">{{ user }}</a> + </li> + {% endif %} +{% endblock %} + +{% block script %} +{{ block.super }} +<script type="text/javascript"> +$(function() { + // Make linkes from relative URLs to resources. + $('span.str').each(function() { + var s = $(this).html(); + if (s.match(/^\"\/.+\/\"$/) || s.match(/^\"\/.+\/\?.*\"$/)) { + $(this).html('"<a href=' + s + '>' + s.replace(/\"/g, '') + '</a>"'); + } + }); + $('.btn-primary').removeClass('btn-primary').addClass('btn-success'); +}); +</script> +{% endblock %} |