Commits

Olemis Lang committed d77abf4

BH Theme #146 : Tooltips for workflow actions

  • Participants
  • Parent commits b18958c
  • Branches t146_inline_edit

Comments (0)

Files changed (1)

File t146/t146_r1420132_inplace_ticket_form.diff

 
 diff -r da551ebf15e9 bhtheme/htdocs/bloodhound.css
 --- a/bhtheme/htdocs/bloodhound.css	Fri Dec 14 04:41:19 2012 -0500
-+++ b/bhtheme/htdocs/bloodhound.css	Fri Dec 14 11:52:37 2012 -0500
++++ b/bhtheme/htdocs/bloodhound.css	Fri Dec 14 12:51:28 2012 -0500
 @@ -202,10 +202,6 @@
    width: 505px;
  }
  /* @end */
  
  /* @group Alternate download links */
+@@ -458,6 +458,10 @@
+   }
+ }
+ 
++.help-msg[title] {
++  cursor: help;
++}
++
+ /* Revert some changes introduced in 2.1.0 */
+ 
+ h6 {
 diff -r da551ebf15e9 bhtheme/templates/bh_ticket.html
 --- a/bhtheme/templates/bh_ticket.html	Fri Dec 14 04:41:19 2012 -0500
-+++ b/bhtheme/templates/bh_ticket.html	Fri Dec 14 11:52:37 2012 -0500
++++ b/bhtheme/templates/bh_ticket.html	Fri Dec 14 12:51:28 2012 -0500
 @@ -48,8 +48,11 @@
          modify_elem.parent().hide();
    
                var fieldurl = fc.find('a').attr('href');
                var fieldnm = fc.attr('id').substr(3);
                fc.empty();
-@@ -58,10 +61,43 @@
+@@ -58,10 +61,50 @@
                  editor = $('#editor-' + fieldnm);
                var fieldval = editor.val();
                editor = editor.clone(false).appendTo(fc).val(fieldval);
 +                    var action_ui = $(this).clone(false).prependTo(actions_box)
 +                        .wrap('<li style="padding: 5px 10px"></li>');
 +                    var action_trigger = action_ui.find('input[name=action]');
++
 +                    function action_click() {
-+                        var newlabel = action_ui.find('label[for^=action_]')
-+                            .text();
-+                        $('#submit-action-label').text(newlabel);
++                      var newlabel = action_ui.find('label[for^=action_]')
++                          .text();
++                      $('#submit-action-label').text(newlabel);
 +
-+                        // Enabled | disable action controls
-+                        actions_box.find('input[name=action]').each(function() {
-+                            $(this).siblings().find("*[id]")
-+                                .enable($(this).checked());
-+                            $(this).siblings().filter("*[id]")
-+                                .enable($(this).checked());
-+                          });
-+                      }
++                      // Enable | disable action controls
++                      actions_box.find('input[name=action]').each(function() {
++                          $(this).siblings().find("*[id]")
++                              .enable($(this).checked());
++                          $(this).siblings().filter("*[id]")
++                              .enable($(this).checked());
++                        });
++                    }
 +                    action_trigger.click(action_click);
-+                    if (action_trigger.attr('checked')) {
++                    if (action_trigger.attr('checked'))
 +                      action_click();
-+                    }
++
++                    var action_help = action_ui.find('.help-block').detach()
++                        .text().replace(/\s+/g, ' ').replace(/^ Tip /g, 'Tip: ')
++                        .replace(/^\s$/, '');
++                    if (action_help)
++                        $('<i class="icon-info-sign"></i>').appendTo(action_ui)
++                            .attr('title', action_help);
 +                  })
 +              }
              });
          }
    
-@@ -397,7 +433,8 @@
+@@ -397,7 +440,8 @@
                          <th><label for="field-summary">Summary:</label></th>
                          <td class="fullrow" colspan="3">
                            <input type="text" id="field-summary" name="field_summary"
                          </td>
                        </tr>
                        <py:if test="only_for_admin">
-@@ -593,5 +630,24 @@
+@@ -593,5 +637,24 @@
          </bh:widget>
        </div>
      </div>