muck-services 0.1.46 → 0.1.47
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/admin/muck/feeds_controller.rb +1 -1
- data/app/controllers/muck/feeds_controller.rb +1 -1
- data/app/helpers/muck_services_feeds_helper.rb +3 -3
- data/app/models/aggregation.rb +15 -1
- data/app/views/admin/feeds/index.html.erb +9 -8
- data/app/views/admin/oai_endpoints/index.html.erb +4 -4
- data/app/views/feeds/index.html.erb +8 -7
- data/lib/muck_services.rb +1 -0
- data/locales/en.yml +2 -0
- data/muck-services.gemspec +2 -4
- metadata +4 -7
- data/VERSION.orig +0 -5
- data/test/rails_root/test/unit/one_test.rb +0 -13
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.47
|
@@ -3,7 +3,7 @@ class Admin::Muck::FeedsController < Admin::Muck::BaseController
|
|
3
3
|
unloadable
|
4
4
|
|
5
5
|
def index
|
6
|
-
@feeds =
|
6
|
+
@feeds = Aggregation.global_feeds(params[:order], params[:asc]).paginate(:page => @page, :per_page => @per_page)
|
7
7
|
respond_to do |format|
|
8
8
|
format.html { render :template => 'admin/feeds/index' }
|
9
9
|
format.xml { render :xml => @feeds.to_xml }
|
@@ -6,7 +6,7 @@ class Muck::FeedsController < ApplicationController
|
|
6
6
|
before_filter :get_owner, :except => ['index', 'show']
|
7
7
|
|
8
8
|
def index
|
9
|
-
@feeds =
|
9
|
+
@feeds = Aggregation.global_feeds(params[:order], params[:asc]).paginate(:page => @page, :per_page => @per_page)
|
10
10
|
respond_to do |format|
|
11
11
|
format.html { render :template => 'feeds/index' }
|
12
12
|
format.xml { render :xml => @feeds.to_xml }
|
@@ -14,18 +14,18 @@ module MuckServicesFeedsHelper
|
|
14
14
|
|
15
15
|
def feed_contributor_link(feed)
|
16
16
|
if feed.contributor_id.nil?
|
17
|
-
admin = Feed.find_by_login('admin')
|
17
|
+
# admin = Feed.find_by_login('admin')
|
18
18
|
'unknown'
|
19
19
|
else
|
20
20
|
link_to feed.contributor.display_name, profile_path(feed.contributor)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def sort_feeds_url(current_order, current_asc, new_order, admin = false)
|
25
25
|
if admin == true
|
26
26
|
admin_feeds_url(:order => new_order, :asc => (current_order == new_order && (current_asc == 'true' || current_asc == nil)) ? 'false' : 'true')
|
27
27
|
else
|
28
|
-
feeds_url(:order => new_order, :asc => (current_order == new_order && (current_asc == '
|
28
|
+
feeds_url(:order => new_order, :asc => (current_order == new_order && (current_asc == 'false' || current_asc == nil)) ? 'true' : 'false')
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
data/app/models/aggregation.rb
CHANGED
@@ -30,7 +30,21 @@ class Aggregation < ActiveRecord::Base
|
|
30
30
|
named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
|
31
31
|
named_scope :newest, :order => "created_at DESC"
|
32
32
|
|
33
|
-
|
33
|
+
|
34
|
+
def self.global_feeds(order_field = 'title', ascending = 'true')
|
35
|
+
allowed_fields = ['languages.english_name','status','entries_count','harvested_from_title','last_harvested_at','created_at','feed_contributor']
|
36
|
+
order_direction = (ascending == 'false' ? ' DESC' : ' ASC')
|
37
|
+
order_by = allowed_fields.include?(order_field) ? (order_field + order_direction + ', title') : ('title ' + order_direction)
|
38
|
+
|
39
|
+
Feed.find_by_sql("SELECT users.id feed_contributor_id, users.login feed_contributor, languages.english_name default_language_name, feeds.*, aggregation_id <=> 1 FROM aggregations " +
|
40
|
+
"INNER JOIN aggregation_feeds ON aggregations.id = aggregation_feeds.aggregation_id " +
|
41
|
+
"RIGHT OUTER JOIN feeds ON aggregation_feeds.feed_id = feeds.id " +
|
42
|
+
"INNER JOIN languages ON feeds.default_language_id = languages.id " +
|
43
|
+
"LEFT OUTER JOIN users ON feeds.contributor_id = users.id " +
|
44
|
+
# "WHERE aggregations.title = 'global_feeds' AND feeds.status >= 0 " +
|
45
|
+
"ORDER BY #{order_by}")
|
46
|
+
end
|
47
|
+
|
34
48
|
# Builds and then adds feeds for a given terms
|
35
49
|
# user: User to be associated with each feed. Default is nil which makes each feed global.
|
36
50
|
# service_ids: An array of service ids. Nil will generate a feed for every available service.
|
@@ -7,14 +7,15 @@
|
|
7
7
|
</p>
|
8
8
|
<table class="feeds">
|
9
9
|
<tr>
|
10
|
-
<th><%= link_to t('muck.services.approval_status'),
|
11
|
-
<th><%= link_to t('muck.services.
|
12
|
-
<th><%= link_to t('muck.services.
|
13
|
-
<th><%= link_to t('muck.services.
|
14
|
-
<th><%= link_to t('muck.services.
|
15
|
-
<th><%= link_to t('muck.services.
|
16
|
-
<th><%= link_to t('muck.services.
|
17
|
-
<th><%= link_to t('muck.services.
|
10
|
+
<th><%= link_to t('muck.services.approval_status'), sort_feeds_url(params[:order], params[:asc], 'status', true) %></th>
|
11
|
+
<th><%= link_to t('muck.services.entries_count'), sort_feeds_url(params[:order], params[:asc], 'entries_count', true) %></th>
|
12
|
+
<th><%= link_to t('muck.services.title'), sort_feeds_url(params[:order], params[:asc], 'title', true) %></th>
|
13
|
+
<th><%= link_to t('muck.services.contributor'), sort_feeds_url(params[:order], params[:asc], 'feed_contributor', true) %></th>
|
14
|
+
<th width="70px"><%= link_to t('muck.services.added_date'), sort_feeds_url(params[:order], params[:asc], 'created_at', true) %></th>
|
15
|
+
<th width="120px"><%= link_to t('muck.services.harvested_at'), sort_feeds_url(params[:order], params[:asc], 'last_harvested_at', true) %></th>
|
16
|
+
<th><%= link_to t('muck.services.default_language'), sort_feeds_url(params[:order], params[:asc], 'languages.english_name', true) %></th>
|
17
|
+
<th><%= link_to t('muck.services.repository'), sort_feeds_url(params[:order], params[:asc], 'harvested_from_title', true) %></th>
|
18
|
+
<th><%= link_to t('muck.services.status'), sort_feeds_url(params[:order], params[:asc], 'status') %></th>
|
18
19
|
</tr>
|
19
20
|
<%= render :partial => 'feeds/feed_row', :collection => @feeds, :locals => { :show_admin => true } %>
|
20
21
|
</table>
|
@@ -7,10 +7,10 @@
|
|
7
7
|
</p>
|
8
8
|
<table class="feeds">
|
9
9
|
<tr>
|
10
|
-
<th><%= link_to t('muck.services.status'),
|
11
|
-
<th><%= link_to t('muck.services.default_language'),
|
12
|
-
<th><%= link_to t('muck.services.title'),
|
13
|
-
<th><%= link_to t('muck.services.added_date'),
|
10
|
+
<th><%= link_to t('muck.services.status'), sort_feeds_url(params[:order], params[:asc], 'status', true) %></th>
|
11
|
+
<th><%= link_to t('muck.services.default_language'), sort_feeds_url(params[:order], params[:asc], 'languages.english_name', true) %></th>
|
12
|
+
<th><%= link_to t('muck.services.title'), sort_feeds_url(params[:order], params[:asc], 'title', true) %></th>
|
13
|
+
<th><%= link_to t('muck.services.added_date'), sort_feeds_url(params[:order], params[:asc], 'created_at', true) %></th>
|
14
14
|
</tr>
|
15
15
|
<%= render :partial => 'oai_endpoints/oai_endpoint_row', :collection => @oai_endpoints, :locals => { :show_admin => true } %>
|
16
16
|
</table>
|
@@ -7,13 +7,14 @@
|
|
7
7
|
</p>
|
8
8
|
<table class="feeds">
|
9
9
|
<tr>
|
10
|
-
<th><%= link_to t('muck.services.
|
11
|
-
<th><%= link_to t('muck.services.
|
12
|
-
<th><%= link_to t('muck.services.
|
13
|
-
<th><%= link_to t('muck.services.
|
14
|
-
<th><%= link_to t('muck.services.
|
15
|
-
<th><%= link_to t('muck.services.
|
16
|
-
<th><%= link_to t('muck.services.
|
10
|
+
<th><%= link_to t('muck.services.entries_count'), sort_feeds_url(params[:order], params[:asc], 'entries_count') %></th>
|
11
|
+
<th><%= link_to t('muck.services.title'), sort_feeds_url(params[:order], params[:asc], 'title') %></th>
|
12
|
+
<th><%= link_to t('muck.services.contributor'), sort_feeds_url(params[:order], params[:asc], 'feed_contributor') %></th>
|
13
|
+
<th width="70px"><%= link_to t('muck.services.added_date'), sort_feeds_url(params[:order], params[:asc], 'created_at') %></th>
|
14
|
+
<th width="120px"><%= link_to t('muck.services.harvested_at'), sort_feeds_url(params[:order], params[:asc], 'last_harvested_at') %></th>
|
15
|
+
<th><%= link_to t('muck.services.default_language'), sort_feeds_url(params[:order], params[:asc], 'languages.english_name') %></th>
|
16
|
+
<th><%= link_to t('muck.services.repository'), sort_feeds_url(params[:order], params[:asc], 'harvested_from_title') %></th>
|
17
|
+
<th><%= link_to t('muck.services.status'), sort_feeds_url(params[:order], params[:asc], 'status') %></th>
|
17
18
|
</tr>
|
18
19
|
<%= render :partial => 'feeds/feed_row', :collection => @feeds %>
|
19
20
|
</table>
|
data/lib/muck_services.rb
CHANGED
@@ -20,3 +20,4 @@ ActiveRecord::Base.class_eval { include ActiveRecord::Acts::MuckAggregationOwner
|
|
20
20
|
ActiveRecord::Base.class_eval { include ActiveRecord::Acts::MuckRecommendations }
|
21
21
|
|
22
22
|
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]
|
23
|
+
MuckEngine.add_muck_admin_nav_item('Feeds', '/admin/feeds')
|
data/locales/en.yml
CHANGED
data/muck-services.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-services}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.47"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joel Duffin", "Justin Ball"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-21}
|
13
13
|
s.description = %q{This gem contains the rails specific code for dealing with feeds, aggregations and recommendations. It is meant to work with the muck-raker gem.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
"README.rdoc",
|
24
24
|
"Rakefile",
|
25
25
|
"VERSION",
|
26
|
-
"VERSION.orig",
|
27
26
|
"app/controllers/admin/muck/feeds_controller.rb",
|
28
27
|
"app/controllers/admin/muck/oai_endpoints_controller.rb",
|
29
28
|
"app/controllers/muck/aggregation_feeds_controller.rb",
|
@@ -529,7 +528,6 @@ Gem::Specification.new do |s|
|
|
529
528
|
"test/rails_root/test/unit/feed_test.rb",
|
530
529
|
"test/rails_root/test/unit/identity_feed_test.rb",
|
531
530
|
"test/rails_root/test/unit/oai_endpoint_test.rb",
|
532
|
-
"test/rails_root/test/unit/one_test.rb",
|
533
531
|
"test/rails_root/test/unit/personal_recommendation_test.rb",
|
534
532
|
"test/rails_root/test/unit/recommendation_test.rb",
|
535
533
|
"test/rails_root/test/unit/service_category_test.rb",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 69
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 47
|
10
|
+
version: 0.1.47
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joel Duffin
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-10-21 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -203,7 +203,6 @@ files:
|
|
203
203
|
- README.rdoc
|
204
204
|
- Rakefile
|
205
205
|
- VERSION
|
206
|
-
- VERSION.orig
|
207
206
|
- app/controllers/admin/muck/feeds_controller.rb
|
208
207
|
- app/controllers/admin/muck/oai_endpoints_controller.rb
|
209
208
|
- app/controllers/muck/aggregation_feeds_controller.rb
|
@@ -701,7 +700,6 @@ files:
|
|
701
700
|
- test/rails_root/test/unit/feed_test.rb
|
702
701
|
- test/rails_root/test/unit/identity_feed_test.rb
|
703
702
|
- test/rails_root/test/unit/oai_endpoint_test.rb
|
704
|
-
- test/rails_root/test/unit/one_test.rb
|
705
703
|
- test/rails_root/test/unit/personal_recommendation_test.rb
|
706
704
|
- test/rails_root/test/unit/recommendation_test.rb
|
707
705
|
- test/rails_root/test/unit/service_category_test.rb
|
@@ -844,7 +842,6 @@ test_files:
|
|
844
842
|
- test/rails_root/test/unit/feed_test.rb
|
845
843
|
- test/rails_root/test/unit/identity_feed_test.rb
|
846
844
|
- test/rails_root/test/unit/oai_endpoint_test.rb
|
847
|
-
- test/rails_root/test/unit/one_test.rb
|
848
845
|
- test/rails_root/test/unit/personal_recommendation_test.rb
|
849
846
|
- test/rails_root/test/unit/recommendation_test.rb
|
850
847
|
- test/rails_root/test/unit/service_category_test.rb
|
data/VERSION.orig
DELETED