Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
erp5
Commits
be0c98c3
Commit
be0c98c3
authored
Jun 16, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: schema editor: make dynamic panel
parent
dec0dcce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
10 deletions
+67
-10
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.html.html
...em/web_page_module/gadget_erp5_ojs_schema_panel.html.html
+5
-4
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
...teItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
+62
-6
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.html.html
View file @
be0c98c3
...
@@ -41,10 +41,11 @@
...
@@ -41,10 +41,11 @@
</script>
</script>
<script
id=
"panel-template-body-list"
type=
"text/x-handlebars-template"
>
<script
id=
"panel-template-body-list"
type=
"text/x-handlebars-template"
>
<
li
class
=
"
ui-first-child
"
><
a
href
=
"
{{document_list_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-search
"
data
-
i18n
=
"
Schemas
"
accesskey
=
"
s
"
>
Schemas
<
/a></
li
>
<
li
><
a
href
=
"
{{document_list_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-search
"
data
-
i18n
=
"
Schemas
"
accesskey
=
"
s
"
>
Schemas
<
/a></
li
>
<
li
><
a
href
=
"
{{sync_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-refresh
"
data
-
i18n
=
"
Synchronize
"
>
Synchronize
<
/a></
li
>
{{
list
}}
<
li
class
=
"
ui-last-child
"
><
a
href
=
"
{{storage_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-dropbox
"
data
-
i18n
=
"
Storages
"
>
Storages
<
/a></
li
>
<
li
><
a
href
=
"
{{sync_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-refresh
"
data
-
i18n
=
"
Synchronize
"
>
Synchronize
<
/a></
li
>
<
li
class
=
"
ui-last-child
"
><
a
href
=
"
{{multi_upload_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-upload
"
data
-
i18n
=
"
Upload
"
>
Upload
<
/a></
li
>
<
li
><
a
href
=
"
{{storage_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-dropbox
"
data
-
i18n
=
"
Storages
"
>
Storages
<
/a></
li
>
<
li
><
a
href
=
"
{{multi_upload_href}}
"
class
=
"
ui-btn ui-btn-icon-left ui-icon-upload
"
data
-
i18n
=
"
Upload
"
>
Upload
<
/a></
li
>
</script>
</script>
<script
id=
"panel-template-body-desktop"
type=
"text/x-handlebars-template"
>
<script
id=
"panel-template-body-desktop"
type=
"text/x-handlebars-template"
>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
View file @
be0c98c3
...
@@ -22,6 +22,20 @@
...
@@ -22,6 +22,20 @@
.
getElementById
(
"
panel-template-body-desktop
"
)
.
getElementById
(
"
panel-template-body-desktop
"
)
.
innerHTML
);
.
innerHTML
);
function
createElement
(
type
,
props
,
innerText
)
{
var
element
=
document
.
createElement
(
type
),
key
;
for
(
key
in
props
)
{
if
(
props
.
hasOwnProperty
(
key
))
{
element
.
setAttribute
(
key
,
props
[
key
]);
}
}
if
(
innerText
)
{
element
.
innerText
=
innerText
;
}
return
element
;
}
gadget_klass
gadget_klass
.
setState
({
.
setState
({
visible
:
false
,
visible
:
false
,
...
@@ -35,6 +49,7 @@
...
@@ -35,6 +49,7 @@
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
...
@@ -132,17 +147,58 @@
...
@@ -132,17 +147,58 @@
queue
queue
// Update the global links
// Update the global links
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
context
.
jio_allDocs
({
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
}}),
"
query
"
:
'
portal_type:"Json Schema"
'
,
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_configurator
"
}}),
"
limit
"
:
[
0
,
31
],
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_sync
"
,
'
auto_repair
'
:
true
}}),
"
select_list
"
:
[
"
title
"
,
"
reference
"
],
context
.
getUrlFor
({
command
:
'
index
'
,
options
:
{
page
:
"
ojs_multi_upload
"
}})
"
sort_on
"
:
[[
"
title
"
,
"
descending
"
]]
]);
});
})
.
push
(
function
(
result
)
{
return
result
.
data
.
rows
;
})
.
push
(
undefined
,
function
()
{
return
[];
})
.
push
(
function
(
result
)
{
function
gen_element
(
row
,
css
)
{
return
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
,
portal_type
:
"
JSON Document
"
,
schema
:
row
.
id
,
schema_title
:
row
.
value
.
title
}})
.
push
(
function
(
url
)
{
var
element
=
createElement
(
"
li
"
);
element
.
appendChild
(
createElement
(
"
a
"
,
{
href
:
url
,
class
:
"
ui-btn ui-btn-icon-left
"
+
css
},
row
.
value
.
title
));
return
element
.
outerHTML
;
});
}
var
i
,
tasks
=
[
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
}}),
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_configurator
"
}}),
context
.
getUrlFor
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_sync
"
,
'
auto_repair
'
:
true
}}),
context
.
getUrlFor
({
command
:
'
index
'
,
options
:
{
page
:
"
ojs_multi_upload
"
}})
];
for
(
i
=
0
;
i
<
result
.
length
;
i
+=
1
)
{
tasks
.
push
(
gen_element
(
result
[
i
],
"
ui-icon-search
"
));
}
return
RSVP
.
all
(
tasks
);
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
var
i
,
html
=
""
;
for
(
i
=
4
;
i
<
result_list
.
length
;
i
+=
1
)
{
html
+=
result_list
[
i
];
}
return
context
.
translateHtml
(
return
context
.
translateHtml
(
panel_template_body_list
({
panel_template_body_list
({
"
document_list_href
"
:
result_list
[
0
],
"
document_list_href
"
:
result_list
[
0
],
"
list
"
:
new
Handlebars
.
SafeString
(
html
),
"
storage_href
"
:
result_list
[
1
],
"
storage_href
"
:
result_list
[
1
],
"
sync_href
"
:
result_list
[
2
],
"
sync_href
"
:
result_list
[
2
],
"
multi_upload_href
"
:
result_list
[
3
]
"
multi_upload_href
"
:
result_list
[
3
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment