Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
4da68b7f
Commit
4da68b7f
authored
Dec 14, 2021
by
Muhamad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output permission
parent
4d5698da
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
346 additions
and
218 deletions
+346
-218
Application/views.py
Application/views.py
+7
-2
templates/includes/js-m.html
templates/includes/js-m.html
+224
-138
templates/includes/js-o.html
templates/includes/js-o.html
+69
-55
templates/includes/permission.html
templates/includes/permission.html
+27
-0
templates/layout/layout.html
templates/layout/layout.html
+19
-23
No files found.
Application/views.py
View file @
4da68b7f
...
...
@@ -510,10 +510,14 @@ class Dashboard(generic.TemplateView):
}
res_all
.
append
(
data_all
)
perm_group
=
[]
if
request
.
user
.
is_authenticated
:
current_user
=
request
.
user
thisUser
=
current_user
.
id
for
xx
in
request
.
user
.
get_group_permissions
():
perm_group
.
append
(
xx
.
split
(
"."
)[
1
])
if
thisUser
==
None
:
user_data
=
{
"filepath"
:
'placeholder.jpg'
}
else
:
...
...
@@ -582,7 +586,7 @@ class Dashboard(generic.TemplateView):
auth_group ag
WHERE
au.id = aug.user_id AND
ag.id = aug.group_id
AND
ag.id = aug.group_id
ORDER BY
au.username ASC"""
userlist_
.
execute
(
sql
)
...
...
@@ -626,6 +630,7 @@ class Dashboard(generic.TemplateView):
'global'
:
all
[
0
],
'res_all'
:
res_all
,
'thisUser'
:
user_data
,
'perm_group'
:
perm_group
# 'user_res':user_res
}
return
render
(
request
,
self
.
template_name
,
context
)
...
...
templates/includes/js-m.html
View file @
4da68b7f
This diff is collapsed.
Click to expand it.
templates/includes/js-o.html
View file @
4da68b7f
...
...
@@ -1026,6 +1026,13 @@
">
<a href="#" class="btn" id="btn_edit_tuplah" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>`
)
if
(
list_perm
.
indexOf
(
'
delete_tuplah
'
)
>=
0
===
false
)
{
$
(
"
.tombol-delete-keterangan
"
).
remove
();
}
if
(
list_perm
.
indexOf
(
'
change_tuplah
'
)
>=
0
===
false
)
{
$
(
"
.tombol-edit-keterangan
"
).
remove
();
}
$
(
"
.nama_keterangan
"
).
html
(
feature
.
legend
.
f2
)
...
...
@@ -1951,6 +1958,13 @@
<a href="#" id="btn_hapus_jalan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`
)
if
(
list_perm
.
indexOf
(
'
delete_jalan
'
)
>=
0
===
false
)
{
$
(
"
.tombol-delete-keterangan
"
).
remove
();
}
if
(
list_perm
.
indexOf
(
'
change_jalan
'
)
>=
0
===
false
)
{
$
(
"
.tombol-edit-keterangan
"
).
remove
();
}
if
(
feature
.
properties
.
f7
!=
null
)
{
...
...
@@ -2032,7 +2046,7 @@
`
)
content_his_jal
=
`
content_his_jal
=
`
<div class="modal-dialog" style="height: max-content;">
<div class="modal-content">
<div class="modal-header" style="height: 50px;background: #1E2233;border-top-left-radius: 10px;border-top-right-radius: 10px;">
...
...
@@ -2928,7 +2942,7 @@
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
if
((
data
[
0
]
==
null
)
||
(
data
[
0
]
==
""
))
{
if
((
data
[
0
]
==
null
)
||
(
data
[
0
]
==
""
))
{
$
(
"
#namajalan2
"
).
val
();
}
else
{
$
(
"
#namajalan2
"
).
val
(
data
[
0
]);
...
...
templates/includes/permission.html
0 → 100644
View file @
4da68b7f
<script>
var
list_perm
=
[]
</script>
{% for p in perm_group %}
<script>
var
perm
=
"
{{p}}
"
list_perm
.
push
(
perm
)
</script>
{% endfor %}
<script>
console
.
log
(
list_perm
)
if
(
list_perm
.
indexOf
(
'
add_roads
'
)
>=
0
===
false
)
{
$
(
"
.btn_create_jalan
"
).
remove
();
}
if
(
list_perm
.
indexOf
(
'
add_bangunan
'
)
>=
0
===
false
)
{
$
(
"
.btn_create_bangunan
"
).
remove
();
}
if
(
list_perm
.
indexOf
(
'
add_kantor_administrasi
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_layanan_kesehatan
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_puskesmas
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_rumah_sakit
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_sarana_ibadah
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_sarana_pendidikan
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_stasiun
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_terminal_bus
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_cagar_budaya
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_gardu_listrik
'
)
>=
0
===
false
)
{
$
(
"
.btn_create_point
"
).
remove
();
}
if
(
list_perm
.
indexOf
(
'
add_roads
'
)
>=
0
===
false
&&
list_perm
.
indexOf
(
'
add_bangunan
'
)
>=
0
===
false
&&
list_perm
.
indexOf
(
'
add_kantor_administrasi
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_layanan_kesehatan
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_puskesmas
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_rumah_sakit
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_sarana_ibadah
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_sarana_pendidikan
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_stasiun
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_terminal_bus
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_cagar_budaya
'
)
>=
0
===
false
||
list_perm
.
indexOf
(
'
add_gardu_listrik
'
)
>=
0
===
false
)
{
$
(
"
#modal_option_create
"
).
remove
();
}
alert
(
list_perm
.
indexOf
(
'
change_rumah_sakit
'
)
>=
0
)
</script>
\ No newline at end of file
templates/layout/layout.html
View file @
4da68b7f
...
...
@@ -49,23 +49,20 @@
font-family
:
'gilroyultralight'
;
src
:
url('/static/css/Gilroy-UltraLight.woff')
format
(
'woff'
);
}
/* start hide fitur modal */
.tab_kdb_klb
{
display
:
none
;
}
.btn_create_lahan
{
.btn_create_lahan
{
display
:
none
;
}
.btn_cek_KDBKLB
{
.btn_cek_KDBKLB
{
display
:
none
;
}
/* end hide fitur modal */
</style>
{% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %}
...
...
@@ -873,8 +870,7 @@
</body>
</html>
{% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
{% include 'includes/permission.html' %} {% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
<script
type=
"text/javascript"
src=
"{% static 'js/action.js' %}"
></script>
<script>
// start disabled inspect
...
...
@@ -916,7 +912,7 @@
$
(
"
#pilihcari
"
).
html
(
'
<i class="icon-home4 text-muted text-size-base" style="color: #5A9AFB;"></i>
'
)
}
else
if
(
dar
==
'
Jalan
'
)
{
$
(
"
#pilihcari
"
).
html
(
'
<i class="icon-git-branch text-muted text-size-base" style="color: #5A9AFB;"></i>
'
)
}
else
if
(
dar
==
'
Reset
'
)
{
}
else
if
(
dar
==
'
Reset
'
)
{
$
(
"
#pilihcari
"
).
html
(
''
)
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment