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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
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
Show 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 @@
<script
src=
"jquery.js"
type=
"text/javascript"
></script>
\n
<script
src=
"jquerymobile.js"
type=
"text/javascript"
></script>
\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
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
...
...
@@ -137,27 +137,15 @@
</div>
\n
</div>
\n
</script>
\n
<script
id=
"panel-template-nolang"
type=
"text/x-handlebars-template"
>
\n
<div
class=
"ui-content"
>
\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
\n
<script
id=
"panel-template-body"
type=
"text/x-handlebars-template"
>
\n
<div
class=
"ui-content"
>
\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><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
{{#if language_list}}\n
<li
data-role=
"collapsible"
data-enhanced=
"true"
data-collapsed=
"true"
data-collapsed-icon=
"comment-o"
class=
"ui-collapsible ui-collapsible-collapsed"
>
\n
<h4
class=
"ui-collapsible-heading ui-collapsible-heading-collapsed ui-li-divider ui-li-has-icon"
>
\n
<a
class=
"ui-collapsible-heading-toggle ui-icon-comment-o ui-btn-icon-left ui-btn-inherit"
href=
"#"
data-i18n=
"[last]Languages"
>
\n
...
...
@@ -178,6 +166,7 @@
</fieldset>
\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
</ul>
\n
</div>
\n
...
...
@@ -315,7 +304,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
s
uper_s
ven
</string>
</value>
<value>
<string>
sven
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -329,7 +318,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -347,7 +336,7 @@
</tuple>
<state>
<tuple>
<float>
142
0197041.32
</float>
<float>
142
8416647.44
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
8239d658
...
...
@@ -107,22 +107,18 @@
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
//
Handlebar
s\n
//
temlate
s\n
/////////////////////////////////////////////////////////////////\n
// Precompile templates while loading the first gadget instance\n
var gadget_klass = rJS(window),\n
source = gadget_klass.__template_element\n
.getElementById("panel-template")\n
source
_header
= gadget_klass.__template_element\n
.getElementById("panel-template
-header
")\n
.innerHTML,\n
panel_template
= Handlebars.compile(source
),\n
source_
content
= gadget_klass.__template_element\n
.getElementById("panel-template-
lang
")\n
panel_template
_header = Handlebars.compile(source_header
),\n
source_
body
= gadget_klass.__template_element\n
.getElementById("panel-template-
body
")\n
.innerHTML,\n
panel_template_lang = Handlebars.compile(source_content),\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
panel_template_body = Handlebars.compile(source_body);\n
\n
gadget_klass\n
/////////////////////////////////////////////////////////////////\n
...
...
@@ -139,7 +135,10 @@
.declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("changeLanguage", "changeLanguage")\n
.declareAcquiredMethod("getLanguageList", "getLanguageList")\n
.declareAcquiredMethod("whoWantToDisplayThisFrontPage", "whoWantToDisplayThisFrontPage")\n
.declareAcquiredMethod(\n
"whoWantToDisplayThisFrontPage",\n
"whoWantToDisplayThisFrontPage"\n
)\n
\n
// Assign the element to a variable\n
.ready(function (g) {\n
...
...
@@ -169,35 +168,28 @@
]);\n
})\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
tmp,\n
language_list,\n
document_list = [],\n
raw_language_list = all_result[2];\n
tmp;\n
\n
// XXX: Customize panel header!\n
tmp = panel_template();\n
tmp = panel_template
_header
();\n
\n
// translation list available\n
if (raw_language_list) {\n
language_list = JSON.parse(raw_language_list);\n
i_len = language_list.length;\n
for (i = 0; i < i_len; i += 1) {\n
document_list.push({"count": i, "lang": language_list[i]});\n
// languages\n
if (len >
0) {\n
language_list = [];\n
for (i = 0, i_len = len; i
< i_len
;
i
+=
1)
{\n
language_list.push({"count":
i,
"lang":
language_list[i]});\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
// no translations available or not loaded when reaching this point
\n
tmp += panel_template_nolang({
\n
module_href: all_result[0
],\n
history_href: all_result[1]
\n
tmp
+=
panel_template_body({
\n
"module_href":
all_result[0],
\n
"history_href":
all_result[1
],\n
"language_list":
language_list
\n
});\n
return
tmp;\n
})\n
...
...
@@ -407,7 +399,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
sven
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -421,7 +413,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -439,7 +431,7 @@
</tuple>
<state>
<tuple>
<float>
142
1080772.85
</float>
<float>
142
8416611.09
</float>
<string>
GMT
</string>
</tuple>
</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