Skip to content

Commit

Permalink
Merge pull request #602 from ethan-nelson/dev54
Browse files Browse the repository at this point in the history
Preventing self-validation
  • Loading branch information
Pierre GIRAUD committed May 17, 2015
2 parents b0822de + fc0c525 commit 7c30169
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions osmtm/templates/task.state.done.mako
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,28 @@ done = task.cur_state and task.cur_state.state == TaskState.state_done
<%
tooltip = _("Validate this task if you consider that the work is complete.")
%>
<button type="submit" rel="tooltip"
name="validate"
data-container="body"
data-original-title="${tooltip}"
class="btn btn-success">
<i class="glyphicon glyphicon-thumbs-up icon-white"></i> ${_('Validate')}
</button>
% if user == task.states[0].user and not (user.is_admin or user.is_project_manager):
<%
selfvalidatestate = """ type="button" disabled """
selfvalidatetext = _("You cannot validate a task that you have personally marked as done.")
selfvalidatediv = """<div id="self_validation" class="help-block small text-right">
<em><i class="glyphicon glyphicon-warning-sign"></i>""" + \
selfvalidatetext + """</em></div>"""
%>
% else:
<%
selfvalidatestate = """ type="submit" """
selfvalidatediv = """"""
%>
% endif
<button rel="tooltip"
name="validate"
data-container="body"
data-original-title="${tooltip}"
class="btn btn-success" ${selfvalidatestate | n }>
<i class="glyphicon glyphicon-thumbs-up icon-white"></i> ${_('Validate')}
</button>
${selfvalidatediv | n}
% endif
</form>
% endif

0 comments on commit 7c30169

Please sign in to comment.