Skip to content

Commit

Permalink
Update "read more" link on tag pages to "learn more on the wiki page" (
Browse files Browse the repository at this point in the history
…fixes publiclab#2112)
  • Loading branch information
ryzokuken committed Jan 26, 2018
1 parent 6b47268 commit e204347
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/tag/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<div class="col-md-6">
<h1 style="color:#333;"><%= link_to @wiki.latest.title, "/wiki/#{params[:id]}" %></h1>
<%= @wiki.latest.render_body.match(/<p>(.+)<\/p>/).to_a.try(:first).to_s.html_safe %>
<%= link_to("Read more", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('</p>').length > 2 %>
<%= link_to("Learn more on the wiki page", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('</p>').length > 2 %>
</div>
</div>
<% else %>
<h1><%= @wiki.latest.title %></h1>
<p><%= @wiki.latest.render_body.html_safe.match(/<p>(.+)<\/p>/).to_a.try(:first).to_s.html_safe %></p>
<p><%= link_to("Read more", "/wiki/#{params[:id]}") if @wiki.latest.render_body.html_safe.match(/<p>(.+)<\/p>/).length > 1 %></p>
<p><%= link_to("Learn more on the wiki page", "/wiki/#{params[:id]}") if @wiki.latest.render_body.html_safe.match(/<p>(.+)<\/p>/).length > 1 %></p>
<% end %>
</div>
<% elsif @wildcard %>
Expand Down

0 comments on commit e204347

Please sign in to comment.