Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

交第二週作業 #432

Open
wants to merge 134 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
7412726
rails g controller admin::products
sdlong Mar 8, 2016
186d357
設定 admin/products 的 routes
sdlong Mar 8, 2016
d46ca0b
建立 model: product
sdlong Mar 8, 2016
263df5c
設定 admin/products_controller.rb
sdlong Mar 8, 2016
c30f8af
建立 admin/products/new.html.erb
sdlong Mar 8, 2016
fcba2be
新增 admin/products_controller 的 index action
sdlong Mar 8, 2016
0b7c236
建立 admin/products/index.html
sdlong Mar 8, 2016
85aa7ad
安裝 gem "devise"
sdlong Mar 8, 2016
85c64fb
必須要先登入才能進入後台
sdlong Mar 8, 2016
7ec0c58
必須要有 admin 權限才能進入
sdlong Mar 8, 2016
c35957d
User 新增 is_admin 欄位
sdlong Mar 8, 2016
a5623ba
新增登出登入的按鈕
sdlong Mar 8, 2016
3263c2d
新增一個種子檔,可以 rake db:seed 自動建一個有 admin 權限的使用者
sdlong Mar 8, 2016
76fee7f
安裝與設定 bootstrap
sdlong Mar 8, 2016
6e8e5e8
修改 application.js
sdlong Mar 8, 2016
aca50c2
新增 partial: navbar
sdlong Mar 8, 2016
7a28add
rails g controller products
sdlong Mar 8, 2016
83f84ac
設定空的前台首頁
sdlong Mar 8, 2016
eccbf03
gem simple_form
sdlong Mar 8, 2016
ea3b87c
rails generate simple_form:install --bootstrap
sdlong Mar 8, 2016
3db74ff
修改 admin/products/new
sdlong Mar 8, 2016
e075415
修改 admin/products/new
sdlong Mar 8, 2016
2921b26
加入產品修改功能
sdlong Mar 8, 2016
9f6c57c
gem install carrierwave and mini_magick
sdlong Mar 8, 2016
de93e4e
rails g uploader image
sdlong Mar 8, 2016
50ac645
新增 model: photo
sdlong Mar 8, 2016
8c86dcd
設定 photo 與 product 的資料庫關聯
sdlong Mar 8, 2016
0d95d51
設定圖片上傳後裁切的尺寸
sdlong Mar 8, 2016
1142ed1
將 public/uploaders 資料夾放進 gitignore
sdlong Mar 8, 2016
f58322d
新增商品時可以上傳商品圖片
sdlong Mar 8, 2016
6e3c724
商品修改頁也能修替換圖片
sdlong Mar 8, 2016
4e1e7b1
建立前台商品 index
sdlong Mar 8, 2016
d397de1
建立前台商品 show
sdlong Mar 8, 2016
839b102
建立 layout: admin
sdlong Mar 8, 2016
d908dfb
重構後台商品列表
sdlong Mar 8, 2016
1a826b5
navbar 的下拉選單放入後台連結
sdlong Mar 8, 2016
a3d3d0d
加上 Bootstrap 的 Alert 效果
sdlong Mar 8, 2016
493b362
建立購物車按鈕
sdlong Mar 8, 2016
3443c0f
用 icon 點綴頁面設計
sdlong Mar 8, 2016
6d56e2e
修飾 css, 讓售價顯示更美觀
sdlong Mar 8, 2016
fab3596
rails g controller admin::users
sdlong Mar 8, 2016
d1bf3cc
建立基礎的使用者清單頁面
sdlong Mar 8, 2016
8e52abc
將使用者清單頁面套入後台權限與 layout
sdlong Mar 8, 2016
919da42
後台邊欄放入使用者管理的連結
sdlong Mar 8, 2016
533d319
顯示使用者現在權限
sdlong Mar 8, 2016
ade4cd1
放入轉換權限的按鈕
sdlong Mar 8, 2016
52abc50
完成設定使用者權限的功能設定
sdlong Mar 8, 2016
fb6af95
將『建立二個商品資料』放入種子檔
Mar 10, 2016
1949501
建立二個 model: cart, cart_item
sdlong Mar 8, 2016
ce5943b
將 cart 與 cart_item 設定資料庫關聯
sdlong Mar 8, 2016
480c772
實作 current_cart 的功能
sdlong Mar 8, 2016
065d375
實作加入購物車的 routing 與按鈕
sdlong Mar 8, 2016
598887f
實作加入購物車的 model 設定
sdlong Mar 8, 2016
a60d1bb
實作加入購物車的 controller 設定
sdlong Mar 8, 2016
ca6c560
加入購物車後,應出現購物車內物品數量
sdlong Mar 8, 2016
ece022a
rails g controller carts
sdlong Mar 8, 2016
b020510
點擊購物車按鈕, 應出現購物車明細
sdlong Mar 8, 2016
8cff2ae
正確顯示購物車商品明細的總金額
sdlong Mar 8, 2016
893bf0b
建立 Model: order , order_info, order_item
sdlong Mar 8, 2016
684ecd7
建立 建立 user, order, order_info, order_item 等 model 的資料庫關聯
sdlong Mar 8, 2016
840174e
建立 前往訂單資訊頁 的連結
sdlong Mar 8, 2016
2a67110
設定訂單資訊頁
sdlong Mar 8, 2016
ce8530b
設定 order.rb 的 accepts_nested_attributes_for
sdlong Mar 8, 2016
c545447
rails g controller orders
sdlong Mar 8, 2016
82663ad
設定 orders_controller 裡的 create action
sdlong Mar 8, 2016
62aa918
設定 order_controller 的 create_action 中用到的 method
sdlong Mar 8, 2016
eb88d01
寄件和收件⼈都需填寫資訊
sdlong Mar 8, 2016
cf14a19
顯示訂單內容
sdlong Mar 8, 2016
25a9282
rails g add_token_to_order
sdlong Mar 8, 2016
097576b
產生訂單前,先亂數產生 token 並存進去
sdlong Mar 8, 2016
cb545c1
訂單建立完成導向的網址會是 token
sdlong Mar 8, 2016
017d34a
設定付款按鈕
sdlong Mar 8, 2016
dc363a6
add is_paid to order
sdlong Mar 8, 2016
194ef81
信用卡付款的按鈕 routing 設定
sdlong Mar 8, 2016
e1e58f0
設定 order 信用卡付款的 action
sdlong Mar 8, 2016
735ceb4
rails g migration add_payment_method_to_order payment_method:string
sdlong Mar 9, 2016
8e7bebf
設定 order 付款完成與付款方式紀錄的 method
sdlong Mar 9, 2016
a37f81c
訂單已付款就不會顯示付款按鈕
sdlong Mar 9, 2016
e6bbbc3
gem install aasm
sdlong Mar 9, 2016
715c082
add aasm_state to order
sdlong Mar 9, 2016
fff9ee5
設定訂單狀態機制
sdlong Mar 9, 2016
2392d48
用 AASM 的機制設定訂單付款
sdlong Mar 9, 2016
3f47e93
消費者可用「清空購物車功能」來手動清空購物車
sdlong Mar 9, 2016
3d2ae4c
rails g controller cart_items
sdlong Mar 9, 2016
e94f9bb
消費者可以「手動」從購物車內刪掉某些物品
sdlong Mar 9, 2016
f80ef46
rails g migration add_quantity_to_cart_item quantity:integer
sdlong Mar 9, 2016
f7c8225
購物車加入「數量」設計 ( 基礎設定 )
sdlong Mar 9, 2016
2d78950
購物車加入「數量」設計 ( 總價 => 小計 x 數量 )
sdlong Mar 9, 2016
49faf24
購物車加入「數量」設計 ( 數量為 0 的貨物不能「購買」)
sdlong Mar 9, 2016
2460e84
購物車加入「數量」設計 ( 購物車不能手動更新超過庫存的數量 )
sdlong Mar 9, 2016
af3f614
訂單建立時把購物車上的商品數量存進去
sdlong Mar 9, 2016
150fa0d
定義 find_cart_item 來簡化常用的程式
sdlong Mar 9, 2016
f603658
產生訂單後,購物車應該被清空
sdlong Mar 9, 2016
c9c0671
修改訂單頁面 ( 增加數量欄位 )
sdlong Mar 9, 2016
590b134
rails g controller account::orders
sdlong Mar 9, 2016
b2e4727
建立 account/orders 可以看到該使用者過去所有訂單
sdlong Mar 9, 2016
28e9719
結賬後轉到 account/orders#index
sdlong Mar 9, 2016
082c12b
navbar 新增個人訂單列表的連結
sdlong Mar 9, 2016
9490cb5
rails g controller admin::orders
sdlong Mar 9, 2016
8da6eff
建立 admin/orders 可以看到系統內所有訂單
sdlong Mar 9, 2016
ca476ba
admin 後台放入管理訂單列表連結
sdlong Mar 9, 2016
e1da4f2
admin 的 order 列表應要能顯示訂單狀態
sdlong Mar 9, 2016
a0d3942
解決 bug: devise 的訊息變成亂碼
sdlong Mar 9, 2016
97cdf45
建立後台訂單頁面
sdlong Mar 9, 2016
8f153ae
後台的訂單可以依照「按照狀態圖」改變狀態
sdlong Mar 9, 2016
f396292
ignore public/uploads folder
lyenliang May 14, 2016
3698770
Complete basic functions
lyenliang May 14, 2016
fc7d482
Finish adding navbar
lyenliang May 14, 2016
73a9770
Finish homework week 1
lyenliang May 15, 2016
f1c9d7c
Generate cart
lyenliang May 17, 2016
92e9a57
Details of the products
lyenliang May 17, 2016
adec653
receiver info work in progress
lyenliang May 17, 2016
db136a3
Finish Order Form
lyenliang May 18, 2016
00f1541
Display order form
lyenliang May 18, 2016
ef6b3fb
The order form is able to be checked out
lyenliang May 18, 2016
be6ad7e
Add order states
lyenliang May 18, 2016
5bbe392
Empty cart
lyenliang May 18, 2016
174175f
Users can remove a sinlge item in the cart
lyenliang May 19, 2016
72dd6d4
Now users can change the quantity of every item.
lyenliang May 19, 2016
cff9bb6
update total price
lyenliang May 19, 2016
5c8d523
You can't buy the product if the number of it is 0.
lyenliang May 19, 2016
2a6c09c
You can't add more than product.quantity products into your cart.
lyenliang May 19, 2016
6b791b9
1. Fix item.quantity. 2. Use find_cart_item
lyenliang May 19, 2016
fa41eed
Clean the cart after the order is generated.
lyenliang May 19, 2016
88332ad
Add quantity column
lyenliang May 19, 2016
f066e97
Users can view orders history
lyenliang May 19, 2016
f6ac2d3
Redirect to accounts/orders after purchasing.
lyenliang May 19, 2016
816a761
Build admin/orders so that the administrator can see all orders.
lyenliang May 19, 2016
8f7b47c
User i18n to change the language of the state into Chinese.
lyenliang May 19, 2016
995639c
Complete homework 2
lyenliang May 19, 2016
258eaea
Merge remote-tracking branch 'origin/week-2-homework' into store-v2
lyenliang May 20, 2016
caa8059
Fix a bug
lyenliang May 20, 2016
02d286d
Fix another bug
lyenliang May 20, 2016
21ff80c
Files retyped
lyenliang May 20, 2016
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
Prev Previous commit
Next Next commit
gem simple_form
  • Loading branch information
sdlong committed Mar 8, 2016
commit eccbf03820c57648f3c3c5a2f1906f7c4f441082
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ gem "devise"

gem "bootstrap-sass"

gem "simple_form"

gem "awesome_rails_console" # 讓你的 rails console 變整齊漂亮的 gem

group :development, :test do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
simple_form (3.2.0)
actionpack (~> 4.0)
activemodel (~> 4.0)
slop (3.6.0)
spring (1.3.6)
sprockets (3.2.0)
Expand Down Expand Up @@ -200,6 +203,7 @@ DEPENDENCIES
rails (= 4.2.2)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
simple_form
spring
sqlite3
turbolinks
Expand Down