Added badge system
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="user">
|
||||
<%= link_to user.name, user, class: "role #{user.role.name} #{"banned" if user.banned?} #{"disabled" if user.disabled?} #{"unconfirmed" unless user.confirmed?}", title: "#{user.ign} – #{user.role}", style: "color: #{fcolor(user.role.color)}; background-color: #{user.role.color}" %>
|
||||
<%= link_to "$", donate_statics_path, class: "role donor", title: "Donator" if user.donor? %>
|
||||
</div>
|
||||
<%= link_to user.badge.symbol, users_path(badge: user.badge.name), class: "role badge", title: user.badge.name, style: "color: #{fcolor(user.badge.color)}; background-color: #{user.badge.color}" unless user.badge.value == 0 %>
|
||||
</div>
|
||||
|
||||
@@ -28,15 +28,17 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Confirmed email address</td>
|
||||
<td>Badge</td>
|
||||
<td>
|
||||
<%= f.select :confirmed, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||
<% if current_user.role >= Role.get(:mod) %>
|
||||
<%= f.select :badge, Badge.all %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donator</td>
|
||||
<td>Confirmed email address</td>
|
||||
<td>
|
||||
<%= f.select :donor, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||
<%= f.select :confirmed, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -87,4 +89,4 @@
|
||||
<span class='red-alert'>This user has not confirmed his email!</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<h1>
|
||||
<% if params[:role] %>
|
||||
<% if params[:role] && !params[:badge]%>
|
||||
<%= title "All '#{params[:role]}' users" %>
|
||||
<% elsif params[:badge] && !params[:role] %>
|
||||
<%= title "All '#{params[:badge]}' users" %>
|
||||
<% elsif params[:role] && params[:badge] %>
|
||||
<%= title "All '#{params[:role]}' and '#{params[:badge]}' users" %>
|
||||
<% else %>
|
||||
<%= title "All Users" %>
|
||||
<% end %>
|
||||
(<%= @count %>)
|
||||
</h1>
|
||||
<%= link_to "show all", users_path if params[:role] %>
|
||||
<%= link_to "show all", users_path if params[:role] || params[:badge] %>
|
||||
|
||||
<div id="userlist">
|
||||
<% @users.each do |u| %>
|
||||
@@ -19,4 +23,4 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<%= paginate @users %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user