diff --git a/tailbone/static/css/forms.css b/tailbone/static/css/forms.css index d33f4cc8..b3cec279 100644 --- a/tailbone/static/css/forms.css +++ b/tailbone/static/css/forms.css @@ -54,7 +54,6 @@ div.field-wrapper.error { } div.field-wrapper label { - color: #000000; display: block; float: left; width: 15em; diff --git a/tailbone/static/css/theme-better.css b/tailbone/static/css/theme-better.css new file mode 100644 index 00000000..923cc613 --- /dev/null +++ b/tailbone/static/css/theme-better.css @@ -0,0 +1,120 @@ + +/********************************************************************** + * styles for 'better' theme + **********************************************************************/ + +/**************************************** + * core overrides + ****************************************/ + +a { + color: #0972a5; +} + +.flash-messages, +.error-messages { + margin: 0.5em 0 0 0; +} + +#context-menu { + margin: 0.5em; + white-space: nowrap; +} + +.form { + padding-left: 5em; +} + +.newgrid-wrapper .grid-header #context-menu { + float: none; + margin: 0; +} + +/**************************************** + * header + ****************************************/ + +header .global { + background-color: #eaeaea; + height: 60px; +} + +header .global a.home, +header .global a.global, +header .global span.global { + display: block; + float: left; + font-size: 2em; + font-weight: bold; + line-height: 60px; + margin-left: 10px; +} + +header .global a.home img { + display: block; + float: left; + padding: 5px 5px 5px 30px; +} + +header .global .grid-nav { + display: inline-block; + font-size: 16px; + font-weight: bold; + line-height: 60px; + margin-left: 5em; +} + +header .global .grid-nav .ui-button, +header .global .grid-nav span.viewing { + margin-left: 1em; +} + +header .global .feedback { + float: right; + line-height: 60px; + margin-right: 1em; +} + +header .page h1 { + border-bottom: 1px solid lightgrey; + margin: 0; + padding: 0 0 0 0.5em; +} + +/**************************************** + * content + ****************************************/ + +body > #body-wrapper { + margin: 0px; + position: relative; +} + +.content-wrapper { + height: 100%; + padding-bottom: 30px; +} + +#scrollpane { + height: 100%; +} + +#scrollpane .inner-content { + padding: 0 0.5em 0.5em 0.5em; +} + +/**************************************** + * footer + ****************************************/ + +#footer { + border-top: 1px solid lightgray; + bottom: 0; + font-size: 9pt; + height: 20px; + left: 0; + line-height: 20px; + margin: 0; + position: absolute; + width: 100%; +} diff --git a/tailbone/templates/base.mako b/tailbone/templates/base.mako index 3dcd5621..77b7271f 100644 --- a/tailbone/templates/base.mako +++ b/tailbone/templates/base.mako @@ -135,9 +135,13 @@ ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.js'))} -<%def name="core_styles()"> +<%def name="core_styles(jquery_theme=None)"> ${h.stylesheet_link(request.static_url('tailbone:static/css/normalize.css'))} - ${self.jquery_theme()} + % if jquery_theme: + ${jquery_theme()} + % else: + ${self.jquery_smoothness_theme()} + % endif ${h.stylesheet_link(request.static_url('tailbone:static/css/jquery.ui.menubar.css'))} ${h.stylesheet_link(request.static_url('tailbone:static/css/jquery.loadmask.css'))} ${h.stylesheet_link(request.static_url('tailbone:static/css/jquery.ui.timepicker.css'))} @@ -150,7 +154,7 @@ ${h.stylesheet_link(request.static_url('tailbone:static/css/newgrids.css'))} -<%def name="jquery_theme()"> +<%def name="jquery_smoothness_theme()"> ${h.stylesheet_link('https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.min.css')} diff --git a/tailbone/templates/themes/better/base.mako b/tailbone/templates/themes/better/base.mako new file mode 100644 index 00000000..1c5c21bf --- /dev/null +++ b/tailbone/templates/themes/better/base.mako @@ -0,0 +1,132 @@ +## -*- coding: utf-8 -*- +<%namespace name="base" file="tailbone:templates/base.mako" /> +<%namespace file="/menu.mako" import="main_menu_items" /> +<%namespace file="/newgrids/nav.mako" import="grid_index_nav" /> + + + + + ${self.global_title()} » ${capture(self.title)} + ${self.favicon()} + ${base.core_javascript()} + ${self.extra_javascript()} + ${base.core_styles(jquery_theme=self.jquery_theme)} + ${self.extra_styles()} + + % if not request.rattail_config.production(): + + % endif + + ${self.head_tags()} + + + +
+ +
+ + +
+ + ${self.header_logo()} + ${self.global_title()} + + % if master: + » + % if master.listing: + ${model_title_plural} + % else: + ${h.link_to(model_title_plural, index_url, class_='global')} + % if master.viewing and grid_index: + ${grid_index_nav()} + % endif + % endif + % endif + + + +
+ +
+ ${self.content_title()} +
+
+ +
+ +
+
+
+ + % if request.session.peek_flash('error'): +
+ % for error in request.session.pop_flash('error'): +
+ + ${error} +
+ % endfor +
+ % endif + + % if request.session.peek_flash(): +
+ % for msg in request.session.pop_flash(): +
+ + ${msg|n} +
+ % endfor +
+ % endif + + ${self.body()} + +
+
+
+ +
+ + + +
+ + + + +<%def name="global_title()">${"[STAGE] " if not request.rattail_config.production() else ''}Rattail + +<%def name="content_title()"> +

${self.title()}

+ + +<%def name="favicon()"> + +<%def name="jquery_theme()"> + ${h.stylesheet_link('https://code.jquery.com/ui/1.11.4/themes/dark-hive/jquery-ui.css')} + + +<%def name="extra_javascript()"> + +<%def name="extra_styles()"> + ${h.stylesheet_link(request.static_url('tailbone:static/css/theme-better.css'))} + + +<%def name="head_tags()"> + +<%def name="header_logo()"> + +<%def name="footer()"> + powered by ${h.link_to("Rattail {}".format(rattail.__version__), 'https://rattailproject.org/', target='_blank')} + diff --git a/tailbone/templates/themes/better/master/create.mako b/tailbone/templates/themes/better/master/create.mako new file mode 100644 index 00000000..9070c58e --- /dev/null +++ b/tailbone/templates/themes/better/master/create.mako @@ -0,0 +1,6 @@ +## -*- coding: utf-8 -*- +<%inherit file="tailbone:templates/master/create.mako" /> + +<%def name="context_menu_items()"> + +${parent.body()} diff --git a/tailbone/templates/themes/better/master/edit.mako b/tailbone/templates/themes/better/master/edit.mako new file mode 100644 index 00000000..00803375 --- /dev/null +++ b/tailbone/templates/themes/better/master/edit.mako @@ -0,0 +1,18 @@ +## -*- coding: utf-8 -*- +<%inherit file="tailbone:templates/master/edit.mako" /> + +<%def name="title()">Edit: ${instance_title} + +<%def name="context_menu_items()"> + % if master.viewable and request.has_perm('{}.view'.format(permission_prefix)): +
  • ${h.link_to("View this {}".format(model_title), action_url('view', instance))}
  • + % endif + % if master.deletable and instance_deletable and request.has_perm('{}.delete'.format(permission_prefix)): +
  • ${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}
  • + % endif + % if master.creatable and request.has_perm('{}.create'.format(permission_prefix)): +
  • ${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}
  • + % endif + + +${parent.body()} diff --git a/tailbone/templates/themes/better/master/index.mako b/tailbone/templates/themes/better/master/index.mako new file mode 100644 index 00000000..b1d1d798 --- /dev/null +++ b/tailbone/templates/themes/better/master/index.mako @@ -0,0 +1,6 @@ +## -*- coding: utf-8 -*- +<%inherit file="tailbone:templates/master/index.mako" /> + +<%def name="content_title()"> + +${parent.body()} diff --git a/tailbone/templates/themes/better/master/view.mako b/tailbone/templates/themes/better/master/view.mako new file mode 100644 index 00000000..fb98b980 --- /dev/null +++ b/tailbone/templates/themes/better/master/view.mako @@ -0,0 +1,21 @@ +## -*- coding: utf-8 -*- +<%inherit file="tailbone:templates/master/view.mako" /> + +<%def name="content_title()"> +

    ${instance_title}

    + + +<%def name="context_menu_items()"> +
  • ${h.link_to("Permalink for this {}".format(model_title), action_url('view', instance))}
  • + % if master.editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)): +
  • ${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}
  • + % endif + % if master.deletable and instance_deletable and request.has_perm('{}.delete'.format(permission_prefix)): +
  • ${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}
  • + % endif + % if master.creatable and request.has_perm('{}.create'.format(permission_prefix)): +
  • ${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}
  • + % endif + + +${parent.body()}