summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-04-08 15:20:25 +0300
committerValery Sizov <vsv2711@gmail.com>2015-04-08 15:20:25 +0300
commit54ae654d7c05b4de009185ac75a89813afc35a6c (patch)
tree6fcb0dae1b90c3c8c3f44f3c0f61a5f5459b29ad
parent1155ba3b0e0d4b3f3b0485f865ead165d4bc0649 (diff)
downloadgitlab-ci-54ae654d7c05b4de009185ac75a89813afc35a6c.tar.gz
adding admin section
-rw-r--r--app/controllers/admin/application_controller.rb2
-rw-r--r--app/views/admin/builds/index.html.haml2
-rw-r--r--app/views/admin/events/index.html.haml7
-rw-r--r--app/views/admin/projects/index.html.haml1
-rw-r--r--app/views/admin/projects/show.html.haml15
-rw-r--r--app/views/admin/runners/show.html.haml20
-rw-r--r--app/views/layouts/_nav.html.haml11
-rw-r--r--app/views/layouts/_nav_admin.html.haml18
-rw-r--r--app/views/layouts/admin.html.haml18
9 files changed, 66 insertions, 28 deletions
diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb
index 83ae7eb..506c6e7 100644
--- a/app/controllers/admin/application_controller.rb
+++ b/app/controllers/admin/application_controller.rb
@@ -1,4 +1,6 @@
class Admin::ApplicationController < ApplicationController
before_filter :authenticate_user!
before_filter :authenticate_admin!
+
+ layout "admin"
end
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
index 96302cb..5f1f489 100644
--- a/app/views/admin/builds/index.html.haml
+++ b/app/views/admin/builds/index.html.haml
@@ -1,7 +1,7 @@
= content_for :title do
%h3.project-title
All builds
-
+
.pull-right
%small
= pluralize(@builds.total_count, 'build')
diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml
index 779f49b..b86eb5d 100644
--- a/app/views/admin/events/index.html.haml
+++ b/app/views/admin/events/index.html.haml
@@ -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
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index 498c66e..3816d3d 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -1,7 +1,6 @@
= content_for :title do
%h3.project-title
Manage Projects
-
.pull-right
%small
= pluralize(@projects.total_count, 'project')
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 54a0187..2551afa 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -1,10 +1,11 @@
-%h4.page-title
- Project: #{@project.name}
- - if current_user.can_manage_project?(@project.gitlab_id)
- .pull-right
- = link_to project_jobs_path(@project), class: "btn btn-default btn-small" do
- %i.icon-edit.icon-white
- Edit Job
+= content_for :title do
+ %h3.project-title
+ Project: #{@project.name}
+ - if current_user.can_manage_project?(@project.gitlab_id)
+ .pull-right
+ = link_to project_jobs_path(@project), class: "btn btn-default btn-small" do
+ %i.icon-edit.icon-white
+ Edit Job
%p
= link_to admin_projects_path do
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index d6bd219..a99bd2e 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -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
diff --git a/app/views/layouts/_nav.html.haml b/app/views/layouts/_nav.html.haml
index 45dd7e1..7ea53b4 100644
--- a/app/views/layouts/_nav.html.haml
+++ b/app/views/layouts/_nav.html.haml
@@ -11,17 +11,8 @@
%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
diff --git a/app/views/layouts/_nav_admin.html.haml b/app/views/layouts/_nav_admin.html.haml
new file mode 100644
index 0000000..c5155db
--- /dev/null
+++ b/app/views/layouts/_nav_admin.html.haml
@@ -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
+
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
new file mode 100644
index 0000000..ec4a9e5
--- /dev/null
+++ b/app/views/layouts/admin.html.haml
@@ -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 \ No newline at end of file