Target list
+
diff --git a/templates/faction/war/target.html b/templates/faction/war/target.html
index 0fb8280f..9a5404e3 100644
--- a/templates/faction/war/target.html
+++ b/templates/faction/war/target.html
@@ -57,4 +57,9 @@
{% include "faction/war/dibs.html" %}
|
+
+
+
+
+ |
{% endif %}
diff --git a/templates/faction/war/targets.html b/templates/faction/war/targets.html
index 99504fae..c01f70ac 100644
--- a/templates/faction/war/targets.html
+++ b/templates/faction/war/targets.html
@@ -43,20 +43,45 @@
9: function(node, table, cellIndex) { return $(node).attr("data-val"); },
10: function(node, table, cellIndex) { return $(node).attr("data-val"); },
11: function(node, table, cellIndex) { return $(node).attr("data-val"); },
+ 14: function(node, table, cellIndex) {return $(node).attr("data-val"); },
},
cssAsc: 'up',
cssDesc: 'down',
- sortList: [[11,0],[7,1],[6,0]]
+ sortList: [[11,0],[7,1],[6,0],[14,0]]
});
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
+
+ $('.add-target').on('click tap', function (e) {
+ e.preventDefault();
+
+ var target_id = $(this).attr('data-val');
+ var csrf_token = getCookie('csrftoken');
+ var faction_id = "{{ faction.tId }}";
+ var removeOrAdd = $(this).find('i').hasClass('fa-toggle-off') ? 1 : 0;
+ $(this).find('i').toggleClass('fa-toggle-off').toggleClass('fa-toggle-on');
+
+ const params = new URLSearchParams();
+ params.set('target_id', target_id);
+ params.set('faction_id', faction_id);
+ params.set('csrfmiddlewaretoken', csrf_token);
+ params.set('remove_or_add', ''+removeOrAdd)
+ $.ajax({
+ type: 'POST',
+ url: './?rank_target=1',
+ data: params.toString(),
+ success: function(data) {
+ // do something to show success
+ }
+ });
+ });
});
-
+
@@ -74,6 +99,7 @@
Status |
Update |
Dibs |
+ A |
{% for target in targets %}
diff --git a/templates/target/targets/index.html b/templates/target/targets/index.html
index a9e02110..fb94631a 100644
--- a/templates/target/targets/index.html
+++ b/templates/target/targets/index.html
@@ -36,6 +36,7 @@
// console.log($(node).attr("data-col") + $(node).find("input.target-list-note").val() + "->" + a + "-" + b);
return a + "-" + b; },
12: function(node, table, cellIndex) { return $(node).attr("data-val"); },
+ 15: function(node, table, cellIndex) { return $(node).attr("data-val"); },
},
cssAsc: 'up',
cssDesc: 'down',
@@ -83,6 +84,7 @@
A |
D |
F |
+ RW |
{% for targetId, target in targets.items %}
diff --git a/templates/target/targets/line.html b/templates/target/targets/line.html
index b1397be3..0cedd245 100644
--- a/templates/target/targets/line.html
+++ b/templates/target/targets/line.html
@@ -69,6 +69,13 @@
{% include "target/targets/faction.html" %}
+
+ {% if targetId in faction_targets %}
+
+ {% else %}
+
+ {% endif %}
+ |
{% else %}
No recorded id. Will be deleted soon. |
{% endif %}