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
Boris Kocherov
erp5
Commits
549864c6
Commit
549864c6
authored
Sep 19, 2014
by
Romain Courteaud
Committed by
Sebastien Robin
Sep 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group modules by business_application
parent
42787197
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
16 deletions
+53
-16
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
...tem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
+6
-5
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
+47
-11
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
View file @
549864c6
...
...
@@ -123,11 +123,12 @@
<script
src=
"gadget_erp5_pt_frontpage.js"
type=
"text/javascript"
></script>
\n
\n
<script
id=
"table-template"
type=
"text/x-handlebars-template"
>
\n
<ul
data-role=
"listview"
data-inset=
"true"
class=
"document-listview"
>
\n
<dl
data-role=
"listview"
data-inset=
"true"
class=
"document-listview"
>
\n
<dt>
{{definition_title}}
</dt>
\n
{{#each documentlist}}\n
<
li><a
href=
"{{link}}"
>
{{title}}
</a></li
>
\n
<
dd><a
href=
"{{link}}"
>
{{title}}
</a></dd
>
\n
{{/each}}\n
</
u
l>
\n
</
d
l>
\n
</script>
\n
\n
</head>
\n
...
...
@@ -271,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
93
6.25886.55930.55876
</string>
</value>
<value>
<string>
93
7.42724.27724.55893
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -289,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
14
06120865.84
</float>
<float>
14
11117135.09
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
View file @
549864c6
...
...
@@ -148,7 +148,7 @@
\n
return gadget.jio_allDocs({\n
"query": \'meta_type:"ERP5 Folder" AND id:"%_module"\',\n
"select_list": ["title"]\n
"select_list": ["title"
, "business_application_title"
]\n
})\n
.push(function (result) {\n
var result_list = [],\n
...
...
@@ -156,24 +156,53 @@
for (i = 0; i < result.data.rows.length; i += 1) {\n
result_list.push(RSVP.all([\n
gadget.whoWantToDisplayThis(result.data.rows[i].id),\n
result.data.rows[i].value.title || result.data.rows[i].id\n
result.data.rows[i].value.title || result.data.rows[i].id,\n
result.data.rows[i].value.business_application_title\n
]));\n
}\n
return RSVP.all(result_list);\n
})\n
.push(function (document_list) {\n
var i,\n
parameter_list = [],\n
business_application_dict = {},\n
business_application_list = [],\n
business_application,\n
module_info,\n
result_html = "",\n
doc;\n
for (i = 0; i < document_list.length; i += 1) {\n
doc = document_list[i];\n
parameter_list[i] = {\n
if (doc[2] === undefined) {\n
doc[2] = "Other";\n
}\n
module_info = {\n
link: doc[0],\n
title: doc[1]\n
};\n
if (business_application_dict[doc[2]] === undefined) {\n
business_application_dict[doc[2]] = [module_info];\n
business_application_list.push(doc[2]);\n
} else {\n
business_application_dict[doc[2]].push(module_info);\n
}\n
}\n
\n
parameter_list.sort(function (a, b) {\n
business_application_list.sort(function (a, b) {\n
// Push the "Other" value at the end\n
var result = 0;\n
if (a === "Other") {\n
result = 1;\n
} else if (b === "Other") {\n
result = -1;\n
} else if (a < b) {\n
result = -1;\n
} else if (a >
b) {\n
result = 1;\n
}\n
return result;\n
});\n
\n
function sort_module(a, b) {\n
var result = 0;\n
if (a.title
< b.title
)
{\n
result =
-1;\n
...
...
@@ -181,12 +210,19 @@
result = 1;\n
}\n
return result;\n
}
);
\n
}\n
\n
gadget.props.element.querySelector(\'.document_list\').innerHTML =\n
table_template({\n
documentlist: parameter_list\n
for (i = 0; i
< business_application_list.length
;
i
+=
1)
{\n
business_application =
business_application_list[i];\n
business_application_dict[business_application].sort(sort_module);\n
result_html
+=
table_template({\n
definition_title:
business_application,\n
documentlist:
business_application_dict[business_application]\n
});\n
}\n
\n
\n
gadget.props.element.querySelector(\'.document_list\')
.innerHTML =
result_html;\n
});\n
});\n
}(window,
rJS,
RSVP,
Handlebars));
...
...
@@ -326,7 +362,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
937.4
2839.47775.3601
0
</string>
</value>
<value>
<string>
937.4
3884.286.4096
0
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -344,7 +380,7 @@
</tuple>
<state>
<tuple>
<float>
1411
055530.72
</float>
<float>
1411
118240.63
</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