OSDN Git Service

Improve admin views for project and groups
authorCyril <jv.cyril@gmail.com>
Wed, 28 Nov 2012 16:08:25 +0000 (17:08 +0100)
committerCyril <jv.cyril@gmail.com>
Wed, 28 Nov 2012 17:04:28 +0000 (18:04 +0100)
* layout: add 'Groups' item to main_menu
* admin/dashboard: add a ui-box for groups
* projects and groups: remove nav tabs

app/views/admin/dashboard/index.html.haml
app/views/admin/groups/index.html.haml
app/views/admin/groups/show.html.haml
app/views/admin/projects/index.html.haml
app/views/admin/projects/show.html.haml
app/views/admin/shared/_projects_head.html.haml [deleted file]
app/views/layouts/_head_panel.html.haml
app/views/layouts/admin.html.haml
features/admin/active_tab.feature
features/steps/admin/admin_active_tab.rb

index b68d7f0..4320bda 100644 (file)
@@ -1,5 +1,29 @@
 .admin_dash.row
-  .span4
+  .span3
+    .ui-box
+      %h5 Projects
+      .data.padded
+        = link_to admin_projects_path do
+          %h1= Project.count
+        %hr
+        = link_to 'New Project', new_project_path, class: "btn small"
+  .span3
+    .ui-box
+      %h5 Groups
+      .data.padded
+        = link_to admin_groups_path do
+          %h1= Group.count
+        %hr
+        = link_to 'New Group', new_admin_group_path, class: "btn small"
+  .span3
+    .ui-box
+      %h5 Users
+      .data.padded
+        = link_to admin_users_path do
+          %h1= User.count
+        %hr
+        = link_to 'New User', new_admin_user_path, class: "btn small"
+  .span3
     .ui-box
       %h5
         Resque Workers
           %p
             %strong Resque status unknown
 
-
-  .span4
-    .ui-box
-      %h5 Projects
-      .data.padded
-        = link_to admin_projects_path do
-          %h1= Project.count
-        %hr
-        = link_to 'New Project', new_project_path, class: "btn small"
-        &nbsp;
-        = link_to 'New Group', new_admin_group_path, class: "btn small"
-  .span4
-    .ui-box
-      %h5 Users
-      .data.padded
-        = link_to admin_users_path do
-          %h1= User.count
-        %hr
-        = link_to 'New User', new_admin_user_path, class: "btn small"
-
-
 .row
   .span6
     %h3 Latest projects
index 534fa1d..952d515 100644 (file)
@@ -1,4 +1,3 @@
-= render 'admin/shared/projects_head'
 %h3.page_title
   Groups
   %small
index f447ac1..d371aca 100644 (file)
@@ -1,4 +1,3 @@
-= render 'admin/shared/projects_head'
 %h3.page_title
   Group: #{@group.name}
   = link_to edit_admin_group_path(@group), class: "btn right" do
index a9ecabf..9bbcbc7 100644 (file)
@@ -1,4 +1,3 @@
-= render 'admin/shared/projects_head'
 %h3.page_title
   Projects
   = link_to 'New Project', new_project_path, class: "btn small right"
index 92bf0ff..3691f7b 100644 (file)
@@ -1,4 +1,3 @@
-= render 'admin/shared/projects_head'
 %h3.page_title
   Project: #{@project.name_with_namespace}
   = link_to edit_admin_project_path(@project), class: "btn right" do
diff --git a/app/views/admin/shared/_projects_head.html.haml b/app/views/admin/shared/_projects_head.html.haml
deleted file mode 100644 (file)
index 3f5c34c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-%ul.nav.nav-tabs
-  = nav_link(controller: :projects) do
-    = link_to 'Projects', admin_projects_path, class: "tab"
-  = nav_link(controller: :groups) do
-    = link_to 'Groups', admin_groups_path, class: "tab"
index 38e1d7f..8fbec43 100644 (file)
@@ -18,7 +18,7 @@
         %li
           = link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile'  do
             %i.icon-user
-        %span.separator
+        %li.separator
         %li
           = render "layouts/search"
         %li
index 582f86b..5069a00 100644 (file)
@@ -8,8 +8,10 @@
       %ul.main_menu
         = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
           = link_to "Stats", admin_root_path
-        = nav_link(controller: [:projects, :groups]) do
+        = nav_link(controller: :projects) do
           = link_to "Projects", admin_projects_path
+        = nav_link(controller: :groups) do
+          = link_to "Groups", admin_groups_path
         = nav_link(controller: :users) do
           = link_to "Users", admin_users_path
         = nav_link(controller: :logs) do
index fce85ce..226d3d5 100644 (file)
@@ -12,6 +12,11 @@ Feature: Admin active tab
     Then the active main tab should be Projects
     And no other main tabs should be active
 
+  Scenario: On Admin Groups
+    Given I visit admin groups page
+    Then the active main tab should be Groups
+    And no other main tabs should be active
+
   Scenario: On Admin Users
     Given I visit admin users page
     Then the active main tab should be Users
index 2929089..05a9a68 100644 (file)
@@ -11,6 +11,10 @@ class AdminActiveTab < Spinach::FeatureSteps
     ensure_active_main_tab('Projects')
   end
 
+  Then 'the active main tab should be Groups' do
+    ensure_active_main_tab('Groups')
+  end
+
   Then 'the active main tab should be Users' do
     ensure_active_main_tab('Users')
   end