From b7c5853de5f0f04625eab6389cba9de8b02e48fb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 12 May 2025 14:53:31 -0400 Subject: Added streams index --- app/views/streams/index.html.haml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/views/streams/index.html.haml (limited to 'app/views/streams/index.html.haml') diff --git a/app/views/streams/index.html.haml b/app/views/streams/index.html.haml new file mode 100644 index 0000000..bf5073f --- /dev/null +++ b/app/views/streams/index.html.haml @@ -0,0 +1,19 @@ +%table#streams-index + %tr#streams-index-header-row + %th Stream Topic + %th Updates + %th Last Post + - @streams.each do |stream| + %tr + %td + = link_to stream.title, stream, class: "stream-link" + %br + %time= stream.created_at.strftime("%B #{stream.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") + %td= stream.updates.size + %td + - unless stream.updates.empty? + - latest_post = stream.updates.order(created_at: :desc).first + = link_to (stripped_markdown(latest_post.body)[0, 30] + "..."), stream + %br + %time= latest_post.created_at.strftime("%B #{latest_post.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") += will_paginate @streams -- cgit 1.4.1