Commit f7c61c39 authored by Manggar Mahardhika's avatar Manggar Mahardhika

Merge branch 'master' of http://git.khansia.co.id/Nahrowi/oku-gis

parents 6751c71a fe5ca450
...@@ -510,10 +510,14 @@ class Dashboard(generic.TemplateView): ...@@ -510,10 +510,14 @@ class Dashboard(generic.TemplateView):
} }
res_all.append(data_all) res_all.append(data_all)
perm_group = []
if request.user.is_authenticated: if request.user.is_authenticated:
current_user = request.user current_user = request.user
thisUser = current_user.id thisUser = current_user.id
for xx in request.user.get_group_permissions():
perm_group.append(xx.split(".")[1])
if thisUser == None: if thisUser == None:
user_data = {"filepath":'placeholder.jpg'} user_data = {"filepath":'placeholder.jpg'}
else: else:
...@@ -582,7 +586,7 @@ class Dashboard(generic.TemplateView): ...@@ -582,7 +586,7 @@ class Dashboard(generic.TemplateView):
auth_group ag auth_group ag
WHERE WHERE
au.id = aug.user_id AND au.id = aug.user_id AND
ag.id = aug.group_id AND ag.id = aug.group_id
ORDER BY ORDER BY
au.username ASC""" au.username ASC"""
userlist_.execute(sql) userlist_.execute(sql)
...@@ -626,6 +630,7 @@ class Dashboard(generic.TemplateView): ...@@ -626,6 +630,7 @@ class Dashboard(generic.TemplateView):
'global':all[0], 'global':all[0],
'res_all':res_all, 'res_all':res_all,
'thisUser' : user_data, 'thisUser' : user_data,
'perm_group' : perm_group
# 'user_res':user_res # 'user_res':user_res
} }
return render (request, self.template_name, context) return render (request, self.template_name, context)
......
...@@ -636,6 +636,13 @@ ...@@ -636,6 +636,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_kantor_administrasi') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_kantor_administrasi') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_adm = ` content_delete_adm = `
<div class="modal-dialog md"> <div class="modal-dialog md">
...@@ -1146,6 +1153,14 @@ ...@@ -1146,6 +1153,14 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_layanan_kesehatan') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_layanan_kesehatan') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_edit_lk = ` content_edit_lk = `
...@@ -1564,6 +1579,13 @@ ...@@ -1564,6 +1579,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_puskesmas') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_puskesmas') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_edit_puskes = ` content_edit_puskes = `
<div class="modal-dialog md"> <div class="modal-dialog md">
<div class="modal-content"> <div class="modal-content">
...@@ -1978,6 +2000,13 @@ ...@@ -1978,6 +2000,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_rumah_sakit') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_rumah_sakit') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_edit_rs = ` content_edit_rs = `
<div class="modal-dialog md"> <div class="modal-dialog md">
...@@ -2600,6 +2629,13 @@ ...@@ -2600,6 +2629,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_sarana_ibadah') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_sarana_ibadah') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
...@@ -3103,6 +3139,13 @@ ...@@ -3103,6 +3139,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_sarana_pendidikan') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_sarana_pendidikan') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
<div class="modal-content"> <div class="modal-content">
...@@ -3889,7 +3932,13 @@ ...@@ -3889,7 +3932,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_statiun') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_stasiun') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
<div class="modal-content"> <div class="modal-content">
...@@ -4277,6 +4326,14 @@ ...@@ -4277,6 +4326,14 @@
</div> </div>
`) `)
if (list_perm.indexOf('delete_terminal_bus') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_terminal_bus') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
<div class="modal-content"> <div class="modal-content">
...@@ -4665,6 +4722,14 @@ ...@@ -4665,6 +4722,14 @@
</div> </div>
`) `)
if (list_perm.indexOf('delete_cagar_budaya') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_cagar_budaya') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
<div class="modal-content"> <div class="modal-content">
...@@ -5064,6 +5129,13 @@ ...@@ -5064,6 +5129,13 @@
<a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_adm" data-toggle="modal" data-target="#modald_adm" data-backdrop="static" data-keyboard="false" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;" title="Delete"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_gardu_listrik') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_gardu_listrik') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content_delete_point = ` content_delete_point = `
<div class="modal-dialog md"> <div class="modal-dialog md">
...@@ -5415,15 +5487,15 @@ ...@@ -5415,15 +5487,15 @@
// var map_cesium = new Cesium.Viewer('map-cesium'); // var map_cesium = new Cesium.Viewer('map-cesium');
var map_cesium = new Cesium.Viewer('map-cesium', { var map_cesium = new Cesium.Viewer('map-cesium', {
imageryProvider : new Cesium.BingMapsImageryProvider({ imageryProvider: new Cesium.BingMapsImageryProvider({
url : '//dev.virtualearth.net', url: '//dev.virtualearth.net',
key : 'Anj9XBZaRShAMdbXJlZ16iqEVpjikY1eY_dzqGl451WYkSKV3l_FJaFgMbhwdbLz', key: 'Anj9XBZaRShAMdbXJlZ16iqEVpjikY1eY_dzqGl451WYkSKV3l_FJaFgMbhwdbLz',
mapStyle : Cesium.BingMapsStyle.AERIAL mapStyle: Cesium.BingMapsStyle.AERIAL
//url : '//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer', //url : '//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
//url : Cesium.buildModuleUrl('/static/Cesium-185/Build/Cesium/Assets/Textures/NaturalEarthII') //url : Cesium.buildModuleUrl('/static/Cesium-185/Build/Cesium/Assets/Textures/NaturalEarthII')
}), }),
baseLayerPicker : false, baseLayerPicker: false,
geocoder : false geocoder: false
}); });
//function mapsganti() { //function mapsganti() {
...@@ -6441,6 +6513,14 @@ ...@@ -6441,6 +6513,14 @@
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_tampak" id="btn_upload_tampak" data-backdrop="static" data-keyboard="false"><i>Upload Tampak Bangunan 3D</i></a> <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_tampak" id="btn_upload_tampak" data-backdrop="static" data-keyboard="false"><i>Upload Tampak Bangunan 3D</i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_bangunan') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_bangunan') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
content = `<table class="table table-hover tasks-list"> content = `<table class="table table-hover tasks-list">
<thead style="text-align: center;"> <thead style="text-align: center;">
<tr> <tr>
...@@ -8580,7 +8660,13 @@ ...@@ -8580,7 +8660,13 @@
<a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a> <a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_bangunan') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_bangunan') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
$("#isi_panel").html(content); $("#isi_panel").html(content);
$("#modal_bangunan_edit").html(content_edit); $("#modal_bangunan_edit").html(content_edit);
......
...@@ -1026,6 +1026,13 @@ ...@@ -1026,6 +1026,13 @@
"> ">
<a href="#" class="btn" id="btn_edit_tuplah" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a> <a href="#" class="btn" id="btn_edit_tuplah" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>`) </div>`)
if (list_perm.indexOf('delete_tuplah') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_tuplah') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
$(".nama_keterangan").html(feature.legend.f2) $(".nama_keterangan").html(feature.legend.f2)
...@@ -1951,6 +1958,13 @@ ...@@ -1951,6 +1958,13 @@
<a href="#" id="btn_hapus_jalan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a> <a href="#" id="btn_hapus_jalan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div> </div>
`) `)
if (list_perm.indexOf('delete_jalan') >= 0 === false) {
$(".tombol-delete-keterangan").remove();
}
if (list_perm.indexOf('change_jalan') >= 0 === false) {
$(".tombol-edit-keterangan").remove();
}
if (feature.properties.f7 != null) { if (feature.properties.f7 != null) {
...@@ -2032,7 +2046,7 @@ ...@@ -2032,7 +2046,7 @@
`) `)
content_his_jal=` content_his_jal = `
<div class="modal-dialog" style="height: max-content;"> <div class="modal-dialog" style="height: max-content;">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="height: 50px;background: #1E2233;border-top-left-radius: 10px;border-top-right-radius: 10px;"> <div class="modal-header" style="height: 50px;background: #1E2233;border-top-left-radius: 10px;border-top-right-radius: 10px;">
...@@ -2928,7 +2942,7 @@ ...@@ -2928,7 +2942,7 @@
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if ((data[0]==null) || (data[0]=="")){ if ((data[0] == null) || (data[0] == "")) {
$("#namajalan2").val(); $("#namajalan2").val();
} else { } else {
$("#namajalan2").val(data[0]); $("#namajalan2").val(data[0]);
......
<script>
var list_perm = []
</script>
{% for p in perm_group %}
<script>
var perm = "{{p}}"
list_perm.push(perm)
</script>
{% endfor %}
<script>
if (list_perm.indexOf('add_roads') >= 0 === false) {
$(".btn_create_jalan").remove();
}
if (list_perm.indexOf('add_bangunan') >= 0 === false) {
$(".btn_create_bangunan").remove();
}
if (list_perm.indexOf('add_kantor_administrasi') >= 0 === false || list_perm.indexOf('add_layanan_kesehatan') >= 0 === false || list_perm.indexOf('add_puskesmas') >= 0 === false || list_perm.indexOf('add_rumah_sakit') >= 0 === false || list_perm.indexOf('add_sarana_ibadah') >= 0 === false || list_perm.indexOf('add_sarana_pendidikan') >= 0 === false || list_perm.indexOf('add_stasiun') >= 0 === false || list_perm.indexOf('add_terminal_bus') >= 0 === false || list_perm.indexOf('add_cagar_budaya') >= 0 === false || list_perm.indexOf('add_gardu_listrik') >= 0 === false) {
$(".btn_create_point").remove();
}
if (list_perm.indexOf('add_roads') >= 0 === false && list_perm.indexOf('add_bangunan') >= 0 === false && list_perm.indexOf('add_kantor_administrasi') >= 0 === false || list_perm.indexOf('add_layanan_kesehatan') >= 0 === false || list_perm.indexOf('add_puskesmas') >= 0 === false || list_perm.indexOf('add_rumah_sakit') >= 0 === false || list_perm.indexOf('add_sarana_ibadah') >= 0 === false || list_perm.indexOf('add_sarana_pendidikan') >= 0 === false || list_perm.indexOf('add_stasiun') >= 0 === false || list_perm.indexOf('add_terminal_bus') >= 0 === false || list_perm.indexOf('add_cagar_budaya') >= 0 === false || list_perm.indexOf('add_gardu_listrik') >= 0 === false) {
$("#modal_option_create").remove();
}
</script>
\ No newline at end of file
...@@ -49,23 +49,20 @@ ...@@ -49,23 +49,20 @@
font-family: 'gilroyultralight'; font-family: 'gilroyultralight';
src: url('/static/css/Gilroy-UltraLight.woff') format('woff'); src: url('/static/css/Gilroy-UltraLight.woff') format('woff');
} }
/* start hide fitur modal */ /* start hide fitur modal */
.tab_kdb_klb { .tab_kdb_klb {
display: none; display: none;
} }
.btn_create_lahan{ .btn_create_lahan {
display: none; display: none;
} }
.btn_cek_KDBKLB{ .btn_cek_KDBKLB {
display: none; display: none;
} }
/* end hide fitur modal */ /* end hide fitur modal */
</style> </style>
{% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %} {% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %}
...@@ -873,8 +870,7 @@ ...@@ -873,8 +870,7 @@
</body> </body>
</html> </html>
{% include 'includes/permission.html' %} {% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
{% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
<script type="text/javascript" src="{% static 'js/action.js' %}"></script> <script type="text/javascript" src="{% static 'js/action.js' %}"></script>
<script> <script>
// start disabled inspect // start disabled inspect
...@@ -916,7 +912,7 @@ ...@@ -916,7 +912,7 @@
$("#pilihcari").html('<i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i>') $("#pilihcari").html('<i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i>')
} else if (dar == ' Jalan') { } else if (dar == ' Jalan') {
$("#pilihcari").html('<i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i>') $("#pilihcari").html('<i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i>')
}else if (dar == ' Reset') { } else if (dar == ' Reset') {
$("#pilihcari").html('') $("#pilihcari").html('')
} }
}); });
......
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