shopqi-app 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,13 @@ class Shop < ActiveRecord::Base
2
2
  attr_accessible :shop_id, :name, :shopqi_domain, :access_token
3
3
 
4
4
  def self.find_for_shopqi_oauth(data)
5
- shop = data.extra.raw_info.shop
6
- where(shop_id: shop.id).first_or_create! name: shop.name, shopqi_domain: shop.shopqi_domain, access_token: data.credentials.token
5
+ shop_data = data.extra.raw_info.shop
6
+ shop = where(shop_id: shop_data.id).first_or_create! name: shop_data.name, shopqi_domain: shop_data.shopqi_domain
7
+ shop.access_token = data.credentials.token
8
+ shop.tap(&:save)
9
+ end
10
+
11
+ def use_shopkit
12
+ Shopkit.setup url: self.shopqi_domain, access_token: self.access_token
7
13
  end
8
14
  end
@@ -63,3 +63,9 @@ body {
63
63
  background: #F9F9F9;
64
64
  .accordion-inner {
65
65
  padding: 20px; }}
66
+
67
+ .footer {
68
+ color: #333;
69
+ text-align: center;
70
+ margin-top: 45px;
71
+ padding: 35px 0 36px; }
@@ -3,7 +3,7 @@ class HomeController < ApplicationController
3
3
 
4
4
  def index
5
5
  if signed_in?
6
- Shopkit.setup url: current_shop.shopqi_domain, access_token: current_shop.access_token # set in shopqi-app sessions controller
6
+ current_shop.use_shopkit
7
7
  @orders = Shopkit.orders per_page: 3
8
8
  @products = Shopkit.products per_page: 5
9
9
  else
@@ -1,7 +1,7 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %title ShopQi App Example
4
+ %title=SecretSetting.app_name
5
5
  = stylesheet_link_tag "application"
6
6
  = javascript_include_tag "application"
7
7
  = csrf_meta_tags
@@ -9,12 +9,12 @@
9
9
  .navbar.navbar-fixed-top
10
10
  .navbar-inner
11
11
  .container
12
- %a.brand(href="/") ShopQi App Example
12
+ %a.brand(href="/")=SecretSetting.app_name
13
13
  -if current_shop
14
14
  %ul.nav.pull-right
15
15
  %li.dropdown
16
16
  =link_to shop_url, class: 'dropdown-toggle', data: { toggle: :dropdown } do
17
- =current_shop['shopqi_domain']
17
+ =current_shop['name']
18
18
  %b.caret
19
19
  %ul.dropdown-menu
20
20
  %li
@@ -31,5 +31,13 @@
31
31
  %i.icon-off
32
32
  退出
33
33
 
34
- #main.container
35
- = yield
34
+ .container
35
+ #main
36
+ = yield
37
+ #footer.footer
38
+ %p
39
+ ==Copyright©#{Date.today.year}
40
+ =link_to SecretSetting.app_name, '/'
41
+ 版权所有
42
+ |
43
+ =SecretSetting.domain.record
@@ -1,12 +1,14 @@
1
1
  defaults: &defaults
2
+ app_name: ShopQi App Example
2
3
  oauth:
3
4
  client_id: <%= client_id %>
4
5
  secret: <%= client_secret %>
5
6
  scope: 'read_products read_orders'
6
7
  callback_path: '/callback'
7
8
  domain:
8
- host: 'lvh.me:3000'
9
9
  record: 粤ICP备11089804号
10
+ shopqi_domain:
11
+ protocol: 'http://'
10
12
 
11
13
  development:
12
14
  <<: *defaults
@@ -22,5 +24,6 @@ production:
22
24
  scope: 'read_products read_orders'
23
25
  callback_path: '/callback'
24
26
  domain:
25
- host: 'example.shopqiapp.com'
26
27
  record: 粤ICP备11089804号
28
+ shopqi_domain:
29
+ protocol: 'https://'
@@ -1,3 +1,3 @@
1
1
  module ShopQiApp
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopqi-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-18 00:00:00.000000000 Z
12
+ date: 2012-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  segments:
207
207
  - 0
208
- hash: -350681073
208
+ hash: -277092943
209
209
  required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  none: false
211
211
  requirements:
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: -350681073
217
+ hash: -277092943
218
218
  requirements: []
219
219
  rubyforge_project:
220
220
  rubygems_version: 1.8.24