Commit 592304dd authored by Muhamad's avatar Muhamad

tampilan mobile stlh login smentara

parent d288374b
......@@ -234,6 +234,7 @@ def addUser(request):
password = request.POST.get('username')
iduser = request.POST.get('id')
isStaff = request.POST.get('isStaff')
phone = request.POST.get('phone')
# arrGroup = group.split("~")
......@@ -245,8 +246,9 @@ def addUser(request):
try:
if iduser:
with conn.cursor() as cursor:
cursor.execute("UPDATE auth_user SET first_name = '"+first_name+"', last_name = '"+last_name+"', email = '"+email+"' WHERE id="+iduser)
cursor.execute("UPDATE auth_user SET first_name = '"+first_name+"', last_name = '"+last_name+"', email = '"+email+"', phone = '"+phone+"' WHERE id="+iduser)
if group != 'none':
with conn.cursor() as curGroup:
curGroup.execute("DELETE FROM auth_user_groups WHERE user_id="+iduser)
......@@ -282,14 +284,20 @@ def addUser(request):
user.password = make_password(password)
user.save()
# add user to group
userinsert = User.objects.get(username=usernames)
insertgroups = Group.objects.get(name=group)
insertgroups.user_set.add(userinsert)
# add phone
with conn.cursor() as cursor:
cursor.execute("UPDATE auth_user SET phone = '%s' WHERE username = '%s' and first_name = '%s' and last_name = '%s'"%(phone, usernames, first_name, last_name))
print(user)
data = {
"code" : 0,
"info" : "success",
......@@ -424,7 +432,8 @@ def loadUserbyId(request):
"last" : rows[2],
"group" : group_res,
"is_staff" : rows[9],
"filepath" : rows[11]
"filepath" : rows[11],
"phone" : rows[12]
}
user_res.append(datas)
......
......@@ -832,6 +832,19 @@ input#change_stat {
margin: 10px;
}
.navbar .navbar-inverse {
display: none
}
.page-content {
display: table;
}
body>ul>li.fixed-plugin.no3d.overlay-cek>div.dropdown.show-dropdown.open>ul {
width: 300px;
margin-left: -270px!important;
}
@media (max-width: 1025px) {
.dock {
position: absolute;
......@@ -860,3 +873,134 @@ input#change_stat {
right: 0px!important;
}
}
@media (max-width: 720px) {
/* html {
transform: rotate(-90deg);
transform-origin: left top;
width: 100vh;
height: 100vw;
overflow-x: hidden;
position: absolute;
top: 100%;
left: 0;
} */
.dock {
position: absolute;
top: -4px;
left: 95%;
}
#map>div.leaflet-control-container>div.leaflet-bottom.leaflet-right {
right: 5px;
}
#map .head {
top: 1%!important;
}
.dock {
left: 93%;
}
.navbar .navbar-inverse {
display: block
}
#map>div.row>div.col-sm-4.input-group.content-group.head {
width: 80%;
margin-top: -15px;
margin-left: 60px;
}
.user-p-nav {
display: none
}
li.fixed-plugin .dropdown-menu {
transform: scale(0.769230);
float: right;
position: absolute;
right: -550px;
width: 190px;
margin-left: -175px !important;
margin-top: -137px !important;
top: 20px;
margin-right: -550px;
}
li.overlay-cek .dropdown-menu {
transform: scale(0.769230);
float: right;
position: absolute;
right: -550px;
width: 190px;
margin-left: -175px !important;
margin-top: -127px !important;
top: 13px;
margin-right: -550px;
}
.menu-heading {
color: black;
}
.menu-list>a>img {
min-width: 120px!important;
min-height: 20px!important;
max-height: 90px!important;
}
#bottom-tab2>div>div:nth-child(2) {
display: none;
}
#panel-sm {
width: 100%!important;
top: 0px;
}
#panel-sm>div {
margin-left: 0px
}
body>div.page-container>div>div.sidebar.sidebar-main {
/* transform: rotate( 270deg);
height: 100%;
float: right;
margin-left: 282px;
top: -290px; */
display: block;
}
#bottom-tab1>div {
margin-left: 10px;
}
#bottom-tab1>div>div.col-sm-2 {
display: none;
}
#bottom-tab2>div>div:nth-child(4) {
margin-left: 18px;
}
#bottom-tab2>div>div {
margin-left: 10px;
}
#panel-sm>div>div.bod>div>ul {
background: #1B1F2D;
}
#panel-sm>div>div.bod>div>ul>li.active>a {
background: #353847;
}
#panel-sm>div>div.bod>div>ul {
border-top: none;
border-left: none;
}
#panel-sm>div>div.bod>div>div {
margin-left: 10px;
}
body>ul>li.fixed-plugin.no3d.overlay-cek>div.dropdown.show-dropdown.open>ul {
width: 270px!important;
margin-left: -245px!important;
}
body>div.page-container>div>div.sidebar.sidebar-main>div.sidebar-category.sidebar-category-visible>div>ul:nth-child(1) {
margin-bottom: 47vh!important;
}
body>div.page-container>div>div.sidebar.sidebar-main>div.sidebar-category.sidebar-category-visible>div>ul:nth-child(2)>li:nth-child(1)>a {
display: none
}
.modal-dialog {
margin-top: 0px;
top: 7%!important;
}
.modal-content {
margin-left: 20px!important;
}
#modal_detail_non_kelurahan>div>div>div.modal-body>fieldset>div>div:nth-child(2)>div>div {
margin-left: 5px
}
}
\ No newline at end of file
......@@ -274,6 +274,17 @@ function load_manage() {
targets: [0],
}, ],
dom: '<"float-left "B>frtip',
buttons: [{
text: 'Add new button',
action: function(e, dt, node, config) {
dt.button().add(1, {
text: 'Button ' + (counter++),
action: function() {
this.remove();
}
});
}
}],
language: {
search: ' _INPUT_',
searchPlaceholder: 'Data User...',
......@@ -285,6 +296,7 @@ function load_manage() {
'previous': '&larr;'
}
},
drawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').addClass('dropup');
},
......@@ -647,6 +659,7 @@ function loaduserbyid(id) {
$("#inNameF").val(user.firstname);
$("#inNameL").val(user.lastname);
$("#inEmail").val(user.email);
$("#phone").val(user.phone)
if (user.is_staff) {
$('input[name=isStaff][value=true]').attr('checked', true)
} else {
......@@ -750,16 +763,6 @@ function modal_detail_point_pengaturan(id, db) {
$("#saveuser").on("click", function() {
addUser()
})
// function destroyfade() {
// $(".modal-backdrop").css("display", "none")
// $(".modal-backdrop").removeClass('show');
// $("body").css('padding-right', '0px !important')
// }
function addUser() {
var isObject = {};
var ars = ''
var group = $("#select_group").val();
......@@ -769,18 +772,11 @@ function addUser() {
isObject.id = iduser;
}
// for(i in group){
// if(i < group.length-1){
// ars += group[i]+"~";
// }else{
// ars += group[i];
// }
// }
// return false
isObject['username'] = $("#inUsername").val();
isObject['first_name'] = $("#inNameF").val();
isObject['last_name'] = $("#inNameL").val();
isObject['email'] = $("#inEmail").val();
isObject['phone'] = $("#phone").val();
isObject.group = group
isObject.isStaff = $('input[name="isStaff"]:checked').val();
......@@ -794,8 +790,6 @@ function addUser() {
if (response.code == 0) {
$("#modal_edit_user").css('display', 'none');
// destroyfade();
swal({
title: response.info,
text: response.data + "reload untuk mendapatkan update",
......@@ -815,7 +809,21 @@ function addUser() {
}
}
});
}
})
$("#add_user").click(function() {
$("#modal_edit_user").modal("show")
$(".modstit").html("Tambah User")
$("#inUsername").attr("disabled", false)
$("#group_use").css("display", "none")
$("#inUsername").val("")
$("#inNameF").val("")
$("#inNameL").val("")
$("#inEmail").val("")
$("#phone").val("")
$("#iduser").val("")
})
$("#saveedit_p").click(function() {
var idka = $('#id_adm_edit').val();
......
......@@ -84,6 +84,20 @@
onEachFeature: function(feature, layer) {
layer.on({
click: function(e) {
var x = window.matchMedia("(max-width: 700px)")
if (x.matches) { // If media query matches
swal({
title: "Sorry",
text: "Untuk di mobile tampilan detail kelurahan tidak mendukung, Silahkan akses menggunakan laptop atau PC",
type: "warning",
icon: "error",
confirmButtonColor: "#00BCD4"
})
setTimeout(function() {
}, 500);
} else {
$('#modal_detail_kelurahan').modal('show');
if (feature.administrasi.f9 == 'NONE') {
......@@ -523,9 +537,7 @@
setTimeout(function() {
chart_agama.render();
}, 100);
}
},
mouseover: function(e) {
......@@ -3004,10 +3016,6 @@
$("body").css("padding-right", "0px !important")
})
$("#saveuser").on("click", function() {
addUser()
})
function loadjlbyid(id) {
var isObject = {};
......
......@@ -1036,8 +1036,13 @@
</div>
</a>
</div>
<div style="position: absolute;left: 250px;font-size: 10pt;background: #2196F3;border-radius: 10px;">
<a class="btn side-bar-but" id="add_user" style="z-index:9;color:white;">
<div>
<span>Tambah User</span>
</div>
</a>
</div>
<thead style="font-size: 12px;line-height: 14px;font-family: 'gilroysemibold';text-transform: capitalize;">
<tr>
......@@ -1810,6 +1815,14 @@
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">Phone</label>
<div class="col-lg-9">
<input id="phone" type="number" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="form-group">
......@@ -1828,12 +1841,12 @@
</div>
</div>
<div class="row">
<div class="row" group_use>
<div class="form-group" style="margin-top: 10px !important;">
<label class="col-lg-3 control-label lbl-top">Groups</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="select_group" data-placeholder="select group.." class="select-size-xs">
<option></option>
<option value="none"></option>
</select>
</div>
</div>
......
......@@ -81,9 +81,7 @@
<img src="{% static 'img/icon-1/Vectoroverlay.svg' %}" alt="" style="height: 50px;
width: 50px;">
</a>
<ul class="dropdown-menu" style="top: 12px;
width: 300px;
margin-left: -270px!important;">
<ul class="dropdown-menu">
<li class="header-title text-center">Sidebar Filters</li>
<!-- <div id="sidebar" onmouseleave="overll()">
<div class="sidebar-wrapper">
......
......@@ -9,6 +9,17 @@
border-bottom: 0.5pt solid #313649;
}
</style>
<!-- <div class="navbar navbar-inverse" style="z-index: 1;
top: 45px;
position: absolute;
background: none;border-color: transparent;">
<div class="navbar-header" style="min-width: 0px;">
<ul class="nav navbar-nav visible-xs-block">
<li><a class="sidebar-mobile-main-toggle" style="border-radius: 5px;"><i class="icon-paragraph-justify3"></i></a></li>
</ul>
</div>
</div> -->
<div class="sidebar sidebar-main">
<div class="sidebar-content">
<img src="{% static 'img/logo-ok.png' %}" alt="" style="width: 25px;height:32px;">
......
......@@ -129,23 +129,11 @@
<div class="content">
<div id="map">
<div class="help_bangunan" style="position: absolute;z-index: 999;top: 0px;right: 60px;"></div>
<div class="col-md-4 col-md-offset-4 input-group content-group head">
<div class="row" style="margin-top: 20px;">
<div class="col-sm-4 head">
<!-- <div class="input-group">
<input type="TextBox" ID="datebox" Class="form-control"></input>
<div class="input-group-btn">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul id="demolist" class="dropdown-menu">
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
<li><a href="#">C</a></li>
</ul>
</div>
</div> -->
<!-- <div class="input-group">
<input type="TextBox" ID="valss" Class="form-control" type="hidden"></input> -->
<div class="col-sm-4 input-group content-group head">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle btn-icon" data-toggle="dropdown" aria-expanded="true" id="btn_s_s">
<span class="caret"></span>
......@@ -168,8 +156,31 @@
201.55deg
, #72BBFF -24.21%, #3D5CCA 130.65%);"><i class="icon-search4 text-muted text-size-base" style="color: white;"></i></button>
</span>
</div>
<div class="col-sm-4 head">
</div>
</div>
<!-- <div class="col-md-4 input-group content-group head"> -->
<!-- <div class="input-group">
<input type="TextBox" ID="datebox" Class="form-control"></input>
<div class="input-group-btn">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul id="demolist" class="dropdown-menu">
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
<li><a href="#">C</a></li>
</ul>
</div>
</div> -->
<!-- <div class="input-group">
<input type="TextBox" ID="valss" Class="form-control" type="hidden"></input> -->
<!-- </div> -->
{% if user.is_authenticated %} {% else %}
......@@ -197,7 +208,7 @@
</div>
{% if user.is_authenticated %}
<div style="height: 10%;width: 10%;position: absolute;top: 30px;right: 65px;z-index: 999;">
<div class="user-p-nav" style="height: 10%;width: 10%;position: absolute;top: 30px;right: 65px;z-index: 999;">
<!-- <a href="#">
<div>
<img src="{% static 'img/placeholder.jpg' %}" style="width: 37px;height: 37px;border-radius: 25px;" />
......@@ -2186,6 +2197,25 @@
});
}
$("#perbaikan_manage").click(function() {
var x = window.matchMedia("(max-width: 700px)")
if (x.matches) { // If media query matches
swal({
title: "Sorry",
text: "Untuk di mobile tampilan manajemen perbaikan tidak mendukung, Silahkan akses menggunakan laptop atau PC",
type: "warning",
icon: "error",
confirmButtonColor: "#00BCD4"
})
setTimeout(function() {
$("#panel-sm2").removeClass('active')
$("#manage_perbaikan").removeClass('active')
$("#btn-hide-all").css("display", "none")
}, 500);
}
})
$('.leaflet-bottom.leaflet-right>.leaflet-control-attribution.leaflet-control').html(`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`)
$('.leaflet-bottom.leaflet-right>.leaflet-control-attribution.leaflet-control').css("right", "50px")
</script>
......
......@@ -632,7 +632,8 @@
<label class="col-lg-3 control-label lbl-top">Groups</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="select_group" data-placeholder="select group.." class="select-size-xs">
<option></option>
<option value="Select Group"></option>
</select>
</div>
</div>
......
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