|
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 |
16fdbf |
<section id="tags"></section>
|
|
Pierre-Yves Chibon |
16fdbf |
Tags:
|
|
Pierre-Yves Chibon |
16fdbf |
{% for tag in issue.tags %}
|
|
Pierre-Yves Chibon |
16fdbf |
|
|
Pierre-Yves Chibon |
16fdbf |
repo=repo.name, tags=tag.tag) }}">
|
|
Pierre-Yves Chibon |
16fdbf |
{{ tag.tag }}{% if not loop.last %},{% endif %}
|
|
Pierre-Yves Chibon |
16fdbf |
{% endfor %}
|
|
Pierre-Yves Chibon |
169392 |
{% if authenticated and form_tag %}
|
|
Pierre-Yves Chibon |
314f5e |
|
|
Pierre-Yves Chibon |
005892 |
repo=repo.name, issueid=issueid) }}" method="post"
|
|
Pierre-Yves Chibon |
1c7219 |
class="tag_form">
|
|
Pierre-Yves Chibon |
1c7219 |
<input id="tag" name="tag" placeholder="tag1, tag2" type="text" value="">
|
|
Pierre-Yves Chibon |
16fdbf |
|
|
Pierre-Yves Chibon |
16fdbf |
class="submit positive button" value="Add">
|
|
Pierre-Yves Chibon |
169392 |
{{ form_tag.csrf_token }}
|
|
Pierre-Yves Chibon |
16fdbf |
|
|
Pierre-Yves Chibon |
16fdbf |
{% endif %}
|
|
Pierre-Yves Chibon |
16fdbf |
|
|
Pierre-Yves Chibon |
16fdbf |
|
|
Pierre-Yves Chibon |
4c2dd9 |
<section id="assigned"></section>
|
|
Pierre-Yves Chibon |
4c2dd9 |
Assigned:
|
|
Pierre-Yves Chibon |
4c2dd9 |
{% if issue.assignee %}
|
|
Pierre-Yves Chibon |
4c2dd9 |
|
|
Pierre-Yves Chibon |
4c2dd9 |
repo=repo.name, assignee=issue.assignee.username) }}">
|
|
Pierre-Yves Chibon |
4c2dd9 |
{{ issue.assignee.username }}
|
|
Pierre-Yves Chibon |
4c2dd9 |
{% endif %}
|
|
Pierre-Yves Chibon |
4c2dd9 |
{% if authenticated and form_tag %}
|
|
Pierre-Yves Chibon |
4c2dd9 |
|
|
Pierre-Yves Chibon |
4c2dd9 |
repo=repo.name, issueid=issueid) }}" method="post"
|
|
Pierre-Yves Chibon |
4c2dd9 |
class="tag_form">
|
|
Pierre-Yves Chibon |
575f23 |
<input name="assignee" type="hidden" value="{{ g.fas_user.username }}">
|
|
Pierre-Yves Chibon |
575f23 |
|
|
Pierre-Yves Chibon |
575f23 |
class="submit positive button" value="Take">
|
|
Pierre-Yves Chibon |
575f23 |
{{ form_tag.csrf_token }}
|
|
Pierre-Yves Chibon |
575f23 |
|
|
Pierre-Yves Chibon |
575f23 |
|
|
Pierre-Yves Chibon |
575f23 |
repo=repo.name, issueid=issueid) }}" method="post"
|
|
Pierre-Yves Chibon |
575f23 |
class="tag_form">
|
|
Pierre-Yves Chibon |
575f23 |
<input name="assignee" type="hidden" value="">
|
|
Pierre-Yves Chibon |
575f23 |
<input class="submit positive button" type="submit" value="Reset">
|
|
Pierre-Yves Chibon |
575f23 |
{{ form_tag.csrf_token }}
|
|
Pierre-Yves Chibon |
575f23 |
|
|
Pierre-Yves Chibon |
4c2dd9 |
{% endif %}
|
|
Pierre-Yves Chibon |
4c2dd9 |
|
|
Pierre-Yves Chibon |
4c2dd9 |
|
|
Pierre-Yves Chibon |
c92cdd |
<section id="blocks"></section>
|
|
Pierre-Yves Chibon |
c92cdd |
Blocking:
|
|
Pierre-Yves Chibon |
c92cdd |
{% if issue.parents %}
|
|
Pierre-Yves Chibon |
c92cdd |
{% for ticket in issue.parents %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
repo=repo.name, issueid=ticket.id) }}">
|
|
Pierre-Yves Chibon |
c92cdd |
{{ ticket.id }}
|
|
Pierre-Yves Chibon |
c92cdd |
{% endfor %}
|
|
Pierre-Yves Chibon |
c92cdd |
{% endif %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
{% if authenticated and form_tag %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
repo=repo.name, issueid=issueid, issuetype='parent') }}" method="post"
|
|
Pierre-Yves Chibon |
c92cdd |
class="tag_form">
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
placeholder="issue blocked" name="depends">
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
class="submit positive button" value="Add">
|
|
Pierre-Yves Chibon |
c92cdd |
{{ form_tag.csrf_token }}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
{% endif %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
<section id="depends"></section>
|
|
Pierre-Yves Chibon |
c92cdd |
Depends on:
|
|
Pierre-Yves Chibon |
c92cdd |
{% if issue.children %}
|
|
Pierre-Yves Chibon |
c92cdd |
{% for ticket in issue.children %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
repo=repo.name, issueid=ticket.id) }}">
|
|
Pierre-Yves Chibon |
c92cdd |
{{ ticket.id }}
|
|
Pierre-Yves Chibon |
c92cdd |
{% endfor %}
|
|
Pierre-Yves Chibon |
c92cdd |
{% endif %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
{% if authenticated and form_tag %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
repo=repo.name, issueid=issueid, issuetype='child') }}" method="post"
|
|
Pierre-Yves Chibon |
c92cdd |
class="tag_form">
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
placeholder="issue depending" name="depends">
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
class="submit positive button" value="Add">
|
|
Pierre-Yves Chibon |
c92cdd |
{{ form_tag.csrf_token }}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
{% endif %}
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
Pierre-Yves Chibon |
c92cdd |
|
|
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 |
c9a7e9 |
<input id="clear_comment" type="button" value="Clear">
|
|
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 |
c9a7e9 |
$( "#clear_comment").click(
|
|
Pierre-Yves Chibon |
c9a7e9 |
function() {
|
|
Pierre-Yves Chibon |
c9a7e9 |
$( "#comment" ).val("");
|
|
Pierre-Yves Chibon |
c9a7e9 |
}
|
|
Pierre-Yves Chibon |
c9a7e9 |
);
|
|
Pierre-Yves Chibon |
c9a7e9 |
|
|
Pierre-Yves Chibon |
9fd82b |
var cache = {};
|
|
Pierre-Yves Chibon |
9fd82b |
$( "#tag" ).autocomplete({
|
|
Pierre-Yves Chibon |
9fd82b |
source: function( request, response ) {
|
|
Pierre-Yves Chibon |
9fd82b |
var pattern = request.term;
|
|
Pierre-Yves Chibon |
9fd82b |
if ( pattern in cache ) {
|
|
Pierre-Yves Chibon |
9fd82b |
response( cache[ pattern ] );
|
|
Pierre-Yves Chibon |
9fd82b |
return;
|
|
Pierre-Yves Chibon |
9fd82b |
}
|
|
Pierre-Yves Chibon |
9fd82b |
|
|
Pierre-Yves Chibon |
9fd82b |
$.getJSON(
|
|
Pierre-Yves Chibon |
9fd82b |
"{{ url_for('api_ns.api_project_tags', repo=repo.name, username=username) }}", {
|
|
Pierre-Yves Chibon |
9fd82b |
pattern: request.term
|
|
Pierre-Yves Chibon |
9fd82b |
},
|
|
Pierre-Yves Chibon |
9fd82b |
function( data ) {
|
|
Pierre-Yves Chibon |
9fd82b |
cache[ pattern ] = data.tags;
|
|
Pierre-Yves Chibon |
9fd82b |
response( data.tags );
|
|
Pierre-Yves Chibon |
9fd82b |
}
|
|
Pierre-Yves Chibon |
9fd82b |
);
|
|
Pierre-Yves Chibon |
9fd82b |
},
|
|
Pierre-Yves Chibon |
9fd82b |
minLength: 0,
|
|
Pierre-Yves Chibon |
9fd82b |
delay: 200,
|
|
Pierre-Yves Chibon |
9fd82b |
});
|
|
Pierre-Yves Chibon |
9fd82b |
|
|
Pierre-Yves Chibon |
a76093 |
});
|
|
Pierre-Yves Chibon |
a76093 |
|
|
Pierre-Yves Chibon |
a76093 |
{% endblock %}
|