Commit fdc72fd1 authored by Muhamad's avatar Muhamad

new again

parent ea31f528
......@@ -61,5 +61,7 @@ urlpatterns = [
path('edit-jalan', views.editjalan, name='edit-jalan'),
path('edit-jalan-valid', views.editjalanvalid, name='edit-jalan-valid'),
path('3d-maps', views.maps3d, name='3d-maps'),
path('deletejalan', views.deletejalan, name='hapus-jalan')
]
\ No newline at end of file
......@@ -138,7 +138,7 @@ def building(request):
FROM
geo_bangunan gb
WHERE
st_intersects ( gb.geom, 'SRID=0;POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' )"""% (kulon, lor, wetan, lor, wetan, kidul, kulon, kidul, kulon, lor))
st_intersects ( st_setsrid(gb.geom,4326) , 'SRID=4326;POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' )"""% (kulon, lor, wetan, lor, wetan, kidul, kulon, kidul, kulon, lor))
prov_res = buldings.fetchall()
polbang = []
......@@ -252,6 +252,31 @@ def editjalanvalid(request):
respon={'data':data, 'info':info, 'code':status}
return Response(respon)
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def deletejalan(request):
idjalan = request.GET.get("idjalan")
# try:
with conn.cursor() as jalan:
jalan.execute("DELETE from geo_jalan WHERE id = %s"% idjalan)
conn.commit()
data = 'SUCCESS'
info = 'data telah diperbaharui'
status = 0
# except:
# data = 'Oops!!'
# info = 'Hubungi Developer'
# status = 1
respon={'data':data, 'info':info, 'code':status}
return Response(respon)
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
......
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# Create your forms here.
class NewUserForm(UserCreationForm):
email = forms.EmailField(required=True)
class Meta:
model = User
fields = ("username", "email", "password1", "password2")
def save(self, commit=True):
user = super(NewUserForm, self).save(commit=False)
user.email = self.cleaned_data['email']
if commit:
user.save()
return user
\ No newline at end of file
......@@ -13,10 +13,14 @@ urlpatterns = [
path('perbaikan', views.perbaikanrenovasi, name='perbaikan'),
path('loadDetail', views.loadDetail, name='loadDetail'),
path('input-perbaikan', views.inpuperbaikan, name='input-perbaikan'),
path('input-perbaikan-bang', views.inputperbaikanbangunan, name='input-perbaikan-bang'),
path('save-perbaikan', views.saveperbaikan, name='save-perbaikan'),
path('save-perbaikan-bang', views.saveperbaikanbangunan, name='save-perbaikan-bang'),
path('load-jl-by-id-detail', views.loadbyiddetail, name='load-jl-by-id-detail'),
path('get-jalan-perbaikan', views.getjalanperbaikan, name='get-jalan-perbaikan'),
path('get-detail-perbaikan', views.getdetailperbaikan, name='get-detail-perbaikan'),
path('get-detail-perbaikan-bang', views.getdetailperbaikanbangunan, name='get-detail-perbaikan-bang'),
path('registration_new_app', views.registrasi_new_app, name='reg_new_app'),
]
\ No newline at end of file
This diff is collapsed.
......@@ -42,7 +42,8 @@ INSTALLED_APPS = [
'Application',
'API',
'myauth.apps.MyauthConfig',
'widget_tweaks'
'widget_tweaks',
'crispy_forms',
]
MIDDLEWARE = [
......
......@@ -35,5 +35,10 @@ urlpatterns = [
path('loadUserbyId/', views.loadUserbyId, name="loadUserbyId"),
path('addGroup/', views.addGroup, name="addGroup"),
path('deleteGroup/', views.deleteGroup, name="deleteGroup"),
path('getGroupById/', views.loadGroupByGroupId, name='getGroupById')
path('getGroupById/', views.loadGroupByGroupId, name='getGroupById'),
path('userprofile/', views.Userprofile.as_view(), name='userprofile'),
path('changepassword/', views.changepassword, name="changepassword"),
path('editprofile/', views.editprofile, name='editprofile'),
path('editpp/', views.editpp, name='editpp'),
path('welcome', views.welcom)
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.contrib import auth
from django.db.models.expressions import F
from django.http import request, response
from django.views import View, generic
......@@ -12,38 +13,13 @@ from django.contrib.auth.hashers import make_password
from rest_framework import status
from rest_framework.decorators import api_view, renderer_classes
from rest_framework.response import Response
import socket
from django.contrib.auth import authenticate
from django.core.files.storage import FileSystemStorage
import random
import string
def get_per_user(req):
us = req
id = us.id
with conn.cursor() as perm:
perm.execute("""SELECT
json_build_object ( 'kab', gpk.kabupaten, 'pro', gpk.provinsi, 'id_apps', uaa.id_apps, 'apps', uaa.NAME )
FROM
user_apps_access uaa
JOIN geo_prov_kab gpk ON uaa.id_kab = gpk.id_kabupaten
WHERE
uaa.id_user = %s"""% id)
per = perm.fetchall()
permm = per[0][0]
return us, permm
def ui_params(id_app):
with conn.cursor() as perm:
perm.execute("""SELECT
json_build_object ( 'title', v1, 'logo', v2)
FROM
ui_params
WHERE
id_apps = %s"""% int(id_app))
per = perm.fetchall()
permm = per[0][0]
return permm
# Create your views here.
class CustomLoginView(LoginView):
......@@ -60,39 +36,49 @@ class CustomLogoutView(LogoutView):
template_name = 'user/login.html'
next_page = 'login'
class Usermanagement(generic.TemplateView):
template_name = "layout/user_layout.html"
class Userprofile(generic.TemplateView):
template_name = 'user/user_profile.html'
def get(self, request):
usern, perm = get_per_user(request.user)
kab = perm['kab']
# print(perm)
ui_param = ui_params(perm['id_apps'])
title = ui_param['title']
logo = ui_param['logo']
print(type(request.user.groups.all()))
with conn.cursor() as userprop_:
userprop_.execute("SELECT * FROM auth_user")
alluser = userprop_.fetchall()
res = []
print("")
for roww in alluser:
print(roww[0])
context = {
'data': res
}
return render(request, self.template_name, context)
class Usermanagement(generic.TemplateView):
template_name = "layout/user_layout.html"
# print("disini")
# print(make_password("kontolbadag"))
def get(self, request):
# print(request.user.groups.all())
with conn.cursor() as userlist_:
# if request.user.groups.all() == ''
arrayGroups = []
for g in request.user.groups.all():
print(g)
userGroup = g.id
arrayGroups.append(userGroup)
isChild = isHaveChild(userGroup)
if isChild == True:
childgroup = getGroupChilds(userGroup)
for z in childgroup['data']:
arrayGroups.append(z[0])
ars = ",".join(str(v) for v in arrayGroups)
arrayGroups.append(userGroup)
isChild = isHaveChild(userGroup)
if isChild == True:
childgroup = getGroupChilds(userGroup)
for z in childgroup['data']:
arrayGroups.append(z[0])
else:
ars = "".join(str(v) for v in arrayGroups)
ars = ",".join(str(v) for v in arrayGroups)
else:
ars = "".join(str(v) for v in arrayGroups)
# print(ars)
......@@ -183,14 +169,37 @@ class Usermanagement(generic.TemplateView):
"name" : rows[1],
}
group_res.append(datas)
parameter_ui = {'logo':logo, 'title':title}
current_user = request.user
thisUser = current_user.id
# print()
sql = "select * from auth_user where id = "+str(thisUser)
with conn.cursor() as userprop:
userprop.execute(sql)
us = userprop.fetchall()
user_data = []
for row in us:
datas = {
"id": row[0],
"username": row[4],
"firstname": row[5],
"lastname": row[6],
"email" : row[7],
"filepath": row[11],
# "password": row[1]
}
user_data.append(datas)
print(user_data)
context = {
'title' : 'user management',
'data' : user_res,
'dataGroup' : group_res,
'title' : title,
'logo' : logo,
'parameter_ui':parameter_ui,
'thisUser' : user_data
}
......@@ -624,3 +633,130 @@ def loadGroupByGroupId(request):
"data": "group tidak memiliki parent"
}
return Response(data)
@api_view(('POST',))
def changepassword(request):
if request.method == "POST":
iduser = request.POST.get('id')
currentpassword = request.POST.get('currPass')
newpassword = request.POST.get('newPass')
renewpassword = request.POST.get('renewPass')
username = request.POST.get('username')
user = authenticate(username=username, password=currentpassword)
if user is not None:
if newpassword == renewpassword:
with conn.cursor() as concur:
sql = "UPDATE auth_user SET password = '"+make_password(newpassword)+"' WHERE id ="+iduser
print(sql)
concur.execute(sql)
reschange = concur.rowcount
if reschange > 0:
data = {
"baseurl" : request.META['HTTP_HOST'],
"code" : 0,
"info" : "Sukses",
"data" : "Password berhasil diperbaharui, silahkan login kembali untuk melanjutkan"
}
else:
data = {
"code" : 4,
"info" : "Gagal",
"data" : "Password gagal diperbaharui, silahkan coba kembali"
}
else:
data = {
"code" : 4,
"info" : "Gagal",
"data" : "Password baru tidak sesuai"
}
else:
data = {
"code" : 4,
"info" : "Gagal",
"data" : "Password salah"
}
return Response(data)
@api_view(('POST',))
def editprofile(request):
if request.method == 'POST':
iduser = request.POST.get('id')
firstname = request.POST.get('first_name')
lastname = request.POST.get('last_name')
email = request.POST.get('email')
with conn.cursor() as edtprop:
sql = "UPDATE auth_user SET first_name = '"+firstname+"', last_name ='"+lastname+"', email ='"+email+"' WHERE id = "+iduser
edtprop.execute(sql)
res = edtprop.rowcount
if(res > 0):
data = {
"code" : 0,
"info" : "Sukses",
"data" : "Profile berhasil diubah"
}
else:
data = {
"code" : 4,
"info" : "Gagal",
"data" : "Profile gagal diperbaharui, silahkan coba kembali"
}
return Response(data)
@api_view(('POST',))
def editpp(request):
if request.method == 'POST':
file = request.FILES.get('inifile')
iduser = request.POST.get('id')
fss = FileSystemStorage(location='static/img/')
try:
letters = string.ascii_letters
resrand = ''.join(random.choice(letters) for i in range(100))
format = (file.name).split(".")
namafile = f"{resrand}.{format[-1:][0]}"
filename = fss.save(namafile, file)
url = fss.url(filename)
with conn.cursor() as concur:
sql = "UPDATE auth_user SET file_path = '"+namafile+"' WHERE id = "+iduser
concur.execute(sql)
resupd = concur.rowcount
if resupd > 0:
data = {
"code" : 0,
"info" : "Sukses",
"data" : "Foto profil berhasil diperbaharui"
}
else:
data = {
"code" : 4,
"info" : "Gagal",
"data" : "Foto profil gagal diperbaharui, silahkan coba kembali"
}
except:
data = {
"code" : 3,
"info" : "Gagal",
"data" : "Foto profil gagal diperbaharui, silahkan coba kembali"
}
return Response(data)
def welcom(request):
return render(request, "layout/welcome.html")
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -121,6 +121,129 @@
</div>
<div class="content-wrapper mymodal" id="input_perbaikan_bang" style="display: none;padding: 60px;">
<div class="content" style="padding: 15px;max-height: 550px;">
<!-- Main charts -->
<div class="panel panel-flat" style="display: none;">
<div class="panel-body" style="padding-top: 10px;">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<button type="button" class="close" onclick="destroyWraper()">&times;</button>
<li class="active"><a href="#left-tab-input-coordinat_bang" data-toggle="tab">Koordinat</a></li>
<li><a href="#right-tab-input-informasi_bang" data-toggle="tab">Insert Informasi</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="left-tab-input-coordinat_bang">
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<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>
<div class="tab-pane" id="right-tab-input-informasi_bang">
<div class="modal-body" style="max-height: 415px;overflow-y: auto;">
<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>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>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>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 class="panel-footer">
<input type="text" id="coorbangbaru" class="form-control" value="">
<button type="button" class="btn btn-info" id="save-perbaikan_bang" style="float: right; margin-right: 40px;">SAVE</button>
<button type="button" class="btn btn-link" onclick="destroyWraper()" style="float: right;">Close</button>
</div>
</div>
</div>
<!-- /main charts -->
</div>
<!-- editing kelurahan -->
<div class="content-wrapper mymodal" id="edit_kelurahan" style="display: none;padding: 60px;">
<div class="content" style="padding: 15px;max-height: 550px;">
......
......@@ -143,9 +143,12 @@
#btn_edit_bangunan {
display: none;
}
#btn_delete_bangunan {
display: none;
}
#btn_edit_kelurahan {
display: block;
display: none;
position: relative;
top: 0;
right: 0;
......@@ -188,6 +191,9 @@
#btn_edit_adm {
display: none;
}
#btn_delete_adm {
display: none;
}
#btn_edit_rs {
display: none;
......@@ -217,6 +223,18 @@
display: none;
}
#btn_detail_per_bang {
display: none;
}
#btn_perbaikan_bangunan {
display: none;
}
#btn_upload_tampak {
display: none;
}
.leaflet-popup{
display: none;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,17 +2,7 @@
<!-- Main navbar -->
<div class="navbar navbar-inverse navbar-fixed-top bg-none">
<div class="navbar-header">
<a class="navbar-brand gradient-text" id="title-logo" href="{% url 'apps:dashboard' %}">
<!-- <h3>NationalAddress</h3> -->
<i>
<img src="{% static 'img/{{logo}}' %}" alt="" style="position: absolute;
width: 26px;
top: 7px;">
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{title}}
</b>
<a class="navbar-brand gradient-text " id="title-id" href="{% url 'apps:dashboard' %}">
</a>
<ul class="nav navbar-nav pull-right visible-xs-block">
......@@ -27,14 +17,13 @@
{% if user.is_authenticated %}
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="{% static 'img/placeholder.jpg' %}" alt="">
<img src="{% static 'img/' %}{{user.filepath}}" alt="">
<span>{{user.username}}</span>
<i class="caret"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#"><i class="icon-user-plus"></i> My profile</a></li>
<li><a href="#"><i class="icon-cog5"></i> Account settings</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>
......
......@@ -41,7 +41,7 @@
<div class="col-md-3">
<ul class="menu-list">
<a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="WorldImagery">
<img src="{% static 'img/maps/esri.png' %}" alt="" style="min-width: 180px; max-height: 130px;
<img src="{% static 'img/maps/esri.PNG' %}" alt="" style="min-width: 180px; max-height: 130px;
min-height: 130px">
<span class="menu-heading">
World Imagery</span>
......@@ -51,7 +51,7 @@
<div class="col-md-3">
<ul class="menu-list">
<a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="BingSatellite">
<img src="{% static 'img/maps/bing.png' %}" alt="" style="min-width: 180px; max-height: 130px;
<img src="{% static 'img/maps/bing.PNG' %}" alt="" style="min-width: 180px; max-height: 130px;
min-height: 130px">
<span class="menu-heading">
Bing Satellite</span>
......@@ -61,7 +61,7 @@
<div class="col-md-3">
<ul class="menu-list">
<a href="#" data-toggle="collapse" data-target=".navbar-collapse.in" id="GoogleSatellite">
<img src="{% static 'img/maps/esri.png' %}" alt="" style="min-width: 180px; max-height: 130px;
<img src="{% static 'img/maps/esri.PNG' %}" alt="" style="min-width: 180px; max-height: 130px;
min-height: 130px">
<span class="menu-heading">
Google Satellite</span>
......@@ -89,7 +89,6 @@
<div class="panel-body"> -->
<div class="row" style="margin: 0;padding: 0;">
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" id="geo_tuplah" onclick="geotuplah()" style="margin-top:2px;">
......@@ -97,7 +96,6 @@
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="geo_building" style="margin-top:2px;">
......@@ -125,12 +123,12 @@
</label>
</div>
<div class="checkbox">
<!-- <div class="checkbox">
<label>
<input type="checkbox" id="geo_sungai" onclick="geosungai()" style="margin-top:2px;">
Sungai
</label>
</div>
</div> -->
<div class="checkbox">
<label>
<input type="checkbox" id="batas_all" onclick="batasall()" style="margin-top:2px;" >
......
......@@ -17,6 +17,4 @@
<script src="{% static '/js/plugins/nouislider.min.js' %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js"></script>
<script src="{% static '/js/plugins/arrive.min.js' %}"></script>
<script src="{% static '/js/plugins/bootstrap-notify.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/tables/datatables/datatables.min.js' %}"></script>
\ No newline at end of file
<script src="{% static '/js/plugins/bootstrap-notify.js' %}"></script>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{% load static %}
<script>
// alert("alerts");
</script>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome</title>
</head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
<link href="{% static 'css/icons/icomoon/styles.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'css/bootstrap.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'css/core.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'css/components.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'css/colors.css' %}" rel="stylesheet" type="text/css">
<style>
.page_loader {
position: fixed;
background: url('../../static/img/loadingz.gif') 50% 50% no-repeat rgb(249, 249, 249);
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
opacity: .5;
}
</style>
<body>
<div style="height: 100%;">
<div id="map" style="height: 100vh;">
</div>
</div>
<div class="container text-center" style=" padding-top: 55vh;
width: 400px;
text-transform: uppercase;
color: rgb(23, 87, 76);
position: fixed;
z-index: 9999;
left: 115px;
top: 10px;
width: 100%;
height: 100%;">
<!-- <h1>
{% if user.is_authenticated %} {{user.username}} {% endif %}, Welcome
</h1> -->
<h2>
Anda Login Sebagai
</h2>
<h2>
{% if user.is_authenticated %} {{user.username}} {% endif %}
</h2>
</div>
<div class="page_loader"></div>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js" integrity="sha384-eMNCOe7tC1doHpGoWe/6oMVemdAVTMs2xqW4mwXrXsW0L84Iytr2wi5v2QjrP/xp" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.min.js" integrity="sha384-cn7l7gDp0eyniUwwAZgrzD06kc/tftFf19TOAs2zVinnD/C7E91j9yyk5//jjpt/" crossorigin="anonymous"></script>
<script src="{% static 'js/plugins/notifications/sweet_alert.min.js' %}"></script>
</body>
</html>
<script>
var map = L.map('map', {
editable: true,
zoomControl: false,
drawControl: true
}).setView([-4.028349, 104.007235], 10);
$("#sidebar").hide()
maps = L.tileLayer('https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
maxZoom: 22,
minZoom: 4,
}).addTo(map);
setTimeout(function() {
window.location.href = "{% url 'apps:dashboard' %}";
}, 1000);
</script>
\ No newline at end of file
This diff is collapsed.
......@@ -196,12 +196,56 @@
<!-- Main navbar -->
<!-- Main navbar -->
{% include 'includes/navbar.html' %}
<div class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand gradient-text " href="{% url 'apps:dashboard' %}">
<!-- <h3>NationalAddress</h3> -->
<i>
<img src="{% static 'img/logo-ok.png' %}" alt="" style="position: absolute;
width: 26px;
top: 7px;">
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b style="margin-left: 12px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Teman-KU
</b> (Sistem Informasi Pembangunan OKU)
</a>
<ul class="nav navbar-nav pull-right visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
</ul>
</div>
<div class="navbar-collapse collapse" id="navbar-mobile">
<p class="navbar-text"><span class="label bg-success-400">Online</span></p>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown dropdown-user">
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="{% static 'img/placeholder.jpg' %}" alt="">
<span>{{user.username}}</span>
<i class="caret"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#"><i class="icon-user-plus"></i> My profile</a></li>
<li><a href="#"><i class="icon-cog5"></i> Account settings</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 %}
<li class="divider"></li>
<li><a href="{% url 'logout' %}"><i class="icon-cog5"></i> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
<!-- /main navbar -->
<!-- Page container -->
<div class="page-container" style="top: 48px;">
<div class="page-container" style="top: 0px;">
<!-- Page content -->
<div class="page-content">
......
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration new app</title>
</head>
<body>
<div class="container py-5">
<h1>Register New Application</h1>
<form method="POST">
{% csrf_token %}
<div id="div_id_username" class="control-group"> <label for="id_username" class="control-label requiredField">
Username<span class="asteriskField">*</span> </label>
<div class="controls"> <input type="text" name="username" maxlength="150" autofocus="" class="textinput textInput" required="" id="id_username">
<p id="hint_id_username" class="help-block">Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.</p>
</div>
</div>
<div id="div_id_password1" class="control-group"> <label for="id_password1" class="control-label requiredField">
Password<span class="asteriskField">*</span> </label>
<div class="controls"> <input type="password" name="password1" autocomplete="new-password" class="textinput textInput" required="" id="id_password1">
<p id="hint_id_password1" class="help-block"></p>
<ul>
<li>Your password can’t be too similar to your other personal information.</li>
<li>Your password must contain at least 8 characters.</li>
<li>Your password can’t be a commonly used password.</li>
<li>Your password can’t be entirely numeric.</li>
</ul>
<p></p>
</div>
</div>
<div id="div_id_password2" class="control-group"> <label for="id_password2" class="control-label requiredField">
Password confirmation<span class="asteriskField">*</span> </label>
<div class="controls"> <input type="password" name="password2" autocomplete="new-password" class="textinput textInput" required="" id="id_password2">
<p id="hint_id_password2" class="help-block">Enter the same password as before, for verification.</p>
</div>
</div>
<div id="app_name" class="control-group"> <label for="app_name" class="control-label requiredField">
App Name<span class="asteriskField">*</span> </label>
<div class="controls"> <input type="text" name="app_name" class="textinput textInput" required="">
<p class="help-block">Enter Application Name.</p>
</div>
</div>
<div id="teritory" class="control-group"> <label for="teritory" class="control-label requiredField">
Teritory<span class="asteriskField">*</span> </label>
<div class="controls">
<select name="teritory_name" id="search_desa" placeholder="Pick a state..." style="width: 256px;height: 35px;">
<option value="">Select Teritory</option>
{% for ter in teritor %}
<option value="{{ter}}">{{ter}}</option>
{% endfor %}
</select>
<p class="help-block"></p>
</div>
</div>
<button class="btn btn-primary" type="submit">Register</button>
</form>
</div>
</body>
</html>
\ No newline at end of file
......@@ -6,12 +6,9 @@
<!------ Include the above in your HEAD tag ---------->
<link href="{% static 'css/icons/icomoon/styles.css' %}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/all.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<style>
body {
margin-top: 100px;
/* background-image: url('https://3.bp.blogspot.com/-juutvktsA3I/WJsuDK2fYJI/AAAAAAAADJc/BLJqU67PqgMFlqG2E9KgxECwFlpO8_e1wCLcB/s4600/Peta%2BKabupaten%2BOgan%2BKomering%2Bulu%2B%2BOKU.gif'); */
}
/* .logo{ nn
background-image: url("{% static 'img/logomaps.png' %}");
} */
......@@ -24,63 +21,85 @@
</head>
<body>
<div class="container">
<br>
<div style="height: 100%;">
<div id="map" style="height: 100vh;">
<div class="container" style="margin-top: 100px;">
<br>
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card">
<header class="card-header">
<center>
<h4 class="card-title mt-2 logo"> Log in </h4>
</center>
</header>
<article class="card-body">
<div>
{% if form.errors %}
<div class="alert alert-danger">
Username atau Password salah. Silahkan coba kembali.
</div>
{% endif %}
</div>
{% load widget_tweaks %}
<form method="post" action="{% url 'login' %}" novalidate>
{% csrf_token %}
<div class="form-group">
<label>{{ form.username.label_tag }}</label> {% if form.is_bound %} {% if form.username.errors %} {% render_field form.username class="form-control is-invalid" %} {% else %} {% render_field form.username class="form-control
is-valid" %} {% endif %} {% else %} {% render_field form.username class="form-control" %} {% endif %}
</div>
<!-- form-group end.// -->
<div class="form-group">
<label>{{ form.password.label_tag }}</label> {% if form.is_bound %} {% if form.password.errors %} {% render_field form.password class="form-control is-invalid" %} {% else %} {% render_field form.password class="form-control
is-valid" %} {% endif %} {% else %} {% render_field form.password class="form-control" %} {% endif %}
</div>
<!-- form-group end.// -->
<hr style="margin-top: 50;">
<div class="form-group">
<input type="hidden" name="next" value="{{ next }}">
<center><button type="submit" class="btn btn-primary " style="background-color: #1a222f; /* Green */"> Login </button></center>
</div>
<!-- form-group// -->
</form>
</article>
<!-- card-body end .// -->
<!-- <div class="border-top card-body text-center">Belum punya akun? <a href="#">Sign Up</a></div>
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card" style="z-index: 999;">
<header class="card-header">
<center>
<h4 class="card-title mt-2 logo"> Log in </h4>
</center>
</header>
<article class="card-body">
<div>
{% if form.errors %}
<div class="alert alert-danger">
Username atau Password salah. Silahkan coba kembali.
</div>
{% endif %}
</div>
{% load widget_tweaks %}
<form method="post" action="{% url 'login' %}" novalidate>
{% csrf_token %}
<div class="form-group">
<label for="">Username</label>
<input type="text" name="username" class="form-control" id="exampleInputEmail1" placeholder="Username" aria-describedby="emailHelp" required>
</div>
<div class="form-group">
<label for="">Password</label>
<input type="password" name="password" class="form-control" placeholder="Password" id="exampleInputPassword1" required>
</div>
<!-- form-group end.// -->
<hr style="margin-top: 50;">
<div class="form-group">
<input type="hidden" name="next" value="{{ next }}">
<center><button type="submit" class="btn btn-primary " style="background-color: #1a222f; /* Green */"> Login </button></center>
</div>
<!-- form-group// -->
</form>
</article>
<!-- card-body end .// -->
<!-- <div class="border-top card-body text-center">Belum punya akun? <a href="#">Sign Up</a></div>
<div class="border-top card-body text-center"><a href="#">Lupa Password?</a></div> -->
</div>
<!-- card.// -->
</div>
<!-- col.//-->
</div>
<!-- card.// -->
<!-- row.//-->
</div>
<!-- col.//-->
</div>
<!-- row.//-->
</div>
<!--container end.//-->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<script>
var map = L.map('map', {
editable: true,
zoomControl: false,
drawControl: true
}).setView([-4.028349, 104.007235], 10);
$("#sidebar").hide()
maps = L.tileLayer('https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
maxZoom: 22,
minZoom: 4,
}).addTo(map);
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
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