#42: Disable quick ticket button when user doesn't have sufficient permission
--------------------------+-------------------------------------
Reporter: jdreimann | Owner: olemis
Type: enhancement | Status: accepted
Priority: major | Milestone: RC1 for initial release
Component: dashboard | Version:
Resolution: | Keywords:
--------------------------+-------------------------------------
Comment (by gjm):
I've got a slight change for that - the original patch would result in an
odd change in shape of the button.
{{{
#!diff
Index: templates/bloodhound_theme.html
===================================================================
--- templates/bloodhound_theme.html (revision 1331432)
+++ templates/bloodhound_theme.html (working copy)
@@ -120,9 +120,11 @@
<py:choose test="">
<py:when test="qct">
<div class="btn-group">
- <a href="#" class="btn btn-primary dropdown-toggle"
+ <a href="#" py:with="enabled = 'TICKET_CREATE' in perm"
+ class="btn btn-primary dropdown-toggle ${not enabled
and 'disabled'}"
id="qct-newticket" rel="popover" title="Ticket "
- data-content="Alert box" data-toggle="dropdown">
+ data-content="Alert box"
+ data-toggle="${enabled and 'dropdown' or None}">
Create Ticket
</a>
<div id="qct-box" class="dropdown-menu" style="width:
300px;">
}}}
This will eventually also have to take account of whether it we have
appropriate permissions for the product although I am prepared for that to
be dealt with in a different ticket.
But.. is it me or does it not really have the feeling of being disabled? I
guess that would be because there are no similar buttons to give that kind
of hint.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/42#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker