Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
nexedi
ecommerce-ui
Commits
10717339
Commit
10717339
authored
Jul 31, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gadgets/item: added description
parent
ff53562f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
modules/ui/item/item.html
modules/ui/item/item.html
+27
-0
modules/ui/item/item.js
modules/ui/item/item.js
+8
-4
No files found.
modules/ui/item/item.html
View file @
10717339
...
...
@@ -25,6 +25,33 @@
data-iconpos=
"left"
data-inline=
"true"
>
Finish Order
</a>
</div>
<div
data-role=
"fieldcontain"
>
<div
data-role=
"collapsible-set"
>
<div
data-role=
"collapsible"
data-collapsed=
"true"
>
<h1
class=
"translate"
data-i18n-target=
".ui-collapsible-heading-toggle"
data-i18n=
"item.description"
>
Description
</h1>
<p
class=
"description translate"
data-i18n=
""
>
<!-- description_template -->
</p>
</div>
<!--
<div data-role="collapsible" data-collapsed="true">
<h1 class="translate" data-i18n-target=".ui-collapsible-heading-toggle" data-i18n="item.reviews">Reviews</h1>
<div class="reviews"></div>
</div>
-->
<div
data-role=
"collapsible"
data-collapsed=
"true"
>
<h1
class=
"translate"
data-i18n-target=
".ui-collapsible-heading-toggle"
data-i18n=
"item.shipping"
>
Shipping
</h1>
<p
class=
"shipping translate"
data-i18n=
"[html]custom.general.shipping"
></p>
</div>
<div
data-role=
"collapsible"
data-collapsed=
"true"
>
<h1
class=
"translate"
data-i18n-target=
".ui-collapsible-heading-toggle"
data-i18n=
"item.returns"
>
Returns
</h1>
<p
class=
"returns translate"
data-i18n=
"[html]custom.general.returns"
></p>
</div>
<div
data-role=
"collapsible"
data-collapsed=
"true"
>
<h1
class=
"translate"
data-i18n-target=
".ui-collapsible-heading-toggle"
data-i18n=
"item.payment"
>
Payment
</h1>
<p
class=
"payment translate"
data-i18n=
"[html]custom.general.payment"
></p>
</div>
</div>
</div>
</body>
</html>
modules/ui/item/item.js
View file @
10717339
...
...
@@ -9,10 +9,11 @@ define([
// ========================== ATTRIBUTES ==============================
// set response, so it's available across function calls
priv
.
response
;
priv
.
generateContent
=
function
(
response
)
{
var
i
,
j
,
k
,
content
,
child
,
dimension
,
dimensions
,
variation
,
sub_dimension
,
sub_dimension_i18n
;
sub_dimension
,
sub_dimension_i18n
,
str
;
// expose response (will be overwritten, when next item loads
priv
.
response
=
response
;
...
...
@@ -75,8 +76,8 @@ define([
"
<option class='translate' data-i18n='
"
+
sub_dimension_i18n
+
"
' selected='selected' disabled>
"
+
sub_dimension
+
"
</option></select>
"
;
}
return
str
=
content
+
dimensions
+
child
+
"
</div>
"
;
str
=
content
+
dimensions
+
child
+
"
</div>
"
;
return
[
str
,
response
.
description
]
;
};
// TODO: show some thing
...
...
@@ -149,6 +150,8 @@ define([
// callback to generate gallery
spec
.
callback
=
function
(
err
,
response
)
{
var
str
;
if
(
err
)
{
str
=
priv
.
generateError
();
}
else
{
...
...
@@ -156,7 +159,8 @@ define([
}
// TODO: this should not replace the whole gadget content
markup
=
params
.
source
.
replace
(
/<!-- dimensions_template -->/g
,
str
);
markup
=
params
.
source
.
replace
(
/<!-- dimensions_template -->/g
,
str
[
0
]);
markup
=
markup
.
replace
(
/<!-- description_template -->/g
,
str
[
1
]);
// this is not response.callback(!!)
params
.
callback_mockup
(
markup
);
...
...
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