From 4b5e4151472f13d5720dcd3c812a7a8af0c72717 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 12 Aug 2017 22:38:23 -0500 Subject: [PATCH] Add show all vs. show diffs for upgrade packages plus some related tweaks --- tailbone/static/css/diffs.css | 3 --- tailbone/templates/forms2/deform.mako | 2 +- tailbone/templates/upgrades/view.mako | 35 +++++++++++++++++++++++++++ tailbone/views/upgrades.py | 10 ++++++-- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/tailbone/static/css/diffs.css b/tailbone/static/css/diffs.css index f76b336d..81a4c8e7 100644 --- a/tailbone/static/css/diffs.css +++ b/tailbone/static/css/diffs.css @@ -10,9 +10,6 @@ table.diff th, table.diff td { border-bottom: 1px solid Black; border-right: 1px solid Black; -} - -table.diff td { padding: 2px 5px; } diff --git a/tailbone/templates/forms2/deform.mako b/tailbone/templates/forms2/deform.mako index afc08096..29d264ea 100644 --- a/tailbone/templates/forms2/deform.mako +++ b/tailbone/templates/forms2/deform.mako @@ -72,7 +72,7 @@ ${h.csrf_token(request)} ## % if form.creating and form.allow_successive_creates: ## ${h.submit('create_and_continue', form.successive_create_label)} ## % endif - ${h.link_to("Cancel", form.cancel_url, class_='button')} + ${h.link_to("Cancel", form.cancel_url, class_='button autodisable')} % endif diff --git a/tailbone/templates/upgrades/view.mako b/tailbone/templates/upgrades/view.mako index d65e874d..e6d2a86e 100644 --- a/tailbone/templates/upgrades/view.mako +++ b/tailbone/templates/upgrades/view.mako @@ -1,6 +1,41 @@ ## -*- coding: utf-8; -*- <%inherit file="/master/view.mako" /> +<%def name="extra_javascript()"> + ${parent.extra_javascript()} + + + ${parent.body()} % if not instance.executed and request.has_perm('{}.execute'.format(permission_prefix)): diff --git a/tailbone/views/upgrades.py b/tailbone/views/upgrades.py index 109aed0c..60d5d484 100644 --- a/tailbone/views/upgrades.py +++ b/tailbone/views/upgrades.py @@ -40,7 +40,7 @@ from rattail.threads import Thread from rattail.upgrades import get_upgrade_handler from deform import widget as dfwidget -from webhelpers2.html import tags +from webhelpers2.html import tags, HTML from tailbone.views import MasterView3 as MasterView from tailbone.progress import SessionProgress, get_progress_session @@ -206,7 +206,13 @@ class UpgradeView(MasterView): columns=["package", "old version", "new version"], render_value=self.render_diff_value, ) - return diff.render_html() + showing = HTML.tag('div', + "showing: " + + tags.link_to("all", '#', class_='all') + + " / " + + tags.link_to("diffs only", '#', class_='diffs'), + class_='showing') + return showing + diff.render_html() except: return "(not available for this upgrade)"