Sha256: 6ed7fc38a3206572a4c6eab48e93404539e52a09fd29f796736e8002c3e8c79f

Contents?: true

Size: 1.32 KB

Versions: 13

Compression:

Stored size: 1.32 KB

Contents

<% cache({:locale => Language.locale_id, :format => 'pjs', :details => @details,
          :grain_size => @grain_size, :q => @search, :omit_feeds => @omit_feeds,
          :page => @page, :per_page => @per_page}) do %>
<% if !@results.blank? %>
function truncate(text, length) {
    nEnd = text.indexOf(" ", 200);
    if (nEnd < 200) return text;
    else return text.substring(0, nEnd) + " ...";
}
var recs = <%= @results.to_json %>;
var app = "<%= request.protocol + request.host_with_port + '/' %>";
document.write('<div class="oer_recommender_container">');
document.write('<div class="oer_recommender_list">');
for(nRec = 0; nRec < recs.length; nRec++) {
	r = recs[nRec].entry;
    if (r == null) r = recs[nRec].attributes;
    if (r == null) r = recs[nRec];
	document.write('<p class="oer_recommender_item">');
	document.write('<a class="oer_recommender_recommendation_link" href="' + app + 'visits/' + r.id + '">' + r.title + ' (' + r.collection + ')</a>');
<% if @details == 'true' %>
    if (r.description) document.write('<br/><span class="oer_recommender_description">' + truncate(r.description) + '</span>');
    document.write('<br/><span class="oer_recommender_uri">' + r.permalink + '</span>');
	document.write('</p>');
<% end %>
}
document.write('</div>');
document.write('</div>');
<% end %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
muck-services-3.3.3 app/views/entries/search.pjs.erb
muck-services-3.3.2 app/views/entries/search.pjs.erb
muck-services-3.3.1 app/views/entries/search.pjs.erb
muck-services-3.3.0 app/views/entries/search.pjs.erb
muck-services-3.2.2 app/views/entries/search.pjs.erb
muck-services-3.2.1 app/views/entries/search.pjs.erb
muck-services-3.2.0 app/views/entries/search.pjs.erb
muck-services-3.1.1 app/views/entries/search.pjs.erb
muck-services-3.1.0 app/views/entries/search.pjs.erb
muck-services-0.1.47 app/views/entries/search.pjs.erb
muck-services-3.0.0 app/views/entries/search.pjs.erb
muck-services-0.1.46 app/views/entries/search.pjs.erb
muck-services-0.1.45 app/views/entries/search.pjs.erb