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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
8239d658
Commit
8239d658
authored
Apr 07, 2015
by
Sven Franck
Committed by
Romain Courteaud
Apr 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: fixed display of languages when no languages are set, combined templates
parent
1fa43554
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
75 deletions
+56
-75
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
...mplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
+28
-39
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+28
-36
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
View file @
8239d658
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<script
src=
"jquery.js"
type=
"text/javascript"
></script>
\n
<script
src=
"jquery.js"
type=
"text/javascript"
></script>
\n
<script
src=
"jquerymobile.js"
type=
"text/javascript"
></script>
\n
<script
src=
"jquerymobile.js"
type=
"text/javascript"
></script>
\n
\n
\n
<script
id=
"panel-template"
type=
"text/x-handlebars-template"
>
\n
<script
id=
"panel-template
-header
"
type=
"text/x-handlebars-template"
>
\n
<div
data-role=
"header"
class=
"ui-bar-inherit"
>
\n
<div
data-role=
"header"
class=
"ui-bar-inherit"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
...
@@ -137,47 +137,36 @@
...
@@ -137,47 +137,36 @@
</div>
\n
</div>
\n
</div>
\n
</div>
\n
</script>
\n
</script>
\n
<script
id=
"panel-template-nolang"
type=
"text/x-handlebars-template"
>
\n
\n
<div
class=
"ui-content"
>
\n
<script
id=
"panel-template-body"
type=
"text/x-handlebars-template"
>
\n
<ul
data-role=
"listview"
>
\n
<li><a
href=
"{{module_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-puzzle-piece"
data-i18n=
"Modules"
>
Modules
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-clipboard"
data-i18n=
"Worklists"
>
Worklists
</a></li>
\n
<li><a
href=
"{{history_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-history"
data-i18n=
"History"
>
History
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-gear"
data-i18n=
"Preference"
>
Preferences
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-comment-o"
data-i18n=
"Language"
>
Language
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-power-off"
data-i18n=
"Logout"
>
Logout
</a></li>
\n
</ul>
\n
</div>
\n
</script>
\n
\n
<!-- listview needs to be pre-enhanced for language collapsibe to work -->
\n
<script
id=
"panel-template-lang"
type=
"text/x-handlebars-template"
>
\n
<div
class=
"ui-content"
>
\n
<div
class=
"ui-content"
>
\n
<ul
data-role=
"listview"
class=
"ui-listview"
data-enhanced=
"true"
>
\n
<ul
data-role=
"listview"
class=
"ui-listview"
data-enhanced=
"true"
>
\n
<li
class=
"ui-first-child"
><a
href=
"{{module_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-puzzle-piece"
data-i18n=
"Modules"
>
Modules
</a></li>
\n
<li
class=
"ui-first-child"
><a
href=
"{{module_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-puzzle-piece"
data-i18n=
"Modules"
>
Modules
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-clipboard"
data-i18n=
"Worklists"
>
Worklists
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-clipboard"
data-i18n=
"Worklists"
>
Worklists
</a></li>
\n
<li><a
href=
"{{history_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-history"
data-i18n=
"History"
>
History
</a></li>
\n
<li><a
href=
"{{history_href}}"
class=
"ui-btn ui-btn-icon-left ui-icon-history"
data-i18n=
"History"
>
History
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-gear"
data-i18n=
"Preference"
>
Preferences
</a></li>
\n
<li><a
class=
"ui-btn ui-btn-icon-left ui-icon-gear"
data-i18n=
"Preference"
>
Preferences
</a></li>
\n
<li
data-role=
"collapsible"
data-enhanced=
"true"
data-collapsed=
"true"
data-collapsed-icon=
"comment-o"
class=
"ui-collapsible ui-collapsible-collapsed"
>
\n
{{#if language_list}}\n
<h4
class=
"ui-collapsible-heading ui-collapsible-heading-collapsed ui-li-divider ui-li-has-icon"
>
\n
<li
data-role=
"collapsible"
data-enhanced=
"true"
data-collapsed=
"true"
data-collapsed-icon=
"comment-o"
class=
"ui-collapsible ui-collapsible-collapsed"
>
\n
<a
class=
"ui-collapsible-heading-toggle ui-icon-comment-o ui-btn-icon-left ui-btn-inherit"
href=
"#"
data-i18n=
"[last]Languages"
>
\n
<h4
class=
"ui-collapsible-heading ui-collapsible-heading-collapsed ui-li-divider ui-li-has-icon"
>
\n
<span
data-i18n=
"Click to expand content"
class=
"ui-collapsible-heading-status"
></span>
Languages\n
<a
class=
"ui-collapsible-heading-toggle ui-icon-comment-o ui-btn-icon-left ui-btn-inherit"
href=
"#"
data-i18n=
"[last]Languages"
>
\n
</a>
\n
<span
data-i18n=
"Click to expand content"
class=
"ui-collapsible-heading-status"
></span>
Languages\n
</h4>
\n
</a>
\n
<div
class=
"ui-collapsible-content ui-collapsible-content-collapsed"
aria-hidden=
"true"
>
\n
</h4>
\n
<fieldset
data-role=
"controlgroup"
>
\n
<div
class=
"ui-collapsible-content ui-collapsible-content-collapsed"
aria-hidden=
"true"
>
\n
{{#each document_list}}\n
<fieldset
data-role=
"controlgroup"
>
\n
<form
method=
"POST"
action=
""
>
\n
{{#each document_list}}\n
<div
class=
"ui-btn ui-input-btn ui-corner-all ui-shadow ui-btn-icon-right ui-icon-carat-r"
data-i18n=
"[node]{{lang}}"
>
\n
<form
method=
"POST"
action=
""
>
\n
\n
<div
class=
"ui-btn ui-input-btn ui-corner-all ui-shadow ui-btn-icon-right ui-icon-carat-r"
data-i18n=
"[node]{{lang}}"
>
\n
<input
type=
"submit"
data-enhanced=
"true"
name=
"lang"
id=
"lang-{{count}}"
value=
"{{lang}}"
/>
\n
\n
</div>
\n
<input
type=
"submit"
data-enhanced=
"true"
name=
"lang"
id=
"lang-{{count}}"
value=
"{{lang}}"
/>
\n
<label
class=
"ui-hidden-accessible"
for=
"lang-{{count}}"
data-i18n=
"{{lang}}"
></label>
\n
</div>
\n
</form>
\n
<label
class=
"ui-hidden-accessible"
for=
"lang-{{count}}"
data-i18n=
"{{lang}}"
></label>
\n
{{/each}}\n
</form>
\n
</fieldset>
\n
{{/each}}\n
</div>
\n
</fieldset>
\n
</li>
\n
</div>
\n
</li>
\n
{{/if}}\n
<li
class=
"ui-last-child"
><a
class=
"ui-btn ui-btn-icon-left ui-icon-power-off"
data-i18n=
"Logout"
>
Logout
</a></li>
\n
<li
class=
"ui-last-child"
><a
class=
"ui-btn ui-btn-icon-left ui-icon-power-off"
data-i18n=
"Logout"
>
Logout
</a></li>
\n
</ul>
\n
</ul>
\n
</div>
\n
</div>
\n
...
@@ -315,7 +304,7 @@
...
@@ -315,7 +304,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
s
uper_s
ven
</string>
</value>
<value>
<string>
sven
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -329,7 +318,7 @@
...
@@ -329,7 +318,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.64258.51349.15786
</string>
</value>
<value>
<string>
9
42.11707.40779.32529
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -347,7 +336,7 @@
...
@@ -347,7 +336,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
142
0197041.32
</float>
<float>
142
8416647.44
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
8239d658
...
@@ -107,22 +107,18 @@
...
@@ -107,22 +107,18 @@
"use strict";\n
"use strict";\n
\n
\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
//
Handlebar
s\n
//
temlate
s\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// Precompile templates while loading the first gadget instance\n
// Precompile templates while loading the first gadget instance\n
var gadget_klass = rJS(window),\n
var gadget_klass = rJS(window),\n
source = gadget_klass.__template_element\n
source
_header
= gadget_klass.__template_element\n
.getElementById("panel-template")\n
.getElementById("panel-template
-header
")\n
.innerHTML,\n
.innerHTML,\n
panel_template
= Handlebars.compile(source
),\n
panel_template
_header = Handlebars.compile(source_header
),\n
source_
content
= gadget_klass.__template_element\n
source_
body
= gadget_klass.__template_element\n
.getElementById("panel-template-
lang
")\n
.getElementById("panel-template-
body
")\n
.innerHTML,\n
.innerHTML,\n
panel_template_lang = Handlebars.compile(source_content),\n
panel_template_body = Handlebars.compile(source_body);\n
source_content_no_lang = gadget_klass.__template_element\n
.getElementById("panel-template-nolang")\n
.innerHTML,\n
panel_template_nolang = Handlebars.compile(source_content_no_lang);\n
\n
\n
gadget_klass\n
gadget_klass\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
...
@@ -139,7 +135,10 @@
...
@@ -139,7 +135,10 @@
.declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("changeLanguage", "changeLanguage")\n
.declareAcquiredMethod("changeLanguage", "changeLanguage")\n
.declareAcquiredMethod("getLanguageList", "getLanguageList")\n
.declareAcquiredMethod("getLanguageList", "getLanguageList")\n
.declareAcquiredMethod("whoWantToDisplayThisFrontPage", "whoWantToDisplayThisFrontPage")\n
.declareAcquiredMethod(\n
"whoWantToDisplayThisFrontPage",\n
"whoWantToDisplayThisFrontPage"\n
)\n
\n
\n
// Assign the element to a variable\n
// Assign the element to a variable\n
.ready(function (g) {\n
.ready(function (g) {\n
...
@@ -169,35 +168,28 @@
...
@@ -169,35 +168,28 @@
]);\n
]);\n
})\n
})\n
.push(function (all_result) {\n
.push(function (all_result) {\n
var i,\n
var raw_language_list = JSON.parse(all_result[2]),\n
len = raw_language_list.length,\n
i,\n
i_len,\n
i_len,\n
tmp,\n
language_list,\n
language_list,\n
document_list = [],\n
tmp;\n
raw_language_list = all_result[2];\n
\n
\n
// XXX: Customize panel header!\n
// XXX: Customize panel header!\n
tmp = panel_template();\n
tmp = panel_template
_header
();\n
\n
\n
// translation list available\n
// languages\n
if (raw_language_list) {\n
if (len >
0) {\n
language_list = JSON.parse(raw_language_list);\n
language_list = [];\n
i_len = language_list.length;\n
for (i = 0, i_len = len; i
< i_len
;
i
+=
1)
{\n
for (i = 0; i < i_len; i += 1) {\n
language_list.push({"count":
i,
"lang":
language_list[i]});\n
document_list.push({"count": i, "lang": language_list[i]});\n
}\n
}\n
tmp += panel_template_lang({\n
module_href: all_result[0],\n
history_href: all_result[1],\n
document_list: document_list\n
});\n
return g.translateHtml(tmp);\n
}\n
}\n
\n
\n
// no translations available or not loaded when reaching this point
\n
tmp
+=
panel_template_body({
\n
tmp += panel_template_nolang({
\n
"module_href":
all_result[0],
\n
module_href: all_result[0
],\n
"history_href":
all_result[1
],\n
history_href: all_result[1]
\n
"language_list":
language_list
\n
});\n
});\n
return
tmp;\n
return
tmp;\n
})\n
})\n
...
@@ -407,7 +399,7 @@
...
@@ -407,7 +399,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
sven
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -421,7 +413,7 @@
...
@@ -421,7 +413,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
0.16198.52720.49783
</string>
</value>
<value>
<string>
94
2.11711.24841.37034
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -439,7 +431,7 @@
...
@@ -439,7 +431,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
142
1080772.85
</float>
<float>
142
8416611.09
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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