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 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 27 .ui-box
4 28 %h5
5 29 Resque Workers
... ... @@ -19,27 +43,6 @@
19 43 %p
20 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 46 .row
44 47 .span6
45 48 %h3 Latest projects
... ...
app/views/admin/groups/index.html.haml
1   -= render 'admin/shared/projects_head'
2 1 %h3.page_title
3 2 Groups
4 3 %small
... ...
app/views/admin/groups/show.html.haml
1   -= render 'admin/shared/projects_head'
2 1 %h3.page_title
3 2 Group: #{@group.name}
4 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 1 %h3.page_title
3 2 Projects
4 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 1 %h3.page_title
3 2 Project: #{@project.name_with_namespace}
4 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   -%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 18 %li
19 19 = link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do
20 20 %i.icon-user
21   - %span.separator
  21 + %li.separator
22 22 %li
23 23 = render "layouts/search"
24 24 %li
... ...
app/views/layouts/admin.html.haml
... ... @@ -8,8 +8,10 @@
8 8 %ul.main_menu
9 9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
10 10 = link_to "Stats", admin_root_path
11   - = nav_link(controller: [:projects, :groups]) do
  11 + = nav_link(controller: :projects) do
12 12 = link_to "Projects", admin_projects_path
  13 + = nav_link(controller: :groups) do
  14 + = link_to "Groups", admin_groups_path
13 15 = nav_link(controller: :users) do
14 16 = link_to "Users", admin_users_path
15 17 = nav_link(controller: :logs) do
... ...
features/admin/active_tab.feature
... ... @@ -12,6 +12,11 @@ Feature: Admin active tab
12 12 Then the active main tab should be Projects
13 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 20 Scenario: On Admin Users
16 21 Given I visit admin users page
17 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 11 ensure_active_main_tab('Projects')
12 12 end
13 13  
  14 + Then 'the active main tab should be Groups' do
  15 + ensure_active_main_tab('Groups')
  16 + end
  17 +
14 18 Then 'the active main tab should be Users' do
15 19 ensure_active_main_tab('Users')
16 20 end
... ...