Permalink
Browse files

Remove old 1.0 code

  • Loading branch information...
1 parent c8e2087 commit d7a2acb2564c10a9e4c787a2d062dcd84563cdcb @joemsak joemsak committed May 30, 2012
Showing with 0 additions and 1,325 deletions.
  1. +0 −9 app/controllers/admin/event_categories_controller.rb
  2. +0 −26 app/controllers/admin/events_controller.rb
  3. +0 −15 app/controllers/event_categories_controller.rb
  4. +0 −65 app/controllers/events_controller.rb
  5. +0 −3 app/helpers/event_categories_helper.rb
  6. +0 −52 app/helpers/events_helper.rb
  7. +0 −84 app/models/event.rb
  8. +0 −4 app/models/event_categorization.rb
  9. +0 −10 app/models/event_category.rb
  10. +0 −1 app/views/admin/event_categories/_event_categories.html.erb
  11. +0 −18 app/views/admin/event_categories/_event_category.html.erb
  12. +0 −26 app/views/admin/event_categories/_form.html.erb
  13. +0 −3 app/views/admin/event_categories/_sortable_list.html.erb
  14. +0 −1 app/views/admin/event_categories/edit.html.erb
  15. +0 −40 app/views/admin/event_categories/index.html.erb
  16. +0 −1 app/views/admin/event_categories/new.html.erb
  17. +0 −18 app/views/admin/events/_event.html.erb
  18. +0 −1 app/views/admin/events/_events.html.erb
  19. +0 −126 app/views/admin/events/_form.html.erb
  20. +0 −20 app/views/admin/events/_sortable_list.html.erb
  21. +0 −1 app/views/admin/events/edit.html.erb
  22. +0 −41 app/views/admin/events/index.html.erb
  23. +0 −1 app/views/admin/events/new.html.erb
  24. +0 −15 app/views/event_categories/show.html.erb
  25. +0 −151 app/views/events/_event.html.erb
  26. +0 −38 app/views/events/_sidebar.html.erb
  27. +0 −17 app/views/events/archive.html.erb
  28. +0 −17 app/views/events/index.html.erb
  29. +0 −24 app/views/events/index.rss.builder
  30. +0 −15 app/views/events/show.html.erb
  31. +0 −32 app/views/events/show.ics.erb
  32. +0 −45 config/locales/bg.yml
  33. +0 −45 config/locales/cs.yml
  34. +0 −24 config/locales/lolcat.yml
  35. +0 −45 config/locales/pl.yml
  36. +0 −45 config/locales/sk.yml
  37. +0 −33 db/migrate/01_create_events.rb
  38. +0 −13 db/migrate/02_create_event_categories.rb
  39. +0 −17 db/migrate/03_create_event_categorizations.rb
  40. +0 −11 db/migrate/04_add_cached_slugs.rb
  41. +0 −17 db/seeds/events.rb
  42. +0 −6 lib/generators/refinerycms_calendar_generator.rb
  43. +0 −13 lib/tasks/events.rake
  44. +0 −14 spec/controllers/events_controller_spec.rb
  45. +0 −16 spec/helpers/events_helper_spec.rb
  46. +0 −29 spec/models/event_category_spec.rb
  47. +0 −77 spec/models/event_spec.rb
@@ -1,9 +0,0 @@
-module Admin
- class EventCategoriesController < Admin::BaseController
-
- crudify :event_category,
- :title_attribute => :name,
- :xhr_paging => true
-
- end
-end
@@ -1,26 +0,0 @@
-module Admin
- class EventsController < Admin::BaseController
- before_filter :find_categories, :except => :index
-
- crudify :event, :xhr_paging => true
-
- def index
- search_all_events if searching?
-
- @archived = Event.archive
- @upcoming = Event.upcoming
- @current = Event.current
-
- @events = (@archived | @upcoming | @current)
-
- render :partial => 'events' if request.xhr?
- end
-
- protected
-
- def find_categories
- @event_categories = EventCategory.all
- end
-
- end
-end
@@ -1,15 +0,0 @@
-class EventCategoriesController < ApplicationController
- helper [:events, :event_categories]
-
- def show
- @event_category = EventCategory.find(params[:id])
- @event_categories = EventCategory.all
- @other_events = Event.live.limit(5)
- # @events = @event_category.events.paginate({
- # :page => params[:page],
- # :per_page => RefinerySetting.find_or_set(:events_per_page, 10)
- # })
- # render :template => 'events/index'
- end
-
-end
@@ -1,65 +0,0 @@
-class EventsController < ApplicationController
-
- before_filter :find_all_events
- before_filter :find_page
- before_filter :find_categories
-
- helper [:events, :event_categories]
-
- def index
- # you can use meta fields from your model instead (e.g. browser_title)
- # by swapping @page for @event in the line below:
- present(@page)
- end
-
- def show
- @event = Event.find(params[:id])
- # you can use meta fields from your model instead (e.g. browser_title)
- # by swapping @page for @event in the line below:
- present(@page)
- end
-
- def archive
- if params[:month].present?
- date = "#{params[:month]}/#{params[:year]}"
- @archive_date = Time.parse(date)
- @date_title = @archive_date.strftime('%B %Y')
- @events = Event.by_archive(@archive_date).paginate({
- :page => params[:page],
- :per_page => RefinerySetting.find_or_set(:events_per_page, 10)
- })
- else
- date = "01/#{params[:year]}"
- @archive_date = Time.parse(date)
- @date_title = @archive_date.strftime('%Y')
- @events = Event.by_year(@archive_date).paginate({
- :page => params[:page],
- :per_page => RefinerySetting.find_or_set(:events_per_page, 10)
- })
- end
- #render :template => 'events/index'
- end
-
-protected
-
- def find_all_events
- upcoming = Event.upcoming.not_featured
- current = Event.current.not_featured
- @events = (upcoming | current).sort { |a,b| a.start_at <=> b.start_at }
-
- featured_upcoming = Event.upcoming.featured
- featured_current = Event.current.featured
- @featured_events = (featured_upcoming | featured_current).sort { |a,b| a.start_at <=> b.start_at }
-
- @other_events = Event.live.limit(5)
- end
-
- def find_page
- @page = Page.find_by_link_url("/events")
- end
-
- def find_categories
- @event_categories = EventCategory.all
- end
-
-end
@@ -1,3 +0,0 @@
-module EventCategoriesHelper
-
-end
@@ -1,52 +0,0 @@
-module EventsHelper
-
- def smart_date_for event
- if event.start_at.to_date == event.end_at.to_date
- "#{event.start_at.strftime('%A, %B %e &ndash; %l:%M%p')} to #{event.end_at.strftime('%l:%M%p')}".html_safe
- else
- "#{event.start_at.strftime('%A, %B %e, at %l:%M%p')} until #{event.end_at.strftime('%A %B %e, %l:%M%p')}".html_safe
- end
- end
-
- def custom_url_for(event, format = nil)
- port = request.port == 80 ? nil : ":#{request.port}"
- "#{request.protocol}#{request.host}#{port}/events/#{event.friendly_id}#{format}"
- end
-
- def events_archive_list
- events = Event.select('start_at').for_archive_list
- return nil if events.blank?
- html = '<ul>'
- links = []
- super_old_links = []
-
- events.each do |e|
- if e.start_at >= Time.now.end_of_year.advance(:years => -3)
- links << e.start_at.strftime('%m/%Y')
- else
- super_old_links << e.start_at.strftime('01/%Y')
- end
- end
- links.uniq!
- super_old_links.uniq!
- links.each do |l|
- year = l.split('/')[1]
- month = l.split('/')[0]
- count = Event.by_archive(Time.parse(l)).size
- text = t("date.month_names")[month.to_i] + " #{year} (#{count})"
- html << "<li>"
- html << link_to(text, archive_events_path(:year => year, :month => month))
- html << "</li>"
- end
- super_old_links.each do |l|
- year = l.split('/')[1]
- count = Event.by_year(Time.parse(l)).size
- text = "#{year} (#{count})"
- html << "<li>"
- html << link_to(text, archive_events_path(:year => year))
- html << "</li>"
- end
- html << '</ul>'
- html.html_safe
- end
-end
View
@@ -1,84 +0,0 @@
-class Event < ActiveRecord::Base
- has_many :event_categorizations
- has_many :categories, :through => :event_categorizations, :source => :event_category
-
- default_scope order('start_at ASC')
-
- scope :current, where(['start_at < ? and end_at >= ?', Time.now, Time.now])
- scope :upcoming, where(['start_at >= ?', Time.now])
- scope :featured, where(['featured IS NOT NULL and featured = ?', true])
- scope :not_featured, where(['featured IS NULL or featured = ?', false])
- scope :live, where(['end_at > ?', Time.now])
-
- scope :by_year, lambda { |archive_year|
- where(['start_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year])
- }
-
- acts_as_indexed :fields => [:title, :venue_name, :venue_address, :ticket_link, :description]
-
- validates :title, :presence => true
- validates :ticket_price, :numericality => true, :allow_blank => true
- validates :ticket_link, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :allow_blank => true
- validate :ends_after_start
-
- has_friendly_id :title, :use_slug => true
-
- belongs_to :image
-
- def current?
- end_at >= Time.now
- end
-
- def upcoming?
- start_at >= Time.now
- end
-
- def archived?
- end_at < Time.now
- end
-
- def featured?
- featured == true
- end
-
- def status
- "current" if current?
- "coming up" if upcoming?
- "archived" if archived?
- end
-
- def next
- Event.where(['start_at > ?', start_at]).first
- end
-
- def prev
- Event.where(['start_at < ?', start_at]).reverse.first
- end
-
- def single_day?
- end_at.blank? || start_at.blank? || (end_at - start_at) < 24*60*60
- end
-
- def multi_day?
- !single_day?
- end
-
- def self.archive
- with_exclusive_scope { order('start_at DESC').where 'end_at < ?', Time.now }
- end
-
- def self.by_archive archive_date
- with_exclusive_scope { order('start_at DESC').where 'start_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month }
- end
-
- def self.for_archive_list
- with_exclusive_scope { order('start_at DESC').where(['end_at < ?', Time.now.beginning_of_month]) }
- end
-
- private
-
- def ends_after_start
- errors.add(:base, "End at date must be after the start at date") if end_at < start_at
- end
-
-end
@@ -1,4 +0,0 @@
-class EventCategorization < ActiveRecord::Base
- belongs_to :event
- belongs_to :event_category
-end
@@ -1,10 +0,0 @@
-class EventCategory < ActiveRecord::Base
- default_scope order('name ASC')
-
- has_many :event_categorizations
- has_many :events, :through => :event_categorizations
-
- validates :name, :presence => true
-
- has_friendly_id :name, :use_slug => true
-end
@@ -1 +0,0 @@
-<%= render :partial => "sortable_list" %>
@@ -1,18 +0,0 @@
-<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(event_category) -%>">
- <span class='title'>
- <%= event_category.name %>
- <span class="preview"></span>
- </span>
- <span class='actions'>
- <%= link_to refinery_icon_tag("application_go.png"), category_events_url(event_category),
- :title => t('.view_live_html'),
- :target => "_blank" %>
- <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_event_category_path(event_category),
- :title => t('.edit') %>
- <%= link_to refinery_icon_tag("delete.png"), admin_event_category_path(event_category),
- :class => "cancel confirm-delete",
- :title => t('.delete'),
- :confirm => t('message', :scope => 'shared.admin.delete', :title => event_category.name),
- :method => :delete %>
- </span>
-</li>
@@ -1,26 +0,0 @@
-<%= form_for [:admin, @event_category] do |f| -%>
- <%= render :partial => "/shared/admin/error_messages", :locals => {
- :object => @event_category,
- :include_object_name => true
- } %>
-
- <div class='field'>
- <%= f.label :name -%>
- <%= f.text_field :name, :class => 'larger widest' -%>
- </div>
-
- <%= render :partial => "/shared/admin/form_actions",
- :locals => {
- :f => f,
- :continue_editing => false,
- :delete_title => t('delete', :scope => 'admin.event_categories.event_category'),
- :delete_confirmation => t('message', :scope => 'shared.admin.delete', :title => @event_category.name)
- } %>
-<% end -%>
-<% content_for :javascripts do %>
- <script>
- $(document).ready(function(){
- page_options.init(false, '', '');
- });
- </script>
-<% end %>
@@ -1,3 +0,0 @@
-<ul id='sortable_list'>
- <%= render :partial => 'event_category', :collection => @event_categories %>
-</ul>
@@ -1 +0,0 @@
-<%= render :partial => "form" %>
@@ -1,40 +0,0 @@
-<div id='records'>
- <% if searching? %>
- <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
- <% end %>
- <% if @event_categories.any? %>
- <div class='pagination_container'>
- <%= render :partial => 'event_categories' %>
- </div>
- <% else %>
- <p>
- <% unless searching? %>
- <strong>
- <%= t('.no_items_yet') %>
- </strong>
- <% else %>
- <%= t('no_results', :scope => 'shared.admin.search') %>
- <% end %>
- </p>
- <% end %>
-</div>
-<div id='actions'>
- <ul>
- <% if Admin::EventCategoriesController.searchable? %>
- <li>
- <%= render :partial => "/shared/admin/search",
- :locals => {
- :url => admin_event_categories_url
- } %>
- </li>
- <% end %>
- <li>
- <%= link_to t('.create_new'), new_admin_event_category_url,
- :class => "add_icon" %>
- </li>
- <li>
- <%= link_to t('.manage_events'), admin_events_url,
- :class => "edit_icon" %>
- </li>
- </ul>
-</div>
@@ -1 +0,0 @@
-<%= render :partial => "form" %>
@@ -1,18 +0,0 @@
-<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(event) -%>">
- <span class='title'>
- <%= truncate strip_tags(event.title), :length => 60 %>
- <span class="preview">(<%= event.start_at.strftime('%b %d, %Y') %>) <%= '***Featured***' if event.featured? %></span>
- </span>
- <span class='actions'>
- <%= link_to refinery_icon_tag("application_go.png"), event_url(event),
- :title => t('.view_live_html'),
- :target => "_blank" %>
- <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_event_path(event),
- :title => t('.edit') %>
- <%= link_to refinery_icon_tag("delete.png"), admin_event_path(event),
- :class => "cancel confirm-delete",
- :title => t('.delete'),
- :confirm => t('message', :scope => 'shared.admin.delete', :title => event.title),
- :method => :delete %>
- </span>
-</li>
Oops, something went wrong.

0 comments on commit d7a2acb

Please sign in to comment.