diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-07 12:04:57 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-07 12:04:57 +0400 |
commit | 1b8f082061e3f120ab02b263cb68e3433b028ef6 (patch) | |
tree | 8c4dd949e79b9b04f0d53e3b17f13b06ae2d6385 /app/views/admin | |
parent | 68154e8fe9d6266f3b1ae00e48530143f87cd138 (diff) |
new access rights implemented
Diffstat (limited to 'app/views/admin')
-rw-r--r-- | app/views/admin/projects/show.html.haml | 13 | ||||
-rw-r--r-- | app/views/admin/team_members/_form.html.haml | 23 | ||||
-rw-r--r-- | app/views/admin/team_members/index.html.haml | 18 | ||||
-rw-r--r-- | app/views/admin/team_members/show.html.haml | 16 | ||||
-rw-r--r-- | app/views/admin/users/show.html.haml | 10 |
5 files changed, 38 insertions, 42 deletions
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index e913754cccb..cd7a3a810bf 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -43,18 +43,17 @@ %tr %th Name %th Added - %th Web - %th Git - %th Admin + %th Project Access + %th Repository Access %th - @admin_project.users_projects.each do |tm| %tr - %td= link_to tm.user_name, admin_team_member_path(tm) + %td + = link_to tm.user_name, admin_team_member_path(tm) %td= time_ago_in_words(tm.updated_at) + " ago" - %td= check_box_tag "read", 1, @admin_project.readers.include?(tm.user), :disabled => :disabled - %td= check_box_tag "commit", 1, @admin_project.writers.include?(tm.user), :disabled => :disabled - %td.span-2= check_box_tag "admin", 1, @admin_project.admins.include?(tm.user), :disabled => :disabled + %td= select_tag :project_access, options_for_select(Project.access_options, tm.project_access), :class => "project-access-select", :disabled => :disabled + %td= select_tag :repo_access, options_for_select(Repository.access_options, tm.repo_access), :class => "repo-access-select", :disabled => :disabled %td= link_to 'Destroy', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete = link_to 'New Team Member', new_admin_team_member_path(:team_member => {:project_id => @admin_project.id}), :class => "grey-button" diff --git a/app/views/admin/team_members/_form.html.haml b/app/views/admin/team_members/_form.html.haml index 042c84ef655..f8e7f1043d0 100644 --- a/app/views/admin/team_members/_form.html.haml +++ b/app/views/admin/team_members/_form.html.haml @@ -17,21 +17,26 @@ = f.select :project_id, Project.all.map { |user| [user.name, user.id] } .span-6 - %b Access: + %b Project Access: .span-6 - = f.check_box :read - Web Access (Browse Repo) + = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select" + .span-6 - = f.check_box :write - Git Access (User will be added to commiters list) + %b Repository Access: .span-6 - = f.check_box :admin - Admin (Can manage project) + = f.select :repo_access, options_for_select(Repository.access_options, @admin_team_member.repo_access), {}, :class => "repo-access-select" %br .actions = f.submit 'Save', :class => "grey-button" +:css + form select { + width:300px; + } + :javascript - $('select#team_member_user_id').selectmenu({width:300}); - $('select#team_member_project_id').selectmenu({width:300}); + $('select#team_member_user_id').chosen(); + $('select#team_member_project_id').chosen(); + $('select#team_member_repo_access').chosen(); + $('select#team_member_project_access').chosen(); diff --git a/app/views/admin/team_members/index.html.haml b/app/views/admin/team_members/index.html.haml index 0cd87d21a48..8033e690642 100644 --- a/app/views/admin/team_members/index.html.haml +++ b/app/views/admin/team_members/index.html.haml @@ -3,21 +3,21 @@ %table %thead %th Name - %th Email - %th Read - %th Git - %th Manage + %th Project Access + %th Repo Access %th Added %th %th - members.each do |tm| - user = tm.user %tr - %td.span-6= link_to tm.user_name, admin_team_member_path(tm) - %td.span-6= tm.user_email - %td.span-1= check_box_tag "read", 1, project.readers.include?(user), :disabled => :disabled - %td.span-1= check_box_tag "commit", 1, project.writers.include?(user), :disabled => :disabled - %td.span-2= check_box_tag "admin", 1, project.admins.include?(user), :disabled => :disabled + %td.span-6 + = link_to tm.user_name, admin_team_member_path(tm) + %br + %br + = tm.user_email + %td.span-3= select_tag :project_access, options_for_select(Project.access_options, tm.project_access), :class => "project-access-select", :disabled => :disabled + %td.span-3= select_tag :repo_access, options_for_select(Repository.access_options, tm.repo_access), :class => "repo-access-select", :disabled => :disabled %td.span-3= time_ago_in_words(tm.updated_at) + " ago" %td= link_to 'Edit', edit_admin_team_member_path(tm), :id => "edit_#{dom_id(tm)}" %td= link_to 'Destroy', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete diff --git a/app/views/admin/team_members/show.html.haml b/app/views/admin/team_members/show.html.haml index 1555424bf3c..8579b6afae0 100644 --- a/app/views/admin/team_members/show.html.haml +++ b/app/views/admin/team_members/show.html.haml @@ -11,19 +11,13 @@ #infoblock .span-6 - %b Access: - %br - .span-6 - = check_box_tag "read", 1, @admin_team_member.read, :disabled => :disabled - Web Access (Browse Repo) + %b Project Access: + = select_tag :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), :class => "project-access-select", :disabled => true + %br .span-6 - = check_box_tag "commit", 1, @admin_team_member.write, :disabled => :disabled - Git Access (User will be added to commiters list) - %br - .span-6.append-bottom - = check_box_tag "admin", 1, @admin_team_member.admin, :disabled => :disabled - Admin (Can manage project) + %b Repository Access: + = select_tag :repo_access, options_for_select(Repository.access_options, @admin_team_member.repo_access), :class => "repo-access-select", :disabled => true %br diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 2fc2daa75c2..da8f4370cab 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -51,9 +51,8 @@ %thead %th Name %th Added - %th Web - %th Git - %th Admin + %th Project Access + %th Repository Access %th %th @@ -62,9 +61,8 @@ %tr %td= link_to project.name, admin_project_path(project) %td= time_ago_in_words(tm.updated_at) + " ago" - %td= check_box_tag "read", 1, project.readers.include?(@admin_user), :disabled => :disabled - %td= check_box_tag "commit", 1, project.writers.include?(@admin_usertm), :disabled => :disabled - %td.span-2= check_box_tag "admin", 1, project.admins.include?(@admin_user), :disabled => :disabled + %td= select_tag :project_access, options_for_select(Project.access_options, tm.project_access), :class => "project-access-select", :disabled => :disabled + %td= select_tag :repo_access, options_for_select(Repository.access_options, tm.repo_access), :class => "repo-access-select", :disabled => :disabled %td= link_to 'Edit', edit_admin_team_member_path(tm) %td= link_to 'Cancel', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete |