muck-services 0.1.40 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/views/entries/search.pjs.erb +8 -1
- data/app/views/recommendations/index.pjs.erb +3 -3
- data/config/muck_services_routes.rb +1 -0
- data/muck-services.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.41
|
@@ -1,5 +1,10 @@
|
|
1
|
+
<% cache({:locale => Language.locale_id, :format => 'pjs', :grain_size => @grain_size, :q => @search, :omit_feeds => @omit_feeds, :page => @page, :per_page => @per_page}) do %>
|
1
2
|
<% if !@results.blank? %>
|
2
|
-
|
3
|
+
function truncate(text, length) {
|
4
|
+
nEnd = text.indexOf(" ", 200);
|
5
|
+
if (nEnd < 200) return text;
|
6
|
+
else return text.substring(0, nEnd) + " ...";
|
7
|
+
}
|
3
8
|
var recs = <%= @results.to_json %>;
|
4
9
|
var app = "<%= request.protocol + request.host_with_port + '/' %>";
|
5
10
|
document.write('<div class="oer_recommender_container">');
|
@@ -10,6 +15,8 @@ for(nRec = 0; nRec < recs.length; nRec++) {
|
|
10
15
|
if (r == null) r = recs[nRec];
|
11
16
|
document.write('<p class="oer_recommender_item">');
|
12
17
|
document.write('<a class="oer_recommender_recommendation_link" href="' + app + 'visits/' + r.id + '">' + r.title + ' (' + r.collection + ')</a>');
|
18
|
+
if (r.description) document.write('<br/><span class="oer_recommender_description">' + truncate(r.description) + '</span>');
|
19
|
+
document.write('<br/><span class="oer_recommender_uri">' + r.permalink + '</span>');
|
13
20
|
document.write('</p>');
|
14
21
|
}
|
15
22
|
document.write('</div>');
|
@@ -14,10 +14,10 @@ function truncate(text, length) {
|
|
14
14
|
if (nEnd < 200) return text;
|
15
15
|
else return text.substring(0, nEnd) + " ...";
|
16
16
|
}
|
17
|
+
var once = true;
|
17
18
|
var asMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
|
18
19
|
function format_date(published_at) {
|
19
|
-
|
20
|
-
date.setTime(Date.parse(published_at));
|
20
|
+
date = new Date(Date.parse(published_at.substring(0,10).replace(/-/g,"/")));
|
21
21
|
return date.getDate() + " " + asMonths[date.getMonth()] + " " + date.getUTCFullYear();
|
22
22
|
}
|
23
23
|
<% end %>
|
@@ -36,7 +36,7 @@ for(nRec = 0; nRec < recs.length; nRec++) {
|
|
36
36
|
<% if @details == true -%>
|
37
37
|
document.write(' <span class="oer_recommender_published_at">(' + format_date(r.published_at) + ')</span>');
|
38
38
|
document.write(' <span class="oer_recommender_relevance_score"><%= t('muck.services.relevance')%>: ' + Math.round(r.relevance*100)/100 + '</span>');
|
39
|
-
document.write('<br/><span class="oer_recommender_description">' + truncate(r.description) + '</span>');
|
39
|
+
if (r.description) document.write('<br/><span class="oer_recommender_description">' + truncate(r.description) + '</span>');
|
40
40
|
document.write('<br/><span class="oer_recommender_uri">' + r.permalink + '</span>');
|
41
41
|
<% end -%>
|
42
42
|
document.write('</p>');
|
@@ -9,6 +9,7 @@ ActionController::Routing::Routes.draw do |map|
|
|
9
9
|
|
10
10
|
map.connect 'resources/search', :controller => 'muck/entries', :action => 'search'
|
11
11
|
map.connect 'resources/search.:format', :controller => 'muck/entries', :action => 'search'
|
12
|
+
map.connect 'search/results.:format', :controller => 'muck/entries', :action => 'search'
|
12
13
|
map.connect 'resources/tags/*tags', :controller => 'muck/entries', :action => 'browse_by_tags'
|
13
14
|
map.resources :resources, :controller => 'muck/entries'
|
14
15
|
|
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.41"
|
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-03-04}
|
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 = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Duffin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-
|
13
|
+
date: 2010-03-04 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|