refinerycms-calendar 1.1.0 → 2.0.0.alpha

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.
Files changed (83) hide show
  1. data/app/controllers/refinery/calendar/admin/events_controller.rb +43 -0
  2. data/app/controllers/refinery/calendar/events_controller.rb +34 -0
  3. data/app/models/refinery/calendar/core_calendar.rb +36 -0
  4. data/app/models/refinery/calendar/event.rb +51 -0
  5. data/app/views/refinery/calendar/admin/events/_actions.html.erb +25 -0
  6. data/app/views/refinery/calendar/admin/events/_event.html.erb +10 -0
  7. data/app/views/refinery/calendar/admin/events/_events.html.erb +2 -0
  8. data/app/views/refinery/calendar/admin/events/_form.html.erb +31 -0
  9. data/app/views/refinery/calendar/admin/events/_records.html.erb +18 -0
  10. data/app/views/refinery/calendar/admin/events/_sortable_list.html.erb +5 -0
  11. data/app/views/refinery/calendar/admin/events/edit.html.erb +1 -0
  12. data/app/views/refinery/calendar/admin/events/index.html.erb +8 -0
  13. data/app/views/refinery/calendar/admin/events/new.html.erb +1 -0
  14. data/app/views/refinery/calendar/events/index.html.erb +11 -0
  15. data/app/views/refinery/calendar/events/show.html.erb +27 -0
  16. data/config/locales/en.yml +25 -43
  17. data/config/locales/es.yml +28 -0
  18. data/config/locales/fr.yml +25 -43
  19. data/config/locales/nb.yml +25 -18
  20. data/config/locales/nl.yml +25 -18
  21. data/config/routes.rb +12 -10
  22. data/db/seeds.rb +23 -0
  23. data/lib/generators/refinery/calendar_generator.rb +29 -0
  24. data/lib/refinery/calendar.rb +28 -0
  25. data/lib/refinery/calendar/configuration.rb +7 -0
  26. data/lib/refinery/calendar/engine.rb +26 -0
  27. data/lib/refinery/calendar/version.rb +17 -0
  28. data/lib/refinery/engine/multi_parameter_assignment.rb +6 -0
  29. data/lib/refinerycms-calendar.rb +1 -24
  30. data/lib/tasks/{events.rake → refinery/calendar.rake} +6 -6
  31. data/readme.md +8 -40
  32. metadata +56 -96
  33. data/app/controllers/admin/event_categories_controller.rb +0 -9
  34. data/app/controllers/admin/events_controller.rb +0 -26
  35. data/app/controllers/event_categories_controller.rb +0 -15
  36. data/app/controllers/events_controller.rb +0 -65
  37. data/app/helpers/event_categories_helper.rb +0 -3
  38. data/app/helpers/events_helper.rb +0 -44
  39. data/app/models/event.rb +0 -86
  40. data/app/models/event_categorization.rb +0 -4
  41. data/app/models/event_category.rb +0 -10
  42. data/app/views/admin/event_categories/_event_categories.html.erb +0 -1
  43. data/app/views/admin/event_categories/_event_category.html.erb +0 -18
  44. data/app/views/admin/event_categories/_form.html.erb +0 -26
  45. data/app/views/admin/event_categories/_sortable_list.html.erb +0 -3
  46. data/app/views/admin/event_categories/edit.html.erb +0 -1
  47. data/app/views/admin/event_categories/index.html.erb +0 -40
  48. data/app/views/admin/event_categories/new.html.erb +0 -1
  49. data/app/views/admin/events/_event.html.erb +0 -18
  50. data/app/views/admin/events/_events.html.erb +0 -1
  51. data/app/views/admin/events/_form.html.erb +0 -126
  52. data/app/views/admin/events/_sortable_list.html.erb +0 -20
  53. data/app/views/admin/events/edit.html.erb +0 -1
  54. data/app/views/admin/events/index.html.erb +0 -41
  55. data/app/views/admin/events/new.html.erb +0 -1
  56. data/app/views/event_categories/show.html.erb +0 -15
  57. data/app/views/events/_event.html.erb +0 -111
  58. data/app/views/events/_sidebar.html.erb +0 -38
  59. data/app/views/events/archive.html.erb +0 -17
  60. data/app/views/events/index.html.erb +0 -17
  61. data/app/views/events/index.rss.builder +0 -24
  62. data/app/views/events/show.html.erb +0 -15
  63. data/app/views/events/show.ics.erb +0 -16
  64. data/changelog.md +0 -35
  65. data/config/locales/lolcat.yml +0 -24
  66. data/db/migrate/01_create_events.rb +0 -33
  67. data/db/migrate/02_create_event_categories.rb +0 -13
  68. data/db/migrate/03_create_event_categorizations.rb +0 -17
  69. data/db/migrate/04_add_cached_slugs.rb +0 -11
  70. data/db/seeds/events.rb +0 -17
  71. data/features/manage_events.feature +0 -54
  72. data/features/step_definitions/event_steps.rb +0 -14
  73. data/features/support/factories/event_categories.rb +0 -3
  74. data/features/support/factories/events.rb +0 -6
  75. data/features/support/paths.rb +0 -17
  76. data/lib/generators/refinerycms_calendar_generator.rb +0 -6
  77. data/public/stylesheets/refinerycms-events.css +0 -73
  78. data/refinerycms-calendar-1.0.4.gem +0 -0
  79. data/refinerycms-calendar.gemspec +0 -17
  80. data/spec/controllers/events_controller_spec.rb +0 -14
  81. data/spec/helpers/events_helper_spec.rb +0 -16
  82. data/spec/models/event_category_spec.rb +0 -29
  83. data/spec/models/event_spec.rb +0 -77
@@ -1,20 +0,0 @@
1
- <% if @current.any? -%>
2
- <h2><%= t('.current_events') %></h2>
3
- <ul id='sortable_list'>
4
- <%= render :partial => 'event', :collection => @current %>
5
- </ul>
6
- <% end -%>
7
-
8
- <% if @upcoming.any? -%>
9
- <h2><%= t('.upcoming_events') %></h2>
10
- <ul id='sortable_list'>
11
- <%= render :partial => 'event', :collection => @upcoming %>
12
- </ul>
13
- <% end -%>
14
-
15
- <% if @archived.any? -%>
16
- <h2><%= t('.archived_events') %></h2>
17
- <ul id='sortable_list'>
18
- <%= render :partial => 'event', :collection => @archived %>
19
- </ul>
20
- <% end -%>
@@ -1 +0,0 @@
1
- <%= render :partial => "form" %>
@@ -1,41 +0,0 @@
1
- <div id='records'>
2
- <% if searching? %>
3
- <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
4
- <% end %>
5
- <% if @events.any? %>
6
- <div class='pagination_container'>
7
- <%= render :partial => 'events' %>
8
- </div>
9
- <% else %>
10
- <p>
11
- <% unless searching? %>
12
- <strong>
13
- <%= t('.no_items_yet') %>
14
- </strong>
15
- <% else %>
16
- <%= t('no_results', :scope => 'shared.admin.search') %>
17
- <% end %>
18
- </p>
19
- <% end %>
20
- </div>
21
- <div id='actions'>
22
- <ul>
23
- <% if Admin::EventsController.searchable? %>
24
- <li>
25
- <%= render :partial => "/shared/admin/search",
26
- :locals => {
27
- :url => admin_events_url
28
- } %>
29
- </li>
30
- <% end %>
31
- <li>
32
- <%= link_to t('.create_new'), new_admin_event_url,
33
- :class => "add_icon" %>
34
- </li>
35
-
36
- <li>
37
- <%= link_to t('.manage_categories'), admin_event_categories_url,
38
- :class => "edit_icon" %>
39
- </li>
40
- </ul>
41
- </div>
@@ -1 +0,0 @@
1
- <%= render :partial => "form" %>
@@ -1,15 +0,0 @@
1
- <% content_for :body_content_title do -%>
2
- <%= "#{@event_category.name} Category" %>
3
- <% end -%>
4
-
5
- <% content_for :body_content_left do %>
6
- <div id="events">
7
- <%= render :partial => 'events/event', :collection => @event_category.events, :locals => { :category => true } %>
8
- </div><!-- #events -->
9
- <% end %>
10
-
11
- <%= render 'events/sidebar' %>
12
-
13
- <%= render :partial => "/shared/content_page" %>
14
-
15
- <% content_for :stylesheets, stylesheet_link_tag('refinerycms-events') %>
@@ -1,111 +0,0 @@
1
- <%
2
- featured ||= false
3
- individual ||= false
4
- archive ||= false
5
- category ||= false
6
- -%>
7
-
8
- <%= div_for event, :class => 'individual_event' do -%>
9
-
10
- <section class="event_image">
11
- <%= image_fu event.image, "150x150#c" %>
12
- </section>
13
-
14
- <% unless individual -%>
15
- <h1><%= link_to event.title, event %></h1>
16
- <% end -%>
17
-
18
- <section class="start_end">
19
- <p>Starts:<br/>
20
- <%= event.start_at.strftime('%b %e, %Y %l:%M %p') %></p>
21
- <p>Ends:<br/>
22
- <%= event.end_at.strftime('%b %e, %Y %l:%M %p') %></p>
23
- </section><!-- .start_end -->
24
-
25
- <section class="venue">
26
- <p>Location:<br/>
27
- <%= event.venue_name %></p>
28
- </section>
29
-
30
-
31
-
32
- <% if event.venue_address.present? -%>
33
- <section class="address">
34
- <p>Address:<br/>
35
- <%= event.venue_address %>
36
- </p>
37
- </section>
38
-
39
- <section id="event_map">
40
- <iframe width="400" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=<%= CGI::escape(event.venue_address) %>&amp;z=14&amp;output=embed"></iframe>
41
- </section><!-- #event_map -->
42
- <% end -%>
43
-
44
- <% unless archive -%>
45
- <% unless event.ticket_price.blank? -%>
46
- <section class="price">
47
- <p>Ticket Price:<br/>
48
- <%=number_to_currency event.ticket_price %>
49
- </p>
50
- </section>
51
- <% end -%>
52
- <% unless event.ticket_link.blank? -%>
53
- <section class="ticket">
54
- <p>Ticket Link:<br/>
55
- <%=auto_link event.ticket_link %>
56
- </p>
57
- </section>
58
- <% end -%>
59
- <% end -%>
60
-
61
- <section>
62
- <% if individual -%>
63
- <%=raw event.description %>
64
- <% else -%>
65
- <%= simple_format(truncate strip_tags(event.description), :length => 200) %>
66
- <% end -%>
67
- </section>
68
-
69
-
70
-
71
- <% if individual -%>
72
- <section id="share_this_event">
73
- <ul>
74
- <li class="facebook"><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<%= request.url %>" layout="box_count" show_faces="false" width="55" font=""></fb:like></li>
75
- <li class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li>
76
- </ul>
77
- </section>
78
-
79
- <nav id="prevnext_nav">
80
- <% if event.prev.present? -%>
81
- <%= link_to event_path(event.prev), :class => "prev button" do -%>
82
- <h3>Previous</h3>
83
- <h4><%=truncate event.prev.title, :length => 38 %></h4>
84
- <% end -%>
85
- <% else -%>
86
- <span class="prev disabled">
87
- <h3>Previous</h3>
88
- <h4>&nbsp;</h4>
89
- </span>
90
- <% end -%>
91
-
92
- <%= link_to events_path, :class => "home button" do -%>
93
- <h3>Events</h3>
94
- <h4>Home</h4>
95
- <% end -%>
96
-
97
- <% if event.next.present? -%>
98
- <%= link_to event_path(event.next), :class => "next button" do -%>
99
- <h3>Next</h3>
100
- <h4><%=truncate event.next.title, :length => 38 %></h4>
101
- <% end -%>
102
- <% else -%>
103
- <span class="next disabled">
104
- <h3>Next</h3>
105
- <h4>&nbsp;</h4>
106
- </span>
107
- <% end -%>
108
- </nav><!--#event_nav-->
109
- <% end -%>
110
-
111
- <% end -%>
@@ -1,38 +0,0 @@
1
- <% content_for :meta, "
2
- <link
3
- rel='alternate'
4
- type='application/rss+xml'
5
- title='#{RefinerySetting.find_or_set(:site_name, 'Company Name')} Events'
6
- href='#{events_url(:format => :rss)}' />".html_safe -%>
7
- <% content_for :body_content_right do %>
8
- <aside class="sidebar_module rss">
9
- <h2>RSS</h2>
10
- <%= link_to "Subscribe", events_path(:format => :rss) %>
11
- </aside><!-- .rss -->
12
-
13
- <aside class="sidebar_module categories">
14
- <h2>Categories</h2>
15
- <% @event_categories.each do |category| -%>
16
- <%= link_to category.name, category_events_path(category) %>
17
- <% end -%>
18
- </aside><!-- .categories -->
19
-
20
- <% unless controller.action_name == "index" or controller.action_name == "archive" -%>
21
- <aside class="sidebar_module other_events">
22
- <h2><%= t('.other') %></h2>
23
- <ul id="events">
24
- <% @other_events.each do |event| %>
25
- <li>
26
- <%= link_to event.title, event_url(event) %>
27
- </li>
28
- <% end %>
29
- </ul>
30
- </aside><!-- .other_events -->
31
- <% end -%>
32
-
33
- <aside class="sidebar_module archives">
34
- <h2>Archives</h2>
35
- <%= events_archive_list %>
36
- </aside><!-- .archives -->
37
-
38
- <% end %>
@@ -1,17 +0,0 @@
1
- <% content_for :body_content_title do -%>
2
- <% date_format = params[:month].present? ? '%B %Y' : '%Y' -%>
3
- <%= "Events posted in #{@archive_date.strftime(date_format)}" %>
4
- <% end -%>
5
-
6
- <% content_for :body_content_left do %>
7
- <div id="events">
8
- <%= render :partial => 'event', :collection => @events, :locals => { :archive => true } %>
9
- </div>
10
- <%= will_paginate @events %>
11
- <% end %>
12
-
13
- <%= render 'events/sidebar' %>
14
-
15
- <%= render :partial => "/shared/content_page" %>
16
-
17
- <% content_for :stylesheets, stylesheet_link_tag('refinerycms-events') %>
@@ -1,17 +0,0 @@
1
- <% content_for :body_content_left do %>
2
- <div id="featured_events" class="events">
3
- <h2>Featured Events</h2>
4
- <%= render :partial => 'event', :collection => @featured_events, :locals => { :featured => true } %>
5
- </div>
6
-
7
- <div id="all_events" class="events">
8
- <h2>All Events</h2>
9
- <%= render :partial => 'event', :collection => @events %>
10
- </div>
11
- <% end %>
12
-
13
- <%= render 'events/sidebar' %>
14
-
15
- <%= render :partial => "/shared/content_page" %>
16
-
17
- <% content_for :stylesheets, stylesheet_link_tag('refinerycms-events') %>
@@ -1,24 +0,0 @@
1
- xml.instruct! :xml, :version => "1.0"
2
- xml.rss :version => "2.0" do
3
- xml.channel do
4
- xml.title RefinerySetting.find_or_set(:site_name, "Pastoral Artisan Cheese, Bread & Wine")
5
- xml.description RefinerySetting.find_or_set(:site_name, "Pastoral Artisan Cheese, Bread & Wine") + " Events"
6
- xml.link events_url
7
-
8
- (@featured_events | @events).each do |event|
9
- xml.item do
10
- xml.title "Featured: #{event.title}"
11
- xml.description simple_format(strip_tags event.description)
12
-
13
- xml.start_at event.start_at.to_s(:rfc822)
14
- xml.end_at event.end_at.to_s(:rfc822)
15
-
16
- xml.ticket_price number_to_currency(event.ticket_price) unless event.ticket_price.blank?
17
- xml.ticket_link event.ticket_link unless event.ticket_link.blank?
18
-
19
- xml.link event_url(event)
20
- xml.pubDate event.created_at.to_s(:rfc822)
21
- end
22
- end
23
- end
24
- end
@@ -1,15 +0,0 @@
1
- <% content_for :body_content_title do %>
2
- <%= @event.title %>
3
- <% end %>
4
-
5
- <% content_for :body_content_left do %>
6
- <div id="event">
7
- <%= render :partial => 'event', :locals => { :event => @event, :individual => true } %>
8
- </div>
9
- <% end %>
10
-
11
- <%= render 'events/sidebar' %>
12
-
13
- <%= render :partial => "/shared/content_page" %>
14
-
15
- <% content_for :stylesheets, stylesheet_link_tag('refinerycms-events') %>
@@ -1,16 +0,0 @@
1
- BEGIN:VCALENDAR
2
- VERSION:2.0
3
- PRODID:-//iCalendar export//EN
4
- BEGIN:VEVENT
5
- UID:<%= @event.id %>@<%= request.host %>
6
- SUMMARY:<%= @event.title %>
7
- DESCRIPTION:<%= truncate(strip_tags(@event.description.gsub(/\n/," ").gsub(/\r/," ")), :length => 200) %>
8
- LOCATION:<%= @event.venue_address %>
9
- URL:<%= custom_url_for @event %>
10
- STATUS:CONFIRMED
11
- CLASS:PUBLIC
12
- DTSTART:<%= @event.start_at.strftime('%Y%m%dT%H%M%S') %>
13
- DTEND:<%= @event.end_at.strftime('%Y%m%dT%H%M%S') %>
14
- DTSTAMP:<%= @event.start_at.strftime('%Y%m%dT%H%M%S') %>
15
- END:VEVENT
16
- END:VCALENDAR
@@ -1,35 +0,0 @@
1
- ## 1.2 [UNRELEASED]
2
-
3
- ## 1.1 [07 July 2011]
4
- * No more unique titles [joemsak](https://github.com/joemsak)
5
- * Cached slugs for performance boost [joemsak](https://github.com/joemsak)
6
- * Controller & view template refactoring [joemsak](https://github.com/joemsak)
7
- * Easy multi-day or single-day detection for date formatting [mdoel](https://github.com/mdoel)
8
- * iCal (ics) export [joemsak](https://github.com/joemsak)
9
- * Google map of venue address [joemsak](https://github.com/joemsak)
10
-
11
- ## 1.0.4 [02 June 2011]
12
- * Archive listing should be reversed
13
-
14
-
15
- ## 1.0 [13 March 2011]
16
-
17
- * Venue Details
18
- * Ticket Pricing & Link
19
- * Feature-ability
20
- * Image attachment
21
- * Ticket price requires a number
22
- * Datetime select defaults noon to 1pm
23
- * Scopes: featured, not_featured, upcoming & current
24
- * Friendly ID based on titles
25
- * Archiving
26
- * Admin screen separates events by their status (TODO: pagination somehow)
27
- * Reasonable validations
28
- * Practical instance methods to check against scopes
29
- * Next & previous navigation on individual event pages.
30
- * has_many :categories, :through => :categorizations, :source => :event_category
31
- * RSS feed of current, upcoming & featured events
32
- * RSS in sidebar && autodiscovery
33
- * Basic layout and styling to get started immediately [blake0102](http://github.com/blake0102)
34
- * Easily hook onto a few semantic CSS classes built into the markup [blake0102](http://github.com/blake0102)
35
- * Basic Facebook & Twitter sharing interface
@@ -1,24 +0,0 @@
1
- lolcat:
2
- shared:
3
- admin:
4
- image_picker:
5
- image: IMAGE
6
- plugins:
7
- calendar:
8
- title: Events
9
- admin:
10
- events:
11
- index:
12
- title: Events
13
- create_new: CREATE NEW Event
14
- reorder: REORDR Events
15
- reorder_done: DUN REORDERIN Events
16
- sorry_no_results: SRY! THAR R NO RESULTS FINDZ.
17
- no_items_yet: THAR R NO Events YET. CLICK "CREATE NEW Event" 2 ADD UR FURST event.
18
- event:
19
- view_live_html: VIEW DIS event LIV <BR/><EM>(OPENS IN NEW WINDOW)</EM>
20
- edit: EDIT DIS event
21
- delete: REMOOV DIS event FOREVR
22
- events:
23
- show:
24
- other: OTHR Events
@@ -1,33 +0,0 @@
1
- class CreateEvents < ActiveRecord::Migration
2
-
3
- def self.up
4
- create_table :events do |t|
5
- t.string :title
6
- t.datetime :start_at
7
- t.datetime :end_at
8
- t.string :venue_name
9
- t.string :venue_address
10
- t.decimal :ticket_price, :precision => 8, :scale => 2
11
- t.string :ticket_link
12
- t.text :description
13
- t.boolean :featured
14
- t.integer :image_id
15
- t.integer :position
16
-
17
- t.timestamps
18
- end
19
-
20
- add_index :events, :id
21
-
22
- load(Rails.root.join('db', 'seeds', 'events.rb'))
23
- end
24
-
25
- def self.down
26
- UserPlugin.destroy_all({:name => "events"})
27
-
28
- Page.delete_all({:link_url => "/events"})
29
-
30
- drop_table :events
31
- end
32
-
33
- end
@@ -1,13 +0,0 @@
1
- class CreateEventCategories < ActiveRecord::Migration
2
- def self.up
3
- create_table :event_categories do |t|
4
- t.string :name
5
-
6
- t.timestamps
7
- end
8
- end
9
-
10
- def self.down
11
- drop_table :event_categories
12
- end
13
- end
@@ -1,17 +0,0 @@
1
- class CreateEventCategorizations < ActiveRecord::Migration
2
- def self.up
3
- create_table :event_categorizations do |t|
4
- t.integer :event_id
5
- t.integer :event_category_id
6
-
7
- t.timestamps
8
- end
9
-
10
- add_index :event_categorizations, :event_id
11
- add_index :event_categorizations, :event_category_id
12
- end
13
-
14
- def self.down
15
- drop_table :event_categorizations
16
- end
17
- end