Skip to content

Commit

Permalink
make icons look gooder
Browse files Browse the repository at this point in the history
  • Loading branch information
loftwah committed Sep 3, 2023
1 parent 4a4d68f commit 1c3ce80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/views/links/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
<td><%= link.links_group %></td>
<td><%= link.links_url %></td>
<td><%= link.links_display_name %></td>
<td class="text-center"><i class="<%= link.links_icon %>"></i></td>
<td class="text-center">
<img
src="https://www.google.com/s2/favicons?domain=<%= URI.parse(link.links_url).host.split('.').last(2).join('.') %>"
alt="favicon"
class="fa-2x text-light"
onerror="this.alt=''; this.style.display='none'; this.nextElementSibling.style.display='inline-block';">
<i class="<%= link.links_icon %> fa-2x text-light" style="display:none;"></i>
</td>
<td class="<%= link.links_enabled ? 'text-success' : 'text-danger' %>">
<%= link.links_enabled ? 'Enabled' : 'Disabled' %>
</td>
Expand Down
7 changes: 6 additions & 1 deletion app/views/links/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
<div class="list-group-item d-flex justify-content-between align-items-center">
<span class="fw-bold">Icon:</span>
<span class="d-flex align-items-center">
<i class="<%= @link.links_icon %>"></i>
<img
src="https://www.google.com/s2/favicons?domain=<%= URI.parse(link.links_url).host.split('.').last(2).join('.') %>"
alt="favicon"
class="fa-2x text-light"
onerror="this.alt=''; this.style.display='none'; this.nextElementSibling.style.display='inline-block';">
<i class="<%= link.links_icon %> fa-2x text-light" style="display:none;"></i>
</span>
</div>
<div class="list-group-item d-flex justify-content-between align-items-center">
Expand Down

0 comments on commit 1c3ce80

Please sign in to comment.