community_engine 2.3.1 → 2.3.2
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.
- checksums.yaml +6 -14
- data/.travis.yml +2 -2
- data/CHANGELOG +1 -0
- data/Gemfile +2 -0
- data/README.markdown +101 -57
- data/about.yml +1 -1
- data/app/controllers/authorizations_controller.rb +2 -1
- data/app/controllers/base_controller.rb +31 -43
- data/app/controllers/comments_controller.rb +11 -5
- data/app/controllers/messages_controller.rb +1 -1
- data/app/controllers/password_resets_controller.rb +4 -4
- data/app/controllers/sessions_controller.rb +3 -4
- data/app/helpers/base_helper.rb +47 -43
- data/app/models/album.rb +3 -3
- data/app/models/authorization.rb +14 -14
- data/app/models/clipping.rb +13 -13
- data/app/models/clipping_image.rb +4 -4
- data/app/models/comment.rb +18 -10
- data/app/models/event.rb +12 -12
- data/app/models/homepage_feature.rb +4 -4
- data/app/models/message.rb +2 -2
- data/app/models/metro_area.rb +1 -1
- data/app/models/photo.rb +4 -4
- data/app/models/poll.rb +1 -1
- data/app/models/post.rb +48 -48
- data/app/models/sb_post.rb +1 -1
- data/app/models/topic.rb +2 -2
- data/app/models/user.rb +3 -2
- data/app/views/admin/comments.html.haml +11 -8
- data/app/views/admin/users.html.haml +6 -4
- data/app/views/comments/_comment.html.haml +3 -0
- data/app/views/comments/approve.js.haml +1 -0
- data/app/views/layouts/application.html.haml +16 -16
- data/app/views/messages/_sent.html.haml +2 -2
- data/app/views/users/_search_options.html.haml +2 -2
- data/app/views/users/new.html.haml +4 -4
- data/community_engine.gemspec +4 -3
- data/config/locales/en.yml +10 -4
- data/config/routes.rb +35 -34
- data/db/migrate/090_add_comment_role.rb +15 -0
- data/lib/community_engine/authenticated_system.rb +11 -11
- data/lib/community_engine/engines_extensions.rb +14 -2
- data/lib/community_engine/version.rb +1 -1
- data/lib/tasks/community_engine_tasks.rake +3 -72
- data/test/functional/authorizations_controller_test.rb +60 -0
- data/test/functional/comments_controller_test.rb +44 -67
- data/test/functional/password_reset_controller_test.rb +14 -6
- data/test/functional/sessions_controller_test.rb +3 -3
- data/test/functional/topics_controller_test.rb +2 -2
- data/test/test_helper.rb +1 -8
- data/test/testapp/config/application.rb +4 -0
- data/test/testapp/db/schema.rb +4 -3
- data/test/unit/comment_test.rb +85 -28
- metadata +53 -49
- data/lib/community_engine/rails_asset_extensions.rb +0 -131
@@ -1,131 +0,0 @@
|
|
1
|
-
# module EnginesHelper
|
2
|
-
# # Configuration and defaults
|
3
|
-
#
|
4
|
-
# mattr_accessor :autoload_assets
|
5
|
-
# self.autoload_assets = true
|
6
|
-
#
|
7
|
-
# mattr_accessor :plugin_assets_directory
|
8
|
-
# self.plugin_assets_directory = 'plugin_assets'
|
9
|
-
#
|
10
|
-
# module Assets
|
11
|
-
# extend self
|
12
|
-
#
|
13
|
-
# # Propagate the public folders
|
14
|
-
# def propagate
|
15
|
-
# return if !EnginesHelper.autoload_assets
|
16
|
-
# plugin_list.each do |plugin|
|
17
|
-
# FileUtils.mkdir_p "#{Rails.root}/public/#{EnginesHelper.plugin_assets_directory}/#{plugin}"
|
18
|
-
# Dir.glob("#{Rails.root}/vendor/plugins/#{plugin}/public/*").each do |asset_path|
|
19
|
-
# FileUtils.cp_r(asset_path, "#{Rails.root}/public/#{EnginesHelper.plugin_assets_directory}/#{plugin}/.", :preserve => true)
|
20
|
-
# end
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# def update_sass_directories
|
25
|
-
#
|
26
|
-
# if check_for_sass
|
27
|
-
#
|
28
|
-
# unless Sass::Plugin.options[:template_location].is_a?(Hash)
|
29
|
-
# Sass::Plugin.options[:template_location] = {
|
30
|
-
# Sass::Plugin.options[:template_location] => Sass::Plugin.options[:template_location].gsub(/\/sass$/, '') }
|
31
|
-
# end
|
32
|
-
#
|
33
|
-
# Dir.glob("#{Rails.root}/public/#{EnginesHelper.plugin_assets_directory}/**/sass") do |sass_dir|
|
34
|
-
# Sass::Plugin.options[:template_location] =
|
35
|
-
# Sass::Plugin.options[:template_location].merge({
|
36
|
-
# sass_dir => sass_dir.gsub(/\/sass$/, '')
|
37
|
-
# })
|
38
|
-
# end
|
39
|
-
#
|
40
|
-
# end
|
41
|
-
# end
|
42
|
-
#
|
43
|
-
# private
|
44
|
-
#
|
45
|
-
# def plugin_list
|
46
|
-
# Dir.glob("#{Rails.root}/vendor/plugins/*").reject { |p|
|
47
|
-
# !File.exist?("#{Rails.root}/vendor/plugins/#{File.basename(p)}/public")
|
48
|
-
# }.map { |d| File.basename(d) }
|
49
|
-
# end
|
50
|
-
#
|
51
|
-
# def check_for_sass
|
52
|
-
# defined?(Sass) && Sass.version[:major]*10 + Sass.version[:minor] >= 21
|
53
|
-
# end
|
54
|
-
#
|
55
|
-
# end
|
56
|
-
#
|
57
|
-
#
|
58
|
-
# end
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
# #
|
63
|
-
# # These helpers are right out of the original Engines plugin
|
64
|
-
# #
|
65
|
-
#
|
66
|
-
# module AssetHelpers
|
67
|
-
# def self.included(base) #:nodoc:
|
68
|
-
# base.class_eval do
|
69
|
-
# [:stylesheet_link_tag, :javascript_include_tag, :image_path, :image_tag].each do |m|
|
70
|
-
# alias_method_chain m, :engine_additions
|
71
|
-
# end
|
72
|
-
# end
|
73
|
-
# end
|
74
|
-
#
|
75
|
-
# # Adds plugin functionality to Rails' default stylesheet_link_tag method.
|
76
|
-
# def stylesheet_link_tag_with_engine_additions(*sources)
|
77
|
-
# stylesheet_link_tag_without_engine_additions(*AssetHelpers.pluginify_sources("stylesheets", *sources))
|
78
|
-
# end
|
79
|
-
#
|
80
|
-
# # Adds plugin functionality to Rails' default javascript_include_tag method.
|
81
|
-
# def javascript_include_tag_with_engine_additions(*sources)
|
82
|
-
# javascript_include_tag_without_engine_additions(*AssetHelpers.pluginify_sources("javascripts", *sources))
|
83
|
-
# end
|
84
|
-
#
|
85
|
-
# #
|
86
|
-
# # Our modified image_path now takes a 'plugin' option, though it doesn't require it
|
87
|
-
# #
|
88
|
-
#
|
89
|
-
# # Adds plugin functionality to Rails' default image_path method.
|
90
|
-
# def image_path_with_engine_additions(source, options={})
|
91
|
-
# options.stringify_keys!
|
92
|
-
# source = AssetHelpers.plugin_asset_path(options["plugin"], "images", source) if options["plugin"]
|
93
|
-
# image_path_without_engine_additions(source)
|
94
|
-
# end
|
95
|
-
#
|
96
|
-
# # Adds plugin functionality to Rails' default image_tag method.
|
97
|
-
# def image_tag_with_engine_additions(source, options={})
|
98
|
-
# options.stringify_keys!
|
99
|
-
# if options["plugin"]
|
100
|
-
# source = AssetHelpers.plugin_asset_path(options["plugin"], "images", source)
|
101
|
-
# options.delete("plugin")
|
102
|
-
# end
|
103
|
-
# image_tag_without_engine_additions(source, options)
|
104
|
-
# end
|
105
|
-
#
|
106
|
-
# #
|
107
|
-
# # The following are methods on this module directly because of the weird-freaky way
|
108
|
-
# # Rails creates the helper instance that views actually get
|
109
|
-
# #
|
110
|
-
#
|
111
|
-
# # Convert sources to the paths for the given plugin, if any plugin option is given
|
112
|
-
# def self.pluginify_sources(type, *sources)
|
113
|
-
# options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }
|
114
|
-
# sources.map! { |s| plugin_asset_path(options["plugin"], type, s) } if options["plugin"]
|
115
|
-
# options.delete("plugin") # we don't want it appearing in the HTML
|
116
|
-
# sources << options # re-add options
|
117
|
-
# end
|
118
|
-
#
|
119
|
-
# # Returns the publicly-addressable relative URI for the given asset, type and plugin
|
120
|
-
# def self.plugin_asset_path(plugin_name, type, asset)
|
121
|
-
# #raise "No plugin called '#{plugin_name}' - please use the full name of a loaded plugin." if !File.exist?("#{Rails.root}/public/#{plugin_name}/#{type}/#{asset}")
|
122
|
-
# "/#{plugin_name}/#{type}/#{asset}"
|
123
|
-
# end
|
124
|
-
#
|
125
|
-
# end
|
126
|
-
#
|
127
|
-
# module ::ActionView::Helpers::AssetTagHelper
|
128
|
-
# if !self.included_modules.include? AssetHelpers
|
129
|
-
# include AssetHelpers
|
130
|
-
# end
|
131
|
-
# end
|