spree_retailers 0.40.0.4 → 0.50.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -23
- data/app/controllers/admin/retailers_controller.rb +13 -25
- data/app/models/retailer.rb +1 -1
- data/app/views/admin/retailers/_form.html.erb +8 -8
- data/app/views/admin/retailers/index.html.erb +21 -14
- data/config/locales/en.yml +6 -1
- data/lib/spree_retailers/version.rb +1 -1
- metadata +6 -8
data/README.md
CHANGED
@@ -7,8 +7,13 @@ Spree Retailers is a simple Spree Extension that adds a retailers page as well a
|
|
7
7
|
Installation
|
8
8
|
------------
|
9
9
|
|
10
|
-
As usual, add '
|
10
|
+
As usual, add 'spree_retailers' to your Gemfile or install directly.
|
11
11
|
|
12
|
+
|
13
|
+
# 0.50.x
|
14
|
+
gem 'spree_retailers', '0.50.0.0'
|
15
|
+
|
16
|
+
# 0.40.x
|
12
17
|
gem 'spree_retailers', '0.40.0.4'
|
13
18
|
|
14
19
|
# or
|
@@ -16,28 +21,6 @@ As usual, add 'spree_retalers' to your Gemfile or install directly.
|
|
16
21
|
(sudo) gem install spree_retailers
|
17
22
|
|
18
23
|
|
19
|
-
Demo
|
20
|
-
----
|
21
|
-
|
22
|
-
To create a spree retailers demo app, run the following:
|
23
|
-
|
24
|
-
rails new spree_retailers_example
|
25
|
-
cd spree_retailers_example
|
26
|
-
echo "gem 'spree', '0.40.3'" >> Gemfile
|
27
|
-
echo "gem 'spree_retailers'" >> Gemfile
|
28
|
-
rm public/index.html
|
29
|
-
bundle install
|
30
|
-
rake spree:install spree_retailers:install db:migrate db:seed db:admin:create
|
31
|
-
|
32
|
-
Or all at once:
|
33
|
-
|
34
|
-
rails new spree_retailers_example; cd spree_retailers_example; echo "gem 'spree', '0.40.3'" >> Gemfile; echo "gem 'spree_retailers'" >> Gemfile; rm public/index.html; bundle install; rake spree:install spree_retailers:install db:migrate db:seed db:admin:create
|
35
|
-
|
36
|
-
`rake spree_sample:install db:sample` if you want to...
|
37
|
-
|
38
|
-
Then start the server with `rails s`
|
39
|
-
|
40
|
-
|
41
24
|
To Do
|
42
25
|
-----
|
43
26
|
|
@@ -21,32 +21,20 @@ class Admin::RetailersController < Admin::BaseController
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
return @collection if @collection.present?
|
31
|
-
unless request.xhr?
|
24
|
+
def object
|
25
|
+
get_states
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
29
|
+
def collection
|
32
30
|
params[:search] ||= {}
|
33
|
-
params[:search][:
|
34
|
-
|
35
|
-
@
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
@collection = @search.do_search.paginate(:per_page => Spree::Config[:admin_products_per_page], :page => params[:page])
|
41
|
-
else
|
42
|
-
@collection = Retailer.find(:all,
|
43
|
-
:conditions => params[:q] ? ["Retailer.name like :search OR Retailer.email like :search OR Retailer.phone like :search", {:search => "#{params[:q].strip}%"}] : nil,
|
44
|
-
:limit => (params[:limit] || 100))
|
31
|
+
params[:search][:meta_sort] ||= "name.asc"
|
32
|
+
@search = end_of_association_chain.metasearch(params[:search])
|
33
|
+
@collection = @search.paginate(:per_page => Spree::Config[:orders_per_page], :page => params[:page])
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_states
|
37
|
+
@states = State.where(:country_id => 214).collect{|state| [state.name, state.abbr] }.sort
|
45
38
|
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def get_states
|
49
|
-
@states = State.where(:country_id => 214).collect{|state| [state.name, state.abbr] }.sort
|
50
|
-
end
|
51
39
|
|
52
40
|
end
|
data/app/models/retailer.rb
CHANGED
@@ -9,7 +9,7 @@ class Retailer < ActiveRecord::Base
|
|
9
9
|
|
10
10
|
|
11
11
|
has_attached_file :logo,
|
12
|
-
:styles => { :mini => '48x48>', :thumb => '
|
12
|
+
:styles => { :mini => '48x48>', :thumb => '150x150>', :large => '450x400>' },
|
13
13
|
:default_style => :thumb,
|
14
14
|
:url => "/assets/retailers/:id/:style/:basename.:extension",
|
15
15
|
:path => ":rails_root/public/assets/retailers/:id/:style/:basename.:extension"
|
@@ -6,20 +6,20 @@
|
|
6
6
|
|
7
7
|
<%= f.field_container :address do %>
|
8
8
|
<%= f.label :address, "Address" %><br />
|
9
|
-
<%= f.text_field :address
|
9
|
+
<%= f.text_field :address, :class => 'text' %>
|
10
10
|
<%= error_message_on :retailer, :address %>
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<%= f.field_container :address2 do %>
|
14
14
|
<%= f.label :address2, "Address (cont)" %><br />
|
15
|
-
<%= f.text_field :address2 %>
|
15
|
+
<%= f.text_field :address2, :class => 'text' %>
|
16
16
|
<%= error_message_on :retailer, :address2 %>
|
17
17
|
<% end %>
|
18
18
|
|
19
19
|
|
20
20
|
<%= f.field_container :city do %>
|
21
21
|
<%= f.label :city, "City" %><br />
|
22
|
-
<%= f.text_field :city
|
22
|
+
<%= f.text_field :city, :class => 'text' %>
|
23
23
|
<%= error_message_on :retailer, :city %>
|
24
24
|
<% end %>
|
25
25
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
<%= f.field_container :zipcode do %>
|
34
34
|
<%= f.label :zipcode, "Zip" %><br />
|
35
|
-
<%= f.text_field :zipcode
|
35
|
+
<%= f.text_field :zipcode, :class => 'text' %>
|
36
36
|
<%= error_message_on :retailer, :zipcode %>
|
37
37
|
<% end %>
|
38
38
|
|
@@ -40,24 +40,24 @@
|
|
40
40
|
|
41
41
|
<%= f.field_container :phone do %>
|
42
42
|
<%= f.label :phone, "Phone" %><br />
|
43
|
-
<%= f.text_field :phone
|
43
|
+
<%= f.text_field :phone, :class => 'text' %>
|
44
44
|
<%= error_message_on :retailer, :phone %>
|
45
45
|
<% end %>
|
46
46
|
|
47
47
|
<%= f.field_container :email do %>
|
48
48
|
<%= f.label :email, "Email" %><br />
|
49
|
-
<%= f.text_field :email
|
49
|
+
<%= f.text_field :email, :class => 'text' %>
|
50
50
|
<%= error_message_on :retailer, :email %>
|
51
51
|
<% end %>
|
52
52
|
|
53
53
|
<%= f.field_container :url do %>
|
54
54
|
<%= f.label :url, "Website URL" %><br />
|
55
|
-
<%= f.text_field :url
|
55
|
+
<%= f.text_field :url, :class => 'text' %>
|
56
56
|
<%= error_message_on :retailer, :url %>
|
57
57
|
<% end %>
|
58
58
|
|
59
59
|
<%= f.field_container :logo do %>
|
60
60
|
<%= f.label :logo, "Logo Image:" %><br />
|
61
|
-
<%= f.file_field :logo
|
61
|
+
<%= f.file_field :logo, :class => 'file' %>
|
62
62
|
<%= error_message_on :retailer, :logo %>
|
63
63
|
<% end %>
|
@@ -13,11 +13,11 @@
|
|
13
13
|
<table class="index">
|
14
14
|
<thead>
|
15
15
|
<tr>
|
16
|
-
<th><%=
|
17
|
-
<th><%=
|
18
|
-
<th><%=
|
19
|
-
<th><%=
|
20
|
-
<th><%=
|
16
|
+
<th><%= sort_link @search, :name %></th>
|
17
|
+
<th><%= sort_link @search, :address %></th>
|
18
|
+
<th><%= sort_link @search, :state %></th>
|
19
|
+
<th><%= sort_link @search, :email %></th>
|
20
|
+
<th><%= sort_link @search, :phone %></th>
|
21
21
|
<th><%= t("action") %></th>
|
22
22
|
</tr>
|
23
23
|
</thead>
|
@@ -41,17 +41,24 @@
|
|
41
41
|
<%= will_paginate(:prev => "« #{t('previous')}", :next => "#{t('next')} »") %>
|
42
42
|
|
43
43
|
|
44
|
+
|
45
|
+
|
44
46
|
<% content_for :sidebar do %>
|
47
|
+
<div class="box">
|
48
|
+
<h3><%= t(:search) %></h3>
|
45
49
|
|
46
|
-
|
47
|
-
|
48
|
-
|
50
|
+
<% @retailer = Retailer.metasearch %>
|
51
|
+
<%= form_for [:admin, @retailer] do |f| %>
|
52
|
+
<%- locals = {:f => f} %>
|
53
|
+
<%= hook :admin_pages_index_search, locals do %>
|
49
54
|
<p>
|
50
|
-
|
51
|
-
<%= f.text_field :name_contains, :size=>
|
52
|
-
</p>
|
55
|
+
<label><%= t '.name_contains' %></label><br />
|
56
|
+
<%= f.text_field :name_contains, :size => 25 %>
|
57
|
+
</p>
|
58
|
+
<% end %>
|
59
|
+
<%= hook :admin_pages_index_search_buttons, locals do %>
|
53
60
|
<p><%= button t("search") %></p>
|
54
|
-
|
61
|
+
<% end %>
|
55
62
|
<% end %>
|
56
|
-
|
57
|
-
<% end %>
|
63
|
+
</div>
|
64
|
+
<% end %>
|
data/config/locales/en.yml
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: spree_retailers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.50.0.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Spencer Steffen
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-04-25 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: spree_core
|
@@ -90,7 +89,7 @@ dependencies:
|
|
90
89
|
type: :development
|
91
90
|
prerelease: false
|
92
91
|
version_requirements: *id007
|
93
|
-
description: Spree Retailers adds a
|
92
|
+
description: Spree Retailers adds a retail store page and admin to Spree Commerce.
|
94
93
|
email:
|
95
94
|
- spencer@citrusme.com
|
96
95
|
executables: []
|
@@ -125,7 +124,6 @@ files:
|
|
125
124
|
- app/views/retailers/index.html.erb
|
126
125
|
- db/migrate/install_spree_retailers.rb
|
127
126
|
- Rakefile
|
128
|
-
has_rdoc: true
|
129
127
|
homepage: http://github.com/citrus/spree_retailers
|
130
128
|
licenses: []
|
131
129
|
|
@@ -139,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
137
|
requirements:
|
140
138
|
- - ">="
|
141
139
|
- !ruby/object:Gem::Version
|
142
|
-
hash: -
|
140
|
+
hash: -2661866179854238972
|
143
141
|
segments:
|
144
142
|
- 0
|
145
143
|
version: "0"
|
@@ -148,14 +146,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
146
|
requirements:
|
149
147
|
- - ">="
|
150
148
|
- !ruby/object:Gem::Version
|
151
|
-
hash: -
|
149
|
+
hash: -2661866179854238972
|
152
150
|
segments:
|
153
151
|
- 0
|
154
152
|
version: "0"
|
155
153
|
requirements: []
|
156
154
|
|
157
155
|
rubyforge_project:
|
158
|
-
rubygems_version: 1.
|
156
|
+
rubygems_version: 1.7.2
|
159
157
|
signing_key:
|
160
158
|
specification_version: 3
|
161
159
|
summary: Spree Retailers adds a retailer admin to Spree.
|