Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fc9347c4
authored
Sep 13, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'latest' of
https://git.opensipkd.com/aa.gusti/opensipkd-base
into latest
2 parents
cd120d9b
2bf58102
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
opensipkd/base/views/widget_os.py
opensipkd/base/views/widgets/autocomplete_input.pt
opensipkd/base/views/widgets/readonly/money_input.pt
opensipkd/base/views/widget_os.py
View file @
fc9347c
...
@@ -172,10 +172,12 @@ class BlokKavNoWidget(Widget):
...
@@ -172,10 +172,12 @@ class BlokKavNoWidget(Widget):
result
=
"|"
.
join
([
blok_kav_no
,
rt
,
rw
])
result
=
"|"
.
join
([
blok_kav_no
,
rt
,
rw
])
if
not
rt
:
if
not
rt
:
raise
Invalid
(
field
.
schema
,
"RT harus diisi. Minimal 000"
,
result
)
raise
Invalid
(
field
.
schema
,
"RT harus diisi. Minimal 000"
,
result
)
if
not
rw
:
if
not
rw
:
raise
Invalid
(
field
.
schema
,
"RW harus diisi. Minimal 00"
,
result
)
raise
Invalid
(
field
.
schema
,
"RW harus diisi. Minimal 00"
,
result
)
# if not blok_kav_no or not rt or not rw:
# if not blok_kav_no or not rt or not rw:
# raise Invalid(field.schema, "Blok Kav No RT/RW tidak lengkap",
# raise Invalid(field.schema, "Blok Kav No RT/RW tidak lengkap",
...
@@ -390,7 +392,7 @@ class MapWidget(Widget):
...
@@ -390,7 +392,7 @@ class MapWidget(Widget):
{
{
"js"
:
"opensipkd.base:static/js/gmap.js"
,
"js"
:
"opensipkd.base:static/js/gmap.js"
,
"css"
:
"deform:static/select2/select2.css"
,
"css"
:
"deform:static/select2/select2.css"
,
},)
},)
def
__init__
(
self
,
**
kw
):
def
__init__
(
self
,
**
kw
):
super
()
.
__init__
(
**
kw
)
super
()
.
__init__
(
**
kw
)
...
@@ -718,6 +720,10 @@ class DateInputWidget(WidgetDateInputWidget):
...
@@ -718,6 +720,10 @@ class DateInputWidget(WidgetDateInputWidget):
type_name
=
"text"
type_name
=
"text"
class
MoneyInputWidget
(
widget
.
MoneyInputWidget
):
readonly_template
=
"readonly/money_input"
# class AutocompleteInputWidget(widget.AutocompleteInputWidget):
# class AutocompleteInputWidget(widget.AutocompleteInputWidget):
# targets = None
# targets = None
# def serialize(self, field, cstruct, **kw):
# def serialize(self, field, cstruct, **kw):
...
...
opensipkd/base/views/widgets/autocomplete_input.pt
View file @
fc9347c
...
@@ -2,23 +2,17 @@
...
@@ -2,23 +2,17 @@
css_class css_class|field.widget.css_class;
css_class css_class|field.widget.css_class;
oid oid|field.oid;
oid oid|field.oid;
style style|field.widget.style;
style style|field.widget.style;
js js|field.widget.js"
js js|field.widget.js|{}" tal:omit-tag="">
tal:omit-tag="">
<input type="text" name="${name}" value="${cstruct}" data-provide="typeahead" tal:attributes="class string: form-control ${css_class or ''};
<input type="text"
name="${name}"
value="${cstruct}"
data-provide="typeahead"
tal:attributes="class string: form-control ${css_class or ''};
style style;
style style;
attributes|field.widget.attributes|{};"
attributes|field.widget.attributes|{};" id="${oid}" />
id="${oid}"/>
<script tal:condition="field.widget.values" type="text/javascript">
<script tal:condition="field.widget.values" type="text/javascript">
deform.addCallback(
deform.addCallback(
'${field.oid}',
'${field.oid}',
function (oid) {
function (oid) {
$('#' + oid).typeahead(${ options });
$('#' + oid).typeahead(${options});
${ structure: js }
${structure:js}
}
}
);
);
</script>
</script>
</span>
</span>
opensipkd/base/views/widgets/readonly/money_input.pt
0 → 100644
View file @
fc9347c
<p class="form-control-static" id="${oid|field.oid}">
</p>
<script type="text/javascript">
deform.addCallback(
'${oid|field.oid}',
function (oid) {
let val = parseInt('${cstruct}');
$("#" + oid).html(val.toLocaleString());
});
</script>
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