diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:07:50 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:25:15 -0400 |
commit | 775418918782d5284000ed0bfea364458c748567 (patch) | |
tree | c31e3633a3bcbed17b000f0165cf35edad41f7ca /app/views/admin/users | |
parent | 1413c23c502d5a5cbc9b81f553a245103c1d6e50 (diff) | |
download | gitlab-ce-775418918782d5284000ed0bfea364458c748567.tar.gz |
Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
Diffstat (limited to 'app/views/admin/users')
-rw-r--r-- | app/views/admin/users/_form.html.haml | 20 | ||||
-rw-r--r-- | app/views/admin/users/index.html.haml | 34 | ||||
-rw-r--r-- | app/views/admin/users/show.html.haml | 22 |
3 files changed, 38 insertions, 38 deletions
diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index c1955b321d5..5e68a23f494 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -22,17 +22,17 @@ -if f.object.new_record? .clearfix - = f.label :admin, :class => "checkbox" do + = f.label :admin, class: "checkbox" do = f.check_box :force_random_password, {}, true, nil %span Generate random password %div.password-fields .clearfix = f.label :password - .input= f.password_field :password, :disabled => f.object.force_random_password + .input= f.password_field :password, disabled: f.object.force_random_password .clearfix = f.label :password_confirmation - .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password + .input= f.password_field :password_confirmation, disabled: f.object.force_random_password %hr .clearfix = f.label :skype @@ -46,27 +46,27 @@ .span6 .clearfix = f.label :projects_limit - .input= f.text_field :projects_limit, :class => "small_input" + .input= f.text_field :projects_limit, class: "small_input" .alert .clearfix %p Make the user a GitLab administrator. - = f.label :admin, :class => "checkbox" do + = f.label :admin, class: "checkbox" do = f.check_box :admin %span Administrator - unless @admin_user.new_record? .alert.alert-error - if @admin_user.blocked %span - = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small" + = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" This user is blocked and is not able to login to GitLab - else %span - = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" + = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" Blocked users will be removed from all projects & will not be able to login to GitLab. .actions - = f.submit 'Save', :class => "btn primary" + = f.submit 'Save', class: "btn primary" - if @admin_user.new_record? - = link_to 'Cancel', admin_users_path, :class => "btn" + = link_to 'Cancel', admin_users_path, class: "btn" - else - = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn" + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 5d5320db0e3..5edca312cc5 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,22 +1,22 @@ %h3 Users - = link_to 'New User', new_admin_user_path, :class => "btn small right" + = link_to 'New User', new_admin_user_path, class: "btn small right" %br -= form_tag admin_users_path, :method => :get do - = text_field_tag :name, params[:name], :class => "xlarge" - = submit_tag "Search", :class => "btn submit primary" += form_tag admin_users_path, method: :get do + = text_field_tag :name, params[:name], class: "xlarge" + = submit_tag "Search", class: "btn submit primary" %ul.nav.nav-pills - %li{:class => "#{'active' unless params[:filter]}"} + %li{class: "#{'active' unless params[:filter]}"} = link_to "Active", admin_users_path - %li{:class => "#{'active' if params[:filter] == "admins"}"} - = link_to admin_users_path(:filter => "admins") do + %li{class: "#{'active' if params[:filter] == "admins"}"} + = link_to admin_users_path(filter: "admins") do Admins - %li{:class => "#{'active' if params[:filter] == "blocked"}"} - = link_to admin_users_path(:filter => "blocked") do + %li{class: "#{'active' if params[:filter] == "blocked"}"} + = link_to admin_users_path(filter: "blocked") do Blocked - %li{:class => "#{'active' if params[:filter] == "wop"}"} - = link_to admin_users_path(:filter => "wop") do + %li{class: "#{'active' if params[:filter] == "wop"}"} + = link_to admin_users_path(filter: "wop") do Without projects %table.admin-table @@ -31,16 +31,16 @@ - @admin_users.each do |user| %tr - %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled + %td= check_box_tag "admin", 1, user.admin, disabled: :disabled %td= link_to user.name, [:admin, user] %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= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small" %td - if user.blocked - = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success" + = 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 '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" -= paginate @admin_users, :theme => "admin" += paginate @admin_users, theme: "admin" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 7510b1446dc..4cca8ed7a4e 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -4,7 +4,7 @@ %small Blocked - if @admin_user.admin %small Administrator - = link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right" + = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right" %br @@ -19,12 +19,12 @@ %td %b Admin: - %td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled + %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled %tr %td %b Blocked: - %td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled + %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled %tr %td %b @@ -56,7 +56,7 @@ %br %h3 Add User to Projects %br -= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do += form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do %table.table-bordered %thead %tr @@ -64,14 +64,14 @@ %th Project Access: %tr - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" + %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select" %tr - %td= submit_tag 'Add', :class => "btn primary" + %td= submit_tag 'Add', class: "btn primary" %td Read more about project permissions - %strong= link_to "here", help_permissions_path, :class => "vlink" + %strong= link_to "here", help_permissions_path, class: "vlink" %br - if @admin_user.projects.present? @@ -90,9 +90,9 @@ - project = tm.project %tr %td= link_to project.name, admin_project_path(project) - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small" - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger" :css form select { |