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,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/index.html.erb
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
5 <th>Name</th> 5 <th>Name</th>
6 <th>Title</th> 6 <th>Title</th>
7 <th>Level</th> 7 <th>Level</th>
8 - <th>Threshold</th>  
9 <th></th> 8 <th></th>
10 <th></th> 9 <th></th>
11 <th></th> 10 <th></th>
@@ -16,7 +15,6 @@ @@ -16,7 +15,6 @@
16 <td><%= gamification_plugin_badge.name %></td> 15 <td><%= gamification_plugin_badge.name %></td>
17 <td><%= gamification_plugin_badge.title %></td> 16 <td><%= gamification_plugin_badge.title %></td>
18 <td><%= gamification_plugin_badge.level %></td> 17 <td><%= gamification_plugin_badge.level %></td>
19 - <td><%= gamification_plugin_badge.threshold %></td>  
20 <td><%= link_to 'Show', :action => :show, :id => gamification_plugin_badge.id %></td> 18 <td><%= link_to 'Show', :action => :show, :id => gamification_plugin_badge.id %></td>
21 <td><%= link_to 'Edit', :action => :edit, :id => gamification_plugin_badge.id %></td> 19 <td><%= link_to 'Edit', :action => :edit, :id => gamification_plugin_badge.id %></td>
22 <td><%= button_without_text :delete, _('Remove'), {:action => :destroy, :id => gamification_plugin_badge.id}, :method => :post, :confirm => _('Are you sure?') %></td> 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,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