buttons "close and comment" & "comment and reopen"
This commit is contained in:
parent
c0ce90019e
commit
3d097abadb
2 changed files with 45 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue