diff options
Diffstat (limited to 'app/views/streams')
-rw-r--r-- | app/views/streams/_stream.html.haml | 8 | ||||
-rw-r--r-- | app/views/streams/index.html.haml | 19 | ||||
-rw-r--r-- | app/views/streams/show.html.haml | 2 |
3 files changed, 25 insertions, 4 deletions
diff --git a/app/views/streams/_stream.html.haml b/app/views/streams/_stream.html.haml index 84a6478..97d4813 100644 --- a/app/views/streams/_stream.html.haml +++ b/app/views/streams/_stream.html.haml | |||
@@ -1,6 +1,8 @@ | |||
1 | %article#stream-post | 1 | %article#stream-post |
2 | %h2#stream-title= stream.title | 2 | %h2#stream-title= stream.title |
3 | - unless stream.body.blank? | 3 | - unless stream.body.blank? |
4 | %header#stream-intro.entry-content= stream.body.html_safe | 4 | %header#stream-intro.entry-content= markdown(stream.body) |
5 | - unless stream.updates.empty? | 5 | = will_paginate @updates |
6 | = render stream.updates | 6 | - unless @updates.empty? |
7 | = render @updates | ||
8 | = will_paginate @updates | ||
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 @@ | |||
1 | %table#streams-index | ||
2 | %tr#streams-index-header-row | ||
3 | %th Stream Topic | ||
4 | %th Updates | ||
5 | %th Last Post | ||
6 | - @streams.each do |stream| | ||
7 | %tr | ||
8 | %td | ||
9 | = link_to stream.title, stream, class: "stream-link" | ||
10 | %br | ||
11 | %time= stream.created_at.strftime("%B #{stream.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") | ||
12 | %td= stream.updates.size | ||
13 | %td | ||
14 | - unless stream.updates.empty? | ||
15 | - latest_post = stream.updates.order(created_at: :desc).first | ||
16 | = link_to (stripped_markdown(latest_post.body)[0, 30] + "..."), stream | ||
17 | %br | ||
18 | %time= latest_post.created_at.strftime("%B #{latest_post.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") | ||
19 | = will_paginate @streams | ||
diff --git a/app/views/streams/show.html.haml b/app/views/streams/show.html.haml index 8365556..8d58f62 100644 --- a/app/views/streams/show.html.haml +++ b/app/views/streams/show.html.haml | |||
@@ -1,3 +1,3 @@ | |||
1 | - title @stream.title | 1 | - title @stream.title |
2 | .breadcrumb= link_to "← Back to home page", root_path | 2 | .breadcrumb= link_to "← Back to streams", streams_path |
3 | = render @stream | 3 | = render @stream |