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 575f7515
authored
Jul 20, 2023
by
Ari Agung Prasetiyo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
menambahkan default_resource_registry untuk jquery.maskMoney
1 parent
3a16d7a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
opensipkd/base/__init__.py
opensipkd/base/views/widget_os.py
opensipkd/base/__init__.py
View file @
575f751
...
@@ -40,7 +40,7 @@ from opensipkd.tools import (
...
@@ -40,7 +40,7 @@ from opensipkd.tools import (
from
deform
import
ZPTRendererFactory
,
Form
from
deform
import
ZPTRendererFactory
,
Form
from
pkg_resources
import
resource_filename
from
pkg_resources
import
resource_filename
from
deform.widget
import
default_resource_registry
import
os
import
os
from
opensipkd.models.handlers
import
LogDBSession
from
opensipkd.models.handlers
import
LogDBSession
...
@@ -423,6 +423,8 @@ partner_idcard_url = 'partner/idcard'
...
@@ -423,6 +423,8 @@ partner_idcard_url = 'partner/idcard'
def
main
(
global_config
,
**
settings
):
def
main
(
global_config
,
**
settings
):
""" This function returns a Pyramid WSGI application.
""" This function returns a Pyramid WSGI application.
"""
"""
default_resource_registry
.
registry
[
'jquery.maskMoney'
]
=
{
None
:
{
"js"
:
"opensipkd.base:static/jquery/jquery.maskMoney.min.js"
}}
engine
=
engine_from_config
(
engine
=
engine_from_config
(
settings
,
'sqlalchemy.'
,
client_encoding
=
'utf8'
,
convert_unicode
=
True
)
settings
,
'sqlalchemy.'
,
client_encoding
=
'utf8'
,
convert_unicode
=
True
)
...
...
opensipkd/base/views/widget_os.py
View file @
575f751
...
@@ -7,7 +7,8 @@ from deform.widget import Widget, _StrippedString, Select2Widget, default_resour
...
@@ -7,7 +7,8 @@ from deform.widget import Widget, _StrippedString, Select2Widget, default_resour
from
deform.form
import
Button
from
deform.form
import
Button
from
iso8601.iso8601
import
ISO8601_REGEX
from
iso8601.iso8601
import
ISO8601_REGEX
from
deform.i18n
import
_
from
deform.i18n
import
_
from
colander
import
compat
from
colander
import
compat
from
deform
import
widget
_logging
=
logging
.
getLogger
(
__name__
)
_logging
=
logging
.
getLogger
(
__name__
)
...
@@ -381,7 +382,7 @@ class MapWidget(Widget):
...
@@ -381,7 +382,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
)
...
@@ -691,16 +692,14 @@ class BootStrapDateTimeInputWidget(Widget):
...
@@ -691,16 +692,14 @@ class BootStrapDateTimeInputWidget(Widget):
raise
Invalid
(
field
.
schema
,
_
(
"Incomplete time"
),
result
)
raise
Invalid
(
field
.
schema
,
_
(
"Incomplete time"
),
result
)
return
result
return
result
from
deform
import
widget
class
MoneyInputWidget
(
widget
.
MoneyInputWidget
):
requirements
=
({
"js"
:
"opensipkd.base:static/jquery/jquery.maskMoney.min.js"
},)
class
TextInputWidget
(
widget
.
TextInputWidget
):
class
TextInputWidget
(
widget
.
TextInputWidget
):
template
=
"textinput_btn"
template
=
"textinput_btn"
button
=
None
button
=
None
def
__init__
(
self
,
**
kw
):
def
__init__
(
self
,
**
kw
):
super
(
TextInputWidget
,
self
)
.
__init__
(
**
kw
)
super
(
TextInputWidget
,
self
)
.
__init__
(
**
kw
)
if
isinstance
(
self
.
button
,
compat
.
string_types
):
if
isinstance
(
self
.
button
,
compat
.
string_types
):
self
.
button
=
Button
(
self
.
button
,
type
=
"button"
)
\ No newline at end of file
\ No newline at end of file
self
.
button
=
Button
(
self
.
button
,
type
=
"button"
)
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