Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
Truncate descriptions on event list to prevent long descriptions from…
Browse files Browse the repository at this point in the history
… filling page
  • Loading branch information
EricPickup committed May 9, 2019
1 parent 233f05c commit e8170dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/events/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<%= event.start_date.strftime('%A, %B %d, %Y %l:%M%P') %> - <%= event.end_time.strftime('%l:%M%P') %>
(in <%= distance_of_time_in_words(Time.now, event.start_date) %>)
</h6>
<p class="card-text"><%= markdown(event.description) %></p>
<p class="card-text"><%= truncate(strip_tags(markdown(event.description)), length: 200) %></p>
<%= link_to 'View', event_path(event), class: "card-link btn btn-primary" %>
<% if current_user&.is_admin? %>
<%= link_to 'Edit', edit_event_path(event), class: "card-link btn btn-warning" %>
Expand All @@ -38,7 +38,7 @@
<%= event.start_date.strftime('%A, %B %d, %Y %l:%M%P') %> - <%= event.end_time.strftime('%l:%M%P') %>
(<%= distance_of_time_in_words(Time.now, event.start_date) %> ago)
</h6>
<p class="card-text"><%= markdown(event.description) %></p>
<p class="card-text"><%= truncate(strip_tags(markdown(event.description)), length: 200) %></p>
<%= link_to 'View', event_path(event), class: "card-link btn btn-primary" %>
<% if current_user&.is_admin? %>
<%= link_to 'Edit', edit_event_path(event), class: "card-link btn btn-warning" %>
Expand Down

0 comments on commit e8170dc

Please sign in to comment.