Index: ticketdelete/web_ui.py
===================================================================
--- ticketdelete/web_ui.py	(revision 6784)
+++ ticketdelete/web_ui.py	(working copy)
@@ -6,7 +6,12 @@
 from trac.core import *
 from trac.ticket.model import Ticket
 from trac.web.api import IRequestFilter
-from trac.web.chrome import ITemplateProvider, add_script, add_stylesheet
+from trac.web.chrome import add_notice
+from trac.web.chrome import add_script
+from trac.web.chrome import add_stylesheet
+from trac.web.chrome import add_warning
+from trac.web.chrome import ITemplateProvider
+from trac.ticket.web_ui import TicketModule 
 from trac.util import sorted
 from trac.util.datefmt import to_datetime, utc, to_timestamp
 
@@ -23,17 +28,20 @@
     
     implements(ITemplateProvider, IAdminPanelProvider, IRequestFilter)
 
-    # IRequestFilter methods
+    ### IRequestFilter methods
+
     def pre_process_request(self, req, handler):
+        if isinstance(handler, TicketModule) and 'TICKET_ADMIN' in req.perm: 
+            add_script(req, 'ticketdelete/ticketdelete.js') 
+            add_stylesheet(req, 'ticketdelete/ticketdelete.css') 
         return handler
 
-    def post_process_request(self, req, template, content_type):
-        if template == 'ticket.html' and 'TICKET_ADMIN' in req.perm:
-            add_script(req, 'ticketdelete/ticketdelete.js')
-            add_stylesheet(req, 'ticketdelete/ticketdelete.css')
-        return template, content_type
+    def post_process_request(self, req, template, data, content_type):
+        return template, data, content_type
  
-    # IAdminPanelProvider methods
+
+    ### IAdminPanelProvider methods
+
     def get_admin_panels(self, req):
         if 'TICKET_ADMIN' in req.perm:
             yield ('ticket', 'Ticket System', 'delete', 'Delete')
@@ -52,15 +60,12 @@
 
         if req.method == 'POST':
             if page == 'delete':
-                if 'ticketid' in req.args and 'ticketid2' in req.args:
-                    if req.args.get('ticketid') == req.args.get('ticketid2'):
-                        t = self._validate(req, req.args.get('ticketid'))
-                        if t:
-                            self._delete_ticket(t.id)
-                            data['message'] = "Ticket #%s has been deleted." % t.id
-                            
-                    else:
-                        data['message'] = "The two IDs did not match. Please try again."
+                if 'ticketid' in req.args:
+                    t = self._validate(req, req.args.get('ticketid'))
+                    if t:
+                        self._delete_ticket(t.id)
+                        add_notice(req, "Ticket #%s has been deleted." % t.id)
+                        req.redirect(req.href('admin', cat, 'delete'))
             elif page == 'comments':
                 if 'ticketid' in req.args:
                     req.redirect(req.href.admin(cat, page, req.args.get('ticketid')))
@@ -82,7 +87,7 @@
                                 if ts != '':
                                     self.log.debug('TicketDelete: Deleting change to ticket %s at %s (%s)'%(t.id,ts,field))
                                     self._delete_change(t.id, ts, field)
-                                    data['message'] = "Change to ticket #%s at %s has been modified" % (t.id, ts)
+                                    add_notice(req, "Change to ticket #%s at %s has been modified" % (t.id, ts))
                                     data['redir'] = 0
                     
                 
@@ -114,7 +119,9 @@
  
         return 'ticketdelete_admin.html', {'ticketdelete': data}
 
-    # ITemplateProvider methods
+
+    ### ITemplateProvider methods
+
     def get_templates_dirs(self):
         """
         Return the absolute path of the directory containing the provided
@@ -138,7 +145,9 @@
         from pkg_resources import resource_filename
         return [('ticketdelete', resource_filename(__name__, 'htdocs'))]
 
-    # Internal methods
+
+    ### Internal methods
+
     def _get_trac_version(self):
         md = re.match('(\d+)\.(\d+)',TRAC_VERSION)
         if md:
@@ -153,9 +162,9 @@
             t = Ticket(self.env, id)
             return t
         except TracError:
-            data['message'] = "Ticket #%s not found. Please try again." % id
+            add_warning(req, "Ticket #%s not found. Please try again." % id)
         except ValueError:
-            data['message'] = "Ticket ID '%s' is not valid. Please try again." % arg
+            add_warning(req, "Ticket ID '%s' is not valid. Please try again." % arg)
         return False
                                                                                                                 
     
Index: ticketdelete/htdocs/ticketdelete.js
===================================================================
--- ticketdelete/htdocs/ticketdelete.js	(revision 6784)
+++ ticketdelete/htdocs/ticketdelete.js	(working copy)
@@ -7,11 +7,11 @@
     } else {
         $('#ticket table.properties').after('<div class="description"><h3><span class="inlinebuttons">'+delete_link+'</span>&nbsp;</h3></div>');
     }
-    $('#changelog h3').each(function() {
-        var comment = $('input[@name=replyto]', this)[0];
-        if (comment) {
-            comment = comment.value;
-            $('.inlinebuttons', this).append('<a href="../admin/ticket/comments/'+ticket+'?cnum='+comment+'">Delete</a>');
-        }
+    $('#changelog .inlinebuttons').each(function() {
+            var comment = $('input[@name=replyto]', this)[0];
+            if (comment) {
+                comment = comment.value;
+                $(this).append('<a href="../admin/ticket/comments/'+ticket+'?cnum='+comment+'">Delete</a>');
+            }
+        });
     });
-});
Index: ticketdelete/templates/ticketdelete_admin.html
===================================================================
--- ticketdelete/templates/ticketdelete_admin.html	(revision 6784)
+++ ticketdelete/templates/ticketdelete_admin.html	(working copy)
@@ -16,22 +16,18 @@
     <h2>Delete Ticket${ticketdelete.page=='comments' and ' Changes' or None}</h2>
 
   <py:choose>
-    <py:when test="ticketdelete.message and ticketdelete.redir">
-      <b>${ticketdelete.message}</b><br />
-      <a href="${ticketdelete.href}">Back</a>
-    </py:when>
     <py:when test="ticketdelete.page == 'delete'">
       <p>
-        <b>Note: This is intended only for use in very odd circumstances.<br />
+        <b>Note: 
           It is usually a better idea to resolve a ticket as invalid, than to
           remove it from the database.</b>
       </p>
 
-      <form method="post" onsubmit="return confirm('Are you sure you want to do this?')">
+      <form method="post">
         Ticket ID: <input type="text" name="ticketid" value="${ticketdelete.id}"/><br />
-        Again: <input type="text" name="ticketid2" value="${ticketdelete.id}"/><br />
           <input type="submit" value="Delete" />
       </form>
+
     </py:when>
     <py:when test="ticketdelete.page == 'comments'">
       <py:choose>
