Commit 8ee9d02f authored by Webb's avatar Webb

fixed html

parent 548d7ef9
...@@ -77,10 +77,6 @@ ...@@ -77,10 +77,6 @@
</div> </div>
</form> </form>
{% endblock %} {% endblock %}
{% block modal_confirm_id %}btn_asset_bulk_update{% endblock %} {% block modal_confirm_id %}btn_asset_bulk_update{% endblock %}
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="tagBtnList"> <div class="tagBtnList">
{% for tag in tag_list %} {% for tag in tag_list %}
<a href="{% url 'assets:asset-tags' tag_id=tag.0 %}" <a href="{% url 'assets:asset-tags' tag_id=tag.0 %}"
{% if tag.0|int_to_str == tag_id %} {% if tag.0 == tag_id %}
class="tagBtn2 label label-warning" name="tag_on"> class="tagBtn2 label label-warning" name="tag_on">
{% else %} {% else %}
class="tagBtn2 label label-default"> class="tagBtn2 label label-default">
...@@ -104,6 +104,38 @@ function tagShow() { ...@@ -104,6 +104,38 @@ function tagShow() {
} }
} //onload; } //onload;
function objDelete(obj, name, url) {
function doDelete() {
var body = {};
var success = function() {
swal('Deleted!', "[ "+name+"]"+" has been deleted ", "success");
$(obj).parent().parent().remove();
};
var fail = function() {
swal("Failed", "Delete"+"[ "+name+" ]"+"failed", "error");
};
APIUpdateAttr({
url: url,
body: JSON.stringify(body),
method: 'DELETE',
success: success,
error: fail
});
}
swal({
title: 'Are you sure delete ?',
text: " [" + name + "] ",
type: "warning",
showCancelButton: true,
cancelButtonText: 'Cancel',
confirmButtonColor: "#DD6B55",
confirmButtonText: 'Confirm',
closeOnConfirm: false
}, function () {
doDelete()
});
}
$(document).ready(function(){ $(document).ready(function(){
var options = { var options = {
ele: $('#asset_list_table'), ele: $('#asset_list_table'),
...@@ -186,7 +218,7 @@ $(document).ready(function(){ ...@@ -186,7 +218,7 @@ $(document).ready(function(){
var name = $(this).closest("tr").find(":nth-child(2)").children('a').html(); var name = $(this).closest("tr").find(":nth-child(2)").children('a').html();
var uid = $this.data('uid'); var uid = $this.data('uid');
var the_url = '{% url "api-assets:asset-detail" pk=99991937 %}'.replace('99991937', uid); var the_url = '{% url "api-assets:asset-detail" pk=99991937 %}'.replace('99991937', uid);
objectDelete($this, name, the_url); objDelete($this, name, the_url);
$data_table.ajax.reload(); $data_table.ajax.reload();
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment