Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
4ce841da
Commit
4ce841da
authored
Aug 29, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update views about status
parent
02afbd12
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
38 additions
and
12 deletions
+38
-12
index.json.jbuilder
...ators/templates/views/customer/orders/index.json.jbuilder
+6
-0
show.json.jbuilder
...rators/templates/views/customer/orders/show.json.jbuilder
+1
-0
index.json.jbuilder
...ors/templates/views/customer/products/index.json.jbuilder
+5
-0
show.json.jbuilder
...tors/templates/views/customer/products/show.json.jbuilder
+1
-0
index.json.jbuilder
...ators/templates/views/customer/series/index.json.jbuilder
+5
-0
show.json.jbuilder
...rators/templates/views/customer/series/show.json.jbuilder
+1
-0
index.json.jbuilder
...rs/templates/views/customer/snapshots/index.json.jbuilder
+5
-0
show.json.jbuilder
...ors/templates/views/customer/snapshots/show.json.jbuilder
+1
-0
_product_simple.json.jbuilder
...ators/templates/views/share/_product_simple.json.jbuilder
+3
-2
_snapshot.json.jbuilder
lib/generators/templates/views/share/_snapshot.json.jbuilder
+2
-1
_snapshot_simple.json.jbuilder
...tors/templates/views/share/_snapshot_simple.json.jbuilder
+2
-1
series.rb
lib/shotengai/series.rb
+1
-1
snapshot.rb
lib/shotengai/snapshot.rb
+5
-7
No files found.
lib/generators/templates/views/customer/orders/index.json.jbuilder
View file @
4ce841da
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/order_simple', as: :order
end
\ No newline at end of file
lib/generators/templates/views/customer/orders/show.json.jbuilder
View file @
4ce841da
json.partial! "shotengai/share/order", order: @resource
lib/generators/templates/views/customer/products/index.json.jbuilder
View file @
4ce841da
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/product_simple', as: :product
end
lib/generators/templates/views/customer/products/show.json.jbuilder
View file @
4ce841da
json.partial! "shotengai/share/product", product: @resource
lib/generators/templates/views/customer/series/index.json.jbuilder
View file @
4ce841da
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/series_simple', as: :series
end
lib/generators/templates/views/customer/series/show.json.jbuilder
View file @
4ce841da
json.partial! "shotengai/share/series", series: @resource
lib/generators/templates/views/customer/snapshots/index.json.jbuilder
View file @
4ce841da
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/snapshot_simple', as: :snapshot
end
lib/generators/templates/views/customer/snapshots/show.json.jbuilder
View file @
4ce841da
json.partial! "shotengai/share/snapshot", snapshot: @resource
lib/generators/templates/views/share/_product_simple.json.jbuilder
View file @
4ce841da
json.extract! product, :id, :title, :status, :status_zh,
:need_express, :cover_image
\ No newline at end of file
:need_express, :cover_image
json.default_series product.default_series, partial: 'shotengai/share/series_simple', as: :series
\ No newline at end of file
lib/generators/templates/views/share/_snapshot.json.jbuilder
View file @
4ce841da
json.extract! snapshot, :id, :original_price, :price, :count,
:product_status_zh, :order_status_zh,
:product_status_zh, :order_status_zh,
:product_status, :order_status,
:total_price, :total_original_price, :revised_amount,
:spec, :cover_image, :banners, :detail, :meta
\ No newline at end of file
lib/generators/templates/views/share/_snapshot_simple.json.jbuilder
View file @
4ce841da
json.extract! snapshot, :id, :original_price, :price, :count,
:product_status_zh, :order_status_zh,
:product_status_zh, :order_status_zh,
:product_status, :order_status,
:total_price, :total_original_price, :revised_amount,
:spec, :cover_image, :meta
\ No newline at end of file
lib/shotengai/series.rb
View file @
4ce841da
...
...
@@ -27,7 +27,7 @@ module Shotengai
# Using validates_uniqueness_of do not work if the order of Hash is diff
validate
:uniq_spec
delegate
:title
,
:detail
,
:banners
,
:cover_image
,
:status_zh
,
to: :product
delegate
:title
,
:detail
,
:banners
,
:cover_image
,
:status
,
:status
_zh
,
to: :product
scope
:query_spec_with_product
,
->
(
val
,
product
)
{
return
none
unless
val
.
keys
.
sort
==
product
.
spec
.
keys
.
sort
...
...
lib/shotengai/snapshot.rb
View file @
4ce841da
...
...
@@ -92,13 +92,11 @@ module Shotengai
count
*
original_price
end
def
product_status_zh
series
.
status_zh
end
def
order_status_zh
shotengai_order
&
.
status_zh
end
def
product_status
;
series
.
status
end
def
product_status_zh
;
series
.
status_zh
end
def
order_status
;
shotengai_order
&
.
status
end
def
order_status_zh
;
shotengai_order
&
.
status_zh
end
######
...
...
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