blacklight_user_generated_content 0.0.3 → 0.0.4
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/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Blacklight
|
2
|
+
|
3
|
+
This is a plugin for [Blacklight](http://projectblacklight.org) that adds a basic layer of ActiveRecord-esque mocking to a Blacklight::Document/RSolr::Ext::Model class that allows it to work seamlessly with (some) extant Ruby on Rails plugins to provide "user generated content" features.
|
4
|
+
|
5
|
+
Currently, acts-as-taggable-on and acts_as_commentable are two integrations supplied by the plugin, although additional integrations should be trivial.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
(Add blacklight_user_generated_content to your gemfile)
|
10
|
+
$ rails generate blacklight_user_generated_content
|
11
|
+
generate cancan:ability # cancan authorization framework
|
12
|
+
create app/models/ability.rb
|
13
|
+
insert app/models/ability.rb
|
14
|
+
generate acts_as_taggable_on:migration
|
15
|
+
create db/migrate/20110228210334_acts_as_taggable_on_migration.rb # acts as taggable expects the taggable_id to be an int. A solr document primary key may also be a string.
|
16
|
+
create db/migrate/20110606124459_alter_taggable_id_to_string.rb
|
17
|
+
generate comment
|
18
|
+
create app/models/comment.rb
|
19
|
+
insert app/models/comment.rb
|
20
|
+
insert app/models/solr_document.rb
|
21
|
+
|
22
|
+
$ rake db:migrate
|
23
|
+
|
24
|
+
Through the Rails Engine framework, this plugin also provides resourceful controllers for tags and comments, and provides an example catalog index of user generated content.
|
25
|
+
|
26
|
+
## TODO
|
27
|
+
This plugin depends on 'cancan', an authorization framework, to restrict Comment management to the original author. Ideally, this would either be optional or pluggable.
|
28
|
+
|
29
|
+
The user generated content "index" currently requires additional information to be indexed within Solr. This integration is not provided by this plugin, however, which may limit its utility.
|
30
|
+
|
31
|
+
This plugin has only been tested against master/HEAD versions of acts-as-taggable-on and acts_as_commentable. Some stable releases of these plugins have known issues.
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.files = `git ls-files`.split("\n")
|
9
9
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
10
10
|
s.require_paths = ["lib"]
|
11
|
-
s.version = "0.0.
|
11
|
+
s.version = "0.0.4"
|
12
12
|
|
13
13
|
s.add_dependency "rails", "~> 3.0"
|
14
14
|
s.add_dependency "blacklight" #, "~> 3.0"
|
@@ -8,7 +8,7 @@ module BlacklightUserGeneratedContent
|
|
8
8
|
def restrict_to_user_generated_content_scope solr_parameters, user_parameters
|
9
9
|
solr_parameters[:fq] ||= []
|
10
10
|
if current_user
|
11
|
-
if current_user.has_role? :admin and
|
11
|
+
if current_user.has_role? :admin and user_parameters[:all]
|
12
12
|
solr_parameters[:fq] << "comments_ids_i:[* TO *]"
|
13
13
|
else
|
14
14
|
solr_parameters[:fq] << "comments_user_ids_i:#{current_user.id} OR tags_user_ids_i:#{current_user.id}"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_user_generated_content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Beer
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-06-06 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rails
|
@@ -115,7 +114,7 @@ files:
|
|
115
114
|
- .gitignore
|
116
115
|
- Gemfile
|
117
116
|
- MIT-LICENSE
|
118
|
-
- README.
|
117
|
+
- README.md
|
119
118
|
- Rakefile
|
120
119
|
- app/controllers/comments_controller.rb
|
121
120
|
- app/controllers/tags_controller.rb
|
@@ -150,7 +149,6 @@ files:
|
|
150
149
|
- lib/generators/blacklight_user_generated_content/blacklight_user_generated_content_generator.rb
|
151
150
|
- lib/generators/blacklight_user_generated_content/templates/alter_commentable_id_to_string.rb
|
152
151
|
- lib/generators/blacklight_user_generated_content/templates/alter_taggable_id_to_string.rb
|
153
|
-
has_rdoc: true
|
154
152
|
homepage:
|
155
153
|
licenses: []
|
156
154
|
|
@@ -180,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
178
|
requirements: []
|
181
179
|
|
182
180
|
rubyforge_project:
|
183
|
-
rubygems_version: 1.
|
181
|
+
rubygems_version: 1.8.4
|
184
182
|
signing_key:
|
185
183
|
specification_version: 3
|
186
184
|
summary: User Generated Content plugin for Blacklight
|
data/README.rdoc
DELETED