spree_dash 0.30.0.beta1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/admin/overview_controller.rb +4 -3
- data/app/views/admin/overview/index.html.erb +4 -4
- data/lib/tasks/install.rake +24 -0
- data/{lib/generators/templates/public → public}/javascripts/dashboard.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/excanvas.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/jquery.jqplot.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.highlighter.min.js +0 -0
- data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js +0 -0
- data/{lib/generators/templates/public → public}/stylesheets/admin/dashboard.css +0 -0
- metadata +27 -24
- data/lib/generators/spree_dash/install_generator.rb +0 -14
@@ -1,6 +1,7 @@
|
|
1
1
|
# this clas was inspired (heavily) from the mephisto admin architecture
|
2
2
|
|
3
3
|
class Admin::OverviewController < Admin::BaseController
|
4
|
+
before_filter :check_json_authenticity, :only => :get_report_data
|
4
5
|
#todo, add rss feed of information that is happening
|
5
6
|
|
6
7
|
def index
|
@@ -57,7 +58,7 @@ class Admin::OverviewController < Admin::BaseController
|
|
57
58
|
["completed_at >= ?", params[:from]]
|
58
59
|
end
|
59
60
|
end
|
60
|
-
|
61
|
+
|
61
62
|
def fill_empty_entries(orders, params)
|
62
63
|
from_date = params[:from].to_date
|
63
64
|
to_date = (params[:to] || Time.now).to_date
|
@@ -129,7 +130,7 @@ class Admin::OverviewController < Admin::BaseController
|
|
129
130
|
orders.map do |o|
|
130
131
|
qty = o.line_items.inject(0) {|sum,li| sum + li.quantity}
|
131
132
|
|
132
|
-
[o.
|
133
|
+
[o.email, qty, o.total]
|
133
134
|
end
|
134
135
|
end
|
135
136
|
|
@@ -139,7 +140,7 @@ class Admin::OverviewController < Admin::BaseController
|
|
139
140
|
orders = User.find(o[0]).orders
|
140
141
|
qty = orders.size
|
141
142
|
|
142
|
-
[orders.first.
|
143
|
+
[orders.first.email, qty, o[1]]
|
143
144
|
|
144
145
|
end
|
145
146
|
|
@@ -97,7 +97,7 @@
|
|
97
97
|
</thead>
|
98
98
|
<% @last_five_orders.each do |order| %>
|
99
99
|
<tr>
|
100
|
-
<td><%= order[0] %></td>
|
100
|
+
<td><%= truncate order[0], :length => 18 %></td>
|
101
101
|
<td class="text-right"><%= order[1] %></td>
|
102
102
|
<td class="text-right"><%= number_to_currency order[2] %></td>
|
103
103
|
</tr>
|
@@ -141,7 +141,7 @@
|
|
141
141
|
<p style="clear:both;"> </p>
|
142
142
|
<% else %>
|
143
143
|
<%= hook :admin_dashboard_welcome do %>
|
144
|
-
<%= t('overview_welcome') %>
|
144
|
+
<%= raw t('overview_welcome') %>
|
145
145
|
<% end %>
|
146
146
|
<% end %>
|
147
147
|
<% end %>
|
@@ -160,12 +160,12 @@
|
|
160
160
|
|
161
161
|
var pie_colors = [<%= raw @pie_colors.map{|c| "'#{c}'"}.join(",") %>];
|
162
162
|
</script>
|
163
|
-
<% end %>
|
164
163
|
|
165
|
-
|
164
|
+
<%= javascript_include_tag 'jqPlot/jquery.jqplot.min.js', 'jqPlot/plugins/jqplot.dateAxisRenderer.min.js', 'jqPlot/plugins/jqplot.highlighter.min.js',
|
166
165
|
'jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js', 'jqPlot/plugins/jqplot.canvasTextRenderer.min.js', 'jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js',
|
167
166
|
'jqPlot/plugins/jqplot.pieRenderer.min.js', 'dashboard.js' %>
|
168
167
|
<!--[if IE]><%= javascript_include_tag 'jqPlot/excanvas.min.js' %><![endif]-->
|
168
|
+
<% end %>
|
169
169
|
<% end %>
|
170
170
|
|
171
171
|
<%= hook :admin_dashboard_stylesheet do %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
namespace :spree_dash do
|
2
|
+
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
|
3
|
+
task :install do
|
4
|
+
Rake::Task['spree_dash:install:migrations'].invoke
|
5
|
+
Rake::Task['spree_dash:install:assets'].invoke
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :install do
|
9
|
+
|
10
|
+
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
11
|
+
task :migrations do
|
12
|
+
# no migrations to migrate
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
|
16
|
+
task :assets do
|
17
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'public')
|
18
|
+
destination = File.join(Rails.root, 'public')
|
19
|
+
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
20
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.highlighter.min.js
RENAMED
File without changes
|
data/{lib/generators/templates/public → public}/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js
RENAMED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_dash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 103
|
5
|
+
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 30
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.30.0.beta1
|
10
|
+
version: 0.30.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Quinn
|
@@ -15,22 +15,23 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09
|
18
|
+
date: 2010-11-09 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: spree_core
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
25
26
|
requirements:
|
26
27
|
- - "="
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 103
|
28
30
|
segments:
|
29
31
|
- 0
|
30
32
|
- 30
|
31
33
|
- 0
|
32
|
-
|
33
|
-
version: 0.30.0.beta1
|
34
|
+
version: 0.30.0
|
34
35
|
type: :runtime
|
35
36
|
version_requirements: *id001
|
36
37
|
description: Required dependancy for Spree
|
@@ -47,19 +48,19 @@ files:
|
|
47
48
|
- app/controllers/admin/overview_controller.rb
|
48
49
|
- app/views/admin/overview/index.html.erb
|
49
50
|
- config/routes.rb
|
50
|
-
- lib/generators/spree_dash/install_generator.rb
|
51
|
-
- lib/generators/templates/public/javascripts/dashboard.js
|
52
|
-
- lib/generators/templates/public/javascripts/jqPlot/excanvas.min.js
|
53
|
-
- lib/generators/templates/public/javascripts/jqPlot/jquery.jqplot.min.js
|
54
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js
|
55
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js
|
56
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js
|
57
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js
|
58
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js
|
59
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js
|
60
|
-
- lib/generators/templates/public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js
|
61
|
-
- lib/generators/templates/public/stylesheets/admin/dashboard.css
|
62
51
|
- lib/spree_dash.rb
|
52
|
+
- lib/tasks/install.rake
|
53
|
+
- public/javascripts/dashboard.js
|
54
|
+
- public/javascripts/jqPlot/excanvas.min.js
|
55
|
+
- public/javascripts/jqPlot/jquery.jqplot.min.js
|
56
|
+
- public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js
|
57
|
+
- public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js
|
58
|
+
- public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js
|
59
|
+
- public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js
|
60
|
+
- public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js
|
61
|
+
- public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js
|
62
|
+
- public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js
|
63
|
+
- public/stylesheets/admin/dashboard.css
|
63
64
|
has_rdoc: true
|
64
65
|
homepage: http://spreecommerce.com
|
65
66
|
licenses: []
|
@@ -70,27 +71,29 @@ rdoc_options: []
|
|
70
71
|
require_paths:
|
71
72
|
- lib
|
72
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
73
75
|
requirements:
|
74
76
|
- - ">="
|
75
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 57
|
76
79
|
segments:
|
77
80
|
- 1
|
78
81
|
- 8
|
79
82
|
- 7
|
80
83
|
version: 1.8.7
|
81
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
82
86
|
requirements:
|
83
|
-
- - "
|
87
|
+
- - ">="
|
84
88
|
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
85
90
|
segments:
|
86
|
-
-
|
87
|
-
|
88
|
-
- 1
|
89
|
-
version: 1.3.1
|
91
|
+
- 0
|
92
|
+
version: "0"
|
90
93
|
requirements:
|
91
94
|
- none
|
92
95
|
rubyforge_project: spree_dash
|
93
|
-
rubygems_version: 1.3.
|
96
|
+
rubygems_version: 1.3.7
|
94
97
|
signing_key:
|
95
98
|
specification_version: 3
|
96
99
|
summary: Overview dashboard for use with Spree.
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module SpreeDash
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
4
|
-
source_root File.expand_path("../../templates", __FILE__)
|
5
|
-
|
6
|
-
desc "Configures an existing Rails application to use spree_dashboard"
|
7
|
-
|
8
|
-
def copy_public
|
9
|
-
directory "public"
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|