docbrown/app/views/notifications/_badgeachievement.html.erb
Vaidehi Joshi 7fbbfa0a2d
[15 Min Fix]: Fix template error in badge achievement notification view (#13186)
* Fix template error in badge achievement notification view

Fixes https://app.honeybadger.io/projects/72638/faults/78624140.

* hello travis are you there its me vaidehi

* why arent you building my PR come onnnnn
2021-03-30 10:45:37 -07:00

21 lines
1.6 KiB
Text

<% json_data = notification.json_data %>
<div class="crayons-card notification notification--promoted grid gap-4">
<header class="mb-2 m:mb-4">
<h3 class="fw-normal fs-l s:fs-xl m:fs-2xl">
You received the <strong class="fw-bold"><%= sanitize(json_data["badge_achievement"]["badge"]["title"]) %></strong> badge
</h3>
<p class="fs-l"><%= json_data["badge_achievement"]["badge"]["description"] %></p>
</header>
<div class="crayons-card crayons-card--secondary p-4 w-100 grid gap-2">
<img class="w-100 max-w-50 l:max-w-25 h-auto inline-block mx-auto" src="<%= optimized_image_url(json_data["badge_achievement"]["badge"]["badge_image_url"], width: 250) %>" alt="<%= json_data["badge_achievement"]["badge"]["title"] %>">
<p class="color-base-70"><em><%= json_data["badge_achievement"]["rewarding_context_message"].to_s.html_safe %></em></p>
</div>
<p class="self-stretch"><a href="<%= json_data["user"]["path"] %>" class="crayons-btn w-100 m:w-50">Visit your profile</a></p>
<% credits_awarded = json_data["badge_achievement"]["badge"]["credits_awarded"] %>
<% unless credits_awarded.present? && credits_awarded.zero? %>
<p class="max-w-75 mx-auto">You also get <a href="/credits" class="crayons-link crayons-link--brand fw-bold"><%= json_data["badge_achievement"]["badge"]["credits_awarded"] %> new credits</a> to use for <a href="/listings">community listings</a> if you have anything you'd like to promote. 🎉</p>
<p class="fs-s"><a href="<%= about_listings_url %>" class="crayons-link crayons-link--secondary">More information about listings<a></p>
<% end %>
</div>