Commit bf13579b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Make admin sorting more obvious

parent 2b79706d
......@@ -2,7 +2,7 @@ class Admin::GroupsController < AdminController
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update]
def index
@groups = Group.scoped
@groups = Group.order('name ASC')
@groups = @groups.search(params[:name]) if params[:name].present?
@groups = @groups.page(params[:page]).per(20)
end
......
......@@ -3,7 +3,7 @@ class Admin::UsersController < AdminController
@admin_users = User.scoped
@admin_users = @admin_users.filter(params[:filter])
@admin_users = @admin_users.search(params[:name]) if params[:name].present?
@admin_users = @admin_users.order("updated_at DESC").page(params[:page])
@admin_users = @admin_users.order("name ASC").page(params[:page])
end
def show
......
......@@ -45,8 +45,22 @@ module Repository
end
def has_post_receive_file?
hook_file = File.join(path_to_repo, 'hooks', 'post-receive')
File.exists?(hook_file)
!!hook_file
end
def valid_post_receive_file?
valid_hook_file == hook_file
end
def valid_hook_file
@valid_hook_file ||= File.read(Rails.root.join('lib', 'hooks', 'post-receive'))
end
def hook_file
@hook_file ||= begin
hook_path = File.join(path_to_repo, 'hooks', 'post-receive')
File.read(hook_path) if File.exists?(hook_path)
end
end
# Returns an Array of branch names
......
......@@ -12,16 +12,22 @@
%table
%thead
%th Name
%th
Name
%i.icon-sort-down
%th Path
%th Projects
%th Owner
%th.cred Danger Zone!
- @groups.each do |group|
%tr
%td= link_to group.name, [:admin, group]
%td
%strong= link_to group.name, [:admin, group]
%td= group.path
%td= group.projects.count
%td
= link_to group.owner_name, admin_user_path(group.owner_id)
%td.bgred
= link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn small"
= link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small danger"
......
......@@ -9,7 +9,9 @@
%table
%thead
%th Name
%th
Name
%i.icon-sort-down
%th Path
%th Team Members
%th Last Commit
......
......@@ -4,14 +4,24 @@
%i.icon-edit
Edit
- if !@project.has_post_receive_file? && @project.has_commits?
%br
.alert.alert-error
%span
%strong Important!
Project has commits but missing post-receive file.
%br
If you exported project manually - copy post-receive hook to bare repository
- if @project.has_commits?
- if !@project.has_post_receive_file?
%br
.alert.alert-error
%span
%strong Project has commits but missing post-receive file.
%br
If you exported project manually - make a link of post-receive hook file from gitolite to project repository
- elsif !@project.valid_post_receive_file?
%br
.alert.alert-error
%span
%strong Project has invalid post-receive file.
%br
1. Make sure your gitolite instace has latest post-receive file.
%br
2. Make a link of post-receive hook file from gitolite to project repository
%br
%table.zebra-striped
......@@ -53,7 +63,7 @@
%td
= check_box_tag :post_receive_file, 1, @project.has_post_receive_file?, disabled: true
%br
%h3
%h5
Team
%small
(#{@project.users_projects.count})
......@@ -75,7 +85,7 @@
%td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small"
%br
%h3 Add new team member
%h5 Add new team member
%br
= form_tag team_update_admin_project_path(@project), class: "bulk_import", method: :put do
%table.zebra-striped
......
......@@ -22,7 +22,9 @@
%table
%thead
%th Admin
%th Name
%th
Name
%i.icon-sort-down
%th Username
%th Email
%th Projects
......
......@@ -66,7 +66,7 @@
= @admin_user.twitter
%br
%h3 Add User to Projects
%h5 Add User to Projects
%br
= form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do
%table
......@@ -86,8 +86,22 @@
%strong= link_to "here", help_permissions_path, class: "vlink"
%br
- if @admin_user.groups.present?
%h5 Owner of groups:
%br
%table.zebra-striped
%thead
%tr
%th Name
- @admin_user.groups.each do |group|
%tr
%td= link_to group.name, admin_group_path(group)
- if @admin_user.projects.present?
%h3 Projects
%h5 Projects:
%br
%table.zebra-striped
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment