Commit cf8b3692cda859e93f56e07d5ecd496578597ab9

Authored by Dmitriy Zaporozhets
2 parents a0aa0212 e0a9ffcd

Merge pull request #2105 from jouve/improve_admin_views

Improve admin section
app/views/admin/dashboard/index.html.haml
1 .admin_dash.row 1 .admin_dash.row
2 - .span4 2 + .span3
  3 + .ui-box
  4 + %h5 Projects
  5 + .data.padded
  6 + = link_to admin_projects_path do
  7 + %h1= Project.count
  8 + %hr
  9 + = link_to 'New Project', new_project_path, class: "btn small"
  10 + .span3
  11 + .ui-box
  12 + %h5 Groups
  13 + .data.padded
  14 + = link_to admin_groups_path do
  15 + %h1= Group.count
  16 + %hr
  17 + = link_to 'New Group', new_admin_group_path, class: "btn small"
  18 + .span3
  19 + .ui-box
  20 + %h5 Users
  21 + .data.padded
  22 + = link_to admin_users_path do
  23 + %h1= User.count
  24 + %hr
  25 + = link_to 'New User', new_admin_user_path, class: "btn small"
  26 + .span3
3 .ui-box 27 .ui-box
4 %h5 28 %h5
5 Resque Workers 29 Resque Workers
@@ -19,27 +43,6 @@ @@ -19,27 +43,6 @@
19 %p 43 %p
20 %strong Resque status unknown 44 %strong Resque status unknown
21 45
22 -  
23 - .span4  
24 - .ui-box  
25 - %h5 Projects  
26 - .data.padded  
27 - = link_to admin_projects_path do  
28 - %h1= Project.count  
29 - %hr  
30 - = link_to 'New Project', new_project_path, class: "btn small"  
31 -    
32 - = link_to 'New Group', new_admin_group_path, class: "btn small"  
33 - .span4  
34 - .ui-box  
35 - %h5 Users  
36 - .data.padded  
37 - = link_to admin_users_path do  
38 - %h1= User.count  
39 - %hr  
40 - = link_to 'New User', new_admin_user_path, class: "btn small"  
41 -  
42 -  
43 .row 46 .row
44 .span6 47 .span6
45 %h3 Latest projects 48 %h3 Latest projects
app/views/admin/groups/index.html.haml
1 -= render 'admin/shared/projects_head'  
2 %h3.page_title 1 %h3.page_title
3 Groups 2 Groups
4 %small 3 %small
app/views/admin/groups/show.html.haml
1 -= render 'admin/shared/projects_head'  
2 %h3.page_title 1 %h3.page_title
3 Group: #{@group.name} 2 Group: #{@group.name}
4 = link_to edit_admin_group_path(@group), class: "btn right" do 3 = link_to edit_admin_group_path(@group), class: "btn right" do
app/views/admin/projects/index.html.haml
1 -= render 'admin/shared/projects_head'  
2 %h3.page_title 1 %h3.page_title
3 Projects 2 Projects
4 = link_to 'New Project', new_project_path, class: "btn small right" 3 = link_to 'New Project', new_project_path, class: "btn small right"
app/views/admin/projects/show.html.haml
1 -= render 'admin/shared/projects_head'  
2 %h3.page_title 1 %h3.page_title
3 Project: #{@project.name_with_namespace} 2 Project: #{@project.name_with_namespace}
4 = link_to edit_admin_project_path(@project), class: "btn right" do 3 = link_to edit_admin_project_path(@project), class: "btn right" do
app/views/admin/shared/_projects_head.html.haml
@@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
1 -%ul.nav.nav-tabs  
2 - = nav_link(controller: :projects) do  
3 - = link_to 'Projects', admin_projects_path, class: "tab"  
4 - = nav_link(controller: :groups) do  
5 - = link_to 'Groups', admin_groups_path, class: "tab"  
app/views/layouts/_head_panel.html.haml
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 %li 18 %li
19 = link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do 19 = link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do
20 %i.icon-user 20 %i.icon-user
21 - %span.separator 21 + %li.separator
22 %li 22 %li
23 = render "layouts/search" 23 = render "layouts/search"
24 %li 24 %li
app/views/layouts/admin.html.haml
@@ -8,8 +8,10 @@ @@ -8,8 +8,10 @@
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do 9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
10 = link_to "Stats", admin_root_path 10 = link_to "Stats", admin_root_path
11 - = nav_link(controller: [:projects, :groups]) do 11 + = nav_link(controller: :projects) do
12 = link_to "Projects", admin_projects_path 12 = link_to "Projects", admin_projects_path
  13 + = nav_link(controller: :groups) do
  14 + = link_to "Groups", admin_groups_path
13 = nav_link(controller: :users) do 15 = nav_link(controller: :users) do
14 = link_to "Users", admin_users_path 16 = link_to "Users", admin_users_path
15 = nav_link(controller: :logs) do 17 = nav_link(controller: :logs) do
features/admin/active_tab.feature
@@ -12,6 +12,11 @@ Feature: Admin active tab @@ -12,6 +12,11 @@ Feature: Admin active tab
12 Then the active main tab should be Projects 12 Then the active main tab should be Projects
13 And no other main tabs should be active 13 And no other main tabs should be active
14 14
  15 + Scenario: On Admin Groups
  16 + Given I visit admin groups page
  17 + Then the active main tab should be Groups
  18 + And no other main tabs should be active
  19 +
15 Scenario: On Admin Users 20 Scenario: On Admin Users
16 Given I visit admin users page 21 Given I visit admin users page
17 Then the active main tab should be Users 22 Then the active main tab should be Users
features/steps/admin/admin_active_tab.rb
@@ -11,6 +11,10 @@ class AdminActiveTab < Spinach::FeatureSteps @@ -11,6 +11,10 @@ class AdminActiveTab < Spinach::FeatureSteps
11 ensure_active_main_tab('Projects') 11 ensure_active_main_tab('Projects')
12 end 12 end
13 13
  14 + Then 'the active main tab should be Groups' do
  15 + ensure_active_main_tab('Groups')
  16 + end
  17 +
14 Then 'the active main tab should be Users' do 18 Then 'the active main tab should be Users' do
15 ensure_active_main_tab('Users') 19 ensure_active_main_tab('Users')
16 end 20 end