Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3dee1df
新贈後台
Jun 9, 2014
ff97964
加上test.todo加上test.todo加上test.todo加上test.todo加上test.todo加上test.todo加上t…
Jun 9, 2014
c582d0f
管理者後台 可以新增產品 完成
Jun 10, 2014
b248eed
管理者全縣完成
Jun 10, 2014
c68b5bd
week1
Jun 10, 2014
80787ad
修正controller
FrankyWu Jun 11, 2014
2018631
修正 controller 開始設計圖片上傳功能
FrankyWu Jun 11, 2014
4b9b44e
圖片上傳功能在product/new OK
FrankyWu Jun 11, 2014
7fd4801
carrierwave done
FrankyWu Jun 11, 2014
61de42c
CRUD done
FrankyWu Jun 12, 2014
57b45c4
Merge branch 'feature/f1_image_upload' into develop
FrankyWu Jun 12, 2014
b02a1a8
Ready push to heroku
FrankyWu Jun 12, 2014
6c7f6be
將按鈕由藍色改成綠色
noni2she Jun 12, 2014
ae474d9
Merge pull request #1 from noni2she/develop
FrankyWu Jun 12, 2014
00f0c3d
首頁建立 done
FrankyWu Jun 12, 2014
a99be08
Nav bar done
FrankyWu Jun 12, 2014
732fd01
排版設定完成
FrankyWu Jun 14, 2014
ffc0e7e
測試 gitignore
FrankyWu Jun 14, 2014
2c17d7d
測試 gitignore part2
FrankyWu Jun 14, 2014
573d1c9
測試 gitignore part3
FrankyWu Jun 14, 2014
959da32
nav partial
FrankyWu Jun 16, 2014
990becc
Ready push to heroku
FrankyWu Jun 12, 2014
f48fd15
將按鈕由藍色改成綠色
noni2she Jun 12, 2014
356b36d
首頁建立 done
FrankyWu Jun 12, 2014
1a6686b
Nav bar done
FrankyWu Jun 12, 2014
b0fab97
排版設定完成
FrankyWu Jun 14, 2014
1e85cc8
測試 gitignore
FrankyWu Jun 14, 2014
3504bd3
測試 gitignore part2
FrankyWu Jun 14, 2014
d90a58f
測試 gitignore part3
FrankyWu Jun 14, 2014
f3692de
nav partial
FrankyWu Jun 16, 2014
dc915fa
Merge branch 'master' of heroku.com:franky-store
FrankyWu Jun 16, 2014
8d62fad
fix applicatinon in diff of heroku master
FrankyWu Jun 16, 2014
19cfd3c
Merge branch 'develop' of https://github.com/FrankyWu/artstore into d…
FrankyWu Jun 16, 2014
45cfb18
week2 spec
FrankyWu Jun 16, 2014
40c7c7c
fix week 1 HW by XDite's version unless view
FrankyWu Jun 18, 2014
2cb429e
fix admin/show.html.erb
FrankyWu Jun 18, 2014
8b8d178
身為消費者,我要在前台能夠找到商品並加到購物車 @done (14-06-18 15:52)
FrankyWu Jun 18, 2014
b16476b
身為消費者,我要將商品加到購物車後,NAV_bar要可以顯示購物車中的商品數量 @done (14-06-18 17:10)
FrankyWu Jun 18, 2014
4f09215
身為消費者,我要可以從購物車內刪掉某些物品 @done (14-06-19 10:13)
FrankyWu Jun 19, 2014
ab55aa3
身為消費者,我要可以在購物車頁清空購物車的商品 @done (14-06-19 11:26)
FrankyWu Jun 19, 2014
8c984fc
add quantity to cart_items
FrankyWu Jun 19, 2014
05f33ad
身為消費者,我要在前台能夠將多樣商品加到購物車,並生成一張訂單 @done (14-06-19 17:41)
FrankyWu Jun 19, 2014
8ba3d97
fix application
FrankyWu Jun 19, 2014
5d80004
fix application part2
FrankyWu Jun 19, 2014
ffaedac
身為消費者,我可以在購物車中選擇我要買某些物品的數量 @done (14-06-20 15:07)
FrankyWu Jun 20, 2014
d6c3656
身為消費者,我可以看到我購物車的總價 (小計 x 數量) @done (14-06-20 16:28)
FrankyWu Jun 20, 2014
df7b7a9
身為消費者,當系統生成一張訂單後,我可以填寫寄送資訊,並且用信用卡結賬 @done (14-06-20 22:56)
FrankyWu Jun 20, 2014
6100b68
install aasm
FrankyWu Jun 21, 2014
e78b7e9
fix order quantity
FrankyWu Jun 21, 2014
f1cde37
身為消費者,可看到過去所有訂單(orders) @done (14-06-21 21:40)
FrankyWu Jun 21, 2014
1b3580a
身為消費者,在結賬完後,會自動跳到訂單的管理界面 @done (14-06-21 22:19)
FrankyWu Jun 21, 2014
7652e78
✔ 身為管理者,可以在後台看到所有訂單 @done (14-06-21 22:47)
FrankyWu Jun 21, 2014
8b228b5
fix _nav
FrankyWu Jun 21, 2014
dde919c
身為管理者,可以在後台對單張訂單做狀態改變
FrankyWu Jun 23, 2014
c23005f
fix admin/new.html.erb
FrankyWu Jun 23, 2014
cff93a5
Merge branch 'feature/week-2' into develop
FrankyWu Jun 23, 2014
198c337
Merge branch 'develop'
FrankyWu Jun 23, 2014
1ef776c
fix bootstrap simple_form
FrankyWu Jun 23, 2014
5ec30e2
身為消費者,當我用信用卡結賬後,我的信箱要能收到一張訂單確認信 @done (14-06-24 16:49)
FrankyWu Jun 24, 2014
a141601
test mailgun on heroku
FrankyWu Jun 26, 2014
5281cb9
add new functions
FrankyWu Jun 29, 2014
cd417cd
test inheritance
FrankyWu Jun 29, 2014
f50939e
test mix for model
FrankyWu Jun 29, 2014
26a9aff
service object
FrankyWu Jun 29, 2014
b5002a1
install setting logic
FrankyWu Jun 29, 2014
5b712c8
extract to stripe charger service
FrankyWu Jun 30, 2014
04f5cfe
身為消費者,我可以搜尋產品的資料(ransack) @done (14-06-30 13:56)
FrankyWu Jun 30, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# Ignore upload files
.DS_Store
/public/uploads/product/photo/
/config/config.yml
40 changes: 38 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'

group :development do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
#Mailer
gem "letter_opener" #本機看信
gem 'roadie' #可在信裡面引入CSS
end

group :production do
gem 'pg'
gem 'rails_12factor'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
Expand Down Expand Up @@ -38,3 +49,28 @@ gem 'spring', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]

gem 'minitest', '~>5.3.4'

gem "simple_form", "~> 3.1.0rc1"

#使用者帳號管理
gem 'devise'

gem 'bootstrap-sass'

#圖片上傳
gem 'carrierwave'

gem "mini_magick"

#FSM
gem 'aasm'

#credit card
gem 'stripe'
# hide keys
gem "settingslogic"
gem "will_paginate"
gem "ransack"


78 changes: 77 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
aasm (3.2.1)
actionmailer (4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
Expand All @@ -27,15 +28,32 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
addressable (2.3.6)
arel (5.0.1.20140414130214)
bcrypt (3.1.7)
bootstrap-sass (3.1.1.1)
sass (~> 3.2)
builder (3.2.2)
carrierwave (0.10.0)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
json (>= 1.7)
mime-types (>= 1.16)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
css_parser (1.3.5)
addressable
devise (3.2.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
erubis (2.7.0)
execjs (2.2.0)
hike (1.2.3)
Expand All @@ -47,12 +65,25 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
launchy (2.4.2)
addressable (~> 2.3)
letter_opener (1.2.0)
launchy (~> 2.2)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (5.3.4)
mini_magick (3.7.0)
subexec (~> 0.2.1)
mini_portile (0.6.0)
minitest (5.3.5)
multi_json (1.10.1)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
orm_adapter (0.5.0)
pg (0.17.1)
polyamorous (1.0.0)
activerecord (>= 3.0)
polyglot (0.3.5)
rack (1.5.2)
rack-test (0.6.2)
Expand All @@ -67,14 +98,32 @@ GEM
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.0)
sprockets-rails (~> 2.0)
rails_12factor (0.0.2)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.1.0)
actionpack (= 4.1.0)
activesupport (= 4.1.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
ransack (1.2.3)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.0.0)
rdoc (4.1.1)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
roadie (2.4.3)
actionmailer (> 3.0.0, < 5.0.0)
css_parser (~> 1.3.4)
nokogiri (> 1.5.0)
sprockets
sass (3.2.19)
sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
Expand All @@ -84,6 +133,10 @@ GEM
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
settingslogic (2.0.9)
simple_form (3.1.0.rc1)
actionpack (~> 4.0)
activemodel (~> 4.0)
spring (1.1.3)
sprockets (2.11.0)
hike (~> 1.2)
Expand All @@ -95,6 +148,11 @@ GEM
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.9)
stripe (1.14.0)
json (~> 1.8.1)
mime-types (~> 1.25)
rest-client (~> 1.4)
subexec (0.2.3)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
Expand All @@ -108,18 +166,36 @@ GEM
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
will_paginate (3.0.6)

PLATFORMS
ruby

DEPENDENCIES
aasm
bootstrap-sass
carrierwave
coffee-rails (~> 4.0.0)
devise
jbuilder (~> 2.0)
jquery-rails
letter_opener
mini_magick
minitest (~> 5.3.4)
pg
rails (= 4.1.0)
rails_12factor
ransack
roadie
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
settingslogic
simple_form (~> 3.1.0rc1)
spring
sqlite3
stripe
turbolinks
uglifier (>= 1.3.0)
will_paginate
38 changes: 38 additions & 0 deletions UserStory.todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
✔ 身為商家的管理者我要能夠在後台上架我的東西,並設定能夠販賣 @done (14-06-10 15:29)
✔ 管理者必須要有一個後台 @done (14-06-10 15:29)
✔ 後台必須要可以新增產品 @done (14-06-10 15:29)
✔ 產品內容必須要有標題 文字 數量 圖片 @done (14-06-16 16:10)
✔ 身為商家的管理者,我要能夠在後台設定權限,權限分為管理者以及消費者 @done (14-06-10 15:55)
✔ 身為管理者,才可以進入後台 @done (14-06-10 15:55)
✔ 身為管理者,必須要登入且是admin @done (14-06-10 15:55)
✔ 管理這的身份必須要被分為 admin / user @done (14-06-10 15:55)
☐ 作為一個消費者,我要在前台能夠找到商品並結賬
✔ 身為消費者,我要在前台能夠找到商品並加到購物車 @done (14-06-18 15:52)
+購物車設計
✔ 身為消費者,我要將商品加到購物車後,NAV_bar要可以顯示購物車中的商品數量 @done (14-06-18 17:10)
✔ 身為消費者,我要可以在購物車頁清空購物車的商品 @done (14-06-19 11:26)
✔ 身為消費者,我要可以從購物車內刪掉某些物品 @done (14-06-19 10:13)
✔ 身為消費者,我可以在購物車中選擇我要買某些物品的數量 @done (14-06-20 15:07)
✔ 身為消費者,我可以看到我購物車的總價 (小計 x 數量) @done (14-06-20 16:28)
✔ 身為消費者,我在購物時數量為0的貨物不能買 @done (14-06-20 16:28)
+購物車訂單
✔ 身為消費者,我要在前台能夠將多樣商品加到購物車,並生成一張訂單 @done (14-06-19 17:41)
☐ 美化訂單
+訂單可以用信用卡結賬
✔ 身為消費者,當系統生成一張訂單後,我可以填寫寄送資訊,並且用信用卡結賬 @done (14-06-20 22:56)
✔ 身為消費者,當我用信用卡結賬後,我的信箱要能收到一張訂單確認信 @done (14-06-24 16:49)
☐ 身為消費者,當我付款成功後,我的信箱要能收到一張確認信
☐ 身為消費者,當我收到確認信上,要有可以檢視訂單的連結
☐ 安裝SettingsLogic,把stripe的key放進SettingLogic的yml裏面
☐ 把mailgun的key放進SettingLogic的yml裏面
+搜尋功能
✔ 身為消費者,我可以搜尋產品的資料(ransack) @done (14-06-30 13:56)
+消費者訂單管理(account)
✔ 身為消費者,可看到過去所有訂單(orders) @done (14-06-21 21:40)
✔ 身為消費者,在結賬完後,會自動跳到訂單的管理界面 @done (14-06-21 22:19)
☐ Admin 管理訂單
✔ 身為管理者,可以在後台看到所有訂單 @done (14-06-21 22:47)
✔ 訂單狀態分為未結賬 已結賬 出貨中 已出貨 辦理退貨 @done (14-06-21 22:47)
✔ 身為管理者,可以在後台對單張訂單做狀態改變 @done (14-06-23 14:57)
☐ 身為管理者,當我在將商品設為已出貨時,消費者應該收到一張已出貨的通知信
☐ 身為商家,當消費者確定購物結賬後,該商品的庫存必須按照數量減少
3 changes: 3 additions & 0 deletions app/assets/javascripts/account/orders.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/admin.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/admin/orders.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/admin/products.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
2 changes: 1 addition & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require orders
3 changes: 3 additions & 0 deletions app/assets/javascripts/card_charges.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/carts.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
35 changes: 35 additions & 0 deletions app/assets/javascripts/orders.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

jQuery ($) ->
$("#payment-form").submit (event) ->
$form = $(this)

# Disable the submit button to prevent repeated clicks
$form.find("button").prop "disabled", true
Stripe.createToken $form, stripeResponseHandler

# Prevent the form from submitting with the default action
false

return

stripeResponseHandler = (status, response) ->
$form = $("#payment-form")
if response.error

# Show the errors on the form
$form.find(".payment-errors").text response.error.message
$form.find("button").prop "disabled", false
else

# token contains id, last4, and card type
token = response.id

# Insert the token into the form so it gets submitted to the server
$form.append $("<input type=\"hidden\" name=\"stripeToken\" />").val(token)

# and submit
$form.get(0).submit()
return
3 changes: 3 additions & 0 deletions app/assets/javascripts/pages.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/products.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/account/orders.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the account/orders controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/admin.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the admin controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/admin/orders.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the admin/orders controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/admin/products.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the admin::products controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
13 changes: 13 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@
*
*= require_tree .
*= require_self
*= require bootstrap
*= require products
*/

.group:before, .group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
zoom: 1; /* IE6&7 */
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/card_charges.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the card_charges controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/cart_items.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the cart_iterms controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/carts.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the carts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/orders.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the orders controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/pages.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
Loading