-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1386 from tvdeyen/gutentag-update
Update Gutentag
- Loading branch information
Showing
11 changed files
with
53 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Admin::LocationsController < Alchemy::Admin::ResourcesController | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
class Event < ActiveRecord::Base | ||
include Alchemy::Taggable | ||
|
||
validates_presence_of :name | ||
belongs_to :location | ||
|
||
scope :starting_today, -> { where(starts_at: Time.current.at_midnight..Date.tomorrow.at_midnight) } | ||
scope :future, -> { where("starts_at > ?", Date.tomorrow.at_midnight) } | ||
|
||
def self.alchemy_resource_relations | ||
{ | ||
location: {attr_method: 'name', attr_type: 'string'} | ||
} | ||
end | ||
|
||
def self.alchemy_resource_filters | ||
%w(starting_today future) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
class Location < ActiveRecord::Base | ||
include Alchemy::Taggable | ||
has_many :events | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
Alchemy.register_ability Ability | ||
Alchemy.user_class_name = 'DummyUser' | ||
Alchemy.signup_path = '/admin/pages' unless Rails.env.test? | ||
Alchemy::Modules.register_module( | ||
name: 'events', | ||
navigation: { | ||
name: 'Events', | ||
controller: '/admin/events', | ||
action: 'index', | ||
icon: 'calendar-alt', | ||
sub_navigation: [{ | ||
name: 'Events', | ||
controller: '/admin/events', | ||
action: 'index' | ||
}, { | ||
name: 'Locations', | ||
controller: '/admin/locations', | ||
action: 'index' | ||
}] | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
namespace :admin do | ||
resources :events | ||
resources :locations | ||
end | ||
|
||
mount Alchemy::Engine => "/" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters