diff options
Diffstat (limited to 'app/views/streams')
| -rw-r--r-- | app/views/streams/_stream.html.haml | 6 | ||||
| -rw-r--r-- | app/views/streams/index.html.haml | 19 | ||||
| -rw-r--r-- | app/views/streams/show.html.haml | 2 |
3 files changed, 22 insertions, 5 deletions
| diff --git a/app/views/streams/_stream.html.haml b/app/views/streams/_stream.html.haml index 4a6b1e9..97d4813 100644 --- a/app/views/streams/_stream.html.haml +++ b/app/views/streams/_stream.html.haml | |||
| @@ -2,9 +2,7 @@ | |||
| 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= markdown(stream.body) | 4 | %header#stream-intro.entry-content= markdown(stream.body) |
| 5 | - if stream.updates.size > 10 | 5 | = will_paginate @updates |
| 6 | = will_paginate @updates | ||
| 7 | - unless @updates.empty? | 6 | - unless @updates.empty? |
| 8 | = render @updates | 7 | = render @updates |
| 9 | - if stream.updates.size > 10 | 8 | = will_paginate @updates |
| 10 | = 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 |
