refinerycms-calendar 2.0.0.alpha → 2.0.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/refinery/calendar/admin/events_controller.rb +7 -31
- data/app/controllers/refinery/calendar/admin/venues_controller.rb +14 -0
- data/app/controllers/refinery/calendar/events_controller.rb +7 -9
- data/app/controllers/refinery/calendar/venues_controller.rb +6 -0
- data/app/models/refinery/calendar/event.rb +23 -38
- data/app/models/refinery/calendar/venue.rb +9 -0
- data/app/views/refinery/calendar/admin/events/_actions.html.erb +1 -0
- data/app/views/refinery/calendar/admin/events/_event.html.erb +13 -3
- data/app/views/refinery/calendar/admin/events/_form.html.erb +60 -6
- data/app/views/refinery/calendar/admin/events/index.html.erb +1 -1
- data/app/views/refinery/calendar/admin/shared/_links.html.erb +8 -0
- data/app/views/refinery/calendar/admin/venues/_actions.html.erb +26 -0
- data/app/views/refinery/calendar/admin/venues/_form.html.erb +35 -0
- data/app/views/refinery/calendar/admin/venues/_records.html.erb +18 -0
- data/app/views/refinery/calendar/admin/venues/_sortable_list.html.erb +5 -0
- data/app/views/refinery/calendar/admin/venues/_venue.html.erb +20 -0
- data/app/views/refinery/calendar/admin/venues/_venues.html.erb +2 -0
- data/app/views/refinery/calendar/admin/venues/edit.html.erb +1 -0
- data/app/views/refinery/calendar/admin/venues/index.html.erb +8 -0
- data/app/views/refinery/calendar/admin/venues/new.html.erb +1 -0
- data/app/views/refinery/calendar/events/_event.html.erb +8 -0
- data/app/views/refinery/calendar/events/index.html.erb +5 -7
- data/app/views/refinery/calendar/events/show.html.erb +19 -18
- data/app/views/refinery/calendar/venues/index.html.erb +11 -0
- data/app/views/refinery/calendar/venues/show.html.erb +45 -0
- data/app/views/sitemap/index.xml.builder +25 -0
- data/config/database.yml.mysql +20 -0
- data/config/database.yml.postgresql +58 -0
- data/config/database.yml.sqlite3 +18 -0
- data/config/initializers/refinery/authentication.rb +4 -0
- data/config/initializers/refinery/core.rb +48 -0
- data/config/initializers/refinery/images.rb +44 -0
- data/config/initializers/refinery/pages.rb +52 -0
- data/config/initializers/refinery/resources.rb +26 -0
- data/config/locales/en.yml +36 -2
- data/config/locales/es.yml +36 -5
- data/config/locales/fr.yml +34 -4
- data/config/locales/nb.yml +36 -4
- data/config/locales/nl.yml +36 -4
- data/config/routes.rb +24 -2
- data/db/migrate/1_create_calendar_events.rb +34 -0
- data/db/migrate/2_create_calendar_venues.rb +29 -0
- data/db/seeds.rb +5 -2
- data/lib/generators/refinery/calendar_generator.rb +3 -13
- data/lib/refinery/{calendar.rb → events.rb} +2 -9
- data/lib/refinery/{calendar → events}/engine.rb +3 -3
- data/lib/refinery/venues.rb +21 -0
- data/lib/refinery/venues/engine.rb +14 -0
- data/lib/refinerycms-calendar.rb +2 -1
- data/readme.md +11 -7
- metadata +52 -14
- data/app/models/refinery/calendar/core_calendar.rb +0 -36
- data/lib/refinery/calendar/configuration.rb +0 -7
- data/lib/refinery/calendar/version.rb +0 -17
- data/lib/refinery/engine/multi_parameter_assignment.rb +0 -6
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            require 'refinerycms-core'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Refinery
         | 
| 4 | 
            +
              autoload :CalendarGenerator, 'generators/refinery/calendar_generator'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              module Venues
         | 
| 7 | 
            +
                require 'refinery/venues/engine'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                class << self
         | 
| 10 | 
            +
                  attr_writer :root
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                  def root
         | 
| 13 | 
            +
                    @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  def factory_paths
         | 
| 17 | 
            +
                    @factory_paths ||= [ root.join('spec', 'factories').to_s ]
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
            end
         | 
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            module Refinery
         | 
| 2 | 
            +
              module Calendar
         | 
| 3 | 
            +
                class Engine < Rails::Engine
         | 
| 4 | 
            +
                  include Refinery::Engine
         | 
| 5 | 
            +
                  isolate_namespace Refinery::Calendar
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                  engine_name :refinery_calendar
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  config.after_initialize do
         | 
| 10 | 
            +
                    Refinery.register_extension(Refinery::Venues)
         | 
| 11 | 
            +
                  end
         | 
| 12 | 
            +
                end
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
            end
         | 
    
        data/lib/refinerycms-calendar.rb
    CHANGED
    
    | @@ -1 +1,2 @@ | |
| 1 | 
            -
            require 'refinery/ | 
| 1 | 
            +
            require 'refinery/events'
         | 
| 2 | 
            +
            require 'refinery/venues'
         | 
    
        data/readme.md
    CHANGED
    
    | @@ -1,12 +1,16 @@ | |
| 1 1 | 
             
            # Calendar extension for Refinery CMS.
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            ## Installation
         | 
| 4 4 |  | 
| 5 | 
            -
             | 
| 5 | 
            +
            ```ruby
         | 
| 6 | 
            +
            # in Gemfile:
         | 
| 7 | 
            +
            gem 'refinerycms-calendar', :git => 'git://github.com/resolve/refinerycms-calendar.git', :branch => 'master'
         | 
| 8 | 
            +
            ```
         | 
| 6 9 |  | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            +
            ```
         | 
| 11 | 
            +
            $ bundle
         | 
| 12 | 
            +
            $ rails g refinery:calendar
         | 
| 13 | 
            +
            $ rake db:migrate db:test:prepare
         | 
| 14 | 
            +
            ```
         | 
| 10 15 |  | 
| 11 | 
            -
             | 
| 12 | 
            -
                gem push refinerycms-calendar.gem
         | 
| 16 | 
            +
            Restart the server
         | 
    
        metadata
    CHANGED
    
    | @@ -1,27 +1,39 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: refinerycms-calendar
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.0.0 | 
| 5 | 
            -
              prerelease:  | 
| 4 | 
            +
              version: 2.0.0
         | 
| 5 | 
            +
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| 8 8 | 
             
            - Joe Sak
         | 
| 9 | 
            +
            - Philip Arndt
         | 
| 9 10 | 
             
            autorequire: 
         | 
| 10 11 | 
             
            bindir: bin
         | 
| 11 12 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2012- | 
| 13 | 
            +
            date: 2012-04-23 00:00:00.000000000 Z
         | 
| 13 14 | 
             
            dependencies:
         | 
| 14 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 16 | 
             
              name: refinerycms-core
         | 
| 16 | 
            -
              requirement: & | 
| 17 | 
            +
              requirement: &2163803640 !ruby/object:Gem::Requirement
         | 
| 17 18 | 
             
                none: false
         | 
| 18 19 | 
             
                requirements:
         | 
| 19 20 | 
             
                - - ~>
         | 
| 20 21 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            -
                    version: 2.0. | 
| 22 | 
            +
                    version: 2.0.3
         | 
| 22 23 | 
             
              type: :runtime
         | 
| 23 24 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: * | 
| 25 | 
            +
              version_requirements: *2163803640
         | 
| 26 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 27 | 
            +
              name: refinerycms-testing
         | 
| 28 | 
            +
              requirement: &2163803120 !ruby/object:Gem::Requirement
         | 
| 29 | 
            +
                none: false
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - ~>
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: 2.0.3
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: *2163803120
         | 
| 25 37 | 
             
            description: Ruby on Rails Calendar extension for Refinery CMS
         | 
| 26 38 | 
             
            email: 
         | 
| 27 39 | 
             
            executables: []
         | 
| @@ -29,9 +41,11 @@ extensions: [] | |
| 29 41 | 
             
            extra_rdoc_files: []
         | 
| 30 42 | 
             
            files:
         | 
| 31 43 | 
             
            - app/controllers/refinery/calendar/admin/events_controller.rb
         | 
| 44 | 
            +
            - app/controllers/refinery/calendar/admin/venues_controller.rb
         | 
| 32 45 | 
             
            - app/controllers/refinery/calendar/events_controller.rb
         | 
| 33 | 
            -
            - app/ | 
| 46 | 
            +
            - app/controllers/refinery/calendar/venues_controller.rb
         | 
| 34 47 | 
             
            - app/models/refinery/calendar/event.rb
         | 
| 48 | 
            +
            - app/models/refinery/calendar/venue.rb
         | 
| 35 49 | 
             
            - app/views/refinery/calendar/admin/events/_actions.html.erb
         | 
| 36 50 | 
             
            - app/views/refinery/calendar/admin/events/_event.html.erb
         | 
| 37 51 | 
             
            - app/views/refinery/calendar/admin/events/_events.html.erb
         | 
| @@ -41,21 +55,44 @@ files: | |
| 41 55 | 
             
            - app/views/refinery/calendar/admin/events/edit.html.erb
         | 
| 42 56 | 
             
            - app/views/refinery/calendar/admin/events/index.html.erb
         | 
| 43 57 | 
             
            - app/views/refinery/calendar/admin/events/new.html.erb
         | 
| 58 | 
            +
            - app/views/refinery/calendar/admin/shared/_links.html.erb
         | 
| 59 | 
            +
            - app/views/refinery/calendar/admin/venues/_actions.html.erb
         | 
| 60 | 
            +
            - app/views/refinery/calendar/admin/venues/_form.html.erb
         | 
| 61 | 
            +
            - app/views/refinery/calendar/admin/venues/_records.html.erb
         | 
| 62 | 
            +
            - app/views/refinery/calendar/admin/venues/_sortable_list.html.erb
         | 
| 63 | 
            +
            - app/views/refinery/calendar/admin/venues/_venue.html.erb
         | 
| 64 | 
            +
            - app/views/refinery/calendar/admin/venues/_venues.html.erb
         | 
| 65 | 
            +
            - app/views/refinery/calendar/admin/venues/edit.html.erb
         | 
| 66 | 
            +
            - app/views/refinery/calendar/admin/venues/index.html.erb
         | 
| 67 | 
            +
            - app/views/refinery/calendar/admin/venues/new.html.erb
         | 
| 68 | 
            +
            - app/views/refinery/calendar/events/_event.html.erb
         | 
| 44 69 | 
             
            - app/views/refinery/calendar/events/index.html.erb
         | 
| 45 70 | 
             
            - app/views/refinery/calendar/events/show.html.erb
         | 
| 71 | 
            +
            - app/views/refinery/calendar/venues/index.html.erb
         | 
| 72 | 
            +
            - app/views/refinery/calendar/venues/show.html.erb
         | 
| 73 | 
            +
            - app/views/sitemap/index.xml.builder
         | 
| 74 | 
            +
            - config/database.yml.mysql
         | 
| 75 | 
            +
            - config/database.yml.postgresql
         | 
| 76 | 
            +
            - config/database.yml.sqlite3
         | 
| 77 | 
            +
            - config/initializers/refinery/authentication.rb
         | 
| 78 | 
            +
            - config/initializers/refinery/core.rb
         | 
| 79 | 
            +
            - config/initializers/refinery/images.rb
         | 
| 80 | 
            +
            - config/initializers/refinery/pages.rb
         | 
| 81 | 
            +
            - config/initializers/refinery/resources.rb
         | 
| 46 82 | 
             
            - config/locales/en.yml
         | 
| 47 83 | 
             
            - config/locales/es.yml
         | 
| 48 84 | 
             
            - config/locales/fr.yml
         | 
| 49 85 | 
             
            - config/locales/nb.yml
         | 
| 50 86 | 
             
            - config/locales/nl.yml
         | 
| 51 87 | 
             
            - config/routes.rb
         | 
| 88 | 
            +
            - db/migrate/1_create_calendar_events.rb
         | 
| 89 | 
            +
            - db/migrate/2_create_calendar_venues.rb
         | 
| 52 90 | 
             
            - db/seeds.rb
         | 
| 53 91 | 
             
            - lib/generators/refinery/calendar_generator.rb
         | 
| 54 | 
            -
            - lib/refinery/ | 
| 55 | 
            -
            - lib/refinery/ | 
| 56 | 
            -
            - lib/refinery/ | 
| 57 | 
            -
            - lib/refinery/ | 
| 58 | 
            -
            - lib/refinery/engine/multi_parameter_assignment.rb
         | 
| 92 | 
            +
            - lib/refinery/events/engine.rb
         | 
| 93 | 
            +
            - lib/refinery/events.rb
         | 
| 94 | 
            +
            - lib/refinery/venues/engine.rb
         | 
| 95 | 
            +
            - lib/refinery/venues.rb
         | 
| 59 96 | 
             
            - lib/refinerycms-calendar.rb
         | 
| 60 97 | 
             
            - lib/tasks/refinery/calendar.rake
         | 
| 61 98 | 
             
            - readme.md
         | 
| @@ -74,9 +111,9 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 74 111 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 75 112 | 
             
              none: false
         | 
| 76 113 | 
             
              requirements:
         | 
| 77 | 
            -
              - - ! ' | 
| 114 | 
            +
              - - ! '>='
         | 
| 78 115 | 
             
                - !ruby/object:Gem::Version
         | 
| 79 | 
            -
                  version:  | 
| 116 | 
            +
                  version: '0'
         | 
| 80 117 | 
             
            requirements: []
         | 
| 81 118 | 
             
            rubyforge_project: 
         | 
| 82 119 | 
             
            rubygems_version: 1.8.16
         | 
| @@ -84,3 +121,4 @@ signing_key: | |
| 84 121 | 
             
            specification_version: 3
         | 
| 85 122 | 
             
            summary: Calendar extension for Refinery CMS
         | 
| 86 123 | 
             
            test_files: []
         | 
| 124 | 
            +
            has_rdoc: 
         | 
| @@ -1,36 +0,0 @@ | |
| 1 | 
            -
            module Refinery
         | 
| 2 | 
            -
              module Calendar
         | 
| 3 | 
            -
                class CoreCalendar
         | 
| 4 | 
            -
                  attr_accessor :entries
         | 
| 5 | 
            -
                  attr_writer :event_source
         | 
| 6 | 
            -
             | 
| 7 | 
            -
                  def initialize
         | 
| 8 | 
            -
                    @entries = []
         | 
| 9 | 
            -
                  end
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  def title
         | 
| 12 | 
            -
                    Refinery::Calendar.title
         | 
| 13 | 
            -
                  end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
                  def new_event(*args)
         | 
| 16 | 
            -
                    event_source.call(*args).tap do |e|
         | 
| 17 | 
            -
                      e.calendar = self
         | 
| 18 | 
            -
                    end
         | 
| 19 | 
            -
                  end
         | 
| 20 | 
            -
             | 
| 21 | 
            -
                  def add_entry(entry)
         | 
| 22 | 
            -
                    @entries << entry
         | 
| 23 | 
            -
                  end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
                  def entries
         | 
| 26 | 
            -
                    @entries.sort_by { |e| e.starts }
         | 
| 27 | 
            -
                  end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                  private
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                  def event_source
         | 
| 32 | 
            -
                    @event_source ||= Event.public_method(:new)
         | 
| 33 | 
            -
                  end
         | 
| 34 | 
            -
                end
         | 
| 35 | 
            -
              end
         | 
| 36 | 
            -
            end
         |