diff --git a/TODO.md b/TODO.md index 7089dcaf..e8d48968 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,6 @@ TODO ==== * scape strings before executing scripts in order to prevent exploits: django templates automatically scapes things. Most important is to ensuer that all escape ' to " -* Optimize SSH: pool, `UseDNS no` * Don't store passwords and other service parameters that can be changed by the services i.e. mailman, vps etc. Find an execution mechanism that trigger `change_password()` * abort transaction on orchestration when `state == TIMEOUT` ? @@ -119,7 +118,6 @@ Remember that, as always with QuerySets, any subsequent chained methods which im * delete main user -> delete account or prevent delete main user -* https://blog.flameeyes.eu/2011/01/mostly-unknown-openssh-tricks * Ansible orchestration *method* (methods.py) * pip upgrade or install * multiple domains creation; line separated domains @@ -151,4 +149,8 @@ textwrap.dedent( \\) * accounts * short name / long name * contact inlines - * autocreate stuff (email/.orchestra.lan) + * autocreate stuff (email/.orchestra.lan/plans) + * account username should be domain freiendly withot lines + + +* parmiko write to a channel instead of transfering files? http://sysadmin.circularvale.com/programming/paramiko-channel-hangs/ diff --git a/docs/images/index-screenshot.png b/docs/images/index-screenshot.png new file mode 100644 index 00000000..a28827c9 Binary files /dev/null and b/docs/images/index-screenshot.png differ diff --git a/docs/services.svg b/docs/images/services.svg similarity index 100% rename from docs/services.svg rename to docs/images/services.svg diff --git a/orchestra/admin/menu.py b/orchestra/admin/menu.py index b330de2f..47776fc3 100644 --- a/orchestra/admin/menu.py +++ b/orchestra/admin/menu.py @@ -1,8 +1,11 @@ from admin_tools.menu import items, Menu from django.core.urlresolvers import reverse +from django.utils.encoding import force_text from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ +from django.utils.safestring import mark_safe +from orchestra import get_version, settings from orchestra.core import services, accounts from orchestra.utils.apps import isinstalled @@ -103,17 +106,26 @@ def get_administration_items(): return childrens + class OrchestraMenu(Menu): + template = 'admin/orchestra/menu.html' + def init_with_context(self, context): - self.children += [ - items.MenuItem( - _('Dashboard'), - reverse('admin:index') - ), - items.Bookmarks(), + self.children = [ +# items.MenuItem( +# mark_safe('{site_name} v{version}'.format( +# site_name=force_text(settings.SITE_VERBOSE_NAME), +# version_style="text-transform:none; float:none; font-size:smaller; background:none;", +# version=get_version())), +# reverse('admin:index') +# ), +# items.MenuItem( +# _('Dashboard'), +# reverse('admin:index') +# ), +# items.Bookmarks(), items.MenuItem( _("Services"), - reverse('admin:index'), children=get_services() ), items.MenuItem( @@ -125,5 +137,5 @@ class OrchestraMenu(Menu): _("Administration"), children=get_administration_items() ), - items.MenuItem("API", api_link(context)) + items.MenuItem("API", api_link(context)), ] diff --git a/orchestra/static/admin_tools/css/theming.css b/orchestra/static/admin_tools/css/theming.css index 2ab98cbe..a1f90bee 100644 --- a/orchestra/static/admin_tools/css/theming.css +++ b/orchestra/static/admin_tools/css/theming.css @@ -1,7 +1,7 @@ /** * theming styles * - */ +**/ #header { background: url(../images/admin-tools.png) 0 0 repeat-x; diff --git a/orchestra/static/orchestra/css/adminextraprettystyle.css b/orchestra/static/orchestra/css/adminextraprettystyle.css index 258a7fab..69ffa6e3 100644 --- a/orchestra/static/orchestra/css/adminextraprettystyle.css +++ b/orchestra/static/orchestra/css/adminextraprettystyle.css @@ -5,7 +5,7 @@ body { #header #branding h1 { margin: 0; - padding: 2px 10px; + padding: 2px 15px; background: transparent url(/static/orchestra/images/orchestra-logo.png) 10px 2px no-repeat; text-indent: 0; height: 31px; @@ -13,6 +13,7 @@ body { /* font-weight: bold;*/ padding-left: 50px; line-height: 30px; + border-right: 1px solid #ededed; } #branding h1, #branding h1 a:link, #branding h1 a:visited { @@ -35,3 +36,49 @@ body { color: #9B9B9B; } + +#header ul#navigation-menu li.first a { + outline: none; + background: none; + margin: 0; + padding: 10px; +} + + +#header-breadcrumb { + width: 100%; + z-index: -1; + margin-top: 35px; + height: 69px; + position: absolute; + background-attachment: scroll; background-clip: border-box; + background-color: rgb(255, 255, 255); + background-image: url(/static/admin/img/nav-bg-reverse.gif); + background-origin: padding-box; + background-position: 0px -8px; + background-size: auto; + border-bottom-color: rgb(237, 237, 237); + border-bottom-style: solid; + border-bottom-width: 1px; + border-left-color: rgb(153, 153, 153); + border-left-style: none; + border-left-width: 0px; + border-right-color: rgb(153, 153, 153); + border-right-style: none; + border-right-width: 0px; + border-top-color: rgb(153, 153, 153); + border-top-style: none; + border-top-width: 0px; + color: white; + height: 13px; + padding-bottom: 10px; + padding-top: 10px; + background-repeat: repeat-x; + padding-left: 0; + padding-right: 0; +} + +div.breadcrumbs { + max-width: 1150px; + margin: auto; +} diff --git a/orchestra/templates/admin/base.html b/orchestra/templates/admin/base.html index c4bcc98b..dcdf02f5 100644 --- a/orchestra/templates/admin/base.html +++ b/orchestra/templates/admin/base.html @@ -41,43 +41,17 @@
{% block branding %}{% endblock %}
- {% if user.is_active and user.is_staff %} -
- {% trans 'Welcome,' %} - {% url 'admin:users_user_change' user.pk as user_change_url %} - {% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}. - {% block userlinks %} - {% url 'django-admindocs-docroot' as docsroot %} - {% if docsroot %} - {% trans 'Documentation' %} / - {% endif %} - {% url 'admin:password_change' as password_change_url %} - {% if password_change_url %} - - {% else %} - - {% endif %} - {% trans 'Change password' %} / - {% url 'admin:logout' as logout_url %} - {% if logout_url %} - - {% else %} - - {% endif %} - {% trans 'Log out' %} - {% endblock %} -
- {% endif %} {% block nav-global %}{% endblock %} - {% block breadcrumbs %}{% endblock %} +
{% block breadcrumbs %}{% endblock %}
{% endif %} {% block messages %} {% if messages %} {% endif %} {% endblock messages %} diff --git a/orchestra/templates/admin/base_site.html b/orchestra/templates/admin/base_site.html index c19028d0..06c19db4 100644 --- a/orchestra/templates/admin/base_site.html +++ b/orchestra/templates/admin/base_site.html @@ -19,9 +19,8 @@ {% endblock %} {% block branding %} -

{{ SITE_VERBOSE_NAME }} {% version %} + {% endblock %} - {% block nav-global %} {% if user.is_active and user.is_staff %} {% if not is_popup %} diff --git a/orchestra/templates/admin/index.html b/orchestra/templates/admin/index.html index 9c841f69..88b1faa7 100644 --- a/orchestra/templates/admin/index.html +++ b/orchestra/templates/admin/index.html @@ -7,11 +7,8 @@ {% endblock %} {% block title %}{{ SITE_VERBOSE_NAME }}{% endblock %} - -{% block breadcrumb-stetic %}{% endblock %} {% block bodyclass %}dashboard{% endblock %} -{% block breadcrumbs %}{% endblock %} {% block content_title %}{% endblock %} {% block content %} {% admin_tools_render_dashboard %} diff --git a/orchestra/templates/admin/login.html b/orchestra/templates/admin/login.html index 41505d1b..2f87fc48 100644 --- a/orchestra/templates/admin/login.html +++ b/orchestra/templates/admin/login.html @@ -16,6 +16,10 @@ {% block breadcrumbs %}{% endblock %} +{% block branding %} +

{{ SITE_VERBOSE_NAME }} {% version %} +{% endblock %} + {% block content %} {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}

@@ -30,7 +34,6 @@

{% endfor %} {% endif %} -
{% csrf_token %}
diff --git a/orchestra/templates/admin/orchestra/menu.html b/orchestra/templates/admin/orchestra/menu.html new file mode 100644 index 00000000..bb8d91bf --- /dev/null +++ b/orchestra/templates/admin/orchestra/menu.html @@ -0,0 +1,58 @@ +{% load i18n admin_tools_menu_tags %} +{% if menu.children %} + + +{% if has_bookmark_item %} + +{% if bookmark %} +{% include "admin_tools/menu/remove_bookmark_form.html" %} +{% else %} +{% include "admin_tools/menu/add_bookmark_form.html" %} +{% endif %} + +{% endif %} + +{% endif %} +