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 f078cc11
authored
Jul 11, 2026
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch '5.0.3' into '5.0.3-oracle'
5.0.3 See merge request !10
2 parents
6e331111
158e195c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
18 deletions
opensipkd/base/views/api_base.py
opensipkd/base/views/base_views.py
opensipkd/base/views/templates/404.pt
opensipkd/base/views/templates/500.pt
opensipkd/base/views/templates/base3.1.pt
opensipkd/base/views/templates/base5.pt
opensipkd/base/views/templates/login.pt
opensipkd/base/views/templates/logout.pt
opensipkd/base/widgets/templates/file_upload.pt
opensipkd/base/views/api_base.py
View file @
f078cc1
...
@@ -223,6 +223,7 @@ class ApiViews(APIView):
...
@@ -223,6 +223,7 @@ class ApiViews(APIView):
"""
"""
Mengubah data menjadi list dan convert objek menjadi string
Mengubah data menjadi list dan convert objek menjadi string
"""
"""
_log
.
debug
(
"Response to Client:
%
s"
,
data
)
if
not
isinstance
(
data
,
list
):
if
not
isinstance
(
data
,
list
):
data
=
[
data
]
data
=
[
data
]
for
i
,
item
in
enumerate
(
data
):
for
i
,
item
in
enumerate
(
data
):
...
...
opensipkd/base/views/base_views.py
View file @
f078cc1
...
@@ -57,9 +57,11 @@ log = logging.getLogger(__name__)
...
@@ -57,9 +57,11 @@ log = logging.getLogger(__name__)
# }
# }
class
AddSchema
(
colander
.
Schema
):
class
AddSchema
(
colander
.
Schema
):
kode
=
colander
.
SchemaNode
(
colander
.
String
(),
title
=
"Kode"
,
validator
=
colander
.
Length
(
max
=
50
),
kode
=
colander
.
SchemaNode
(
colander
.
String
(),
title
=
"Kode"
,
validator
=
colander
.
Length
(
max
=
50
),
search_method
=
"string_contains"
,
search_method
=
"string_contains"
,
searchable
=
True
,
searchable
=
True
,
aligned
=
"text-left"
)
)
class
UploadSchema
(
colander
.
Schema
):
class
UploadSchema
(
colander
.
Schema
):
upload
=
colander
.
SchemaNode
(
upload
=
colander
.
SchemaNode
(
...
@@ -143,7 +145,7 @@ class BaseView(object):
...
@@ -143,7 +145,7 @@ class BaseView(object):
self
.
list_form
=
None
# List dam Form
self
.
list_form
=
None
# List dam Form
self
.
form_list
=
None
# Form kemudian detail list
self
.
form_list
=
None
# Form kemudian detail list
self
.
global_search
=
False
self
.
form_scripts
=
"""
self
.
form_scripts
=
"""
$('#parent_nm').bind('typeahead:selected', function(obj, datum) {
$('#parent_nm').bind('typeahead:selected', function(obj, datum) {
$('#parent_id').val(datum.id);
$('#parent_id').val(datum.id);
...
@@ -590,9 +592,10 @@ class BaseView(object):
...
@@ -590,9 +592,10 @@ class BaseView(object):
if
not
self
.
columns
:
if
not
self
.
columns
:
columns
=
[]
columns
=
[]
for
d
in
list_schema
():
for
d
in
list_schema
():
global_search
=
getattr
(
d
,
"global_search"
,
False
)
global_search
=
hasattr
(
d
,
"global_search"
)
\
and
getattr
(
d
,
"global_search"
,
self
.
global_search
)
or
self
.
global_search
search_method
=
hasattr
(
d
,
"search_method"
)
\
search_method
=
hasattr
(
d
,
"search_method"
)
\
and
getattr
(
d
,
"search_method"
)
or
"string_contains"
and
getattr
(
d
,
"search_method"
,
"string_contains"
)
or
"string_contains"
if
hasattr
(
d
,
"field"
):
if
hasattr
(
d
,
"field"
):
if
isinstance
(
d
.
field
,
str
):
if
isinstance
(
d
.
field
,
str
):
columns
.
append
(
columns
.
append
(
...
@@ -825,8 +828,10 @@ class BaseView(object):
...
@@ -825,8 +828,10 @@ class BaseView(object):
def
view_view
(
self
,
**
kwargs
):
def
view_view
(
self
,
**
kwargs
):
request
=
self
.
req
request
=
self
.
req
row
=
self
.
query_id
()
.
first
()
qry
=
self
.
query_id
()
row
=
qry
.
first
()
if
not
row
:
if
not
row
:
log
.
debug
(
str
(
qry
.
statement
.
compile
(
compile_kwargs
=
{
'literal_binds'
:
True
})))
return
self
.
id_not_found
()
return
self
.
id_not_found
()
self
.
ses
[
"readonly"
]
=
True
self
.
ses
[
"readonly"
]
=
True
...
@@ -1196,6 +1201,7 @@ class BaseView(object):
...
@@ -1196,6 +1201,7 @@ class BaseView(object):
msg
=
f
"Data yang dicari Tidak Ditemukan ID:"
\
msg
=
f
"Data yang dicari Tidak Ditemukan ID:"
\
f
" {self.req.matchdict['id']}."
f
" {self.req.matchdict['id']}."
self
.
req
.
session
.
flash
(
msg
,
'error'
)
self
.
req
.
session
.
flash
(
msg
,
'error'
)
log
.
error
(
msg
)
return
self
.
route_list
(
**
kwargs
)
return
self
.
route_list
(
**
kwargs
)
def
get_values
(
self
,
row
,
istime
=
False
,
null
=
False
):
def
get_values
(
self
,
row
,
istime
=
False
,
null
=
False
):
...
@@ -1250,6 +1256,8 @@ class BaseView(object):
...
@@ -1250,6 +1256,8 @@ class BaseView(object):
is_object
=
kwargs
.
get
(
"is_object"
,
self
.
is_object
)
is_object
=
kwargs
.
get
(
"is_object"
,
self
.
is_object
)
kwargs
[
"is_object"
]
=
is_object
kwargs
[
"is_object"
]
=
is_object
if
not
row
:
if
not
row
:
log
.
debug
(
self
.
query_id
()
.
statement
.
compile
(
compile_kwargs
=
{
'literal_binds'
:
True
}))
return
self
.
id_not_found
(
**
kwargs
)
return
self
.
id_not_found
(
**
kwargs
)
if
self
.
edit_restrict
(
row
):
if
self
.
edit_restrict
(
row
):
...
@@ -1350,6 +1358,9 @@ class BaseView(object):
...
@@ -1350,6 +1358,9 @@ class BaseView(object):
is_object
=
kwargs
.
get
(
"is_object"
,
self
.
is_object
)
is_object
=
kwargs
.
get
(
"is_object"
,
self
.
is_object
)
kwargs
[
"is_object"
]
=
is_object
kwargs
[
"is_object"
]
=
is_object
if
not
row
:
if
not
row
:
log
.
debug
(
str
(
q
.
statement
.
compile
(
compile_kwargs
=
{
'literal_binds'
:
True
})))
return
self
.
id_not_found
()
return
self
.
id_not_found
()
if
not
self
.
bindings
:
if
not
self
.
bindings
:
self
.
bindings
=
self
.
get_bindings
(
row
)
self
.
bindings
=
self
.
get_bindings
(
row
)
...
...
opensipkd/base/views/templates/404.pt
View file @
f078cc1
<html
tal:define=
"home
''
;"
>
<html
tal:define=
"home
request.home.strip('/')
;"
>
<body>
<body>
<div
class=
"well"
>
<div
class=
"well"
>
<h2>
${request.app_name}
</h2>
<h2>
${request.app_name}
</h2>
...
...
opensipkd/base/views/templates/500.pt
View file @
f078cc1
<html>
<html
tal:define=
"home request.home.strip('/');"
>
<body>
<body>
<div
class=
"well"
>
<div
class=
"well"
>
...
...
opensipkd/base/views/templates/base3.1.pt
View file @
f078cc1
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en-us"
tal:define=
"
<html
lang=
"en-us"
tal:define=
"
home request.home;
home request.home
.strip('/')
;
user_path ['user', 'user-add', 'user-edit', 'user-view', 'user-delete'];
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'];
user_area_path ['user-area', 'user-area-add', 'user-area-edit', 'user-area-view', 'user-area-delete'];
user_dep_path ['user-departemen', 'user-departemen-add', 'user-departemen-edit', 'user-departemen-view', 'user-departemen-delete'];
user_dep_path ['user-departemen', 'user-departemen-add', 'user-departemen-edit', 'user-departemen-view', 'user-departemen-delete'];
...
...
opensipkd/base/views/templates/base5.pt
View file @
f078cc1
...
@@ -5,13 +5,9 @@
...
@@ -5,13 +5,9 @@
css css|[];
css css|[];
js js|[];
js js|[];
"
>
"
>
<head>
<head>
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<title>
${request.app_name} | ${request.company}
</title>
<title>
${request.app_name} | ${request.company}
</title>
<meta
name=
"description"
content=
""
>
<meta
name=
"description"
content=
""
>
<meta
name=
"author"
content=
""
>
<meta
name=
"author"
content=
""
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
>
...
@@ -207,8 +203,6 @@
...
@@ -207,8 +203,6 @@
</span>
</span>
</aside>
</aside>
<!-- END NAVIGATION -->
<!-- END NAVIGATION -->
<!-- JS -->
<!-- JS -->
<script
src=
"${home}/static/v3/js/jquery-2.1.1.min.js"
></script>
<script
src=
"${home}/static/v3/js/jquery-2.1.1.min.js"
></script>
<script>
<script>
...
...
opensipkd/base/views/templates/login.pt
View file @
f078cc1
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
tal:define=
"home request.home;"
>
<html
lang=
"en"
tal:define=
"home request.home
.strip('/')
;"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
...
...
opensipkd/base/views/templates/logout.pt
View file @
f078cc1
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
tal:define=
"home request.home;"
>
<html
lang=
"en"
tal:define=
"home request.home
.strip('/')
;"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
...
...
opensipkd/base/widgets/templates/file_upload.pt
View file @
f078cc1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
css_class css_class|field.widget.css_class;
css_class css_class|field.widget.css_class;
style style|field.widget.style;
style style|field.widget.style;
preview_url cstruct.get('preview_url')|'';
preview_url cstruct.get('preview_url')|'';
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|
[]
;
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|
''
;
fname str(cstruct.get('filename'))|'';
fname str(cstruct.get('filename'))|'';
delete cstruct.get('delete')|'';
delete cstruct.get('delete')|'';
maxsize field.widget.size|5242880;
maxsize field.widget.size|5242880;
...
@@ -10,8 +10,12 @@
...
@@ -10,8 +10,12 @@
video ['avi', 'mov', 'mp4']
video ['avi', 'mov', 'mp4']
">
">
${field.start_mapping()}
${field.start_mapping()}
<div class="thumbnail" tal:condition="not ext or ext ==''">
<img id="preview-${oid}" alt="" src="${preview_url}" style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img>
</div>
<div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'">
<div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'">
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}" style="${style}"
<img tal:condition="ext in img
or ext
" id="preview-${oid}" alt="" src="${preview_url}" style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img>
onload="window.URL.revokeObjectURL(this.src);"></img>
<video tal:condition="ext in video" style="${style}" controls src="${preview_url}" type="video/${ext}"
<video tal:condition="ext in video" style="${style}" controls src="${preview_url}" type="video/${ext}"
id="preview-${oid}">
id="preview-${oid}">
...
...
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