From daa5126c216c1707d5a686168d481f1cb0e7c21e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 23 Dec 2021 12:34:57 -0600 Subject: [PATCH] Improve email bounce view per buefy theme --- tailbone/templates/email-bounces/view.mako | 62 +++++++++++++++++++++- tailbone/views/bouncer.py | 11 ++-- 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/tailbone/templates/email-bounces/view.mako b/tailbone/templates/email-bounces/view.mako index 36eb0c12..d24f3a00 100644 --- a/tailbone/templates/email-bounces/view.mako +++ b/tailbone/templates/email-bounces/view.mako @@ -5,6 +5,7 @@ <%def name="extra_javascript()"> ${parent.extra_javascript()} + % if not use_buefy: + % endif <%def name="extra_styles()"> ${parent.extra_styles()} + % if use_buefy: + + % else: + % endif + + +<%def name="object_helpers()"> + ${parent.object_helpers()} + % if use_buefy: + + % endif <%def name="context_menu_items()"> ${parent.context_menu_items()} + % if not use_buefy: % if not bounce.processed and request.has_perm('emailbounces.process'):
  • ${h.link_to("Mark this Email Bounce as Processed", url('emailbounces.process', uuid=bounce.uuid))}
  • % elif bounce.processed and request.has_perm('emailbounces.unprocess'):
  • ${h.link_to("Mark this Email Bounce as UN-processed", url('emailbounces.unprocess', uuid=bounce.uuid))}
  • % endif + % endif <%def name="page_content()"> ${parent.page_content()} + % if not use_buefy:
    -  ${message}
    +    ${message}
       
    + % endif +<%def name="render_this_page()"> + ${parent.render_this_page()} + % if use_buefy: +
    +        ${message}
    +      
    + % endif + ${parent.body()} diff --git a/tailbone/views/bouncer.py b/tailbone/views/bouncer.py index 314f0eb6..6bee7099 100644 --- a/tailbone/views/bouncer.py +++ b/tailbone/views/bouncer.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2021 Lance Edgar # # This file is part of Rattail. # @@ -147,6 +147,7 @@ class EmailBounceView(MasterView): kwargs['message'] = "(file not found)" return kwargs + # TODO: should require POST here def process(self): """ View for marking a bounce as processed. @@ -155,8 +156,9 @@ class EmailBounceView(MasterView): bounce.processed = datetime.datetime.utcnow() bounce.processed_by = self.request.user self.request.session.flash("Email bounce has been marked processed.") - return self.redirect(self.request.route_url('emailbounces')) + return self.redirect(self.get_action_url('view', bounce)) + # TODO: should require POST here def unprocess(self): """ View for marking a bounce as *unprocessed*. @@ -165,7 +167,7 @@ class EmailBounceView(MasterView): bounce.processed = None bounce.processed_by = None self.request.session.flash("Email bounce has been marked UN-processed.") - return self.redirect(self.request.route_url('emailbounces')) + return self.redirect(self.get_action_url('view', bounce)) def download(self): """ @@ -207,9 +209,6 @@ class EmailBounceView(MasterView): cls._defaults(config) -# TODO: deprecate / remove this -EmailBouncesView = EmailBounceView - def includeme(config): EmailBounceView.defaults(config)