buttons "close and comment" & "comment and reopen"

This commit is contained in:
Élie Bouttier 2014-12-10 20:48:45 +01:00
parent c0ce90019e
commit 3d097abadb
2 changed files with 45 additions and 4 deletions

View file

@ -93,9 +93,11 @@
<div class="text-center">
{% if perm.manage_issue %}
{% if issue.closed %}
<a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Reopen this issue</a>
<a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default" id="normal-button"><span class="glyphicon glyphicon-refresh"></span> Reopen this issue</a>
<button type="submit" class="btn btn-default" style="display: none;" id="comment-button" name="change-state"><span class="glyphicon glyphicon-refresh"></span> Reopen and comment</button>
{% else %}
<a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-ok-circle"></span> Close this issue</a>
<a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default" id="normal-button"><span class="glyphicon glyphicon-ok-circle"></span> Close this issue</a>
<button type="submit" class="btn btn-default" style="display: none;" id="comment-button" name="change-state"><span class="glyphicon glyphicon-ok-circle"></span> Comment and close</button>
{% endif %}
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-pencil"></span> Add a comment</button>
</div>
@ -224,6 +226,15 @@
{{ block.super }}
<script type="text/javascript">
var markdown_preview_url = "{% url 'markdown' %}";
$('#markdown-content').on('keyup', function () {
if ($('#markdown-content').val()) {
$('#normal-button').hide();
$('#comment-button').show();
} else {
$('#normal-button').show();
$('#comment-button').hide();
}
});
</script>
<script src="{% static 'js/jquery.cookie.js' %}"></script>
<script src="{% static 'js/markdown-preview.js' %}"></script>