Skip to content

Commit 7bcfc82

Browse files
author
Greg Anderson
authored
Merge pull request #130 from devGregA/master
Added has attr to URLs
2 parents cdad27f + e3f82ee commit 7bcfc82

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

dojo/templates/dojo/report_builder.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ <h4>Available Widgets</h4>
167167

168168
$(document).on('submit', 'form.finding-list', function (event) {
169169
var form = this;
170-
$.get('/reports/findings?' + $(this).serialize()).done(function (data) {
170+
$.get("{% url 'report_findings' %}?" + $(this).serialize()).done(function (data) {
171171
$(form).closest('li.finding-list').html(data);
172172
setUpFindingFilters();
173173
});
@@ -178,7 +178,7 @@ <h4>Available Widgets</h4>
178178
$(document).on('click', 'form.finding-list a.clear.centered, div.finding-pagination a', function (event) {
179179
var link_href = $(this).attr('href')
180180
console.log(link_href);
181-
$.get('/reports/findings'+link_href).done(function (data) {
181+
$.get("{% url 'report_findings' %}"+link_href).done(function (data) {
182182
$('div.in-use-widgets li.finding-list').html(data);
183183
setUpFindingFilters();
184184
});
@@ -188,7 +188,7 @@ <h4>Available Widgets</h4>
188188

189189
$(document).on('submit', 'form.endpoint-list', function (event) {
190190
var form = this;
191-
$.get('/reports/endpoints?' + $(this).serialize()).done(function (data) {
191+
$.get("{% url 'report_endpoints' %}?" + $(this).serialize()).done(function (data) {
192192
$(form).closest('li.endpoint-list').html(data);
193193
setUpFindingFilters();
194194
});
@@ -197,7 +197,7 @@ <h4>Available Widgets</h4>
197197
});
198198

199199
$(document).on('click', 'form.endpoint-list a.clear.centered, div.endpoint-pagination a', function (event) {
200-
$.get('/reports/endpoints').done(function (data) {
200+
$.get("{% url 'report_endpoints' %}").done(function (data) {
201201
$('div.in-use-widgets li.endpoint-list').html(data);
202202
setUpFindingFilters();
203203
});

dojo/templates/dojo/reports.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ <h3 class="has-filters">
130130

131131
function get_report_status() {
132132
$('span.report_status.requested').each(function () {
133-
$.get("/reports/" + this.id + "/status", function (data, status) {
133+
$.get("{% url 'report_status' 0 %}".replace(0, this.id.toString()), function (data, status) {
134134
if (data.status == 'success') {
135135
$('span#'+data.id).removeClass('requested').addClass('alert-success');
136136
$('span#'+data.id).html("<a class='btn btn-primary btn-sm' href='/reports/[id]/download'>Download <span class='fa fa-download'></span></a> <a class='btn btn-sm btn-info' href='/reports/[id]/regen'>Regenerate <span class='fa fa-refresh'></span></a> <form method='post' action='/reports/[id]/delete' style='display: inline' class='form-inline form'>{% csrf_token %}<input type='hidden' name='id' value='[id]'/><button type='submit' class='btn btn-danger btn-sm report-delete'>Delete <span class='fa fa-trash'></span></button></form>".replace(/\[id\]/g, data.id));

dojo/urls.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@
6060
ur+= test_urls
6161
ur+= user_urls
6262

63-
print >>sys.stderr, 'this is ur'
64-
print >>sys.stderr, ur
65-
66-
63+
if not hasattr(settings, 'URL_PREFIX'):
64+
settings.URL_PREFIX = ''
6765

6866
urlpatterns = [
6967
# django admin

0 commit comments

Comments
 (0)