Commit 9c526a4a authored by Muhamad's avatar Muhamad

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

# Conflicts:
#	API/__pycache__/views.cpython-37.pyc
#	API/views.py
#	Application/__pycache__/views.cpython-37.pyc
#	Application/views.py
#	OKU/__pycache__/settings.cpython-37.pyc
#	myauth/__pycache__/views.cpython-37.pyc
#	templates/includes/js-o.html
#	templates/includes/modal.html
#	templates/includes/navbar.html
#	templates/includes/plugin.html
#	templates/layout/layout.html
#	templates/layout/user_layout.html
#	templates/maps/e.html
parents 95cddbb4 56e6d6c6
......@@ -15,8 +15,8 @@ from django.db import connection as conn
# Create your views here.
from rest_framework.renderers import JSONRenderer, TemplateHTMLRenderer
#from django.utils import six
import six
from django.utils import six
#import six
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse, HttpResponseNotFound
......@@ -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,7 @@
}
});
};
$(document).on("click", "#btn_detail_kelurahan", function() {
$(document).on("click", "#btn_edit_kelurahan", function() {
......
......@@ -42,6 +42,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>
......
......@@ -236,6 +236,7 @@
left: -408px;
max-width: 100%;
float: right;
/* left: -5px; */
position: absolute;
z-index: 1000;
......@@ -325,6 +326,20 @@
.move-btn {
transform: rotate(180deg)
}
/*.fixed-plugin {*/
/* position: absolute;*/
/* z-index: 1000;*/
/* right: 0px;*/
/* background-color: #40777c;*/
/* border-top-left-radius: 10px;*/
/* border-bottom-left-radius: 10px;*/
/* margin-top: 5px;*/
/* width: 48px;*/
/* height: 48px;*/
/* box-shadow: 0 0 20px rgb(0 0 0 / 30%);*/
/* transition: 0.3s ease-out;*/
/* display: inline-block;*/
/*}*/
.fixed-plugin {
position: absolute;
......
......@@ -250,6 +250,8 @@
{% endif %}
{% endfor %}
{% endif %} {% endfor %}
<div class="media-body">
<span class="media-heading text-semibold">{{user.username}}</span>
<div class="text-size-mini text-muted">
......@@ -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 -->
......@@ -568,6 +571,133 @@
</div>
<!-- /page content -->
</div>
<!-- /page container -->
{% endif %}
<!-- content profile -->
<div class="content-wrapper" id="userprofile" style="display: none;">
<div>
<!-- Page header -->
<div class="page-header page-header-default" style="margin-bottom: 0px;">
<div class="breadcrumb-line">
<ul class="breadcrumb">
<li>User Profile</li>
</ul>
</div>
</div>
<!-- /page header -->
<!-- Content area -->
<div class="content" style="padding: 15px;">
<!-- Main charts -->
<!-- Sales stats -->
<div class="panel panel-flat" style="display: block;">
<div class="panel-body">
<div class="row" style="margin-top: 20px">
<div class="col-lg-3 col-md-6">
<div class="image_area">
<form method="post">
<label for="upload_image">
{% for us in thisUser %}
{% if us.filepath %}
<img src="{% static 'img/' %}{{us.filepath}}" id="uploaded_image" class="img-responsive img-circle" width="350px"/>
{% else %}
<img src="{% static 'img/placeholder.jpg' %}" id="uploaded_image" class="img-responsive img-circle" width="350px"/>
{% endif %}
{% endfor %}
<div class="overlay">
<div class="textover">Ubah Foto Profil</div>
</div>
<input type="file" name="image" class="image" id="upload_image" style="display:none" accept="image/png, image/gif, image/jpeg"/>
</label>
</form>
</div>
</div>
<div class="col-lg-9 col-md-6">
<div class="panel panel-flat">
<div class="panel-heading">
<h6 class="panel-title">Informasi Profil</h6>
</div>
<div class="panel-body" id="user-mahasiswa" style="display:block">
{% for us in thisUser %}
<form action="#">
<div class="form-group" id="dosormhs">
<div class="row">
<div class="col-md-6">
<label>Username </label>
<input type="text" id="username" class="form-control" value="{{us.username}}" readonly>
</div>
</div>
</div>
<div class="form-group" id="dosormhs">
<div class="row">
<div class="col-md-6">
<label>Nama Depan </label>
<input type="text" id="namadepan" class="form-control" value="{{us.firstname}}" readonly>
</div>
</div>
</div>
<div class="form-group" id="dosormhs">
<div class="row">
<div class="col-md-6">
<label>Nama Belakang </label>
<input type="text" id="namabelakang" class="form-control" value="{{us.lastname}}" readonly>
</div>
</div>
</div>
<div class="form-group" id="dosormhs">
<div class="row">
<div class="col-md-6">
<label>Email </label>
<input type="text" id="useremail" class="form-control" value="{{us.email}}" readonly>
</div>
</div>
</div>
</form>
{% endfor %}
</div>
<div class="panel-footer" style="margin-top: 20px;">
<div class="pull-right mr-5">
<button type="button" type="button" class="btn btn-primary btn-labeled btn-labeled-right " id='edit-profile-mhs' data-toggle="modal" data-target="#modal-edit-data-mhs">Edit Profile <b><i class="icon-circle-right2"></i></b></button>
<button type="button" type="button" class="btn btn-primary btn-labeled btn-labeled-right " id='edit-profile-mhs' data-toggle="modal" data-target="#modal-edt-password">Edit Password <b><i class="icon-lock"></i></b></button>
</div>
</div>
</div>
</div>
</div>
<!-- /form validation -->
</div>
</div>
<!-- /main charts -->
</div>
</div>
<!-- end content profile -->
<!-- /main content -->
</div>
<!-- /page content -->
</div>
<!-- /page container -->
<div id="modal_theme_info" class="modal fade">
......@@ -646,10 +776,94 @@
</div>
</div>
<hr>
</div>
</div>
<div id="modal-edit-data-mhs" role="dialog" class="modal fade" tabindex="-9999999" style="margin-top:5%;">
<div class="modal-dialog modal-md" role="dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header bg-primary" style="background-color: #1a222f !important;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title"> Edit Profile</h6>
</div>
<div class="modal-body">
<div class="alert alert-danger" id="notificationsprop" style="display: none">
</div>
<form class="form-horizontal" id="formmen" method="post" enctype="multipart/form-data">
<div class="panel panel-flat">
<div class="panel-body" style="margin: 20px !important">
<div class="row">
{% for us in thisUser %}
<input type="text" id="iduseredt" value="{{us.id}}" hidden>
<div class="form-group">
<div class="col-md-12">
<label class="control-label"> Username :</label>
<input type="text" id="usernamepedt" class="form-control" value="{{us.username}}" readonly>
</div>
<!-- <div class="col-md-6">
<label class="control-label"> Password saat ini :</label>
<input type="text" id="nama-mhs-edt" class="form-control" >
</div> -->
</div>
<div class="form-group">
<div class="col-md-12">
<label class="control-label"> Nama Depan:</label>
<input type="text" id="firstnameedt" class="form-control" value="{{us.firstname}}">
</div>
<!-- <div class="col-md-6">
<label class="control-label"> Password baru :</label>
<input type="text" id="nama-mhs-edt" class="form-control" >
</div> -->
</div>
<div class="form-group">
<div class="col-md-12">
<label class="control-label"> Nama Belakang:</label>
<input type="text" id="lastnameedt" class="form-control" value="{{us.lastname}}">
</div>
<!-- <div class="col-md-6">
<label class="control-label"> Ulangi password baru :</label>
<input type="text" id="nama-mhs-edt" class="form-control" >
</div> -->
</div>
<div class="form-group">
<div class="col-md-12">
<label class="control-label"> Email :</label>
<input type="text" id="emailedts" class="form-control" value="{{us.email}}">
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal" onclick="destroyfade()">Close</button>
<button type="button" class="btn btn-info" id="saveuser">Save changes</button>
<button class="btn btn-lg btn-success" id="save-edit-profile">
<i class="icon-checkmark2"></i>
Simpan
</button>
<button class="btn btn-lg" data-dismiss="modal">
<i class="icon-cross3"></i>
Batal
</button>
</div>
</div>
</div>
......@@ -890,6 +1104,83 @@
</div>
</div>
<div id="modal_group" class="modal fade">
<div class="modal-dialog md" style="margin-top: 200px;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #1a222f !important;">
<button type="button" class="close" data-dismiss="modal" onclick="destroyfade()">&times;</button>
<h6 class="modal-title modstitg">Modal Tambah Group</h6>
</div>
</div>
</div>
<div id="modal-edit-profil" role="dialog" class="modal fade" tabindex="-9999999" style="margin-top:5%;">
<div class="modal-dialog modal-lg" role="dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header bg-primary" style="background-color: #1a222f !important;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h6 class="modal-title"> Edit Picture</h6>
</div>
<div class="modal-body">
<div class="row" id="set-crop-ratio">
<div class="col-md-6 col-md-offset-3">
<div class="image-cropper-container"><img src="{% static 'img/placeholder.jpg' %}" alt="" class="crop-4-3"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-lg btn-success" id="save-picture">
<i class="icon-checkmark2"></i>
Simpan
</button>
<button class="btn btn-lg" data-dismiss="modal">
<i class="icon-cross3"></i>
Batal
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Crop Image Before Upload</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="img-container">
<div class="row">
<div class="col-md-8">
<img src="" id="sample_image" />
</div>
<div class="col-md-4">
<div class="eg-preview">
<div class="preview preview-lg"></div>
<!-- <div class="preview preview-md"></div>
<div class="preview preview-sm"></div>
<div class="preview preview-xs"></div> -->
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="crop" class="btn btn-primary">Crop</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div id="modal_group" class="modal fade">
<div class="modal-dialog md" style="margin-top: 200px;">
<div class="modal-content">
......@@ -924,6 +1215,8 @@
</div>
</div>
</div>
<hr>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal" onclick="destroyfade()">Close</button>
......
......@@ -225,7 +225,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>
......@@ -321,6 +321,13 @@
<div class="panel-body form-horizontal form-validate-jquery">
<div class="row">
<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 +387,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 +444,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 +607,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 +731,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 +1006,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 +1061,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