-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to use nested routes into the Dashboard Activity. R…
…emoved the use of eval from dashboard_helper and cleaned up the init files so that they are not all scrunched up.
- Loading branch information
Showing
12 changed files
with
109 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ public/stylesheets/cache | |
config/database.yml.example | ||
.yardoc/ | ||
themes/* | ||
refinerycms.gemspec |
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 +1 @@ | ||
0.9.6.4 | ||
0.9.6.5 |
8 changes: 4 additions & 4 deletions
8
vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
module Refinery | ||
class Activity | ||
|
||
attr_accessor :class, :title, :url_prefix, :order, :conditions, :limit, :created_image, :updated_image, :conditions | ||
attr_accessor :class, :conditions, :created_image, :limit, :nested_with, :order, :title, :updated_image, :url, :url_prefix | ||
|
||
def initialize(new_options) | ||
options = {:class => nil, :title => nil, :url_prefix => "", :order => 'updated_at DESC', :conditions => nil, :limit => 10, :created_image => "add.png", :updated_image => "edit.png"} | ||
options.merge!(new_options).each { |key,value| eval("self.#{key} = value") } | ||
# for nested_with, pass in the reverse order of ancestry e.g. [parent.parent_of_parent, parent] | ||
def initialize(options={}) | ||
{ | ||
:class => nil, | ||
:conditions => nil, | ||
:created_image => "add.png", | ||
:limit => 10, | ||
:nested_with => [], | ||
:order => 'updated_at DESC', | ||
:title => nil, | ||
:updated_image => "edit.png", | ||
:url => nil, | ||
:url_prefix => "" | ||
}.merge(options).each { |key,value| self.instance_variable_set(:"@#{key}", value) } | ||
end | ||
|
||
# to use in a URL like edit_admin_group_individuals_url(record.group, record) | ||
# which will help you if you're using nested routed. | ||
def nesting(record_string="record") | ||
self.nested_with.inject("") { |nest_chain, nesting| nest_chain << "#{record_string}.#{nesting}," } | ||
end | ||
|
||
def url_prefix | ||
@url_prefix.blank? ? "" : "#{@url_prefix}_".gsub("__", "_") | ||
"#{"#{@url_prefix}_".gsub("__", "_") if @url_prefix.present?}" | ||
end | ||
|
||
def url | ||
"#{self.url_prefix}#{@url ||= "admin_#{self.class.name.underscore.downcase}_url"}" | ||
end | ||
|
||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
Refinery::Plugin.register do |plugin| | ||
|
||
plugin.title = "Themes" | ||
plugin.description = "Upload and manage themes" | ||
plugin.version = 1.0 | ||
plugin.activity = {:class => Theme, :title => 'title', :url_prefix => 'edit', | ||
:created_image => "layout_add.png", :updated_image => "layout_edit.png"} | ||
|
||
plugin.activity = { | ||
:class => Theme, | ||
:title => 'title', | ||
:url_prefix => 'edit', | ||
:created_image => "layout_add.png", | ||
:updated_image => "layout_edit.png" | ||
} | ||
end |