Merge branch 'Develop'
# Conflicts: # cps/db.py # cps/templates/user_edit.html
This commit is contained in:
@@ -26,7 +26,7 @@ html.http-error {
|
||||
|
||||
body{background:#f2f2f2}body h2{font-weight:normal;color:#444}
|
||||
body { margin-bottom: 40px;}
|
||||
a{color: #45b29d}a:hover{color: #444;}
|
||||
a{color: #45b29d} /*a:hover{color: #444;}*/
|
||||
.navigation .nav-head{text-transform:uppercase;color:#999;margin:20px 0}.navigation .nav-head:nth-child(1n+2){border-top:1px solid #ccc;padding-top:20px}
|
||||
.navigation li a{color:#444;text-decoration:none;display:block;padding:10px}.navigation li a:hover{background:rgba(153,153,153,0.4);border-radius:5px}
|
||||
.navigation li a span{margin-right:10px}
|
||||
@@ -82,6 +82,12 @@ span.glyphicon.glyphicon-tags {padding-right: 5px;color: #999;vertical-align: te
|
||||
.spinner {margin:0 41%;}
|
||||
.spinner2 {margin:0 41%;}
|
||||
|
||||
table .bg-dark-danger {background-color: #d9534f; color: #fff;}
|
||||
table .bg-dark-danger a {color: #fff;}
|
||||
table .bg-dark-danger:hover {background-color: #c9302c;}
|
||||
table .bg-primary:hover {background-color: #1C5484;}
|
||||
table .bg-primary a {color: #fff;}
|
||||
|
||||
.block-label {display: block;}
|
||||
.fake-input {position: absolute; pointer-events: none; top: 0;}
|
||||
|
||||
|
||||
@@ -228,6 +228,41 @@ $(function() {
|
||||
$(this).find(".modal-body").html("...");
|
||||
});
|
||||
|
||||
$("#modal_kobo_token")
|
||||
.on("show.bs.modal", function(e) {
|
||||
var $modalBody = $(this).find(".modal-body");
|
||||
|
||||
// Prevent static assets from loading multiple times
|
||||
var useCache = function(options) {
|
||||
options.async = true;
|
||||
options.cache = true;
|
||||
};
|
||||
preFilters.add(useCache);
|
||||
|
||||
$.get(e.relatedTarget.href).done(function(content) {
|
||||
$modalBody.html(content);
|
||||
preFilters.remove(useCache);
|
||||
});
|
||||
})
|
||||
.on("hidden.bs.modal", function() {
|
||||
$(this).find(".modal-body").html("...");
|
||||
$("#config_delete_kobo_token").show();
|
||||
});
|
||||
|
||||
$("#btndeletetoken").click(function() {
|
||||
//get data-id attribute of the clicked element
|
||||
var pathname = document.getElementsByTagName("script"), src = pathname[pathname.length-1].src;
|
||||
var path = src.substring(0,src.lastIndexOf("/"));
|
||||
// var domainId = $(this).value("domainId");
|
||||
$.ajax({
|
||||
method:"get",
|
||||
url: path + "/../../kobo_auth/deleteauthtoken/" + this.value,
|
||||
});
|
||||
$("#modalDeleteToken").modal("hide");
|
||||
$("#config_delete_kobo_token").hide();
|
||||
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
$(".discover .row").isotope("layout");
|
||||
});
|
||||
|
||||
@@ -93,6 +93,116 @@ $(function() {
|
||||
var domainId = $(e.relatedTarget).data("domain-id");
|
||||
$(e.currentTarget).find("#btndeletedomain").data("domainId", domainId);
|
||||
});
|
||||
|
||||
$('#restrictModal').on('hidden.bs.modal', function () {
|
||||
// Destroy table and remove hooks for buttons
|
||||
$("#restrict-elements-table").unbind();
|
||||
$('#restrict-elements-table').bootstrapTable('destroy');
|
||||
$("[id^=submit_]").unbind();
|
||||
$('#h1').addClass('hidden');
|
||||
$('#h2').addClass('hidden');
|
||||
$('#h3').addClass('hidden');
|
||||
$('#h4').addClass('hidden');
|
||||
});
|
||||
function startTable(type){
|
||||
var pathname = document.getElementsByTagName("script"), src = pathname[pathname.length-1].src;
|
||||
var path = src.substring(0,src.lastIndexOf("/"));
|
||||
$("#restrict-elements-table").bootstrapTable({
|
||||
formatNoMatches: function () {
|
||||
return "";
|
||||
},
|
||||
url: path + "/../../ajax/listrestriction/" + type,
|
||||
rowStyle: function(row, index) {
|
||||
console.log('Reihe :' + row + ' Index :'+ index);
|
||||
if (row.id.charAt(0) == 'a') {
|
||||
return {classes: 'bg-primary'}
|
||||
}
|
||||
else {
|
||||
return {classes: 'bg-dark-danger'}
|
||||
}
|
||||
},
|
||||
onClickCell: function (field, value, row, $element) {
|
||||
if(field == 3){
|
||||
console.log("element")
|
||||
$.ajax ({
|
||||
type: 'Post',
|
||||
data: 'id=' + row.id + '&type=' + row.type + "&Element=" + row.Element,
|
||||
url: path + "/../../ajax/deleterestriction/" + type,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function(data) {
|
||||
$.ajax({
|
||||
method:"get",
|
||||
url: path + "/../../ajax/listrestriction/"+type,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function(data) {
|
||||
$("#restrict-elements-table").bootstrapTable("load", data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
striped: false
|
||||
});
|
||||
$("#restrict-elements-table").removeClass('table-hover');
|
||||
$("#restrict-elements-table").on('editable-save.bs.table', function (e, field, row, old, $el) {
|
||||
console.log("Hallo");
|
||||
$.ajax({
|
||||
url: path + "/../../ajax/editrestriction/"+type,
|
||||
type: 'Post',
|
||||
data: row //$(this).closest("form").serialize() + "&" + $(this)[0].name + "=",
|
||||
});
|
||||
});
|
||||
$("[id^=submit_]").click(function(event) {
|
||||
// event.stopPropagation();
|
||||
// event.preventDefault();
|
||||
$(this)[0].blur();
|
||||
console.log($(this)[0].name);
|
||||
$.ajax({
|
||||
url: path + "/../../ajax/addrestriction/"+type,
|
||||
type: 'Post',
|
||||
data: $(this).closest("form").serialize() + "&" + $(this)[0].name + "=",
|
||||
success: function () {
|
||||
$.ajax ({
|
||||
method:"get",
|
||||
url: path + "/../../ajax/listrestriction/"+type,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function(data) {
|
||||
$("#restrict-elements-table").bootstrapTable("load", data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return;
|
||||
});
|
||||
}
|
||||
$('#get_column_values').on('click',function()
|
||||
{
|
||||
startTable(1);
|
||||
$('#h2').removeClass('hidden');
|
||||
});
|
||||
|
||||
$('#get_tags').on('click',function()
|
||||
{
|
||||
startTable(0);
|
||||
$('#h1').removeClass('hidden');
|
||||
});
|
||||
$('#get_user_column_values').on('click',function()
|
||||
{
|
||||
startTable(3);
|
||||
$('#h4').removeClass('hidden');
|
||||
});
|
||||
|
||||
$('#get_user_tags').on('click',function()
|
||||
{
|
||||
startTable(2);
|
||||
$(this)[0].blur();
|
||||
$('#h3').removeClass('hidden');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* Function for deleting domain restrictions */
|
||||
@@ -104,3 +214,12 @@ function TableActions (value, row, index) {
|
||||
"</a>"
|
||||
].join("");
|
||||
}
|
||||
|
||||
/* Function for deleting domain restrictions */
|
||||
function RestrictionActions (value, row, index) {
|
||||
return [
|
||||
"<div class=\"danger remove\" data-restriction-id=\"" + row.id + "\" title=\"Remove\">",
|
||||
"<i class=\"glyphicon glyphicon-trash\"></i>",
|
||||
"</div>"
|
||||
].join("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user