Skip to content

Commit

Permalink
UX: Move previous alert link from top to bottom of topic body
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhnambiar committed Nov 4, 2018
1 parent 17386fd commit 0f68219
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/jobs/concerns/alert_post_mixin.rb
Expand Up @@ -112,7 +112,7 @@ def prev_topic_link(topic_id)
created_at = Topic.where(id: topic_id).pluck(:created_at).first
return "" unless created_at

"([Previous alert topic created.](#{Discourse.base_url}/t/#{topic_id}) #{local_date(created_at.to_s)})\n\n"
"[Previous alert](#{Discourse.base_url}/t/#{topic_id}) #{local_date(created_at.to_s)}\n\n"
end

def first_post_body(receiver:,
Expand All @@ -122,8 +122,8 @@ def first_post_body(receiver:,

output = ""
output += "#{topic_body}\n\n"
output += "#{prev_topic_link(prev_topic_id)}\n\n" if prev_topic_id
output += "#{render_alerts(alert_history)}\n"
output += "#{render_alerts(alert_history)}\n\n"
output += "#{prev_topic_link(prev_topic_id)}\n" if prev_topic_id
end

def revise_topic(topic:, title:, raw:, datacenters:, firing: nil, high_priority: false)
Expand Down

0 comments on commit 0f68219

Please sign in to comment.