Validate username. Gitlab::Regex added

This commit is contained in:
Dmitriy Zaporozhets 2012-11-28 06:14:05 +03:00
parent 5ed4e7e216
commit 47234ab367
8 changed files with 43 additions and 13 deletions

View file

@ -6,7 +6,7 @@
= form_tag admin_users_path, method: :get, class: 'form-inline' do
= text_field_tag :name, params[:name], class: "xlarge"
= submit_tag "Search", class: "btn submit primary"
%ul.nav.nav-pills
%ul.nav.nav-tabs
%li{class: "#{'active' unless params[:filter]}"}
= link_to "Active", admin_users_path
%li{class: "#{'active' if params[:filter] == "admins"}"}
@ -23,24 +23,25 @@
%thead
%th Admin
%th Name
%th Username
%th Email
%th Projects
%th Edit
%th Blocked
%th.cred Danger Zone!
- @admin_users.each do |user|
%tr
%td= check_box_tag "admin", 1, user.admin, disabled: :disabled
%td= link_to user.name, [:admin, user]
%td= user.username
%td= user.email
%td= user.users_projects.count
%td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small"
%td
%td.bgred
- if user.blocked
= link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success"
- else
= link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
%td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
= paginate @admin_users, theme: "admin"

View file

@ -21,6 +21,12 @@
Email:
%td
= @admin_user.email
%tr
%td
%b
Username:
%td
= @admin_user.username
%tr
%td
%b