diff options
author | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 |
commit | 9ba1224867665844b117fa037e1465bb706b3685 (patch) | |
tree | 52fbfc1cdb55df21843965479c97be0c91121a9a /app/views/admin | |
parent | 93efff945215a4407afcaf0cba15ac601b56df0d (diff) | |
download | gitlab-ce-9ba1224867665844b117fa037e1465bb706b3685.tar.gz |
init commit
Diffstat (limited to 'app/views/admin')
-rw-r--r-- | app/views/admin/_top_menu.html.haml | 6 | ||||
-rw-r--r-- | app/views/admin/mailer/preview.html.haml | 29 | ||||
-rw-r--r-- | app/views/admin/projects/_form.html.haml | 30 | ||||
-rw-r--r-- | app/views/admin/projects/edit.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/projects/index.html.haml | 26 | ||||
-rw-r--r-- | app/views/admin/projects/new.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/projects/show.html.haml | 45 | ||||
-rw-r--r-- | app/views/admin/team_members/_form.html.haml | 34 | ||||
-rw-r--r-- | app/views/admin/team_members/edit.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/team_members/index.html.haml | 30 | ||||
-rw-r--r-- | app/views/admin/team_members/new.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/team_members/show.html.haml | 32 | ||||
-rw-r--r-- | app/views/admin/users/_form.html.haml | 38 | ||||
-rw-r--r-- | app/views/admin/users/edit.html.haml | 4 | ||||
-rw-r--r-- | app/views/admin/users/index.html.haml | 24 | ||||
-rw-r--r-- | app/views/admin/users/new.html.haml | 6 | ||||
-rw-r--r-- | app/views/admin/users/show.html.haml | 42 |
17 files changed, 366 insertions, 0 deletions
diff --git a/app/views/admin/_top_menu.html.haml b/app/views/admin/_top_menu.html.haml new file mode 100644 index 00000000000..d63caa7e8ee --- /dev/null +++ b/app/views/admin/_top_menu.html.haml @@ -0,0 +1,6 @@ +%div.top_project_menu + %span= link_to "Users", admin_users_path, :style => "width:50px;", :class => controller.controller_name == "users" ? "current" : nil + %span= link_to "Projects", admin_projects_path, :style => "width:50px;", :class => controller.controller_name == "projects" ? "current" : nil + %span= link_to "Teams", admin_team_members_path, :style => "width:50px;", :class => controller.controller_name == "team_members" ? "current" : nil + %span= link_to "Emails", admin_emails_path, :style => "width:50px;", :class => controller.controller_name == "mailer" ? "current" : nil + diff --git a/app/views/admin/mailer/preview.html.haml b/app/views/admin/mailer/preview.html.haml new file mode 100644 index 00000000000..7b723cb8021 --- /dev/null +++ b/app/views/admin/mailer/preview.html.haml @@ -0,0 +1,29 @@ +%p This is page with preview for all system emails that are sent to user +%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system + +#accordion + %h3 + %a New user + %div + %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} + %h3 + %a New issue + %div + %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} + %h3 + %a Commit note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} + %h3 + %a Issue note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} + %h3 + %a Wall note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} + + +:javascript + $(function() { + $( "#accordion" ).accordion(); }); diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml new file mode 100644 index 00000000000..9823e594e1a --- /dev/null +++ b/app/views/admin/projects/_form.html.haml @@ -0,0 +1,30 @@ += form_for [:admin, @admin_project] do |f| + -if @admin_project.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" + %ul + - @admin_project.errors.full_messages.each do |msg| + %li= msg + + .span-24 + .span-12 + .field + = f.label :name + %br + = f.text_field :name + .field + = f.label :code + %br + = f.text_field :code + .field + = f.label :path + %br + = f.text_field :path + .span-10 + .field + = f.label :description + %br + = f.text_area :description + .clear + .actions + = f.submit 'Save', :class => "lbutton" diff --git a/app/views/admin/projects/edit.html.haml b/app/views/admin/projects/edit.html.haml new file mode 100644 index 00000000000..9d9a1ee0a3f --- /dev/null +++ b/app/views/admin/projects/edit.html.haml @@ -0,0 +1,5 @@ += render 'form' + += link_to 'Show', [:admin, @admin_project] +\| += link_to 'Back', admin_projects_path diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml new file mode 100644 index 00000000000..55c41ec31bb --- /dev/null +++ b/app/views/admin/projects/index.html.haml @@ -0,0 +1,26 @@ +%table + %tr + %th Name + %th Code + %th Path + %th Team Members + %th Last Commit + %th + %th + %th + + - @admin_projects.each do |project| + %tr + %td= project.name + %td= project.code + %td= project.path + %td= project.users_projects.count + %td= last_commit(project) + %td= link_to 'Show', [:admin, project] + %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}" + %td= link_to 'Destroy', [:admin, project], :confirm => 'Are you sure?', :method => :delete + +%br + += paginate @admin_projects += link_to 'New Project', new_admin_project_path diff --git a/app/views/admin/projects/new.html.haml b/app/views/admin/projects/new.html.haml new file mode 100644 index 00000000000..3a4d50e19f9 --- /dev/null +++ b/app/views/admin/projects/new.html.haml @@ -0,0 +1,5 @@ +%h1 New project + += render 'form' + += link_to 'Back', admin_projects_path diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml new file mode 100644 index 00000000000..6891894122c --- /dev/null +++ b/app/views/admin/projects/show.html.haml @@ -0,0 +1,45 @@ +%p#notice= notice + +.span-8.colborder + %h2= @admin_project.name + + %p + %b Name: + = @admin_project.name + %p + %b Code: + = @admin_project.code + %p + %b Path: + = @admin_project.path + %p + %b Description: + = @admin_project.description + + = link_to 'Edit', edit_admin_project_path(@admin_project) + \| + = link_to 'Back', admin_projects_path + +.span-14 + + %h2 Team + + %table.round-borders + %tr + %th Name + %th Added + %th Web + %th Git + %th Admin + %th + + - @admin_project.users_projects.each do |tm| + %tr + %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= 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}) diff --git a/app/views/admin/team_members/_form.html.haml b/app/views/admin/team_members/_form.html.haml new file mode 100644 index 00000000000..ab48c513a86 --- /dev/null +++ b/app/views/admin/team_members/_form.html.haml @@ -0,0 +1,34 @@ += form_for @admin_team_member, :as => :team_member, :url => @admin_team_member.new_record? ? admin_team_members_path(@admin_team_member) : admin_team_member_path(@admin_team_member) do |f| + -if @admin_team_member.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_team_member.errors.count, "error")} prohibited this admin_project from being saved:" + %ul + - @admin_team_member.errors.full_messages.each do |msg| + %li= msg + + .span-10 + - if @admin_team_member.new_record? + .field + = f.label :user_id + %br + = f.select :user_id, User.all.map { |user| [user.name, user.id] } + .field + = f.label :project_id + %br + = f.select :project_id, Project.all.map { |user| [user.name, user.id] } + + .span-10 + .span-6 + %b Access: + .span-8 + = f.check_box :read + Web Access (Browse Repo) + .span-8 + = f.check_box :write + Git Access (User will be added to commiters list) + .span-6.append-bottom + = f.check_box :admin + Admin (Can manage project) + %hr + .actions + = f.submit 'Save' diff --git a/app/views/admin/team_members/edit.html.haml b/app/views/admin/team_members/edit.html.haml new file mode 100644 index 00000000000..d0362812834 --- /dev/null +++ b/app/views/admin/team_members/edit.html.haml @@ -0,0 +1,5 @@ += render 'form' + += link_to 'Show', admin_team_member_path(@admin_team_member) +\| += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/team_members/index.html.haml b/app/views/admin/team_members/index.html.haml new file mode 100644 index 00000000000..4076917da64 --- /dev/null +++ b/app/views/admin/team_members/index.html.haml @@ -0,0 +1,30 @@ +- @admin_team_members.group_by(&:project).sort.each do |project, members| + %h3= link_to project.name, [:admin, project] + %table + %tr + %th Name + %th Email + %th Read + %th Git + %th Manage + %th Added + %th + %th + %th + - members.each do |tm| + - user = tm.user + %tr + %td.span-6= tm.user_name + %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-3= time_ago_in_words(tm.updated_at) + " ago" + %td= link_to 'Show', admin_team_member_path(tm) + %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 + +%br + += paginate @admin_team_members += link_to 'New Team Member', new_admin_team_member_path diff --git a/app/views/admin/team_members/new.html.haml b/app/views/admin/team_members/new.html.haml new file mode 100644 index 00000000000..1321f42e7db --- /dev/null +++ b/app/views/admin/team_members/new.html.haml @@ -0,0 +1,5 @@ +%h1 New team member + += render 'form' + += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/team_members/show.html.haml b/app/views/admin/team_members/show.html.haml new file mode 100644 index 00000000000..bd30c7b0e6c --- /dev/null +++ b/app/views/admin/team_members/show.html.haml @@ -0,0 +1,32 @@ +%p#notice= notice + +.span-10 + %p + %b Name: + = @admin_team_member.user_name + %p + %b Project: + = @admin_team_member.project.name + %p + %b Since: + = @admin_team_member.updated_at + + +.span-10 + .span-6 + %b Access: + .span-8 + = check_box_tag "read", 1, @admin_team_member.read, :disabled => :disabled + Web Access (Browse Repo) + .span-8 + = check_box_tag "commit", 1, @admin_team_member.write, :disabled => :disabled + Git Access (User will be added to commiters list) + .span-6.append-bottom + = check_box_tag "admin", 1, @admin_team_member.admin, :disabled => :disabled + Admin (Can manage project) + +%hr + += link_to 'Edit', edit_admin_team_member_path(@admin_project) +\| += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml new file mode 100644 index 00000000000..a5e4d8ab4b3 --- /dev/null +++ b/app/views/admin/users/_form.html.haml @@ -0,0 +1,38 @@ +.user_new + = form_for [:admin, @admin_user] do |f| + -if @admin_user.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_user.errors.count, "error")} prohibited this admin_user from being saved:" + %ul + - @admin_user.errors.full_messages.each do |msg| + %li= msg + + .span-24 + .span-11.colborder + .field + = f.label :name + %br + = f.text_field :name + .field + = f.label :email + %br + = f.text_field :email + .field + = f.label :password + %br + = f.password_field :password + .field + = f.label :password_confirmation + %br + = f.password_field :password_confirmation + .span-11 + .field.prepend-top.append-bottom + = f.check_box :admin + = f.label :admin + .field.prepend-top + = f.check_box :allowed_create_repo, :disabled => true + = f.label :allowed_create_repo + .clear + %br + .actions + = f.submit 'Save', :class => "lbutton" diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml new file mode 100644 index 00000000000..fac995175fe --- /dev/null +++ b/app/views/admin/users/edit.html.haml @@ -0,0 +1,4 @@ += render 'form' + += link_to 'Show', [:admin, @admin_user], :class => "right lbutton" += link_to 'Back', admin_users_path, :class => "right lbutton" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml new file mode 100644 index 00000000000..db60a613bce --- /dev/null +++ b/app/views/admin/users/index.html.haml @@ -0,0 +1,24 @@ +%table + %tr + %th Admin + %th Name + %th Email + %th Projects + %th + %th + %th + + - @admin_users.each do |user| + %tr + %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled + %td= user.name + %td= user.email + %td= user.users_projects.count + %td= link_to 'Show', [:admin, user] + %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}" + %td= link_to 'Destroy', [:admin, user], :confirm => 'Are you sure?', :method => :delete + +%br + += paginate @admin_users += link_to 'New User', new_admin_user_path diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml new file mode 100644 index 00000000000..cec6e3e188c --- /dev/null +++ b/app/views/admin/users/new.html.haml @@ -0,0 +1,6 @@ +%h1 New user + += render 'form' + + += link_to 'Back', admin_users_path, :class => "right lbutton" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml new file mode 100644 index 00000000000..f41fc51b8d0 --- /dev/null +++ b/app/views/admin/users/show.html.haml @@ -0,0 +1,42 @@ +%p#notice= notice + +.span-8.colborder + %p + %b Name: + = @admin_user.name + %p + %b Email: + = @admin_user.email + %p + %b Admin: + = @admin_user.admin + + .clear + = link_to 'Edit', edit_admin_user_path(@admin_user) + \| + = link_to 'Back', admin_users_path + +.span-14 + %h2 Projects + + %table.round-borders + %tr + %th Name + %th Added + %th Web + %th Git + %th Admin + %th + + - @admin_user.users_projects.each do |tm| + - project = tm.project + %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= link_to 'Edit', edit_admin_team_member_path(tm) + %td= link_to 'Cancel', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete + + = link_to 'Add To Another Project', new_admin_team_member_path(:team_member => {:user_id => @admin_user.id}) |