Commit 56e6d6c6 authored by Muhamad's avatar Muhamad

user_layout,dll

parent d943372a
......@@ -2276,7 +2276,6 @@ def createbang(request):
tb = tibang
except:
tb = 0
print(tb)
try:
if ltbang == "" and tibang != "":
......@@ -2288,13 +2287,11 @@ def createbang(request):
ltb = ltbang
except:
ltb = 0
print(ltb)
if kilimep == "":
pemilik = "unnamed"
else:
pemilik = kilimep
print(pemilik)
# try:
......@@ -2302,6 +2299,11 @@ def createbang(request):
kel.execute("SELECT desa, kecamatan, kab_kota, provinsi FROM geo_data_kelurahan WHERE st_intersects(geom, 'SRID=4326;POINT(%s)'::geometry)"% latlng)
adm = kel.fetchall()
print(adm)
if adm == []:
administrasi = ["", "", "", ""]
else:
administrasi = adm[0]
with conn.cursor() as buldings:
......
......@@ -126,7 +126,26 @@ class Usermanagement(generic.TemplateView):
ag.id = aug.group_id AND
ag.id IN("""+ars+")"
else:
print('not staff')
sql = """
SELECT
au.id,
au.username,
au.first_name,
au.last_name,
au.is_active,
au.last_login,
au.email,
ag.name,
au.is_staff,
au.is_superuser
FROM
auth_user au,
auth_user_groups aug,
auth_group ag
WHERE
au.id = aug.user_id AND
ag.id = aug.group_id AND
ag.id IN("""+ars+")"
userlist_.execute(sql)
allUser = userlist_.fetchall()
......
var map = L.map('map', { editable: true, zoomControl: false, drawControl: true }).setView([-4.125826277307029, 104.1881561279297], 10);
var map = L.map('map', { editable: true, zoomControl: false, drawControl: true }).setView([-4.117012285203445, 104.0673065185547], 10);
var pool = [];
......
......@@ -240,6 +240,7 @@
content = `
<a href="#" data-target="#modal_detail_kel" id="btn_detail_kelurahan" data-toggle="modal" data-target="#modal-edit-tuplah" data-backdrop="static" data-keyboard="false" style="right: 10px;position: absolute;margin-top: 375px;">Detail</a>
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
......@@ -680,6 +681,10 @@
}
});
};
$(document).on("click", "#btn_detail_kelurahan", function() {
});
$(document).on("click", "#btn_edit_kelurahan", function() {
......
......@@ -709,6 +709,141 @@
</div>
</div>
</div>
<div id="modal_detail_kel" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title">Informasi Umum</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<div class="tab-pane has-padding" id="panel-tab2">
<div class="tab-pane" id="bottom-justified-data">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
<div class="row">
<div class="col-md-5">
</div>
<div class="col-md-7">
<div class="tab-pane active" id="left-tab1-feas-upl">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan">
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama :</label>
<input type="text" id="nama_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Type :</label>
<input type="text" id="type_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kelurahan :</label>
<input type="text" id="kelurahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kecamatan :</label>
<input type="text" id="kecamatan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Disetujui :</label>
<input type="date" id="tgldisetujui_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Mulai Perbaikan :</label>
<input type="date" id="tglmulaiperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Selesai Perbaikan :</label>
<input type="date" id="tglselesaiperbaikan_bang" class="form-control" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Anggaran :</label>
<input type="text" id="anggaran_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Pihak yang Mengesahkan :</label>
<input type="text" id="pihakpengesahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Penanggung Jawab Lapangan :</label>
<input type="text" id="pjlapangan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kontraktor :</label>
<input type="text" id="kontraktor_bang" class="form-control" value="">
</div>
<!-- <div class="form-group">
<label>Panjang Jalan Keseluruhan :</label>
<input type="text" id="panjangjalanall" class="form-control" value="">
</div>
<div class="form-group">
<label>Panjang Jalan Perbaikan :</label>
<input type="text" id="panjangjalanperbaikan" class="form-control" value="">
</div>
<div class="form-group">
<label>Lebar Jalan Perbaikan :</label>
<input type="text" id="lebarjalanperbaikan" class="form-control" value="">
</div> -->
<div class="form-group">
<label>Jenis Perbaikan :</label>
<input type="text" id="jenisperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Proposal (.pdf):</label>
<input type="file" id="proposal_bang">
</div>
<div class="form-group">
<label>Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):</label>
<input type="file" id="buktiselesai_bang">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal">Close</button>
<button type="button" id="btnsavevalidasi" class="btn btn-info">Save changes</button>
</div>
</div>
</div>
</div>
<!--
<script>
$("#tipe_point").change(function() {
......
......@@ -33,6 +33,8 @@
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{% url 'usermanagement' %}?page=userprofile"><i class="icon-user-tie"></i>User Profile</a></li>
{% if user.is_superuser or user.is_staff %}
<li><a href="{% url 'usermanagement' %}"><i class="icon-user"></i>User Management</a></li>
<li><a href="{% url 'apps:perbaikan' %}"><i class="icon-list"></i>Repair & Renovation</a></li>
......
......@@ -38,7 +38,6 @@
.modal-backdrop {
z-index: -1!important;
}
.sidebar {
......@@ -116,8 +115,7 @@
height: 270px;
}
#placelg{
#placelg {
object-fit: cover;
object-position: center center;
width: 30px;
......@@ -132,7 +130,7 @@
border: 1px solid red;
}
.modal-lg{
.modal-lg {
max-width: 1000px !important;
}
......@@ -164,8 +162,6 @@
transform: translate(-50%, -50%);
text-align: center;
}
</style>
</head>
......@@ -212,8 +208,10 @@
</a>
<ul class="dropdown-menu dropdown-menu-right">
{% if user.is_superuser or user.is_staff %}
<li><a href="/"><i class="icon-home2"></i>Dashboard</a></li>
<li><a href="{% url 'usermanagement' %}?page=userprofile"><i class="icon-user-tie"></i>User Profile</a></li>
{% if user.is_superuser or user.is_staff %}
<li><a href="{% url 'usermanagement' %}"><i class="icon-user"></i>User Management</a></li>
<li><a href="{% url 'apps:perbaikan' %}"><i class="icon-list"></i>Repair & Renovation</a></li>
{% endif %}
......@@ -241,14 +239,12 @@
<div class="sidebar-user">
<div class="category-content">
<div class="media">
{% for us in thisUser %}
{% if us.filepath %}
{% for us in thisUser %} {% if us.filepath %}
<a href="#" class="media-left"><img src="{% static 'img/' %}{{us.filepath}}" class="img-circle img-sm" alt=""></a>
{% else %}
<a href="#" class="media-left"><img src="{% static '/img/placeholder.jpg' %}" class="img-circle img-sm" alt=""></a>
{% endif %}
{% endfor %}
{% endif %} {% endfor %}
<div class="media-body">
<span class="media-heading text-semibold">{{user.username}}</span>
......@@ -277,8 +273,14 @@
<!-- Main -->
<li class="navigation-header"> <i class="icon-menu" title="Main pages"></i></li>
<li><a href="/"><i class="icon-home2"></i>Dashboard</a></li>
{% if user.is_superuser or user.is_staff %}
<li><a href="?page=user" class="tablinks" id="defaultOpen"><i class="icon-user"></i><span>User Management</span></a></li>
<li><a href="?page=group" class="tablinks" id="defaultOpen"><i class="icon-users4"></i><span>Group</span></a></li>
{% else %}
<li><a href="#" class="tablinks" id="defaultOpen"><i class="icon-users4"></i><span>User Profile</span></a></li>
{% endif %}
<!-- <li><a class="tablinks" onclick="openInfo(event, 'info-penduduk')" id="defaultOpen"><span>Kependudukan</span></a></li>
<li><a class="tablinks" onclick="openInfo(event, 'info-pendidikan')" id="defaultOpen"><span>Pendidikan</span></a></li>
<li><a class="tablinks" onclick="openInfo(event, 'info-pekerjaan')" id="defaultOpen"><span>Pekerjaan</span></a></li>
......@@ -298,6 +300,7 @@
<!-- Main content -->
<!-- User management Tab -->
{% if user.is_superuser or user.is_staff %}
<div class="content-wrapper" id="info-maps">
<div>
<!-- Page header -->
......@@ -446,6 +449,9 @@
</div>
</div>
{% endif %}
<!-- content profile -->
<div class="content-wrapper" id="userprofile" style="display: none;">
<div>
......@@ -504,7 +510,7 @@
<div class="row">
<div class="col-md-6">
<label>Username </label>
<input type="text" id="username" class="form-control" value="{{us.username}}"readonly>
<input type="text" id="username" class="form-control" value="{{us.username}}" readonly>
</div>
</div>
......@@ -534,7 +540,7 @@
<div class="row">
<div class="col-md-6">
<label>Email </label>
<input type="text" id="useremail" class="form-control" value="{{us.email}}"readonly>
<input type="text" id="useremail" class="form-control" value="{{us.email}}" readonly>
</div>
</div>
......@@ -755,7 +761,7 @@
<h6 class="modal-title"> Edit Password</h6>
</div>
<div class="modal-body">
<div >
<div>
<div class="alert alert-danger" id="notifications" style="display: none">
</div>
......@@ -775,7 +781,7 @@
<div class="col-md-12">
<label class="control-label"> Password saat ini :</label>
<input type="password" id="currentPass" class="form-control" >
<input type="password" id="currentPass" class="form-control">
</div>
</div>
......@@ -784,7 +790,7 @@
<div class="col-md-12">
<label class="control-label"> Password baru :</label>
<input type="password" id="newPass" class="form-control" >
<input type="password" id="newPass" class="form-control">
</div>
</div>
......@@ -793,7 +799,7 @@
<div class="col-md-12">
<label class="control-label"> Ulangi password baru :</label>
<input type="password" id="renewPass" class="form-control" >
<input type="password" id="renewPass" class="form-control">
</div>
</div>
......@@ -975,8 +981,7 @@
<!-- <script type="text/javascript" src="{% static 'js/plugins/ui/ripple.min.js' %}"></script> -->
<!-- /theme JS files -->
{% include 'includes/scripts.html' %}
{% include 'layout/userprofile.html' %}
{% include 'includes/scripts.html' %} {% include 'layout/userprofile.html' %}
<script src="{% static 'js/leaflet-bing-layer.js' %}"></script>
<!-- <script src="https://unpkg.com/sweetalert/dists/sweetalert.min.js"></script> -->
......@@ -1056,15 +1061,15 @@
const urlParams = new URLSearchParams(queryString);
const page = urlParams.get('page')
if (page == "group" ) {
if (page == "group") {
$("#usergroup").css("display", "block");
$("#info-maps").css("display", "none");
$("#userprofile").css("display", "none");
} else if(page == "user" || page == null){
} else if (page == "user" || page == null) {
$("#usergroup").css("display", "none");
$("#info-maps").css("display", "block");
$("#userprofile").css("display", "none")
} else{
} else {
$("#usergroup").css("display", "none");
$("#info-maps").css("display", "none");
$("#userprofile").css("display", "block");
......@@ -1579,11 +1584,11 @@
//user profile js
$("#save-edt-password").on("click", function(){
$("#save-edt-password").on("click", function() {
changepassword();
})
function changepassword(){
function changepassword() {
var isObject = {};
isObject.id = $("#iduseredt").val();
......@@ -1592,7 +1597,7 @@
isObject.renewPass = $("#renewPass").val();
isObject.username = $("#usernameedt").val();
if(isObject.currPass == "" || isObject.newPass == "" || isObject.renewPass == ""){
if (isObject.currPass == "" || isObject.newPass == "" || isObject.renewPass == "") {
$("#notifications").css("display", "block")
$("#notifications").html("Inputan tidak boleh kosong")
......@@ -1629,11 +1634,11 @@
}
$("#save-edit-profile").on("click", function(){
$("#save-edit-profile").on("click", function() {
editprofile();
})
function editprofile(){
function editprofile() {
var isObject = {}
isObject.id = $("#iduseredt").val();
......@@ -1641,14 +1646,14 @@
isObject.last_name = $("#lastnameedt").val();
isObject.email = $("#emailedts").val()
if(isObject.first_name == "" || isObject.last_name == "" || isObject.email == ""){
if (isObject.first_name == "" || isObject.last_name == "" || isObject.email == "") {
$("#notificationsprop").css("display", "block");
$("#notificationsprop").html("Inputan tidak boleh kosong")
return false
}else{
} else {
var mail_format = /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/;
if(!isObject.email.match(mail_format)){
if (!isObject.email.match(mail_format)) {
$("#notificationsprop").css("display", "block");
$("#notificationsprop").html("Format email tidak valid, silahkan coba kembali.")
return false
......@@ -1739,6 +1744,4 @@
}
})
});
</script>
\ No newline at end of file
......@@ -74,7 +74,8 @@
.leaflet-control-container {
display: none;
}
.modal-backdrop{
.modal-backdrop {
display: none;
}
</style>
......@@ -225,7 +226,7 @@
</div>
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<div class="row" style="margin-bottom: 20px;">
<div class="col-lg-7">
<div>
<div id="map" class="map-container" style="padding-top: -100px; max-width:600px; max-height:385px;margin-bottom: 15px;"></div>
......@@ -319,8 +320,15 @@
</div>
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-4" style="max-width: 335px;">
<div class="form-group text-center">
<h5 style="margin-top: 0px;margin-bottom: 10px;">
<b>
Informasi Umum
</b>
</h5>
</div>
<fieldset>
<div class="form-group">
<label class="col-lg-3 control-label">Jumlah Penduduk:</label>
......@@ -380,6 +388,13 @@
</div>
<div class="col-md-4" style="max-width: 400px;">
<div class="form-group text-center">
<h5 style="margin-top: 0px;margin-bottom: 10px;">
<b>
Agama
</b>
</h5>
</div>
<fieldset>
<div class="form-group">
......@@ -430,6 +445,13 @@
<div class="col-md-4" style="max-width: 400px;">
<div class="row">
<div class="form-group text-center">
<h5 style="margin-top: 0px;margin-bottom: 10px;">
<b>
Umur (Usia)
</b>
</h5>
</div>
<div class="col-md-6">
<fieldset>
<div class="form-group">
......@@ -586,7 +608,7 @@
</div>
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-6" style="max-width: 500px;">
<fieldset>
<div class="form-group">
......@@ -710,7 +732,7 @@
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-4" style="max-width: 400px;">
<fieldset>
<div class="form-group">
......@@ -985,7 +1007,7 @@
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-6" style="margin-left: 30px;max-width: 500px;">
<fieldset>
<div class="form-group">
......@@ -1040,9 +1062,9 @@
<div id="modal_theme_DEL" class="modal fade">
<div class="modal-dialog">
<div class="modal-content" style="width: 400px;margin-left: 100px;">
<div class="modal-header bg-info">
<div class="modal-header bg-info" style="background-color: #37474F;border-color: #37474F;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title">Info header</h6>
<h6 class="modal-title">Informasi Umum</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
......
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