forked from opensourceBIM/bimvie.ws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basicusersettings.html
56 lines (51 loc) · 1.81 KB
/
basicusersettings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<div class="basicusersettings">
<h3>Basic User Settings</h3>
<form role="form">
<div class="checkbox class showDeletedItemsDiv">
<label> <input type="checkbox" class="showDeletedItems"> Show deleted items
(projects, users)
</label>
</div>
<div class="checkbox class showImportAlertDiv">
<label> <input type="checkbox" class="showImportAlert"> Show import alert on projects page
</label>
</div>
<div class="row">
<div class="form-group col-lg-4">
<label>Service Token</label>
<input type="text" class="tokenInput form-control" disabled="disabled"/>
</div>
</div>
</form>
</div>
<script>
function BasicUserSettings(containerDiv, main) {
var othis = this;
if (main.user.userType != "ADMIN") {
containerDiv.find(".showDeletedItemsDiv").hide();
}
this.showDeletedItemsChange = function(){
$.cookie(main.user.oid + "showdeleteditems", $(this).is(":checked"));
Global.notifier.setSuccess("Show deleted items settings successfully changed");
};
this.showImportAlertChange = function(){
$.cookie(main.user.oid + "importalert", $(this).is(":checked"));
Global.notifier.setSuccess("Show import alert setting successfully changed");
};
this.show = function(){
Global.bimServerApi.call("ServiceInterface", "getUserByUoid", {uoid: main.user.oid}, function(user){
containerDiv.find(".tokenInput").val(user.token);
});
containerDiv.find(".showDeletedItems").change(othis.showDeletedItemsChange);
containerDiv.find(".showImportAlert").change(othis.showImportAlertChange);
if ($.cookie(main.user.oid + "showdeleteditems") == "true") {
containerDiv.find(".showDeletedItems").prop("checked", "checked");
}
if ($.cookie(main.user.oid + "importalert") == "true") {
containerDiv.find(".showImportAlert").prop("checked", "checked");
}
};
this.close = function(){
};
}
</script>