From 9a85bd0edb6ce55fd3ab37cd480ae19567b7be00 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 9 Mar 2019 23:18:35 -0600 Subject: [PATCH] Add basic 'dodo' theme definitely not complete, but a decent feature preview --- tailbone/static/themes/dodo/css/admin.css | 84 ++++++++ tailbone/static/themes/dodo/css/base.css | 11 ++ tailbone/static/themes/dodo/js/bulma.js | 12 ++ tailbone/templates/themes/dodo/base.mako | 231 ++++++++++++++++++++++ 4 files changed, 338 insertions(+) create mode 100644 tailbone/static/themes/dodo/css/admin.css create mode 100644 tailbone/static/themes/dodo/css/base.css create mode 100644 tailbone/static/themes/dodo/js/bulma.js create mode 100644 tailbone/templates/themes/dodo/base.mako diff --git a/tailbone/static/themes/dodo/css/admin.css b/tailbone/static/themes/dodo/css/admin.css new file mode 100644 index 00000000..a362b64f --- /dev/null +++ b/tailbone/static/themes/dodo/css/admin.css @@ -0,0 +1,84 @@ +/* copied from https://github.com/dansup/bulma-templates/blob/master/css/admin.css */ + +html, body { + font-family: 'Open Sans', serif; + font-size: 16px; + line-height: 1.5; + height: 100%; + background: #ECF0F3; +} +nav.navbar { + border-top: 4px solid #276cda; + margin-bottom: 1rem; +} +.navbar-item.brand-text { + font-weight: 300; +} +.navbar-item, .navbar-link { + font-size: 14px; + font-weight: 700; +} +.columns { + width: 100%; + height: 100%; + margin-left: 0; +} +.menu-label { + color: #8F99A3; + letter-spacing: 1.3; + font-weight: 700; +} +.menu-list a { + color: #0F1D38; + font-size: 14px; + font-weight: 700; +} +.menu-list a:hover { + background-color: transparent; + color: #276cda; +} +.menu-list a.is-active { + background-color: transparent; + color: #276cda; + font-weight: 700; +} +.card { + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.18); + margin-bottom: 2rem; +} +.card-header-title { + color: #8F99A3; + font-weight: 400; +} +.info-tiles { + margin: 1rem 0; +} +.info-tiles .subtitle { + font-weight: 300; + color: #8F99A3; +} +.hero.welcome.is-info { + background: #36D1DC; + background: -webkit-linear-gradient(to right, #5B86E5, #36D1DC); + background: linear-gradient(to right, #5B86E5, #36D1DC); +} +.hero.welcome .title, .hero.welcome .subtitle { + color: hsl(192, 17%, 99%); +} +.card .content { + font-size: 14px; +} +.card-footer-item { + font-size: 14px; + font-weight: 700; + color: #8F99A3; +} +.card-footer-item:hover { +} +.card-table .table { + margin-bottom: 0; +} +.events-card .card-table { + max-height: 250px; + overflow-y: scroll; +} \ No newline at end of file diff --git a/tailbone/static/themes/dodo/css/base.css b/tailbone/static/themes/dodo/css/base.css new file mode 100644 index 00000000..27f44c9f --- /dev/null +++ b/tailbone/static/themes/dodo/css/base.css @@ -0,0 +1,11 @@ + +/****************************** + * tweaks for root user + ******************************/ + +.navbar .navbar-menu .navbar-link.root-user, +.navbar .navbar-menu .navbar-item.root-user, +.navbar.is-white .navbar-item.has-dropdown.is-active .navbar-link.root-user, +.navbar.is-white .navbar-item.has-dropdown:hover .navbar-link.root-user { + background-color: red; +} diff --git a/tailbone/static/themes/dodo/js/bulma.js b/tailbone/static/themes/dodo/js/bulma.js new file mode 100644 index 00000000..a2e2dc9a --- /dev/null +++ b/tailbone/static/themes/dodo/js/bulma.js @@ -0,0 +1,12 @@ +// copied from https://github.com/dansup/bulma-templates/blob/master/js/bulma.js + +// The following code is based off a toggle menu by @Bradcomp +// source: https://gist.github.com/Bradcomp/a9ef2ef322a8e8017443b626208999c1 +(function() { + var burger = document.querySelector('.burger'); + var menu = document.querySelector('#'+burger.dataset.target); + burger.addEventListener('click', function() { + burger.classList.toggle('is-active'); + menu.classList.toggle('is-active'); + }); +})(); diff --git a/tailbone/templates/themes/dodo/base.mako b/tailbone/templates/themes/dodo/base.mako new file mode 100644 index 00000000..21910d79 --- /dev/null +++ b/tailbone/templates/themes/dodo/base.mako @@ -0,0 +1,231 @@ +## -*- coding: utf-8; -*- +## largely copied from https://github.com/dansup/bulma-templates/blob/master/templates/admin.html +## <%namespace file="/feedback_dialog.mako" import="feedback_dialog" /> +<%namespace name="base_meta" file="/base_meta.mako" /> + + + + + ## + + ${base_meta.global_title()} » ${capture(self.title)|n} + + + + + + ${h.stylesheet_link(request.static_url('tailbone:static/themes/dodo/css/admin.css') + '?ver={}'.format(tailbone.__version__))} + + ${h.stylesheet_link(request.static_url('tailbone:static/themes/dodo/css/base.css') + '?ver={}'.format(tailbone.__version__))} + + % if background_color: + + % endif + + % if not request.rattail_config.production(): + + % endif + + ${h.javascript_link('https://code.jquery.com/jquery-1.12.4.min.js')} + + + + + + + + + + +
+
+
+ +
+
+ +
+ + % 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} +
+ % endfor + % endif + + ${self.body()} + +
+ +
+
+
+ + + + + +<%def name="title()"> + +<%def name="content_title()"> + ${self.title()} +