incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r1453819 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/ bloodhound_theme/bhtheme/ bloodhound_theme/bhtheme/htdocs/js/ bloodhound_theme/bhtheme/templates/
Date Thu, 07 Mar 2013 12:43:58 GMT
Author: matevz
Date: Thu Mar  7 12:43:58 2013
New Revision: 1453819

URL: http://svn.apache.org/r1453819
Log:
#429 - Multiproduct UI: Ticket page (QCT dialog not working)

Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/web_ui.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/web_ui.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/web_ui.py?rev=1453819&r1=1453818&r2=1453819&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/web_ui.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/web_ui.py
Thu Mar  7 12:43:58 2013
@@ -129,10 +129,9 @@ class ProductModule(Component):
     
     # IRequestHandler methods
     def match_request(self, req):
-        """match request handler"""
-        if req.path_info.startswith('/products'):
-            return True
-        return False
+        m = PRODUCT_RE.match(req.path_info)
+        # handle '/products', but excluding QuickCreateTicket (qct) requests
+        return m and m.group('pathinfo').strip('/') != 'qct'
     
     def process_request(self, req):
         """process request handler"""

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js?rev=1453819&r1=1453818&r2=1453819&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js
Thu Mar  7 12:43:58 2013
@@ -74,9 +74,7 @@ $( function () {
       );
     $('#qct-create').click(
         function() {
-          var base_url = $('#qct-create').attr('data-target');
-          if (base_url === '/')
-            base_url = '';
+          var base_url = $('#qct-create').attr('data-target') + '/' + $('#field-product').val();
           $.post(base_url + '/qct', $('#qct-form').serialize(), 
               function(ticket_id) {
                 qct_alert({

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1453819&r1=1453818&r2=1453819&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
Thu Mar  7 12:43:58 2013
@@ -170,7 +170,7 @@
                               ${qct_box()}
                             </div>
                           </form>
-                          <button id="qct-create" class="btn" data-target="${href()}">Create</button>
+                          <button id="qct-create" class="btn" data-target="${href.products()}">Create</button>
                           <a id="qct-cancel">Cancel</a>
                         </py:when>
                         <div py:otherwise="" class="alert alert-info">

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py?rev=1453819&r1=1453818&r2=1453819&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
Thu Mar  7 12:43:58 2013
@@ -52,6 +52,7 @@ from wsgiref.util import setup_testing_d
 
 from multiproduct.model import Product
 from multiproduct.env import ProductEnvironment, ProductEnvironmentFactory
+from multiproduct.web_ui import PRODUCT_RE
 
 try:
     from multiproduct.ticket.web_ui import ProductTicketModule
@@ -443,7 +444,8 @@ class QuickCreateTicketDialog(Component)
     def match_request(self, req):
         """Handle requests sent to /qct
         """
-        return req.path_info == '/qct'
+        m = PRODUCT_RE.match(req.path_info)
+        return m and m.group('pathinfo').strip('/') == 'qct'
 
     def process_request(self, req):
         """Forward new ticket request to `trac.ticket.web_ui.TicketModule`



Mime
View raw message