From 1d78ba374d5fa61ddba63db7a1c4c159e3e6a7af Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 12 May 2025 14:01:39 -0400 Subject: Markdownify streams & updates Also added an edit link to updates. --- app/assets/stylesheets/main/entries.scss | 11 ++++++++++- app/views/streams/_stream.html.haml | 2 +- app/views/updates/_update.html.haml | 7 +++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/main/entries.scss b/app/assets/stylesheets/main/entries.scss index 4afd15d..6ccaf7e 100644 --- a/app/assets/stylesheets/main/entries.scss +++ b/app/assets/stylesheets/main/entries.scss @@ -153,7 +153,6 @@ .update-posted { display: block; - font-style: italic; background-color: #EAADEA; font-size: 16px; margin: .5em -20px; @@ -161,6 +160,16 @@ border-width: 1px 0 1px 0; border-style: solid; border-color: #DB70DB; + + time { + font-style: italic; + } + + .update-edit-link { + float: right; + color: blue; + font-weight: normal; + } } } } diff --git a/app/views/streams/_stream.html.haml b/app/views/streams/_stream.html.haml index 84a6478..74e8a19 100644 --- a/app/views/streams/_stream.html.haml +++ b/app/views/streams/_stream.html.haml @@ -1,6 +1,6 @@ %article#stream-post %h2#stream-title= stream.title - unless stream.body.blank? - %header#stream-intro.entry-content= stream.body.html_safe + %header#stream-intro.entry-content= markdown(stream.body) - unless stream.updates.empty? = render stream.updates diff --git a/app/views/updates/_update.html.haml b/app/views/updates/_update.html.haml index 57f4158..3647ca2 100644 --- a/app/views/updates/_update.html.haml +++ b/app/views/updates/_update.html.haml @@ -1,3 +1,6 @@ %section.stream-update.entry-content{ id: "update-#{update.id}" } - %time.update-posted= update.created_at.strftime("%B #{update.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") - = update.body.html_safe + %header.update-posted + %time= update.created_at.strftime("%B #{update.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") + - if user_signed_in? and !update.new_record? + = link_to "Edit", edit_admin_stream_update_path(update.stream, update), :class => "update-edit-link" + = markdown(update.body) -- cgit 1.4.1