Commit e4384ee8 authored by Manggar Mahardhika's avatar Manggar Mahardhika

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

parents 1de831b2 dbfe6011
from django.shortcuts import render, redirect
# from django.views.generic import ListView, DetailView, DeleteView, UpdateView, CreateView
from django.views import View, generic
from django.db import connection as conn
def editkelurahan(request):
kode_dagri = request.POST.get('kode_dagri')
print(kode_dagri)
return render (request, 'maps/edit.html')
\ No newline at end of file
......@@ -2,6 +2,7 @@ from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from . import views
from . import edit
app_name = 'apps'
urlpatterns = [
......@@ -11,4 +12,5 @@ urlpatterns = [
path('CheckByAddress', views.SearchLocation.as_view(), name='CheckByAddress'),
path('CheckByRadius', views.SearchRadius.as_view(), name='CheckByRadius'),
path('CheckByPolygon', views.SearchPolygon.as_view(), name='CheckByPolygon'),
path('editkelurahan', edit.editkelurahan, name='edit_kel'),
]
\ No newline at end of file
......@@ -2,7 +2,7 @@ from django.shortcuts import render, redirect
# from django.views.generic import ListView, DetailView, DeleteView, UpdateView, CreateView
from django.views import View, generic
from django.db import connection as conn
# from edit import *
# Create your views here.
class Dashboard(generic.TemplateView):
......
/* ------------------------------------------------------------------------------
*
* # Form layouts
*
* Specific JS code additions for form layouts pages
*
* Version: 1.0
* Latest update: Aug 1, 2015
*
* ---------------------------------------------------------------------------- */
$(function() {
// Select2 select
// ------------------------------
// Basic
$('.select').select2();
//
// Select with icons
//
// Format icon
function iconFormat(icon) {
var originalOption = icon.element;
if (!icon.id) { return icon.text; }
var $icon = "<i class='icon-" + $(icon.element).data('icon') + "'></i>" + icon.text;
return $icon;
}
// Initialize with options
$(".select-icons").select2({
templateResult: iconFormat,
minimumResultsForSearch: Infinity,
templateSelection: iconFormat,
escapeMarkup: function(m) { return m; }
});
// Styled form components
// ------------------------------
// Checkboxes, radios
$(".styled").uniform({ radioClass: 'choice' });
// File input
$(".file-styled").uniform({
fileButtonClass: 'action btn bg-pink-400'
});
});
......@@ -32,7 +32,23 @@
onEachFeature: function(feature, layer) {
layer.on({
click: function(e) {
content = `<thead style="text-align: center;">
content = `
<form action="{% url 'apps:edit_kel' %}" class="form-group" method="POST">
{% csrf_token %}
<fieldset id="data-poly">
<input class="hidden" type="text" name='kode_dagri' id="kode_desa" value="` + feature.administrasi.f1 + `">
<input id='btn_edit_kelurahan' class="btn btn-default" type="submit" value="Edit" style="position: absolute;
top: 260px;right: 5px;width: 60px;">
</div>
</fieldset>
</form>
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/maps/bing.png" alt="Image" style="width: 100%;max-height: 237px;height:237"> </th>
......@@ -347,7 +363,8 @@
</div>
</th>
</tr>
</tbody>`;
</tbody>
</table>`;
$("#panel-samping").css("display", "block");
$("#button_hide_panel").css("display", "block")
$("#thisFooter").css('left', '380px');
......@@ -355,6 +372,8 @@
$("#thisFooter").css('display', 'none');
$("#button_unhide").css('display', 'block')
$("#isi_panel").html(content)
$()
},
mouseover: function(e) {
......@@ -835,7 +854,12 @@
layer.on({
click: function(e) {
//var geogeo = geocodeService.reverse().latlng(e.latlng).run(function(error, result) {
var content = `<thead style="text-align: center;">
var content = `
<a id="btn_edit_kelurahan" style="position: absolute;
top: 240px;
right: 5px;">Edit</a>
<table class="table table-hover tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/maps/bing.png" alt="Image" style="width: 100%;max-height: 237px;height:237"> </th>
......@@ -883,56 +907,11 @@
</th
</tr>
</tbody>
</table>
`;
$("#isi_panel").html(content)
$('#id_poly').val(feature.properties.f1);
$('#id_poly_edit').val(feature.properties.f1);
$('#name').val(feature.properties.f2);
......@@ -1328,4 +1307,20 @@
}
});
});
$(document).on("click", "#btn_edit_kelurahan", function(e) {
var kode_dagri = $('#kode_dagri').val()
console.log(kode_dagri)
$.ajax({
url: "{% url 'apps:edit_kel' %}",
data: {
'kode_dagri': kode_dagri
},
dataType: 'json',
success: function(data) {
console.log('ceckceck')
}
});
});
</script>
\ No newline at end of file
......@@ -229,6 +229,16 @@
</head>
<body>
{% include 'includes/navbar.html' %}
<div style="height: 605px;">
......@@ -253,8 +263,12 @@
<div class="panel panel-default" id="features">
<div class="sidebar-table">
<table class="table table-hover tasks-list" id="isi_panel">
<div class="sidebar-table" id="isi_panel">
<!-- <input type="submit" value="submit"> -->
<a href="" id="btn_edit_kelurahan" style="position: absolute;
top: 240px;
right: 5px;">Edit</a>
<table class="table table-hover tasks-list">
<!-- panel samping js disini -->
......
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