Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ncsu-libraries/quick_search
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeswick committed Jul 25, 2016
2 parents bc1516f + 75d237f commit 446eec6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/views/layouts/quick_search/_best_bets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@
<% end %>
<span class='highlight'>Best&nbsp;Bet</span>
</h3>
<p><%= best_bets[:description] %></p>

<p>
<% if best_bets[:description].length > 200 %>
<%= truncate(best_bets[:description], length: 200) %>
<%= link_to 'Read more', '', class: "read-more" %>
<script>
$('.read-more').on('click', function(e) {
e.preventDefault()
$(this).parent().html('<%= escape_javascript best_bets[:description] %>')
})
</script>
<% else %>
<%= best_bets[:description] %>
<% end %>
</p>
</div>
</div>
<% end %>
Expand Down

0 comments on commit 446eec6

Please sign in to comment.