Commit 19fcea5d8fb3caf9593979074daa48f4040168fe

Authored by Leandro Santos
2 parents 6b56cd1f 9bd32efd

Merge branch 'working' into 'master'

Adjust new badges threshold location on admin show and remove from index



See merge request !8
views/gamification_plugin_badges/_form.html.erb
... ... @@ -41,6 +41,7 @@
41 41 <%= d.label :threshold %><br />
42 42 <%= d.text_field :threshold, {value: action.fetch('threshold', "")} %>
43 43 </div>
  44 + <br>
44 45 <% end %>
45 46 <% end %>
46 47 </div>
... ...
views/gamification_plugin_badges/index.html.erb
... ... @@ -5,7 +5,6 @@
5 5 <th>Name</th>
6 6 <th>Title</th>
7 7 <th>Level</th>
8   - <th>Threshold</th>
9 8 <th></th>
10 9 <th></th>
11 10 <th></th>
... ... @@ -16,7 +15,6 @@
16 15 <td><%= gamification_plugin_badge.name %></td>
17 16 <td><%= gamification_plugin_badge.title %></td>
18 17 <td><%= gamification_plugin_badge.level %></td>
19   - <td><%= gamification_plugin_badge.threshold %></td>
20 18 <td><%= link_to 'Show', :action => :show, :id => gamification_plugin_badge.id %></td>
21 19 <td><%= link_to 'Edit', :action => :edit, :id => gamification_plugin_badge.id %></td>
22 20 <td><%= button_without_text :delete, _('Remove'), {:action => :destroy, :id => gamification_plugin_badge.id}, :method => :post, :confirm => _('Are you sure?') %></td>
... ...
views/gamification_plugin_badges/show.html.erb
... ... @@ -24,7 +24,10 @@
24 24  
25 25 <p>
26 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 31 </p>
29 32  
30 33  
... ...