| |
@@ -1199,25 +1199,45 @@
|
| |
}
|
| |
$("#comment").atwho(userConfig);
|
| |
});
|
| |
- $.when($.get("{{ url_for('api_ns.api_view_issues', repo=repo.name, username=username, status='all') }}"),
|
| |
- $.get("{{ url_for('api_ns.api_pull_request_views', repo=repo.name, username=username, status='all') }}")
|
| |
- ).done(function(issuesResp, prResp) {
|
| |
- // 0 is the api response
|
| |
- var issuesAndPrs = issuesResp[0]['issues'].concat(prResp[0]['requests']);
|
| |
- var data = $.map(issuesAndPrs, function(ticket, idx) {
|
| |
- return {
|
| |
- name: ticket.id.toString(),
|
| |
- title: $('<div>').text(ticket.title).html()
|
| |
+
|
| |
+ {% if config.get('ENABLE_TICKETS', True) %}
|
| |
+ $.when($.get("{{ url_for('api_ns.api_view_issues', repo=repo.name, username=username, status='all') }}"),
|
| |
+ $.get("{{ url_for('api_ns.api_pull_request_views', repo=repo.name, username=username, status='all') }}")
|
| |
+ ).done(function(issuesResp, prResp) {
|
| |
+ // 0 is the api response
|
| |
+ var issuesAndPrs = issuesResp[0]['issues'].concat(prResp[0]['requests']);
|
| |
+ var data = $.map(issuesAndPrs, function(ticket, idx) {
|
| |
+ return {
|
| |
+ name: ticket.id.toString(),
|
| |
+ title: $('<div>').text(ticket.title).html()
|
| |
+ }
|
| |
+ });
|
| |
+ var issueAndPrConfig = {
|
| |
+ at: '#',
|
| |
+ data: data,
|
| |
+ insertTpl: '#${name}',
|
| |
+ displayTpl: "<li>#${name}<small> ${title}</small></li>",
|
| |
}
|
| |
- });
|
| |
- var issueAndPrConfig = {
|
| |
- at: '#',
|
| |
- data: data,
|
| |
- insertTpl: '#${name}',
|
| |
- displayTpl: "<li>#${name}<small> ${title}</small></li>",
|
| |
- }
|
| |
- $("#comment").atwho(issueAndPrConfig);
|
| |
- });
|
| |
+ $("#comment").atwho(issueAndPrConfig);
|
| |
+ });
|
| |
+ {% else %}
|
| |
+ $.get("{{ url_for('api_ns.api_pull_request_views', repo=repo.name, username=username, status='all') }}")
|
| |
+ .done(function(prResp) {
|
| |
+ var data = $.map(prResp['requests'], function(pr, idx) {
|
| |
+ return {
|
| |
+ name: pr.id.toString(),
|
| |
+ title: $('<div>').text(pr.title).html()
|
| |
+ }
|
| |
+ });
|
| |
+ var conf = {
|
| |
+ at: '#',
|
| |
+ data: data,
|
| |
+ insertTpl: '#${name}',
|
| |
+ displayTpl: "<li>#${name}<small> ${title} </small></li>",
|
| |
+ }
|
| |
+ $("#comment").atwho(conf);
|
| |
+ });
|
| |
+ {% endif %}
|
| |
} );
|
| |
$(window).on('hashchange', updateHighlight);
|
| |
var selected = [];
|
| |
This is not complete yet. The thing is it is able to query and show the options but when you press "Update", the link doesn't get created. It happens only when the issue tracker is turned off on the instance (the change is for that case only)