Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VietTH-VenShop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tran Hoang Viet
VietTH-VenShop
Commits
9718b420
Commit
9718b420
authored
Jul 13, 2015
by
Tran Hoang Viet
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hotfix-1.0.1'
Conflicts: app/controllers/categories_controller.rb
parents
0b28f610
5a34ad79
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
3 deletions
+9
-3
app/controllers/categories_controller.rb
+1
-1
app/decorators/product_decorator.rb
+5
-0
app/views/categories/_recommended.html.haml
+1
-1
app/views/products/_product.html.haml
+1
-1
config/settings.yml
+1
-0
No files found.
app/controllers/categories_controller.rb
View file @
9718b420
...
@@ -4,7 +4,7 @@ class CategoriesController < ApplicationController
...
@@ -4,7 +4,7 @@ class CategoriesController < ApplicationController
def
show
def
show
@products
=
@category
.
products
.
page
(
params
[
:page
])
@products
=
@category
.
products
.
page
(
params
[
:page
])
add_breadcrumb
(
@category
.
title
)
add_breadcrumb
(
@category
.
decorate
.
title
)
end
end
private
private
...
...
app/decorators/product_decorator.rb
View file @
9718b420
...
@@ -16,4 +16,8 @@ class ProductDecorator < Draper::Decorator
...
@@ -16,4 +16,8 @@ class ProductDecorator < Draper::Decorator
def
image_lg_url
def
image_lg_url
object
.
amazon?
?
object
.
image_lg_url
:
object
.
image
.
large
.
url
object
.
amazon?
?
object
.
image_lg_url
:
object
.
image
.
large
.
url
end
end
def
short_title
return
object
.
title
.
truncate
(
Settings
.
limit_length_category_title
,
separator:
' '
)
end
end
end
\ No newline at end of file
app/views/categories/_recommended.html.haml
View file @
9718b420
-
products
.
each
do
|
product
|
-
products
.
each
do
|
product
|
.product-item.col-md-4.text-center
.product-item.col-md-4.text-center
.product-title
.product-title
=
link_to
product
.
title
,
product
=
link_to
product
.
decorate
.
short_
title
,
product
.product-image.img-thumbnail
.product-image.img-thumbnail
=
image_tag
product
.
decorate
.
image_md_url
=
image_tag
product
.
decorate
.
image_md_url
app/views/products/_product.html.haml
View file @
9718b420
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
%img
{
src:
product
.
decorate
.
image_sm_url
}
%img
{
src:
product
.
decorate
.
image_sm_url
}
.col-md-9
.col-md-9
.product-title
.product-title
=
link_to
product
.
title
,
product_path
(
product
)
=
link_to
product
.
decorate
.
short_
title
,
product_path
(
product
)
-
if
local_assigns
.
has_key?
(
:show_price
)
&&
show_price
.
present?
-
if
local_assigns
.
has_key?
(
:show_price
)
&&
show_price
.
present?
.col-md-2
.col-md-2
.product-price
.product-price
...
...
config/settings.yml
View file @
9718b420
...
@@ -2,6 +2,7 @@ defaults: &defaults
...
@@ -2,6 +2,7 @@ defaults: &defaults
limit_category
:
5
limit_category
:
5
limit_product_recommended
:
6
limit_product_recommended
:
6
limit_product_newest
:
4
limit_product_newest
:
4
limit_length_category_title
:
50
development
:
development
:
<<
:
*defaults
<<
:
*defaults
...
...
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