* Added credits_awarded to /admin/badges forms * Award credits only if badge has them * Removed information about credits and listings in the new badge email when not needed * Specs for number of credits awarded for badges * Added missing newline * Fix typo Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> * Improve new_badge_email.text.erb Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> * Fixed number of credits in notification * Added specs for number of credits in notifications Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
40 lines
1.3 KiB
Text
40 lines
1.3 KiB
Text
<header class="flex mb-6">
|
|
<h2 class="crayons-title"><%= "Edit Badge #{@badge.id}" %></h2>
|
|
|
|
<div class="ml-auto">
|
|
<%= link_to "Back to All Badges", admin_badges_path, class: "btn btn-primary " %>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="crayons-card p-6">
|
|
<%= form_for [:admin, @badge], method: :patch do |form| %>
|
|
<div class="form-group">
|
|
<%= form.label :title %>
|
|
<%= form.text_field :title, class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= form.label :slug, "Slug:" %>
|
|
<%= form.text_field :slug, class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= form.label :description, "Description:" %>
|
|
<%= form.text_field :description, class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= form.label :badge_image, "Badge Image:" %>
|
|
<% if @badge.badge_image %>
|
|
<img class="mx-auto mt-3" width="60" height="60" src="<%= @badge.badge_image %>" alt="badge image">
|
|
<% end %>
|
|
<%= form.file_field :badge_image, class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= form.label :credits_awarded, "Credits awarded:" %>
|
|
<%= form.text_field :credits_awarded, class: "form-control" %>
|
|
</div>
|
|
<%= submit_tag "Update Badge", class: "btn btn-primary" %>
|
|
<% end %>
|
|
</div>
|