Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Commit

Permalink
Merge branch 'ui_improvements' into 'master'
Browse files Browse the repository at this point in the history
UI improvements

https://dev.gitlab.org/gitlab/gitlab-ci/issues/190

* move admin pages to the admin menu
* remove confusing project show page

![joxi_screenshot_1428498118775](https://gitlab.com/gitlab-org/gitlab-ci/uploads/53354051ebd61d4318f77ce80fbf11a4/joxi_screenshot_1428498118775.png)

See merge request !58
  • Loading branch information
dzaporozhets committed Apr 8, 2015
2 parents 1155ba3 + e1748f0 commit 306ac71
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 122 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ v7.10.0
- Events for admin
- Events per projects
- Search for runners in admin area
- UI improvements: created separated admin section, removed useless project show page

v7.9.3
- Contains no changes
Expand Down Expand Up @@ -186,4 +187,4 @@ v1.2.0

v1.1.0
- Added JSON response for builds status
- Compatible with GitLab v4.0.0
- Compatible with GitLab v4.0.0
2 changes: 2 additions & 0 deletions app/controllers/admin/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class Admin::ApplicationController < ApplicationController
before_filter :authenticate_user!
before_filter :authenticate_admin!

layout "admin"
end
4 changes: 0 additions & 4 deletions app/controllers/admin/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ def index
@projects = Project.ordered_by_last_commit_date.page(params[:page]).per(30)
end

def show
project
end

def destroy
project.destroy

Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/builds/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= content_for :title do
%h3.project-title
All builds

.pull-right
%small
= pluralize(@builds.total_count, 'build')
Expand Down
7 changes: 6 additions & 1 deletion app/views/admin/events/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
%h3.page-title Events
= content_for :title do
%h3.project-title
Events
.pull-right
%small
= pluralize(@events.total_count, 'event')

%table.table
%thead
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/projects/_project.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%td
= project.id
%td
= link_to [:admin, project] do
= link_to project do
%strong= project.name
%td
- if last_commit
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/projects/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
= content_for :title do
%h3.project-title
Manage Projects

.pull-right
%small
= pluralize(@projects.total_count, 'project')
Expand Down
86 changes: 0 additions & 86 deletions app/views/admin/projects/show.html.haml

This file was deleted.

20 changes: 12 additions & 8 deletions app/views/admin/runners/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
%h4
- if @runner.shared?
%span.runner-state.runner-state-shared
Shared
- else
%span.runner-state.runner-state-specific
Specific
Runner ##{@runner.id}
= content_for :title do
%h3.project-title
Runner ##{@runner.id}
.pull-right
- if @runner.shared?
%span.runner-state.runner-state-shared
Shared
- else
%span.runner-state.runner-state-specific
Specific



- if @runner.shared?
.bs-callout.bs-callout-success
Expand Down
11 changes: 1 addition & 10 deletions app/views/layouts/_nav.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@
.collapse.navbar-collapse
%ul.nav.navbar-nav
- if current_user && current_user.is_admin
%li
= link_to admin_runners_path do
Runners
%li
= link_to admin_projects_path do
Projects
%li
= link_to admin_builds_path do
Builds
%li
= link_to admin_events_path do
Events
Admin
%li
= link_to 'Help', help_path
Expand Down
18 changes: 18 additions & 0 deletions app/views/layouts/_nav_admin.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
%ul.nav.nav-pills.nav-stacked.admin-menu
= nav_link path: 'projects' do
= link_to admin_projects_path do
%i.icon-list-alt
Projects
= nav_link path: 'events' do
= link_to admin_events_path do
%i.icon-bar-chart
Events
= nav_link path: 'runners#index' do
= link_to admin_runners_path do
%i.icon-cog
Runners
= nav_link path: 'builds' do
= link_to admin_builds_path do
%i.icon-link
Builds

18 changes: 18 additions & 0 deletions app/views/layouts/admin.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
!!! 5
%html{ lang: "en"}
= render 'layouts/head'
%body{ :'data-page' => body_data_page }
= render 'layouts/nav'
= render 'layouts/info'
.container
%h3
- if content_for?(:title)
= yield(:title)

%hr
.container
.row
.col-md-2.append-bottom-20
= render 'layouts/nav_admin'
.col-md-10
= yield
9 changes: 0 additions & 9 deletions spec/features/admin/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,4 @@

it { page.should have_content "Manage Projects" }
end

describe "GET /admin/projects/:id" do
before do
visit admin_project_path(project)
end

it { page.should have_content "Project info" }
it { page.should have_content project.name }
end
end

0 comments on commit 306ac71

Please sign in to comment.