|
Pierre-Yves Chibon |
6e76e1 |
{% extends "repo_master.html" %}
|
|
Johan Cwiklinski |
bc00dc |
{% from "_formhelper.html" import render_field %}
|
|
Pierre-Yves Chibon |
6e76e1 |
|
|
Pierre-Yves Chibon |
301ea7 |
{% block title %}Issue #{{ issueid }} - {{ repo.name }}{% endblock %}
|
|
Pierre-Yves Chibon |
6e76e1 |
{%block tag %}home{% endblock %}
|
|
Pierre-Yves Chibon |
6e76e1 |
|
|
Pierre-Yves Chibon |
3d3baf |
{% macro show_comment(user, date, content) %}
|
|
Johan Cwiklinski |
bc00dc |
<section class="issue_comment"></section>
|
|
Johan Cwiklinski |
bc00dc |
<header></header>
|
|
Johan Cwiklinski |
bc00dc |
{{ user.user | avatar(16) | safe }}
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
{{ user.user }}
|
|
Pierre-Yves Chibon |
77d026 |
- {{ date | humanize}}
|
|
Pierre-Yves Chibon |
6df8a0 |
<aside class="issue_action"></aside>
|
|
Pierre-Yves Chibon |
6df8a0 |
|
|
Pierre-Yves Chibon |
6df8a0 |
reply
|
|
Pierre-Yves Chibon |
6df8a0 |
|
|
Pierre-Yves Chibon |
6df8a0 |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
{% autoescape false %}
|
|
Johan Cwiklinski |
bc00dc |
{{ content | markdown }}
|
|
Johan Cwiklinski |
bc00dc |
{% endautoescape %}
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
{% endmacro %}
|
|
Pierre-Yves Chibon |
6e76e1 |
|
|
Pierre-Yves Chibon |
6e76e1 |
{% block repo %}
|
|
Pierre-Yves Chibon |
6e76e1 |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Johan Cwiklinski |
bc00dc |
#{{ issueid }} {{ issue.title }}
|
|
Johan Cwiklinski |
bc00dc |
{% if authenticated %}
|
|
Johan Cwiklinski |
bc00dc |
-
|
|
Pierre-Yves Chibon |
6bf823 |
repo=repo.name, issueid=issueid) }}">
|
|
Pierre-Yves Chibon |
11013f |
Edit
|
|
Johan Cwiklinski |
bc00dc |
{% endif %}
|
|
Pierre-Yves Chibon |
3d3baf |
<aside class="issue_action"></aside>
|
|
Pierre-Yves Chibon |
3d3baf |
{% if authenticated and form %}
|
|
Pierre-Yves Chibon |
3d3baf |
|
|
Pierre-Yves Chibon |
3d3baf |
repo=repo.name, issueid=issueid) }}" method="post">
|
|
Pierre-Yves Chibon |
3d3baf |
{{ render_field(form.status) }}
|
|
Pierre-Yves Chibon |
3d3baf |
<input class="submit positive button" type="submit" value="Update">
|
|
Pierre-Yves Chibon |
3d3baf |
{{ form.csrf_token }}
|
|
Pierre-Yves Chibon |
3d3baf |
|
|
Pierre-Yves Chibon |
3d3baf |
{% else %}
|
|
Pierre-Yves Chibon |
3d3baf |
Status: {{ issue.status }}
|
|
Pierre-Yves Chibon |
3d3baf |
{% endif %}
|
|
Pierre-Yves Chibon |
3d3baf |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Pierre-Yves Chibon |
11013f |
|
|
Pierre-Yves Chibon |
3d3baf |
{{ show_comment(issue.user, issue.date_created, issue.content) }}
|
|
Pierre-Yves Chibon |
ceda80 |
|
|
Pierre-Yves Chibon |
008224 |
{% if issue.comments %}
|
|
Pierre-Yves Chibon |
ceda80 |
{% for comment in issue.comments %}
|
|
Johan Cwiklinski |
bc00dc |
{{ show_comment(comment.user, comment.date_created, comment.comment) }}
|
|
Pierre-Yves Chibon |
ceda80 |
{% endfor %}
|
|
Pierre-Yves Chibon |
008224 |
{% endif %}
|
|
Pierre-Yves Chibon |
008224 |
|
|
Johan Cwiklinski |
bc00dc |
<section class="issue_comment add_comment"></section>
|
|
Pierre-Yves Chibon |
a37659 |
{% if authenticated %}
|
|
Pierre-Yves Chibon |
a76093 |
<header></header>
|
|
Pierre-Yves Chibon |
a76093 |
<label for="comment">Add new comment</label>
|
|
Pierre-Yves Chibon |
a76093 |
(supports the
|
|
Pierre-Yves Chibon |
a76093 |
target="_blank">Markdown syntax)
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
Comment
|
|
Pierre-Yves Chibon |
a76093 |
Preview
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
repo=repo.name, issueid=issueid) }}" method="post">
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
<textarea id="comment" name="comment" placeholder="Enter your comment here"></textarea>
|
|
Pierre-Yves Chibon |
a76093 |
{{ form_comment.csrf_token }}
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
<input class="submit positive button" type="submit" value="Comment">
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Johan Cwiklinski |
bc00dc |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
ceda80 |
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a37659 |
{% else %}
|
|
Johan Cwiklinski |
bc00dc |
Login to comment on this ticket.
|
|
Pierre-Yves Chibon |
a37659 |
{% endif %}
|
|
Johan Cwiklinski |
bc00dc |
|
|
Pierre-Yves Chibon |
6e76e1 |
|
|
Pierre-Yves Chibon |
6e76e1 |
{% endblock %}
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
{% block jscripts %}
|
|
Pierre-Yves Chibon |
a76093 |
{{ super() }}
|
|
Pierre-Yves Chibon |
a76093 |
<script type="text/javascript"></script>
|
|
Pierre-Yves Chibon |
a76093 |
$(function() {
|
|
Pierre-Yves Chibon |
a76093 |
$( "#tabs" ).tabs();
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
$( "#tabs" ).on('tabsactivate',
|
|
Pierre-Yves Chibon |
a76093 |
function(event, ui) {
|
|
Pierre-Yves Chibon |
a76093 |
if (ui.newPanel.selector == '#preview') {
|
|
Pierre-Yves Chibon |
a76093 |
var _text = $( "#comment" ).val();
|
|
Pierre-Yves Chibon |
a76093 |
var _url = "{{ url_for('markdown_preview') }}";
|
|
Pierre-Yves Chibon |
a76093 |
$.ajax({
|
|
Pierre-Yves Chibon |
a76093 |
url: _url ,
|
|
Pierre-Yves Chibon |
a76093 |
type: 'POST',
|
|
Pierre-Yves Chibon |
a76093 |
data: {content: _text},
|
|
Pierre-Yves Chibon |
a76093 |
dataType: 'html',
|
|
Pierre-Yves Chibon |
a76093 |
success: function(res) {
|
|
Pierre-Yves Chibon |
a76093 |
$( "#preview" ).html(res);
|
|
Pierre-Yves Chibon |
a76093 |
},
|
|
Pierre-Yves Chibon |
a76093 |
error: function() {
|
|
Pierre-Yves Chibon |
a76093 |
alert('Unable to generate preview!');
|
|
Pierre-Yves Chibon |
a76093 |
}
|
|
Pierre-Yves Chibon |
a76093 |
});
|
|
Pierre-Yves Chibon |
a76093 |
return false;
|
|
Pierre-Yves Chibon |
a76093 |
}
|
|
Pierre-Yves Chibon |
a76093 |
}
|
|
Pierre-Yves Chibon |
a76093 |
);
|
|
Pierre-Yves Chibon |
6df8a0 |
|
|
Pierre-Yves Chibon |
6df8a0 |
$( ".reply" ).click(
|
|
Pierre-Yves Chibon |
6df8a0 |
function() {
|
|
Pierre-Yves Chibon |
6df8a0 |
var _section = $(this).parent().parent().parent();
|
|
Pierre-Yves Chibon |
6df8a0 |
var _comment = _section.find('.comment_body');
|
|
Pierre-Yves Chibon |
6df8a0 |
var _text = _comment.text().split("\n");
|
|
Pierre-Yves Chibon |
6df8a0 |
var _output = new Array();
|
|
Pierre-Yves Chibon |
6df8a0 |
for (cnt = 0; cnt < _text.length - 1; cnt ++) {
|
|
Pierre-Yves Chibon |
6df8a0 |
_output[cnt] = '> ' + jQuery.trim(_text[cnt + 1]);
|
|
Pierre-Yves Chibon |
6df8a0 |
}
|
|
Pierre-Yves Chibon |
6df8a0 |
$( "#comment" ).val(_output.join("\n"));
|
|
Pierre-Yves Chibon |
6df8a0 |
}
|
|
Pierre-Yves Chibon |
6df8a0 |
);
|
|
Pierre-Yves Chibon |
6df8a0 |
|
|
Pierre-Yves Chibon |
a76093 |
});
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
{% endblock %}
|