Commit 9bd32efd3feaf392badb3067678474b2e8404daf

Authored by Hugo Melo
1 parent 76a472db

Adjust new threshold location on badges

views/gamification_plugin_badges/_form.html.erb
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 <%= d.label :threshold %><br /> 41 <%= d.label :threshold %><br />
42 <%= d.text_field :threshold, {value: action.fetch('threshold', "")} %> 42 <%= d.text_field :threshold, {value: action.fetch('threshold', "")} %>
43 </div> 43 </div>
  44 + <br>
44 <% end %> 45 <% end %>
45 <% end %> 46 <% end %>
46 </div> 47 </div>
views/gamification_plugin_badges/show.html.erb
@@ -24,7 +24,10 @@ @@ -24,7 +24,10 @@
24 24
25 <p> 25 <p>
26 <b>Threshold:</b> 26 <b>Threshold:</b>
27 - <%= @gamification_plugin_badge.threshold %> 27 + <% @gamification_plugin_badge.custom_fields.is_a? Hash %>
  28 + <% @gamification_plugin_badge.custom_fields.keys.each do |key| %>
  29 + <div><%= _(key) + ': ' + @gamification_plugin_badge.custom_fields[key].fetch("threshold", "") %></div>
  30 + <% end %>
28 </p> 31 </p>
29 32
30 33