Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d65b84ee
authored
Feb 21, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan datatable dan css
1 parent
a3d64342
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
252 additions
and
235 deletions
opensipkd/base/static/css/osipkd.css
opensipkd/base/views/base_views.py
opensipkd/base/views/departemen.py
opensipkd/base/views/templates/base3.1.pt
opensipkd/base/views/user_login.py
opensipkd/base/views/widgets/autocomplete_input_ms.pt
opensipkd/detable/detable.py
opensipkd/detable/templates/detable.pt
opensipkd/base/static/css/osipkd.css
View file @
d65b84e
...
...
@@ -27,18 +27,28 @@ legend {
.twitter-typeahead
.tt-query
,
.twitter-typeahead
.tt-hint
{
margin-bottom
:
0
;
width
:
100%
;
height
:
26px
;
position
:
absolute
;
top
:
0
;
left
:
0
;
margin-bottom
:
0
;
width
:
100%
;
height
:
26px
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.twitter-typeahead
.tt-hint
{
color
:
#a1a1a1
;
z-index
:
1
;
padding
:
3px
6px
;
border
:
1px
solid
transparent
;
color
:
#a1a1a1
;
z-index
:
1
;
padding
:
3px
6px
;
border
:
1px
solid
transparent
;
}
.select2-container
.select2-selection--single
.select2-selection__rendered
{
/* display: block; */
/* padding-left: 8px; */
/* padding-right: 20px; */
overflow
:
hidden
;
/* text-overflow: ellipsis; */
/* white-space: nowrap; */
padding
:
3px
6px
;
}
.form-control
{
font-size
:
12px
;
...
...
@@ -51,14 +61,14 @@ border: 1px solid transparent;
height
:
26px
;
}
.input-group-addon
{
.input-group-addon
{
padding
:
3px
6px
;
height
:
26px
;
font-size
:
12px
;
}
.picker__select--month
,
.picker__select--year
{
.picker__select--month
,
.picker__select--year
{
padding
:
0.1em
;
/*height: 3em;*/
}
...
...
@@ -88,19 +98,19 @@ border: 1px solid transparent;
padding
:
10px
20px
;
border-radius
:
6px
;
border
:
0px
none
;
background
:
#BC
2131
;
background-image
:
linear-gradient
(
to
bottom
,
#C6414E
0px
,
#BC
2131
100%
);
background
:
#bc
2131
;
background-image
:
linear-gradient
(
to
bottom
,
#c6414e
0px
,
#bc
2131
100%
);
background-repeat
:
repeat-x
;
margin-top
:
20px
;
margin-top
:
20px
;
}
.container
.btn-logout
{
margin-top
:
12px
;
margin-top
:
12px
;
}
.container
.btn-login
:hover
{
background
:
#BC
2131
;
background
:
#bc
2131
;
}
.container
.btn-login
.label
{
...
...
@@ -108,20 +118,19 @@ border: 1px solid transparent;
font-size
:
8px
;
}
/* dataTables Customize */
table
.dataTable
thead
{
background-color
:
#EAEAEA
;
background-color
:
#eaeaea
;
}
table
.dataTable
tr
.even.selected
td
{
background-color
:
#B0BED
9
;
background-color
:
#b0bed
9
;
}
table
.dataTable
tr
.odd.selected
td
{
background-color
:
#9FAFD
1
;
background-color
:
#9fafd
1
;
}
table
.dataTable
tr
.selected
td
{
background-color
:
#9FAFD
1
;
background-color
:
#9fafd
1
;
}
/*
...
...
@@ -189,6 +198,6 @@ div.tab-content {
font-size
:
10px
!important
;
}
.paginate_button
.current
{
.paginate_button
.current
{
font-size
:
10px
!important
;
}
opensipkd/base/views/base_views.py
View file @
d65b84e
...
...
@@ -720,6 +720,8 @@ class BaseView(object):
for
k
in
cstruct
:
val
=
cstruct
.
get
(
k
)
if
type
(
val
)
is
dict
:
if
k
not
in
value
:
value
[
k
]
=
{}
value
[
k
]
=
self
.
update_value
(
value
[
k
],
val
)
elif
val
:
value
[
k
]
=
cstruct
.
get
(
k
)
...
...
@@ -747,14 +749,7 @@ class BaseView(object):
e
.
cstruct
[
f
.
name
])
if
f
.
name
==
"captcha"
:
e
.
cstruct
[
f
.
name
]
=
self
.
get_captcha_url
()
# if e.cstruct[f.name]:
# cstruct = {}
value
=
self
.
update_value
(
value
,
e
.
cstruct
)
# for k in cstruct:
# if not e.cstruct.get(k):
# e.cstruct[k] = value[k]
# value.update(e.cstruct)
# value.update(cstruct)
form
.
set_appstruct
(
value
)
return
self
.
returned_form
(
form
,
table
,
**
kwargs
)
...
...
@@ -771,13 +766,6 @@ class BaseView(object):
form
.
set_appstruct
(
values
)
return
self
.
returned_form
(
form
,
table
,
**
kwargs
)
def
view_act
(
self
,
**
kwargs
):
if
self
.
req
.
matchdict
[
'act'
]
==
'grid'
:
if
self
.
req
.
params
.
get
(
"paren"
):
return
self
.
get_list
(
**
kwargs
)
return
self
.
get_list
(
**
kwargs
)
return
super
()
.
view_act
(
**
kwargs
)
def
save
(
self
,
values
,
user
,
row
=
None
):
log
.
info
(
"Save"
)
log
.
debug
(
values
)
...
...
@@ -890,7 +878,7 @@ class BaseView(object):
form
=
self
.
get_form
(
self
.
edit_schema
,
**
kwargs
)
table
=
self
.
get_item_table
(
row
)
resources
=
form
.
get_widget_resources
(
)
values
=
self
.
get_values
(
row
)
if
request
.
POST
:
if
'save'
in
request
.
POST
:
controls
=
request
.
POST
.
items
()
...
...
@@ -899,7 +887,14 @@ class BaseView(object):
controls
=
form
.
validate
(
controls
)
except
ValidationFailure
as
e
:
log
.
error
(
f
"Edit Error: {str(e.error.msg)}"
)
form
.
set_appstruct
(
e
.
cstruct
)
for
f
in
e
.
field
.
children
:
if
isinstance
(
f
.
typ
,
colander
.
Date
):
e
.
cstruct
[
f
.
name
]
=
date_from_str
(
e
.
cstruct
[
f
.
name
])
if
f
.
name
==
"captcha"
:
e
.
cstruct
[
f
.
name
]
=
self
.
get_captcha_url
()
values
=
self
.
update_value
(
values
,
e
.
cstruct
)
form
.
set_appstruct
(
values
)
return
self
.
returned_form
(
form
,
table
,
**
kwargs
)
c
=
dict
(
controls
)
...
...
@@ -908,7 +903,6 @@ class BaseView(object):
return
self
.
next_edit
(
form
,
row
=
row
)
values
=
self
.
get_values
(
row
)
form
.
set_appstruct
(
values
)
form
=
self
.
before_edit
(
form
)
...
...
opensipkd/base/views/departemen.py
View file @
d65b84e
...
...
@@ -78,7 +78,10 @@ class AddSchema(colander.Schema):
missing
=
colander
.
drop
,
oid
=
"company_id"
)
status
=
colander
.
SchemaNode
(
colander
.
Boolean
(),
oid
=
"status"
)
status
=
colander
.
SchemaNode
(
colander
.
Integer
(),
widget
=
widget
.
CheckboxWidget
(
true_val
=
'1'
,
false_val
=
'0'
),
oid
=
"status"
)
def
after_bind
(
self
,
schema
,
kwargs
):
request
=
kwargs
[
"request"
]
...
...
opensipkd/base/views/templates/base3.1.pt
View file @
d65b84e
<!DOCTYPE html>
<html
lang=
"en-us"
tal:define=
"
<html
lang=
"en-us"
tal:define=
"
home request._host;
user_path ['user', 'user-add', 'user-edit', 'user-view', 'user-delete'];
user_area_path ['user-area', 'user-area-add', 'user-area-edit', 'user-area-view', 'user-area-delete'];
...
...
@@ -22,6 +21,7 @@
js js|[];
route_name route_name|request.matched_route.name;
"
>
<head>
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
...
...
@@ -41,42 +41,41 @@
<!-- Basic Styles -->
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/bootstrap.min.css"
>
<!--? <link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/font-awesome.min.css">-->
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/fonts/fontawesome-free-6.1.2-web/css/all.min.css"
>
<!--? <link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/font-awesome.min.css">-->
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/fonts/fontawesome-free-6.1.2-web/css/all.min.css"
>
<!-- SmartAdmin Styles : Caution! DO NOT change the order -->
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/smartadmin-production-plugins.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/smartadmin-production.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/smartadmin-skins.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/smartadmin-production.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/smartadmin-skins.min.css"
>
<!-- We recommend you use "your_style.css" to override SmartAdmin
specific styles this will also ensure you retrain your customization with each SmartAdmin update. -->
<!-- LOOP FORM CSS INCLUDED-->
<tal:loop
tal:repeat=
"css_resource css"
>
<link
rel=
"stylesheet"
href=
"${home}${request.static_path(css_resource)}"
type=
"text/css"
tal:condition=
"css_resource[:4]!='http'"
>
<link
rel=
"stylesheet"
href=
"${css_resource}"
type=
"text/css"
tal:condition=
"css_resource[:4]=='http'"
>
<link
rel=
"stylesheet"
href=
"${home}${request.static_path(css_resource)}"
type=
"text/css"
tal:condition=
"css_resource[:4]!='http'"
>
<link
rel=
"stylesheet"
href=
"${css_resource}"
type=
"text/css"
tal:condition=
"css_resource[:4]=='http'"
>
</tal:loop>
<!--? <link href="${home}/static/v3/js/plugin/bootstrap-datepicker/css/bootstrap-datepicker.min.css"-->
<!--? rel="stylesheet">-->
<link
href=
"${home}/deform_static/css/form.css"
rel=
"stylesheet"
>
<!--? <link href="${home}/static/v3/css/select2.min.css" rel="stylesheet" type="text/css">-->
<metal:css
define-slot=
"css_files"
></metal:css>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/osipkd.css"
>
</head>
<body
class=
"fixed-header"
>
<div
id=
"loading"
style=
"display:none;"
>
<img
id=
"loading-image"
src=
"${home}/static/img/ajax-loader.gif"
alt=
"Loading..."
/>
</div>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"${home}/static/v3/css/osipkd.css"
>
<div
id=
"loading"
style=
"display:none;"
>
<img
id=
"loading-image"
src=
"${home}/static/img/ajax-loader.gif"
alt=
"Loading..."
/>
</div>
<!-- #HEADER -->
<header
id=
"header"
>
<!-- #HEADER -->
<header
id=
"header"
>
<div
id=
"logo-group"
>
<!-- PLACE YOUR LOGO HERE -->
<h3
id=
"logo"
>
...
...
@@ -96,8 +95,8 @@
<div
class=
"pull-right"
>
<div
tal:condition=
"request.user"
class=
"project-context hidden-xs"
>
<span
class=
"label"
><i
class=
"fa fa-sm fa-fw fa-institution"
></i>
${request.company}
</span>
<span
tal:condition=
"request.user"
class=
"project-selector dropdown-toggle"
data-toggle=
"dropdown"
>
Pilih Module
<i
class=
"fa fa-angle-down"
></i></span>
<span
tal:condition=
"request.user"
class=
"project-selector dropdown-toggle"
data-toggle=
"dropdown"
>
Pilih
Module
<i
class=
"fa fa-angle-down"
></i></span>
<ul
tal:condition=
"request.user"
class=
"dropdown-menu"
>
<li
tal:repeat=
"menu request.menus"
>
<a
href=
"${home}/${menu}"
>
${request.menus[menu]}
</a>
...
...
@@ -121,35 +120,36 @@
<!-- User info -->
<ul
tal:condition=
"request.user"
class=
"header-dropdown-list hidden-xs"
>
<li>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
><i
class=
"fa fa-lg fa-fw fa-user"
></i>
<span
style=
"text-transform:capitalize"
>
${request.user and request.user.nice_username() or ""}
</span>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
><i
class=
"fa fa-lg fa-fw fa-user"
></i>
<span
style=
"text-transform:capitalize"
>
${request.user and request.user.nice_username() or ""}
</span>
<i
class=
"fa fa-angle-down"
></i>
</a>
<ul
class=
"dropdown-menu pull-right"
>
<li><a
style=
"text-transform:capitalize"
href=
"${request.route_url('profile')}"
>
Profile
</a></li>
<li
tal:condition=
"not request.user.external"
>
<a
style=
"text-transform:capitalize"
href=
"${request.route_url('password')}"
>
Ubah password
</a>
<a
style=
"text-transform:capitalize"
href=
"${request.route_url('password')}"
>
Ubah
password
</a>
</li>
<li><a
style=
"text-transform:capitalize"
href=
"${request.route_url('logout')}"
>
Logout
</a></li>
<li
tal:condition=
"request.user.api_key"
><a
style=
"text-transform:capitalize"
<li
tal:condition=
"request.user.api_key"
><a
style=
"text-transform:capitalize"
href=
"${home}/recreate-api-key"
>
API Key
</a></li>
<li
tal:condition=
"'core' in request.modules and change_unit(request)"
>
<a
style=
"text-transform:capitalize"
href=
"${home}/departemen/chg"
>
Ubah
Organisasi
</a>
</li>
<a
style=
"text-transform:capitalize"
href=
"${home}/departemen/chg"
>
Ubah
Organisasi
</a>
</li>
</ul>
</li>
</ul>
<!-- end user info -->
</div>
<!-- end pulled right: nav area -->
</header>
<!-- END HEADER -->
</header>
<!-- END HEADER -->
<!-- Left panel : Navigation area -->
<!-- Note: This width of the aside area can be adjusted through LESS variables -->
<aside
id=
"left-panel"
style=
"padding-bottom:67px"
>
<!-- Left panel : Navigation area -->
<!-- Note: This width of the aside area can be adjusted through LESS variables -->
<aside
id=
"left-panel"
style=
"padding-bottom:67px"
>
<!-- NAVIGATION : This navigation is also responsive-->
<nav
style=
""
>
<!-- Modul Menu -->
...
...
@@ -181,44 +181,57 @@
</li>
<li
tal:condition=
"has_permission(request, 'upload-logo')"
tal:attributes=
"class route_name in ['upload-logo'] and 'active'"
>
<a
href=
"${home}/upload/logo"
>
Upload Logo
</a></li>
<a
href=
"${home}/upload/logo"
>
Upload Logo
</a>
</li>
<li
tal:condition=
"has_permission(request, 'parameter')"
tal:attributes=
"class route_name in param_path and 'active'"
>
<a
href=
"${home}/parameter"
>
Parameter
</a></li>
<a
href=
"${home}/parameter"
>
Parameter
</a>
</li>
<li
tal:condition=
"has_permission(request, 'company')"
tal:attributes=
"class route_name in company_path and 'active'"
>
<a
href=
"${home}/company"
>
Pemerintah
</a></li>
<a
href=
"${home}/company"
>
Pemerintah
</a>
</li>
<li
tal:condition=
"has_permission(request, 'eselon')"
tal:attributes=
"class route_name in eselon_path and 'active'"
>
<a
href=
"${home}/eselon"
>
Eselon
</a></li>
<a
href=
"${home}/eselon"
>
Eselon
</a>
</li>
<li
tal:condition=
"has_permission(request, 'jabatan')"
tal:attributes=
"class route_name in jabatan_path and 'active'"
>
<a
href=
"${home}/jabatan"
>
Jabatan
</a></li>
<a
href=
"${home}/jabatan"
>
Jabatan
</a>
</li>
<li
tal:condition=
"has_permission(request, 'departemen')"
tal:attributes=
"class route_name in dep_path and 'active'"
>
<a
href=
"${home}/departemen"
>
Departemen
</a></li>
<a
href=
"${home}/departemen"
>
Departemen
</a>
</li>
<li
tal:condition=
"has_permission(request, 'partner')"
tal:attributes=
"class route_name in partner_path and 'active'"
>
<a
href=
"${home}/partner"
>
Partner
</a></li>
<a
href=
"${home}/partner"
>
Partner
</a>
</li>
<li
tal:condition=
"has_permission(request, 'partner-departemen')"
tal:attributes=
"class route_name in part_dep_path and 'active'"
>
<a
href=
"${home}/partner/departemen"
>
Partner Departemen
</a></li>
<a
href=
"${home}/partner/departemen"
>
Partner Departemen
</a>
</li>
<li
tal:condition=
"has_permission(request, 'provinsi')"
tal:attributes=
"class route_name in provinsi_path and 'active'"
>
<a
href=
"${home}/provinsi"
>
Provinsi
</a></li>
<a
href=
"${home}/provinsi"
>
Provinsi
</a>
</li>
<li
tal:condition=
"has_permission(request, 'dati2')"
tal:attributes=
"class route_name in dati2_path and 'active'"
>
<a
href=
"${home}/dati2"
>
Kabupaten/Kota
</a></li>
<a
href=
"${home}/dati2"
>
Kabupaten/Kota
</a>
</li>
<li
tal:condition=
"has_permission(request, 'kecamatan')"
tal:attributes=
"class route_name in kecamatan_path and 'active'"
>
<a
href=
"${home}/kecamatan"
>
Kecamatan
</a></li>
<a
href=
"${home}/kecamatan"
>
Kecamatan
</a>
</li>
<li
tal:condition=
"has_permission(request, 'desa')"
tal:attributes=
"class route_name in desa_path and 'active'"
>
<a
href=
"${home}/desa"
>
Desa/Kelurahan
</a></li>
<a
href=
"${home}/desa"
>
Desa/Kelurahan
</a>
</li>
<li
tal:condition=
"has_permission(request, 'log')"
tal:attributes=
"class route_name in ['log'] and 'active'"
>
<a
href=
"${home}/log"
>
Log
</a></li>
<a
href=
"${home}/log"
>
Log
</a>
</li>
</ul>
</li>
...
...
@@ -230,72 +243,72 @@
<span
class=
"footer-side"
>
©
OpenSIPKD.com
<script>
document
.
write
(
new
Date
().
getFullYear
());
</script>
</span>
</aside>
<!-- END NAVIGATION -->
</aside>
<!-- END NAVIGATION -->
<!-- JS -->
<script
src=
"${home}/static/v3/js/jquery-2.1.1.min.js"
></script>
<script>
<!-- JS -->
<script
src=
"${home}/static/v3/js/jquery-2.1.1.min.js"
></script>
<script>
if
(
!
window
.
jQuery
)
{
document
.
write
(
'<script src="${home}/static/v3/js/libs/jquery-2.1.1.min.js"><\/script>'
);
}
</script>
<!--?<script src="${home}/static/v3/js/jquery-ui-1.10.3.min.js"></script>-->
<script>
</script>
<!--?<script src="${home}/static/v3/js/jquery-ui-1.10.3.min.js"></script>-->
<script>
// if (!window.jQuery.ui) {
<!--
?
document
.
write
(
'<script src="${home}/static/v3/js/libs/jquery-ui-1.10.3.min.js"><\/script>'
);
-->
// }
</script>
</script>
<!-- IMPORTANT: APP CONFIG -->
<script
src=
"${home}/static/v3/js/app.config.js"
></script>
<!-- IMPORTANT: APP CONFIG -->
<script
src=
"${home}/static/v3/js/app.config.js"
></script>
<!-- BOOTSTRAP JS -->
<script
src=
"${home}/static/v3/js/bootstrap/bootstrap.min.js"
></script>
<!-- BOOTSTRAP JS -->
<script
src=
"${home}/static/v3/js/bootstrap/bootstrap.min.js"
></script>
<!-- FastClick: For mobile devices -->
<script
src=
"${home}/static/v3/js/plugin/fastclick/fastclick.min.js"
></script>
<!-- FastClick: For mobile devices -->
<script
src=
"${home}/static/v3/js/plugin/fastclick/fastclick.min.js"
></script>
<!--[if IE 8]>
<!--[if IE 8]>
<h1>Your browser is out of date, please update your browser by going to www.microsoft.com/download</h1>
<![endif]-->
<!-- MAIN APP JS FILE -->
<script
src=
"${home}/static/v3/js/app.min.js"
></script>
<!-- PAGE RELATED PLUGIN(S) -->
<!--?<script src="${home}/static/v3/js/plugin/datatables/jquery.dataTables.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.colVis.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.tableTools.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.bootstrap.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatable-responsive/datatables.responsive.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/bootstrap-timepicker/bootstrap-timepicker.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/deform.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/typeahead.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/jquery.maskMoney-3.1.1.min.js"></script>-->
<!--?<script src="${home}/deform_static/tinymce/tinymce.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/tools.js"></script>-->
<!--?<script src="${home}/static/v3/js/notification/SmartNotification.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/masked-input/jquery.maskedinput.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/select2.full.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/file_upload.js"></script>-->
<script
src=
"${home}/static/v3/js/osipkd.js"
></script>
<!-- LOOP ON JS RESOURCE -->
<tal:loop
tal:repeat=
"js_resource js"
>
<!-- MAIN APP JS FILE -->
<script
src=
"${home}/static/v3/js/app.min.js"
></script>
<!-- PAGE RELATED PLUGIN(S) -->
<!--?<script src="${home}/static/v3/js/plugin/datatables/jquery.dataTables.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.colVis.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.tableTools.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatables/dataTables.bootstrap.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/datatable-responsive/datatables.responsive.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/bootstrap-timepicker/bootstrap-timepicker.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/deform.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/typeahead.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/jquery.maskMoney-3.1.1.min.js"></script>-->
<!--?<script src="${home}/deform_static/tinymce/tinymce.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/tools.js"></script>-->
<!--?<script src="${home}/static/v3/js/notification/SmartNotification.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/plugin/masked-input/jquery.maskedinput.min.js"></script>-->
<!--?<script src="${home}/static/v3/js/select2.full.min.js"></script>-->
<!--?<script src="${home}/deform_static/scripts/file_upload.js"></script>-->
<script
src=
"${home}/static/v3/js/osipkd.js"
></script>
<!-- LOOP ON JS RESOURCE -->
<tal:loop
tal:repeat=
"js_resource js"
>
<script
src=
"${home}${request.static_path(js_resource)}"
tal:condition=
"js_resource[:4]!='http'"
></script>
<script
src=
"${js_resource}"
tal:condition=
"js_resource[:4]=='http'"
></script>
</tal:loop>
</tal:loop>
<metal:js
define-slot=
"js_files"
></metal:js>
<metal:js
define-slot=
"js_files"
></metal:js>
<!-- End isi Script-->
<!-- MAIN PANEL -->
<div
id=
"main"
role=
"main"
>
<!-- End isi Script-->
<!-- MAIN PANEL -->
<div
id=
"main"
role=
"main"
>
<!-- MAIN CONTENT -->
<div
id=
"content"
>
...
...
@@ -333,10 +346,11 @@
</div>
<!-- END MAIN CONTENT -->
</div>
<!-- END MAIN PANEL -->
</div>
<!-- END MAIN PANEL -->
<!-- Define Script-->
<script
metal:define-slot=
"scripts"
></script>
<!-- Define Script-->
<script
metal:define-slot=
"scripts"
></script>
</body>
</html>
\ No newline at end of file
opensipkd/base/views/user_login.py
View file @
d65b84e
...
...
@@ -57,9 +57,6 @@ class Login(CSRFSchema):
password
=
colander
.
SchemaNode
(
colander
.
String
(),
widget
=
widget
.
PasswordWidget
())
# def after_bind(self, schema, kwargs):
# request = kwargs["request"]
# csrf_token = new_csrf_token(request)
...
...
@@ -98,6 +95,8 @@ class LoginUser(object):
self
.
message
=
"Login Gagal"
set_user_log
(
self
.
message
,
self
.
request
,
log
,
values
[
"username"
])
return
for
g
in
self
.
user
.
groups
:
log
.
debug
(
f
"Group: {g.id} as {g.group_name}"
)
# generate security_code dan simpan dalam session
regenerate_security_code
(
self
.
user
,
0.03
)
# berlaku selama 1.8 menit
...
...
@@ -115,8 +114,7 @@ class Oauth2UserExc(Exception):
def
oauth2_login
(
request
,
params
=
None
):
provider_name
=
params
and
params
[
"provider_name"
]
\
or
request
.
params
[
"provider_name"
]
provider_name
=
params
and
params
[
"provider_name"
]
or
request
.
params
[
"provider_name"
]
if
provider_name
==
"google"
:
from
.base_google
import
googlesignin
try
:
...
...
@@ -129,8 +127,8 @@ def oauth2_login(request, params=None):
id_info
=
None
iss
=
id_info
and
re
.
sub
(
r'https?://'
,
''
,
id_info
[
'iss'
])
or
None
user
=
id_info
and
ExternalIdentityService
.
\
user_by_external_id_and_provider
(
id_info
[
'sub'
],
iss
)
user
=
id_info
and
ExternalIdentityService
.
user_by_external_id_and_provider
(
id_info
[
'sub'
],
iss
)
log
.
debug
(
"Users :
%
s"
,
user
)
log
.
debug
(
"IdInfo :
%
s"
,
id_info
)
if
id_info
and
not
user
:
...
...
@@ -143,7 +141,8 @@ def oauth2_login(request, params=None):
log
.
debug
(
"User :
%
s"
,
user
)
log
.
debug
(
"Partner :
%
s"
,
partner
)
if
user
or
partner
:
raise
Oauth2UserExc
(
"Email sudah terdaftar silahkan login standard"
)
raise
Oauth2UserExc
(
"Email sudah terdaftar silahkan login standard"
)
user
=
User
()
user
.
from_dict
(
values
)
...
...
@@ -205,8 +204,8 @@ class ViewLogin(BaseView):
# start cek external module
pckgs
=
get_params
(
'external-uim'
)
if
user
:
external_user
=
DBSession
.
query
(
ExternalIdentity
)
\
.
filter_by
(
local_user_id
=
user
.
id
,
external_user
=
DBSession
.
query
(
ExternalIdentity
)
.
\
filter_by
(
local_user_id
=
user
.
id
,
external_user_name
=
identity
)
.
first
()
pckgs
=
external_user
and
pckgs
or
None
...
...
@@ -224,7 +223,8 @@ class ViewLogin(BaseView):
login
=
LoginUser
(
self
.
req
)
if
not
login
.
login
(
values
,
user
):
request
.
session
.
flash
(
login
.
message
,
"error"
)
next_url
=
get_urls
(
f
"{request.route_url('login')}?next={next_url}"
)
next_url
=
get_urls
(
f
"{request.route_url('login')}?next={next_url}"
)
return
HTTPFound
(
location
=
next_url
)
return
redirect_login
(
request
,
user
)
...
...
@@ -237,8 +237,7 @@ class ViewLogin(BaseView):
del
request
.
session
[
'login failed'
]
return
r
elif
"provider_name"
in
request
.
params
and
\
request
.
params
[
"provider_name"
]:
elif
"provider_name"
in
request
.
params
and
request
.
params
[
"provider_name"
]:
try
:
user
=
oauth2_login
(
request
)
except
Oauth2ParseExc
as
e
:
...
...
@@ -279,6 +278,9 @@ class ViewLogin(BaseView):
def
redirect_login
(
request
,
user
):
set_user_log
(
"Login Sukses"
,
request
,
log
,
user
.
user_name
)
for
g
in
user
.
groups
:
log
.
debug
(
f
"Group: {g.id} as {g.group_name}"
)
headers
=
get_login_headers
(
request
,
user
)
request
.
session
.
flash
(
"Sukses Login"
)
next_url
=
request
.
params
.
get
(
'next'
)
...
...
@@ -379,8 +381,7 @@ def view_change_password(request):
code
=
request
.
matchdict
[
'code'
]
q
=
DBSession
.
query
(
User
)
.
filter_by
(
security_code
=
code
)
user
=
q
.
first
()
if
not
user
or
\
create_now
()
-
user
.
security_code_date
>
one_hour
:
if
not
user
or
create_now
()
-
user
.
security_code_date
>
one_hour
:
request
.
session
.
flash
(
'Security code expired'
,
'error'
)
return
HTTPFound
(
location
=
get_urls
(
request
.
route_url
(
'login'
)))
...
...
@@ -436,7 +437,7 @@ class ResetPassword(colander.Schema):
colander
.
String
(),
title
=
_
(
'Email'
),
description
=
_
(
'email-reset-password'
,
default
=
'Enter your email address and we will send you '
\
default
=
'Enter your email address and we will send you '
'a link to reset your password.'
)
)
...
...
@@ -459,8 +460,7 @@ def send_email_security_code(
**
kwargs
):
settings
=
get_settings
()
password
=
kwargs
.
get
(
"password"
,
""
)
if
'mail.sender_name'
not
in
settings
\
or
'mail.username'
not
in
settings
:
if
'mail.sender_name'
not
in
settings
or
'mail.username'
not
in
settings
:
return
url
=
'{}/password/{}?password={}'
.
format
(
...
...
@@ -499,8 +499,7 @@ def sending_mail(request, user, subject, body):
def
send_email_pending
(
request
,
user
,
subject
,
body_msg_id
,
body_default_file
):
settings
=
get_settings
()
if
'mail.sender_name'
not
in
settings
\
or
'mail.username'
not
in
settings
:
if
'mail.sender_name'
not
in
settings
or
'mail.username'
not
in
settings
:
return
here
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
...
...
opensipkd/base/views/widgets/autocomplete_input_ms.pt
View file @
d65b84e
...
...
@@ -3,8 +3,8 @@
oid oid|field.oid;
style style|field.widget.style;
autofocus autofocus|field.autofocus;
url url|field.widget.url;
slave slave|field.widget.slave;
url url|field.widget.url;
" tal:omit-tag="">
${field.start_mapping()}
<input type="hidden" name="auto_id" id="${oid}-auto_id" value="${auto_id}" />
...
...
@@ -28,15 +28,22 @@
var not_check = ["id", "value"];
$.each(datum, function (key, val) {
if (!not_check.includes(key)) {
var ele = $('#' + key);
if (ele !== undefined) {
var eleName = ele.prop('nodeName').toLowerCase();
var eleName = $('#' + key).prop('nodeName');
if (eleName !== undefined) {
eleName = eleName.toLowerCase();
if (eleName === "select")
$("#" + key).val(val).trigger("change");
else if (eleName === "input")
$("#" + key).val(val);
else
$("#" + key).text(val);
} else {
//Check apakah jika radio button
eleName = $("input[name ='" + key + "']").prop('type');
if (eleName == "radio") {
$("input[name ='" + key + "'][value='" + val + "']").prop('checked', true);
}
}
}
});
...
...
opensipkd/detable/detable.py
View file @
d65b84e
...
...
@@ -265,6 +265,8 @@ class DeTable(field.Field):
d
[
"action"
]
=
f
.
action
else
:
d
[
"action"
]
=
True
if
hasattr
(
f
,
"search_method"
):
d
[
"search_method"
]
=
f
.
search_method
if
isinstance
(
f
.
widget
,
deform_widget
.
HiddenWidget
):
d
[
"visible"
]
=
False
...
...
@@ -441,6 +443,15 @@ class DeTable(field.Field):
html
+=
'</select>'
elif
isinstance
(
f
.
typ
,
colander
.
Date
):
search_method
=
getattr
(
f
,
"search_method"
,
None
)
if
search_method
==
"date"
:
# html += f'<div class="tooltip">'
html
+=
f
'<label class="form-label" style="font-size:12px">{f.title}</label>'
html
+=
f
'<input type="date" class="form-control {self.tableid}-control-filter"'
html
+=
f
'{txt}/>'
# html += f'<span class="tooltiptext">{f.title}</span>'
# html += f'</div>'
else
:
html
+=
f
'<div class="form-group" {txt}>'
html
+=
f
'<label class="form-label" style="font-size:12px">{f.title}</label>'
html
+=
f
'<div class="input-group input-daterange" style="padding: 3px 0px 7px !important;">'
...
...
opensipkd/detable/templates/detable.pt
View file @
d65b84e
...
...
@@ -57,7 +57,7 @@
<script>
$(document).ready(function () {
$(document).on("click",
'.${tableid}checkAll',
function () {
$(document).on("click",
'.${tableid}checkAll',
function () {
if (this.checked) {
$(".${tableid}_check").prop("checked", true);
} else {
...
...
@@ -105,20 +105,16 @@
var o${tableid}Url = o${tableid}Uri + "${url_suffix}";
var m${tableid}ID;
var m${tableid}CheckList = [];
var check_field = ${
check_field
};
var check_field = ${
check_field
};
deform.addCallback('${tableid}', function (oid) {
// $(document).ready(function () {
function displayEmptyID() {
$("#emptyID").show();
$('#emptyID').animate({
opacity: 0.8
}, 2000);
$('#emptyID').animate({
opacity: 0.8
}, 2000);
setTimeout(function () {
$("#emptyID").fadeTo(500, 0).slideUp(500, function () {
$("#emptyID").hide();
});
}
, 4000);
}, 4000);
}
let tb_array = [
...
...
@@ -147,22 +143,18 @@
};
let ${tableid}Columns = ${
structure: columns
};
let ${tableid}Columns = ${
structure: columns
};
function render_checkbox(value) {
if (value === true)
{
if (value === true)
return '<i class="fas fa-check-square" aria-hidden="true">';
}
if (value === false) {
if (value === false)
return '<i class="fas fa-minus-square" aria-hidden="true">';
//'Archived';
}
return value;
}
function render_checklist(value) {
return '<input type="checkbox" class="${tableid}_check" checked="' + {value} + '"></input>';
return '<input type="checkbox" class="${tableid}_check" checked="' + { value } + '"></input>';
}
...
...
@@ -184,7 +176,7 @@
// return ${tableid}Columns[co].wg_select_val[value];
// return "";
// }
}
else if (${tableid}Columns[co].hasOwnProperty("url")) {
}else if (${tableid}Columns[co].hasOwnProperty("url")) {
let url = ${tableid}Columns[co].url;
${tableid}Columns[co].render = function (data) {
let result = "No Data";
...
...
@@ -193,12 +185,11 @@
}
return result;
}
}
else if (${tableid}Columns[co].data === "id") {
}else if (${tableid}Columns[co].data === "id") {
${tableid}Columns[co].render = function (id, typ, data, setting) {
if (${tableid}Columns[co].action === false) return ""
let result = "";
if (${
allow_check
}) {
if (${
allow_check
}) {
var checked = "";
if (check_field !== "") {
checked = data[check_field] !== null ? "checked" : "";
...
...
@@ -208,53 +199,49 @@
var mtableId = "${tableid}";
result = '<input type="checkbox" class="' + mtableId + '_check" value="' + id + '" ' + checked + ' name="' + mtableId + '_check"/> ';
}
if (${
allow_view
})
if (${
allow_view
})
result += '<a href="${url}/' + id + '/view"><i class="fas fa-eye" aria-hidden="true" title="View"></i></a> ';
if (${
allow_edit
})
if (${
allow_edit
})
result += '<a href="${url}/' + id + '/edit"><i class="fas fa-edit" aria-hidden="true" title="Edit"></i></a> '
if (${
allow_delete
})
if (${
allow_delete
})
result += '<a href="${url}/' + id + '/delete"><i class="fas fa-trash" aria-hidden="true" title="Delete"></i></a>';
if (${
allow_post
})
if (${
allow_post
})
result += '<a href="${url}/' + id + '/post"><i class="fas fa-signs-post" aria-hidden="true" title="Post"></i></a>';
if (${
allow_unpost
})
if (${
allow_unpost
})
result += '<a href="${url}/' + id + '/unpost"><i class="fas fa-delete-left" aria-hidden="true" title="Unpost"></i></a>';
return result;
}
//columns[1].order = "order_asc";
}
}
let ${tableid}Params = {}
let ${tableid}Params = {};
var param_ajax = "";
var param_data = [];
if (!${server_side}) {
param_data = ${data};
} else {
param_ajax = o${tableid}Url;
}
if (!${ server_side }) param_data = ${ data };
else param_ajax = o${tableid}Url;
o${tableid} = $('#${tableid}').DataTable({
scrollX: ${field.scroll_x
},
scrollX: ${ field.scroll_x
},
//scrollY: ${field.scroll_y},
//dom: '<"row"<"col-md-8"<"toolbar">Bl><"col-md-4"fr>>tip',
dom: '<"row"<"col-md-8"<"toolbar">>><"row"<"col-md-8"Bl><"col-md-4"fr>>t<"row dt-footer"<"col-md-8" i><"col-md-4"p>>',
processing: true,
serverSide: ${server_side
},
serverSide: ${ server_side
},
data: param_data,
ajax: param_ajax,
stateSave: ${state_save
},
stateSave: ${ state_save
},
scrollCollapse: true,
sort: ${sorts
},
sort: ${ sorts
},
info: true,
filter: ${filters
},
filter: ${ filters
},
autoWidth: false,
paginate: ${paginates
},
paginate: ${ paginates
},
paginationType: "full_numbers",
order: [],
lengthMenu: [
...
...
@@ -273,14 +260,13 @@
}
});
}
}
);
});
let tb = tb_array.join(' ');
$("div.toolbar").html(tb);
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$("div.dt-footer").attr('style','margin-left: -7px;');
$(".dataTables_scrollBody").attr('style','margin-top: -10px;');
$("div.dt-footer").attr('style', 'margin-left: -7px;');
$(".dataTables_scrollBody").attr('style', 'margin-top: -10px;');
$('#${tableid} tbody').on('click', ':checkbox', function () {
if (this.checked) m${tableid}CheckList.push($(this).val());
else m${tableid}CheckList.splice(m${tableid}CheckList.indexOf($(this).val()), 1);
...
...
@@ -304,7 +290,7 @@
if (code === 13) filter_table();
});
$("#${tableid}_length").append('<label> ${structure:edit_buttons}</label>')
$("#${tableid}_length").append('<label> ${structure:edit_buttons}</label>')
;
function filter_table() {
$(".${tableid}-control-filter").each(function (e) {
...
...
@@ -316,17 +302,19 @@
col_id = col_id.join("-");
value = this.value;
if (this.checked) {
console.log(col_id, $(this).attr('id'), value, this.checked);
//
console.log(col_id, $(this).attr('id'), value, this.checked);
localStorage.setItem(col_id, value);
o${tableid}
.column($(this).data('index'))
.search(this.value)
o${tableid}.column($(this).data('index')).search(this.value)
}
}
else if ($(this).attr("type") === 'date') {
value = this.value;
localStorage.setItem(col_id, value);
var splitted = col_id.split('-');
if (splitted[splitted.length - 1] !== "min" && splitted[splitted.length - 1] !== "max"){
o${tableid}.column($(this).data('index')).search(value)
}
else{
var min_val = undefined;
var max_val = undefined;
if (splitted[splitted.length - 1] === "min") {
...
...
@@ -334,27 +322,26 @@
splitted.length = splitted.length - 1;
col_id = splitted.join("-");
max_val = $("#" + col_id + '-max').val()
} else {
}
else {
max_val = this.value;
splitted.length = splitted.length - 1;
col_id = splitted.join("-");
min_val = $("#" + col_id + '-min').val()
min_val = $("#" + col_id + '-min').val();
}
if (min_val === undefined && max_val !== undefined)
min_val = max_val;
if (max_val === undefined && min_val !== undefined)
max_val = min_val;
if (max_val !== undefined && min_val !== undefined && min_val !== "" && max_val !== "" && min_val !== null && max_val !== null)
if (min_val === undefined && max_val !== undefined) min_val = max_val;
if (max_val === undefined && min_val !== undefined) max_val = min_val;
if (max_val !== undefined && min_val !== undefined && min_val !== null && max_val !== null)
o${tableid}
.column($(this).data('index'))
.search(min_val + '-yadcf_delim-' + max_val, true)
.search(min_val + '-yadcf_delim-' + max_val, true);
//&& min_val !== "" && max_val !== ""
}
}
else {
col_id = this.id;
value = this.value;
if (value === undefined || value === null) {
value = "";
}
if (value === undefined || value === null) value = "";
console.log(col_id, $(this).attr('id'), value, $(this).data('index'));
localStorage.setItem(col_id, value);
o${tableid}
...
...
@@ -362,12 +349,11 @@
.search(value);
}
});
//o${tableid}.ajax.url(o${tableid}Url).load();
o${tableid}.draw();
}
$(".${tableid}-control-filter").on('click', function (e) {
console.log("Write Data Click");
//
console.log("Write Data Click");
var typ = $(this).attr("type");
if (typ === 'radio') {
filter_table();
...
...
@@ -375,15 +361,10 @@
});
$(".${tableid}-control-filter").on('change', function (e) {
var typ = $(this).prop("nodeName").toLowerCase();
if (typ === "select") {
filter_table()
}
if (typ === "select") filter_table();
var typ = $(this).attr("type").toLowerCase();
if (typ === "date") {
filter_table();
}
if (typ === "date") filter_table();
});
console.log("Read Data");
...
...
@@ -398,19 +379,18 @@
if (value !== undefined && value != null)
if ($(this).val() === value) $(this).attr("checked", true);
else $(this).attr("checked", false);
} else {
}
else {
value = localStorage.getItem(col_id);
if (value !== undefined && value !== null)
$(this).val(value);
}
//console.log(col_id, $(this).attr('id'), value);
});
filter_table();
</tal:block>
${structure:
btnscripts}
${structure:
filter_scripts}
${structure:
btnscripts}
${structure:
filter_scripts}
});
</script>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment