Skip to content

Commit

Permalink
Add megaphone icon in front of every announcement
Browse files Browse the repository at this point in the history
(on login page)
  • Loading branch information
Splines committed Jun 14, 2023
1 parent 47bfba5 commit 08c5e4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,12 @@ def first_course_independent?
end

def get_announcements
megaphone_icon_str = '<i class="bi bi-megaphone p-2"></i>'
separator_str = "<hr class=\"my-3 w-100\">#{megaphone_icon_str}"
Announcement.active_on_main
.pluck(:details)
.join('<hr class="my-3 w-100">')
.join(separator_str)
.prepend(megaphone_icon_str)
end

# Navbar items styling based on which page we are on
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/devise.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<%# Announcements %>
<% if Announcement.active_on_main.exists? %>
<div id="announcement-box" class="landing-box">
<i class="bi bi-megaphone p-2"></i>
<%= get_announcements().html_safe %>
</div>
<% end %>
Expand Down

0 comments on commit 08c5e4c

Please sign in to comment.