spree_events_list 0.50.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/.gitignore +9 -0
- data/LICENSE +23 -0
- data/README.md +10 -0
- data/Rakefile +75 -0
- data/app/controllers/admin/events_controller.rb +20 -0
- data/app/controllers/events_controller.rb +11 -0
- data/app/models/event.rb +12 -0
- data/app/views/admin/events/_form.html.erb +81 -0
- data/app/views/admin/events/edit.html.erb +11 -0
- data/app/views/admin/events/index.html.erb +31 -0
- data/app/views/admin/events/new.html.erb +12 -0
- data/app/views/events/show.html.erb +26 -0
- data/config/locales/en-US.yml +24 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20091226204316_create_events.rb +27 -0
- data/db/migrate/20100103032841_combine_date_and_time_fields.rb +22 -0
- data/db/migrate/20100103051313_change_date_names_once_again.rb +9 -0
- data/db/migrate/20100106094811_add_start_time_to_events.rb +9 -0
- data/lib/spree_events_list.rb +17 -0
- data/lib/spree_events_list_hooks.rb +5 -0
- data/lib/tasks/install.rake +25 -0
- data/lib/tasks/spree_events_list.rake +1 -0
- data/spec/spec_helper.rb +30 -0
- data/spree_events_list.gemspec +20 -0
- metadata +79 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
2
|
+
are permitted provided that the following conditions are met:
|
|
3
|
+
|
|
4
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
5
|
+
this list of conditions and the following disclaimer.
|
|
6
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
7
|
+
this list of conditions and the following disclaimer in the documentation
|
|
8
|
+
and/or other materials provided with the distribution.
|
|
9
|
+
* Neither the name of the Rails Dog LLC nor the names of its
|
|
10
|
+
contributors may be used to endorse or promote products derived from this
|
|
11
|
+
software without specific prior written permission.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
14
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
15
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
16
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
17
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
18
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
19
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
20
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
21
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
22
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
23
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
require 'rake/testtask'
|
|
4
|
+
require 'rake/packagetask'
|
|
5
|
+
require 'rake/gempackagetask'
|
|
6
|
+
|
|
7
|
+
gemfile = File.expand_path('../spec/test_app/Gemfile', __FILE__)
|
|
8
|
+
if File.exists?(gemfile) && (%w(spec cucumber).include?(ARGV.first.to_s) || ARGV.size == 0)
|
|
9
|
+
require 'bundler'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
11
|
+
Bundler.setup
|
|
12
|
+
|
|
13
|
+
require 'rspec'
|
|
14
|
+
require 'rspec/core/rake_task'
|
|
15
|
+
RSpec::Core::RakeTask.new
|
|
16
|
+
|
|
17
|
+
require 'cucumber/rake/task'
|
|
18
|
+
Cucumber::Rake::Task.new do |t|
|
|
19
|
+
t.cucumber_opts = %w{--format progress}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "Default Task"
|
|
24
|
+
task :default => [:spec, :cucumber ]
|
|
25
|
+
|
|
26
|
+
spec = eval(File.read('spree_events_list.gemspec'))
|
|
27
|
+
|
|
28
|
+
Rake::GemPackageTask.new(spec) do |p|
|
|
29
|
+
p.gem_spec = spec
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc "Release to gemcutter"
|
|
33
|
+
task :release => :package do
|
|
34
|
+
require 'rake/gemcutter'
|
|
35
|
+
Rake::Gemcutter::Tasks.new(spec).define
|
|
36
|
+
Rake::Task['gem:push'].invoke
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
desc "Default Task"
|
|
40
|
+
task :default => [ :spec ]
|
|
41
|
+
|
|
42
|
+
desc "Regenerates a rails 3 app for testing"
|
|
43
|
+
task :test_app do
|
|
44
|
+
require '../spree/lib/generators/spree/test_app_generator'
|
|
45
|
+
class SpreeEventsListTestAppGenerator < Spree::Generators::TestAppGenerator
|
|
46
|
+
|
|
47
|
+
def install_gems
|
|
48
|
+
inside "test_app" do
|
|
49
|
+
run 'rake spree_core:install'
|
|
50
|
+
run 'rake spree_events_list:install'
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def migrate_db
|
|
55
|
+
run_migrations
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
protected
|
|
59
|
+
def full_path_for_local_gems
|
|
60
|
+
<<-gems
|
|
61
|
+
gem 'spree_core', :path => \'#{File.join(File.dirname(__FILE__), "../spree/", "core")}\'
|
|
62
|
+
gem 'spree_events_list', :path => \'#{File.dirname(__FILE__)}\'
|
|
63
|
+
gems
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
SpreeEventsListTestAppGenerator.start
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
namespace :test_app do
|
|
71
|
+
desc 'Rebuild test and cucumber databases'
|
|
72
|
+
task :rebuild_dbs do
|
|
73
|
+
system("cd spec/test_app && rake db:drop db:migrate RAILS_ENV=test && rake db:drop db:migrate RAILS_ENV=cucumber")
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
class Admin::EventsController < Admin::BaseController
|
|
2
|
+
resource_controller
|
|
3
|
+
|
|
4
|
+
update.response do |wants|
|
|
5
|
+
wants.html { redirect_to edit_admin_event_url(Event.find(@event.id)) }
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
update.after do
|
|
9
|
+
Rails.cache.delete('events')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
create.response do |wants|
|
|
13
|
+
wants.html { redirect_to collection_url }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
create.after do
|
|
17
|
+
Rails.cache.delete('events')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
class EventsController < Spree::BaseController
|
|
2
|
+
def index
|
|
3
|
+
@events = Event.find_visible_by_date(Spree::Config[:events_days_before], Spree::Config[:events_days_after])
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def show
|
|
7
|
+
@event = Event.find(params[:id])
|
|
8
|
+
render :template => 'events/show', :layout => 'plain'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
end
|
data/app/models/event.rb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class Event < ActiveRecord::Base
|
|
2
|
+
has_attached_file :image,
|
|
3
|
+
:styles => { :large => "800x800>",
|
|
4
|
+
:medium => "400x400>",
|
|
5
|
+
:thumb => "100x100>" }
|
|
6
|
+
validates_presence_of :begin_event, :end_event
|
|
7
|
+
|
|
8
|
+
# visible events that start within 'to' days of today, or ended less than 'from' days ago.
|
|
9
|
+
def Event.find_visible_by_date(to, from)
|
|
10
|
+
Event.find_all_by_visible(true, :conditions => ["begin_event > ? or end_event > ?", DateTime.now + to.to_i.days, DateTime.now - from.to_i.days])
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<% content_for :head do %>
|
|
2
|
+
|
|
3
|
+
<%= javascript_include_tag 'jquery/jquery.js' %>
|
|
4
|
+
<%= javascript_include_tag 'wymeditor/jquery.wymeditor.js' %>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
|
8
|
+
|
|
9
|
+
var $j = jQuery.noConflict();
|
|
10
|
+
$j(function() {
|
|
11
|
+
$j('.wymeditor').wymeditor({
|
|
12
|
+
xhtmlParser: 'xhtml_parser.js',
|
|
13
|
+
cssParser: 'wym_css_parser.js',
|
|
14
|
+
stylesheet: '/stylesheets/wymeditor.css?v='+Math.random(),
|
|
15
|
+
containersItems: [
|
|
16
|
+
{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'},
|
|
17
|
+
{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'},
|
|
18
|
+
{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'},
|
|
19
|
+
{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'},
|
|
20
|
+
{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'},
|
|
21
|
+
{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'},
|
|
22
|
+
],
|
|
23
|
+
lang: '<%= I18n.locale.to_s.split("-").first %>'
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
</script>
|
|
28
|
+
<% end %>
|
|
29
|
+
|
|
30
|
+
<table class="admin-report" width="545">
|
|
31
|
+
<tr>
|
|
32
|
+
<td valign="top"><%=t('title')%></td>
|
|
33
|
+
<td><%= f.text_field :title, {"style" => "width:500px;"} %></td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td valign="top"><%=t('venue')%></td>
|
|
37
|
+
<td><%= f.text_field :venue, {"style" => "width:500px;"} %></td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td valign="top"><%=t('sponsor')%></td>
|
|
41
|
+
<td><%= f.text_field :sponsor, {"style" => "width:500px;"} %></td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td valign="top"><%=t('begin')%></td>
|
|
45
|
+
<td><%= f.date_select :begin_event %></td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td valign="top"><%=t('end')%></td>
|
|
49
|
+
<td><%= f.date_select :end_event %></td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td valign="top"><%=t('start_time')%></td>
|
|
53
|
+
<td><%= f.text_field :start_time, {"style" => "width: 500px;"} %></td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td valign="top"><%=t('further_information')%><br />
|
|
57
|
+
<span class="small_help"><%=t('further_information_desc')%></span>
|
|
58
|
+
</td>
|
|
59
|
+
<td><%= f.text_field :further_information, {"style" => "width:500px;"} %><br/>
|
|
60
|
+
<span class="small_help">Example: <%=t('further_information_example')%></span>
|
|
61
|
+
</td>
|
|
62
|
+
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td valign="top"><%=t('summary')%></td>
|
|
65
|
+
<td><%= f.text_area :summary, {"style" => "width:500px; height:200px;", "class"=> "wymeditor"} %></td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td valign="top"><%=t("full_description")%>:</td>
|
|
69
|
+
<td><%= f.text_area :full_description, {"style" => "width:500px; height:500px;", "class"=> "wymeditor"} %></td>
|
|
70
|
+
</tr>
|
|
71
|
+
<tr>
|
|
72
|
+
<td valign="top"><%=t('visible')%><br />
|
|
73
|
+
<span class="small_help"><%=t('visible_desc')%></span>
|
|
74
|
+
</td>
|
|
75
|
+
<td><%= f.check_box :visible %></td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td valign="top"><%=t('image')%></td>
|
|
79
|
+
<td><%= image_tag(@event.image.url(:thumb)) + "<br/>" if not @event.image.size.nil? %><%= f.file_field :image, {"style" => "width:500px;"} %></td>
|
|
80
|
+
</tr>
|
|
81
|
+
</table>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<%= render :partial => 'admin/shared/configuration_menu' %>
|
|
2
|
+
|
|
3
|
+
<h1><%= t("editing_event") %></h1>
|
|
4
|
+
<%= error_messages_for :event %>
|
|
5
|
+
|
|
6
|
+
<%= form_for(:event, :url => object_url, :html => { :multipart => true, :method => :put }) do |f| -%>
|
|
7
|
+
<%= render :partial => "form", :locals => { :f => f } %>
|
|
8
|
+
<p>
|
|
9
|
+
<%=submit_tag t("update"), {"class" => "wymupdate"}%> or <%= link_to t("cancel"), admin_events_path%>
|
|
10
|
+
</p>
|
|
11
|
+
<% end %>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<%= render :partial => 'admin/shared/configuration_menu' %>
|
|
2
|
+
|
|
3
|
+
<h1><%=t("events") %></h1>
|
|
4
|
+
|
|
5
|
+
<h2><%=t("all_events") %></h2>
|
|
6
|
+
<table class="admin-report" width="545">
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th><%=t("begin")%> - <%=t("end")%></th>
|
|
10
|
+
<th><%=t("title")%></th>
|
|
11
|
+
<th><%=t("action")%></th>
|
|
12
|
+
</tr>
|
|
13
|
+
</thead>
|
|
14
|
+
|
|
15
|
+
<tbody>
|
|
16
|
+
<% @events.each do |event| %>
|
|
17
|
+
<tr class="<%= cycle('even', 'odd') %>">
|
|
18
|
+
<td>
|
|
19
|
+
<%= event.begin_event.strftime("%b %d, %Y %I:%M%p") %> - <%= event.end_event.strftime("%b %d, %Y %I:%M%p")%>
|
|
20
|
+
</td>
|
|
21
|
+
<td><%= event.title %></td>
|
|
22
|
+
<td>
|
|
23
|
+
<%=link_to t("edit"), edit_object_url(event), :id => "edit_#{event.id}" %> |
|
|
24
|
+
<%=link_to t("delete"), object_url(event), :method => :delete, :id => "delete_#{event.id}" %>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
<% end %>
|
|
28
|
+
</tbody>
|
|
29
|
+
</table>
|
|
30
|
+
|
|
31
|
+
<%= link_to t("new_event"), new_object_url, :id => "new_event" %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%= render :partial => 'admin/shared/configuration_menu' %>
|
|
2
|
+
|
|
3
|
+
<h1><%= t("new_event") %></h1>
|
|
4
|
+
|
|
5
|
+
<%= error_messages_for :event %>
|
|
6
|
+
|
|
7
|
+
<% form_for(:event, :url => collection_url, :html => { :multipart => true }) do |f| %>
|
|
8
|
+
<%= render :partial => "form", :locals => { :f => f } %>
|
|
9
|
+
<p>
|
|
10
|
+
<%= submit_tag t("create"), {"class" => "wymupdate"}%> or <%= link_to t("cancel"), admin_events_path%>
|
|
11
|
+
</p>
|
|
12
|
+
<% end %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<h1><%= raw @event.title %></h1>
|
|
2
|
+
<div style="width: 50%;float: left;">
|
|
3
|
+
<div><strong>Start Date:</strong> <%= Date.parse(@event.begin_event.to_s).to_s %></div>
|
|
4
|
+
<div><strong> End Date:</strong> <%= Date.parse(@event.end_event.to_s).to_s %></div>
|
|
5
|
+
</div>
|
|
6
|
+
<div style="width: 50%;float: left;">
|
|
7
|
+
<%= if not @event.start_time.nil? -%>
|
|
8
|
+
<div><strong>Start Time:</strong> <%= @event.start_time %></div>
|
|
9
|
+
<% end -%>
|
|
10
|
+
<div><strong>Venue:</strong> <%= raw @event.venue %></div>
|
|
11
|
+
<div><strong>Sponsor:</strong> <%= raw @event.sponsor %></div>
|
|
12
|
+
</div>
|
|
13
|
+
<%= if (@event.respond_to?(:image)) and (@event.image.respond_to?(:url))-%>
|
|
14
|
+
<div style="text-align: center;">
|
|
15
|
+
<%= image_tag @event.image.url(:large) %>
|
|
16
|
+
</div>
|
|
17
|
+
<% end -%>
|
|
18
|
+
<div style="clear: both; width: 75%;" class="event_summary">
|
|
19
|
+
<%= raw(@event.summary) %>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="event_description">
|
|
22
|
+
<%= raw(@event.full_description) %>
|
|
23
|
+
</div>
|
|
24
|
+
<%= if not @event.further_information == "" and not @event.further_information == nil -%>
|
|
25
|
+
<div><%= link_to "Further Information", @event.further_information %></div>
|
|
26
|
+
<% end -%>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
en:
|
|
3
|
+
events: "Events"
|
|
4
|
+
all_events: "All Events"
|
|
5
|
+
events_desc: "Manage events"
|
|
6
|
+
new_event: "New Event"
|
|
7
|
+
editing_event: "Editing Event"
|
|
8
|
+
visible: "Visible"
|
|
9
|
+
visible_desc: "Checking this box will make the event show up on the site."
|
|
10
|
+
title: "Title"
|
|
11
|
+
venue: "Venue"
|
|
12
|
+
sponsor: "Sponsor"
|
|
13
|
+
further_information: "Further Information"
|
|
14
|
+
further_information_desc: "Place a <acronym title=\"Uniform Resource Locator\">URL</acronym>here. (optional, best for linking to other sites)"
|
|
15
|
+
further_information_example: "http://www.example.com/cool-event"
|
|
16
|
+
summary: "Summary"
|
|
17
|
+
full_description: "Full Description"
|
|
18
|
+
image: "Image"
|
|
19
|
+
begin: "Begin"
|
|
20
|
+
end: "End"
|
|
21
|
+
days_before: "Days Before"
|
|
22
|
+
days_after: "Days After"
|
|
23
|
+
global_settings: "Global Settings"
|
|
24
|
+
start_time: "Start Time"
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class CreateEvents < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :events do |t|
|
|
4
|
+
t.date :start_date
|
|
5
|
+
t.date :end_date
|
|
6
|
+
t.time :start_time
|
|
7
|
+
t.time :end_time
|
|
8
|
+
t.string :title
|
|
9
|
+
t.text :venue
|
|
10
|
+
t.string :sponsor
|
|
11
|
+
t.string :further_information
|
|
12
|
+
t.text :summary
|
|
13
|
+
t.text :full_description
|
|
14
|
+
t.boolean :visible
|
|
15
|
+
t.string :image_file_name
|
|
16
|
+
t.string :image_content_type
|
|
17
|
+
t.integer :image_file_size
|
|
18
|
+
t.datetime :image_updated_at
|
|
19
|
+
|
|
20
|
+
t.timestamps
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.down
|
|
25
|
+
drop_table :events
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class CombineDateAndTimeFields < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
add_column :events, :begin, :datetime
|
|
4
|
+
add_column :events, :end, :datetime
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Event.find(:all).each do |c|
|
|
8
|
+
c.begin = DateTime.parse( c.start_date.to_s + ' ' + c.start_time.to_s)
|
|
9
|
+
c.end = DateTime.parse(c.end_date.to_s + ' ' + c.end_time.to_s)
|
|
10
|
+
c.save
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
remove_column :events, :start_date
|
|
14
|
+
remove_column :events, :end_date
|
|
15
|
+
remove_column :events, :start_time
|
|
16
|
+
remove_column :events, :end_time
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.down
|
|
20
|
+
raise ActiveRecord::IrreversibleMigration
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'spree_core'
|
|
2
|
+
require 'spree_events_list_hooks'
|
|
3
|
+
|
|
4
|
+
module SpreeEventsList
|
|
5
|
+
class Engine < Rails::Engine
|
|
6
|
+
|
|
7
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
|
8
|
+
|
|
9
|
+
def self.activate
|
|
10
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
|
11
|
+
Rails.env.production? ? require(c) : load(c)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
config.to_prepare &method(:activate).to_proc
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
namespace :spree_events_list 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_events_list:install:migrations'].invoke
|
|
5
|
+
Rake::Task['spree_events_list:install:assets'].invoke
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
namespace :install do
|
|
9
|
+
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
|
10
|
+
task :migrations do
|
|
11
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
|
|
12
|
+
destination = File.join(Rails.root, 'db')
|
|
13
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
|
|
17
|
+
task :assets do
|
|
18
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'public')
|
|
19
|
+
destination = File.join(Rails.root, 'public')
|
|
20
|
+
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
|
21
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# add custom rake tasks here
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
|
2
|
+
# from the project root directory.
|
|
3
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
4
|
+
require File.expand_path("../test_app/config/environment", __FILE__)
|
|
5
|
+
require 'rspec/rails'
|
|
6
|
+
|
|
7
|
+
# Requires supporting files with custom matchers and macros, etc,
|
|
8
|
+
# in ./support/ and its subdirectories.
|
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
10
|
+
|
|
11
|
+
RSpec.configure do |config|
|
|
12
|
+
# == Mock Framework
|
|
13
|
+
#
|
|
14
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
|
15
|
+
#
|
|
16
|
+
# config.mock_with :mocha
|
|
17
|
+
# config.mock_with :flexmock
|
|
18
|
+
# config.mock_with :rr
|
|
19
|
+
config.mock_with :rspec
|
|
20
|
+
|
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
22
|
+
|
|
23
|
+
#config.include Devise::TestHelpers, :type => :controller
|
|
24
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
25
|
+
# examples within a transaction, comment the following line or assign false
|
|
26
|
+
# instead of true.
|
|
27
|
+
config.use_transactional_fixtures = true
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
@configuration ||= AppConfiguration.find_or_create_by_name("Default configuration")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.platform = Gem::Platform::RUBY
|
|
3
|
+
s.name = 'spree_events_list'
|
|
4
|
+
s.version = '0.50.0'
|
|
5
|
+
s.summary = 'Administrable list of events'
|
|
6
|
+
s.description = ''
|
|
7
|
+
|
|
8
|
+
s.author = 'Christopher Maujean'
|
|
9
|
+
s.email = 'cmaujean@gmail.com'
|
|
10
|
+
|
|
11
|
+
# s.rubyforge_project = 'actionmailer'
|
|
12
|
+
|
|
13
|
+
s.files = `git ls-files`.split("\n")
|
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
15
|
+
s.require_path = 'lib'
|
|
16
|
+
s.requirements << 'none'
|
|
17
|
+
|
|
18
|
+
s.has_rdoc = true
|
|
19
|
+
|
|
20
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: spree_events_list
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
prerelease:
|
|
5
|
+
version: 0.50.0
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Christopher Maujean
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
|
|
13
|
+
date: 2011-06-11 00:00:00 -07:00
|
|
14
|
+
default_executable:
|
|
15
|
+
dependencies: []
|
|
16
|
+
|
|
17
|
+
description: ""
|
|
18
|
+
email: cmaujean@gmail.com
|
|
19
|
+
executables: []
|
|
20
|
+
|
|
21
|
+
extensions: []
|
|
22
|
+
|
|
23
|
+
extra_rdoc_files: []
|
|
24
|
+
|
|
25
|
+
files:
|
|
26
|
+
- .gitignore
|
|
27
|
+
- LICENSE
|
|
28
|
+
- README.md
|
|
29
|
+
- Rakefile
|
|
30
|
+
- app/controllers/admin/events_controller.rb
|
|
31
|
+
- app/controllers/events_controller.rb
|
|
32
|
+
- app/models/event.rb
|
|
33
|
+
- app/views/admin/events/_form.html.erb
|
|
34
|
+
- app/views/admin/events/edit.html.erb
|
|
35
|
+
- app/views/admin/events/index.html.erb
|
|
36
|
+
- app/views/admin/events/new.html.erb
|
|
37
|
+
- app/views/events/show.html.erb
|
|
38
|
+
- config/locales/en-US.yml
|
|
39
|
+
- config/routes.rb
|
|
40
|
+
- db/migrate/20091226204316_create_events.rb
|
|
41
|
+
- db/migrate/20100103032841_combine_date_and_time_fields.rb
|
|
42
|
+
- db/migrate/20100103051313_change_date_names_once_again.rb
|
|
43
|
+
- db/migrate/20100106094811_add_start_time_to_events.rb
|
|
44
|
+
- lib/spree_events_list.rb
|
|
45
|
+
- lib/spree_events_list_hooks.rb
|
|
46
|
+
- lib/tasks/install.rake
|
|
47
|
+
- lib/tasks/spree_events_list.rake
|
|
48
|
+
- spec/spec_helper.rb
|
|
49
|
+
- spree_events_list.gemspec
|
|
50
|
+
has_rdoc: true
|
|
51
|
+
homepage:
|
|
52
|
+
licenses: []
|
|
53
|
+
|
|
54
|
+
post_install_message:
|
|
55
|
+
rdoc_options: []
|
|
56
|
+
|
|
57
|
+
require_paths:
|
|
58
|
+
- lib
|
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
|
+
none: false
|
|
61
|
+
requirements:
|
|
62
|
+
- - ">="
|
|
63
|
+
- !ruby/object:Gem::Version
|
|
64
|
+
version: "0"
|
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
|
+
none: false
|
|
67
|
+
requirements:
|
|
68
|
+
- - ">="
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: "0"
|
|
71
|
+
requirements:
|
|
72
|
+
- none
|
|
73
|
+
rubyforge_project:
|
|
74
|
+
rubygems_version: 1.6.2
|
|
75
|
+
signing_key:
|
|
76
|
+
specification_version: 3
|
|
77
|
+
summary: Administrable list of events
|
|
78
|
+
test_files:
|
|
79
|
+
- spec/spec_helper.rb
|