Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
coba
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5ec7b72b
authored
Feb 25, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan menu
1 parent
e67a0978
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
opensipkd/coba/__init__.py
opensipkd/coba/views/__init__.py
opensipkd/coba/views/templates/base.pt
opensipkd/coba/__init__.py
View file @
5ec7b72
...
@@ -12,10 +12,18 @@ ROUTES = [
...
@@ -12,10 +12,18 @@ ROUTES = [
"def_func"
:
"home"
,
"def_func"
:
"home"
,
"template"
:
"home.pt"
,
"template"
:
"home.pt"
,
},
},
{
"kode"
:
"coba-menus"
,
{
"kode"
:
"coba-menus"
,
"nama"
:
"Menus"
,
"nama"
:
"Menus"
,
"is_menu"
:
1
,
"is_menu"
:
1
,
"children"
:[
"children"
:[
{
"kode"
:
"coba-form-add"
,
"nama"
:
"Tambah"
,
"path"
:
"/coba/form/add"
,
"class_view"
:
"view_form"
,
"def_func"
:
"add"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-form"
,
{
"kode"
:
"coba-form"
,
"nama"
:
"Formulir"
,
"nama"
:
"Formulir"
,
"is_menu"
:
1
,
"is_menu"
:
1
,
...
@@ -24,13 +32,7 @@ ROUTES = [
...
@@ -24,13 +32,7 @@ ROUTES = [
"def_func"
:
"list"
,
"def_func"
:
"list"
,
"template"
:
"form.pt"
,
"template"
:
"form.pt"
,
"children"
:
[
"children"
:
[
{
"kode"
:
"coba-form-add"
,
"nama"
:
"Tambah"
,
"path"
:
"/coba/form/add"
,
"class_view"
:
"view_form"
,
"def_func"
:
"add"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-form-edit"
,
{
"kode"
:
"coba-form-edit"
,
"nama"
:
"Edit"
,
"nama"
:
"Edit"
,
"path"
:
"/coba/form/{id}/edit"
,
"path"
:
"/coba/form/{id}/edit"
,
...
@@ -113,7 +115,18 @@ ROUTES = [
...
@@ -113,7 +115,18 @@ ROUTES = [
"template"
:
"json"
,
"template"
:
"json"
,
},
},
]
]
}
},
{
"kode"
:
"coba2"
,
"nama"
:
"Home2"
,
"path"
:
"/coba"
,
"is_menu"
:
1
,
"class_view"
:
"__init__"
,
"def_func"
:
"home"
,
"template"
:
"home.pt"
,
},
]
]
...
@@ -126,7 +139,6 @@ class CobaModules(BaseApp):
...
@@ -126,7 +139,6 @@ class CobaModules(BaseApp):
self
.
uploads
=
get_params
(
'coba_upload'
,
'/tmp/coba/upload/'
)
self
.
uploads
=
get_params
(
'coba_upload'
,
'/tmp/coba/upload/'
)
config
.
add_static_view
(
config
.
add_static_view
(
'/coba/uploads'
,
self
.
uploads
,
cache_max_age
=
0
)
'/coba/uploads'
,
self
.
uploads
,
cache_max_age
=
0
)
def
get_menus
(
self
):
def
get_menus
(
self
):
return
self
.
menus
return
self
.
menus
...
@@ -140,7 +152,7 @@ def includeme(config):
...
@@ -140,7 +152,7 @@ def includeme(config):
# config.add_route(route[0], route[1])
# config.add_route(route[0], route[1])
# titles[route[0]] = route[2]
# titles[route[0]] = route[2]
MODULE_CLASS
.
set_static
(
config
)
MODULE_CLASS
.
set_static
(
config
)
MODULE_CLASS
.
add_menu
(
config
,
ROUTES
)
MODULE_CLASS
.
add_menu
(
config
,
ROUTES
,
paket
=
"opensipkd.coba.views"
)
config
.
scan
(
'.'
)
config
.
scan
(
'.'
)
...
...
opensipkd/coba/views/__init__.py
View file @
5ec7b72
...
@@ -23,8 +23,8 @@ class Views(BaseView):
...
@@ -23,8 +23,8 @@ class Views(BaseView):
def
__init__
(
self
,
request
):
def
__init__
(
self
,
request
):
super
()
.
__init__
(
request
)
super
()
.
__init__
(
request
)
# @view_config(route_name='coba
-home
', renderer='templates/home.pt',
# @view_config(route_name='coba
2
', renderer='templates/home.pt',
#
permission='view')
#
permission='view')
def
view_home
(
self
):
def
view_home
(
self
):
tpl
=
self
.
get_params
(
"coba-home-tpl"
)
tpl
=
self
.
get_params
(
"coba-home-tpl"
)
if
tpl
:
if
tpl
:
...
...
opensipkd/coba/views/templates/base.pt
View file @
5ec7b72
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
</a>
</a>
<a
tal:condition=
"python:menu['children']!=[] and (not menu['permission'] or has_permission(request, menu['permission']))"
<a
tal:condition=
"python:menu['children']!=[] and (not menu['permission'] or has_permission(request, menu['permission']))"
href=
"#"
>
href=
"#"
>
<p
style=
"color: aliceblue;"
>
</p>
<i
tal:condition=
"menu['icon']"
class=
"fa fa-lg fa-fw ${menu['icon']}"
></i>
<i
tal:condition=
"menu['icon']"
class=
"fa fa-lg fa-fw ${menu['icon']}"
></i>
<span
class=
"menu-item-parent"
>
${menu['nama']}
</span>
<span
class=
"menu-item-parent"
>
${menu['nama']}
</span>
</a>
</a>
...
...
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