Author: matevz
Date: Tue Mar 12 08:25:34 2013
New Revision: 1455436

URL: http://svn.apache.org/r1455436
Log:
#429 - Multiproduct UI: Ticket page (fixed ticket preview)

Modified:
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/js/theme.js
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_ticket.html
    
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

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=1455436&r1=1455435&r2=1455436&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
 Tue Mar 12 08:25:34 2013
@@ -74,7 +74,9 @@ $( function () {
       );
     $('#qct-create').click(
         function() {
-          var base_url = $('#qct-create').attr('data-target') + '/' + 
$('#field-product').val();
+          var base_url = $('#qct-create').attr('data-target');
+          if (base_url === '/')
+            base_url = '';
           $.post(base_url + '/qct', $('#qct-form').serialize(), 
               function(ticket_id) {
                 qct_alert({

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_ticket.html
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_ticket.html?rev=1455436&r1=1455435&r2=1455436&view=diff
==============================================================================
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_ticket.html
 (original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bh_ticket.html
 Tue Mar 12 08:25:34 2013
@@ -66,36 +66,21 @@
         // Install in place editing
 
         var modify_elem = $('#modify');
-        <py:choose test="ticket.exists">
-          <py:when test="True">
-            modify_elem.parent().hide();
-            $('#propertyform .buttons [name="preview"]').hide();
-            $('#comment').change(function (e) {
-              $('#hidden-comment').val($('#comment').val());
-            });
-            $('#propertyform .buttons [name="submit"]').click(function (e) {
-              if ($('button#edit-submit').length) {
-                // if available trigger the edit state's update button
-                $('button#edit-submit').click();
-                e.preventDefault();
-              }
-              // otherwise the default submit comment only happens
-            });
-          </py:when>
-          <py:otherwise>
-            $('#propertyform .buttons [name="submit"]').click(function(e) {
-              /*
-                change the form action from /products to
-                  /products/target_product/newticket#ticket
-              */
-              var form = $('#propertyform');
-              var action = form.attr('action') + '/' + 
-                $('#propertyform [name="field_product"]').val() +
-                '/newticket#ticket';
-              form.attr('action', action);
-            });
-          </py:otherwise>
-        </py:choose>
+        <py:if test="ticket.exists">
+          modify_elem.parent().hide();
+          $('#propertyform .buttons [name="preview"]').hide();
+          $('#comment').change(function (e) {
+            $('#hidden-comment').val($('#comment').val());
+          });
+          $('#propertyform .buttons [name="submit"]').click(function (e) {
+            if ($('button#edit-submit').length) {
+              // if available trigger the edit state's update button
+              $('button#edit-submit').click();
+              e.preventDefault();
+            }
+            // otherwise the default submit comment only happens
+          });
+        </py:if>
   
         function modify_ticket() {
           if ($('#vc-summary').is('.edit-active'))
@@ -397,7 +382,7 @@
           <!--! add comment + modify ticket -->
           <form py:if="has_property_editor" method="post" id="propertyform"
                   action="${href.ticket(ticket.id) + '#trac-add-comment' if 
ticket.exists
-                            else href.products()}">
+                            else href.newticket() + '#ticket'}">
             <div py:if="ticket.exists and can_append">
               <!--! Add comment -->
               <div id="trac-add-comment" class="field">

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=1455436&r1=1455435&r2=1455436&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
 Tue Mar 12 08:25:34 2013
@@ -179,7 +179,7 @@
                               ${qct_box()}
                             </div>
                           </form>
-                          <button id="qct-create" class="btn" 
data-target="${href.products()}">Create</button>
+                          <button id="qct-create" class="btn" 
data-target="${href()}">Create</button>
                           <a id="qct-cancel">Cancel</a>
                         </py:when>
                         <div py:otherwise="" class="alert alert-info">


Reply via email to