Commit e09d573e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '18338-change-admin-navigation-to-match-new-ui' into 'master'

Resolve "Change admin navigation to match new UI"

## What does this MR do?
Moves admin navigation to layout nav to match Project, Groups, and Profile navigation

## Are there points in the code the reviewer needs to double check?

## Why was this MR needed?

## What are the relevant issue numbers?
Closes #18338

## Screenshots (if relevant)
![Screen_Shot_2016-06-14_at_10.26.40_AM](/uploads/f0b8c8b259da16d929be2b36e8eeafb8/Screen_Shot_2016-06-14_at_10.26.40_AM.png)
![Screen_Shot_2016-06-14_at_10.26.44_AM](/uploads/07d9ece2063dfcfec1f0f2647d8ee782/Screen_Shot_2016-06-14_at_10.26.44_AM.png)
## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4650
parents b2247398 bcbe9b4d
.nav-links.sub-nav
%ul{ class: (container_class) }
= nav_link(controller: :background_jobs) do
= link_to admin_background_jobs_path, title: 'Background Jobs' do
%span
Background Jobs
= nav_link(controller: :logs) do
= link_to admin_logs_path, title: 'Logs' do
%span
Logs
= nav_link(controller: :health_check) do
= link_to admin_health_check_path, title: 'Health Check' do
%span
Health Check
- @no_container = true
- page_title "Background Jobs" - page_title "Background Jobs"
%h3.page-title Background Jobs = render 'admin/background_jobs/head'
%p.light GitLab uses #{link_to "sidekiq", "http://sidekiq.org/"} library for async job processing
%hr %div{ class: (container_class) }
%h3.page-title Background Jobs
%p.light GitLab uses #{link_to "sidekiq", "http://sidekiq.org/"} library for async job processing
.panel.panel-default %hr
.panel-heading Sidekiq running processes
.panel-body
- if @sidekiq_processes.empty?
%h4.cred
%i.fa.fa-exclamation-triangle
There are no running sidekiq processes. Please restart GitLab
- else
.table-holder
%table.table
%thead
%th USER
%th PID
%th CPU
%th MEM
%th STATE
%th START
%th COMMAND
%tbody
- @sidekiq_processes.each do |process|
- next unless process.match(/(sidekiq \d+\.\d+\.\d+.+$)/)
- data = process.strip.split(' ')
%tr
%td= gitlab_config.user
- 5.times do
%td= data.shift
%td= data.join(' ')
.clearfix .panel.panel-default
%p .panel-heading Sidekiq running processes
%i.fa.fa-exclamation-circle .panel-body
If '[25 of 25 busy]' is shown, restart GitLab with 'sudo service gitlab reload'. - if @sidekiq_processes.empty?
%p %h4.cred
%i.fa.fa-exclamation-circle %i.fa.fa-exclamation-triangle
If more than one sidekiq process is listed, stop GitLab, kill the remaining sidekiq processes (sudo pkill -u #{gitlab_config.user} -f sidekiq) and restart GitLab. There are no running sidekiq processes. Please restart GitLab
- else
.table-holder
%table.table
%thead
%th USER
%th PID
%th CPU
%th MEM
%th STATE
%th START
%th COMMAND
%tbody
- @sidekiq_processes.each do |process|
- next unless process.match(/(sidekiq \d+\.\d+\.\d+.+$)/)
- data = process.strip.split(' ')
%tr
%td= gitlab_config.user
- 5.times do
%td= data.shift
%td= data.join(' ')
.clearfix
%p
%i.fa.fa-exclamation-circle
If '[25 of 25 busy]' is shown, restart GitLab with 'sudo service gitlab reload'.
%p
%i.fa.fa-exclamation-circle
If more than one sidekiq process is listed, stop GitLab, kill the remaining sidekiq processes (sudo pkill -u #{gitlab_config.user} -f sidekiq) and restart GitLab.
.panel.panel-default
%iframe{src: sidekiq_path, width: '100%', height: 970, style: "border: none"} .panel.panel-default
%iframe{src: sidekiq_path, width: '100%', height: 970, style: "border: none"}
.top-area - @no_container = true
%ul.nav-links = render "admin/dashboard/head"
%li{class: ('active' if @scope.nil?)}
= link_to admin_builds_path do %div{ class: (container_class) }
All
%span.badge.js-totalbuilds-count= @all_builds.count(:id) .top-area
%ul.nav-links
%li{class: ('active' if @scope == 'running')} %li{class: ('active' if @scope.nil?)}
= link_to admin_builds_path(scope: :running) do = link_to admin_builds_path do
Running All
%span.badge.js-running-count= number_with_delimiter(@all_builds.running_or_pending.count(:id)) %span.badge.js-totalbuilds-count= @all_builds.count(:id)
%li{class: ('active' if @scope == 'finished')} %li{class: ('active' if @scope == 'running')}
= link_to admin_builds_path(scope: :finished) do = link_to admin_builds_path(scope: :running) do
Finished Running
%span.badge.js-running-count= number_with_delimiter(@all_builds.finished.count(:id)) %span.badge.js-running-count= number_with_delimiter(@all_builds.running_or_pending.count(:id))
.nav-controls %li{class: ('active' if @scope == 'finished')}
- if @all_builds.running_or_pending.any? = link_to admin_builds_path(scope: :finished) do
= link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post Finished
%span.badge.js-running-count= number_with_delimiter(@all_builds.finished.count(:id))
.row-content-block.second-block
#{(@scope || 'all').capitalize} builds .nav-controls
- if @all_builds.running_or_pending.any?
%ul.content-list = link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
- if @builds.blank?
%li .row-content-block.second-block
.nothing-here-block No builds to show #{(@scope || 'all').capitalize} builds
- else
.table-holder %ul.content-list
%table.table.builds - if @builds.blank?
%thead %li
%tr .nothing-here-block No builds to show
%th Status - else
%th Build ID .table-holder
%th Project %table.table.builds
%th Commit %thead
%th Ref %tr
%th Runner %th Status
%th Name %th Build ID
%th Tags %th Project
%th Duration %th Commit
%th Finished at %th Ref
%th %th Runner
%th Name
- @builds.each do |build| %th Tags
= render "admin/builds/build", build: build %th Duration
%th Finished at
= paginate @builds, theme: 'gitlab' %th
- @builds.each do |build|
= render "admin/builds/build", build: build
= paginate @builds, theme: 'gitlab'
.nav-links.sub-nav
%ul{ class: (container_class) }
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to admin_root_path, title: 'Overview' do
%span
Overview
= nav_link(controller: [:admin, :projects]) do
= link_to admin_namespaces_projects_path, title: 'Projects' do
%span
Projects
= nav_link(controller: :users) do
= link_to admin_users_path, title: 'Users' do
%span
Users
= nav_link(controller: :groups) do
= link_to admin_groups_path, title: 'Groups' do
%span
Groups
= nav_link path: 'builds#index' do
= link_to admin_builds_path, title: 'Builds' do
%span
Builds
.admin-dashboard.prepend-top-default - @no_container = true
.row = render "admin/dashboard/head"
.col-md-4
%h4 Statistics
%hr
%p
Forks
%span.light.pull-right
= number_with_delimiter(ForkedProjectLink.count)
%p
Issues
%span.light.pull-right
= number_with_delimiter(Issue.count)
%p
Merge Requests
%span.light.pull-right
= number_with_delimiter(MergeRequest.count)
%p
Notes
%span.light.pull-right
= number_with_delimiter(Note.count)
%p
Snippets
%span.light.pull-right
= number_with_delimiter(Snippet.count)
%p
SSH Keys
%span.light.pull-right
= number_with_delimiter(Key.count)
%p
Milestones
%span.light.pull-right
= number_with_delimiter(Milestone.count)
%p
Active Users
%span.light.pull-right
= number_with_delimiter(User.active.count)
.col-md-4
%h4
Features
%hr
%p
Sign up
%span.light.pull-right
= boolean_to_icon signup_enabled?
%p
LDAP
%span.light.pull-right
= boolean_to_icon Gitlab.config.ldap.enabled
%p
Gravatar
%span.light.pull-right
= boolean_to_icon gravatar_enabled?
%p
OmniAuth
%span.light.pull-right
= boolean_to_icon Gitlab.config.omniauth.enabled
%p
Reply by email
%span.light.pull-right
= boolean_to_icon Gitlab::IncomingEmail.enabled?
.col-md-4
%h4
Components
- if current_application_settings.version_check_enabled
.pull-right
= version_status_badge
%hr %div{ class: (container_class) }
%p .admin-dashboard.prepend-top-default
GitLab .row
%span.pull-right .col-md-4
= Gitlab::VERSION %h4 Statistics
%p %hr
GitLab Shell
%span.pull-right
= Gitlab::Shell.new.version
%p
GitLab API
%span.pull-right
= API::API::version
%p
Git
%span.pull-right
= Gitlab::Git.version
%p
Ruby
%span.pull-right
#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
%p
Rails
%span.pull-right
#{Rails::VERSION::STRING}
%p
= Gitlab::Database.adapter_name
%span.pull-right
= Gitlab::Database.version
%hr
.row
.col-sm-4
.light-well
%h4 Projects
.data
= link_to admin_namespaces_projects_path do
%h1= number_with_delimiter(Project.count)
%hr
= link_to('New Project', new_project_path, class: "btn btn-new")
.col-sm-4
.light-well
%h4 Users
.data
= link_to admin_users_path do
%h1= number_with_delimiter(User.count)
%hr
= link_to 'New User', new_admin_user_path, class: "btn btn-new"
.col-sm-4
.light-well
%h4 Groups
.data
= link_to admin_groups_path do
%h1= number_with_delimiter(Group.count)
%hr
= link_to 'New Group', new_admin_group_path, class: "btn btn-new"
.row.prepend-top-10
.col-md-4
%h4 Latest projects
%hr
- @projects.each do |project|
%p %p
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project], class: 'str-truncated' Forks
%span.light.pull-right %span.light.pull-right
#{time_ago_with_tooltip(project.created_at)} = number_with_delimiter(ForkedProjectLink.count)
.col-md-4
%h4 Latest users
%hr
- @users.each do |user|
%p %p
= link_to [:admin, user], class: 'str-truncated' do Issues
= user.name
%span.light.pull-right %span.light.pull-right
#{time_ago_with_tooltip(user.created_at)} = number_with_delimiter(Issue.count)
%p
.col-md-4 Merge Requests
%h4 Latest groups %span.light.pull-right
%hr = number_with_delimiter(MergeRequest.count)
- @groups.each do |group| %p
Notes
%span.light.pull-right
= number_with_delimiter(Note.count)
%p
Snippets
%span.light.pull-right
= number_with_delimiter(Snippet.count)
%p
SSH Keys
%span.light.pull-right
= number_with_delimiter(Key.count)
%p
Milestones
%span.light.pull-right
= number_with_delimiter(Milestone.count)
%p
Active Users
%span.light.pull-right
= number_with_delimiter(User.active.count)
.col-md-4
%h4
Features
%hr
%p
Sign up
%span.light.pull-right
= boolean_to_icon signup_enabled?
%p %p
= link_to [:admin, group], class: 'str-truncated' do LDAP
= group.name
%span.light.pull-right %span.light.pull-right
#{time_ago_with_tooltip(group.created_at)} = boolean_to_icon Gitlab.config.ldap.enabled
%p
Gravatar
%span.light.pull-right
= boolean_to_icon gravatar_enabled?
%p
OmniAuth
%span.light.pull-right
= boolean_to_icon Gitlab.config.omniauth.enabled
%p
Reply by email
%span.light.pull-right
= boolean_to_icon Gitlab::IncomingEmail.enabled?
.col-md-4
%h4
Components
- if current_application_settings.version_check_enabled
.pull-right
= version_status_badge
%hr
%p
GitLab
%span.pull-right
= Gitlab::VERSION
%p
GitLab Shell
%span.pull-right
= Gitlab::Shell.new.version
%p
GitLab API
%span.pull-right
= API::API::version
%p
Git
%span.pull-right
= Gitlab::Git.version
%p
Ruby
%span.pull-right
#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
%p
Rails
%span.pull-right
#{Rails::VERSION::STRING}
%p
= Gitlab::Database.adapter_name
%span.pull-right
= Gitlab::Database.version
%hr
.row
.col-sm-4
.light-well
%h4 Projects
.data
= link_to admin_namespaces_projects_path do
%h1= number_with_delimiter(Project.count)
%hr
= link_to('New Project', new_project_path, class: "btn btn-new")
.col-sm-4
.light-well
%h4 Users
.data
= link_to admin_users_path do
%h1= number_with_delimiter(User.count)
%hr
= link_to 'New User', new_admin_user_path, class: "btn btn-new"
.col-sm-4
.light-well
%h4 Groups
.data
= link_to admin_groups_path do
%h1= number_with_delimiter(Group.count)
%hr
= link_to 'New Group', new_admin_group_path, class: "btn btn-new"
.row.prepend-top-10
.col-md-4
%h4 Latest projects
%hr
- @projects.each do |project|
%p
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project], class: 'str-truncated'
%span.light.pull-right
#{time_ago_with_tooltip(project.created_at)}
.col-md-4
%h4 Latest users
%hr
- @users.each do |user|
%p
= link_to [:admin, user], class: 'str-truncated' do
= user.name
%span.light.pull-right
#{time_ago_with_tooltip(user.created_at)}
.col-md-4
%h4 Latest groups
%hr
- @groups.each do |group|
%p
= link_to [:admin, group], class: 'str-truncated' do
= group.name
%span.light.pull-right
#{time_ago_with_tooltip(group.created_at)}
- @no_container = true
- page_title "Groups" - page_title "Groups"
%h3.page-title = render "admin/dashboard/head"
Groups (#{number_with_delimiter(@groups.total_count)})
%p.light %div{ class: (container_class) }
Group allows you to keep projects organized. %h3.page-title
Use groups for uniting related projects. Groups (#{number_with_delimiter(@groups.total_count)})
.top-area %p.light
.nav-search Group allows you to keep projects organized.
= form_tag admin_groups_path, method: :get, class: 'form-inline' do Use groups for uniting related projects.
= hidden_field_tag :sort, @sort
= text_field_tag :name, params[:name], class: "form-control"
= button_tag "Search", class: "btn submit btn-primary"
.nav-controls .top-area
.dropdown.inline .nav-search
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} = form_tag admin_groups_path, method: :get, class: 'form-inline' do
%span.light = hidden_field_tag :sort, @sort
- if @sort.present? = text_field_tag :name, params[:name], class: "form-control"
= sort_options_hash[@sort] = button_tag "Search", class: "btn submit btn-primary"
- else
= sort_title_recently_created .nav-controls
%b.caret .dropdown.inline
%ul.dropdown-menu %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%li %span.light
= link_to admin_groups_path(sort: sort_value_recently_created) do - if @sort.present?
= sort_options_hash[@sort]
- else
= sort_title_recently_created = sort_title_recently_created
= link_to admin_groups_path(sort: sort_value_oldest_created) do %b.caret
= sort_title_oldest_created %ul.dropdown-menu
= link_to admin_groups_path(sort: sort_value_recently_updated) do %li
= sort_title_recently_updated = link_to admin_groups_path(sort: sort_value_recently_created) do
= link_to admin_groups_path(sort: sort_value_oldest_updated) do = sort_title_recently_created
= sort_title_oldest_updated = link_to admin_groups_path(sort: sort_value_oldest_created) do
= link_to 'New Group', new_admin_group_path, class: "btn btn-new" = sort_title_oldest_created
= link_to admin_groups_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
= link_to admin_groups_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
= link_to 'New Group', new_admin_group_path, class: "btn btn-new"
%ul.content-list %ul.content-list
- @groups.each do |group| - @groups.each do |group|
= render 'group', group: group = render 'group', group: group
= paginate @groups, theme: "gitlab" = paginate @groups, theme: "gitlab"
- @no_container = true
- page_title "Health Check" - page_title "Health Check"
= render 'admin/background_jobs/head'
%h3.page-title %div{ class: (container_class) }
Health Check %h3.page-title
.bs-callout.clearfix Health Check
.pull-left .bs-callout.clearfix
%p .pull-left
Access token is %p
%code#health-check-token= current_application_settings.health_check_access_token Access token is
= button_to reset_health_check_token_admin_application_settings_path, %code#health-check-token= current_application_settings.health_check_access_token
method: :put, class: 'btn btn-default', = button_to reset_health_check_token_admin_application_settings_path,
data: { confirm: 'Are you sure you want to reset the health check token?' } do method: :put, class: 'btn btn-default',
= icon('refresh') data: { confirm: 'Are you sure you want to reset the health check token?' } do
Reset health check access token = icon('refresh')
%p.light Reset health check access token
Health information can be retrieved as plain text, JSON, or XML using: %p.light
%ul Health information can be retrieved as plain text, JSON, or XML using:
%li %ul
%code= health_check_url(token: current_application_settings.health_check_access_token) %li
%li %code= health_check_url(token: current_application_settings.health_check_access_token)
%code= health_check_url(token: current_application_settings.health_check_access_token, format: :json) %li
%li %code= health_check_url(token: current_application_settings.health_check_access_token, format: :json)
%code= health_check_url(token: current_application_settings.health_check_access_token, format: :xml) %li
%code= health_check_url(token: current_application_settings.health_check_access_token, format: :xml)
%p.light %p.light
You can also ask for the status of specific services: You can also ask for the status of specific services:
%ul %ul
%li %li
%code= health_check_url(token: current_application_settings.health_check_access_token, checks: :cache) %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :cache)
%li %li
%code= health_check_url(token: current_application_settings.health_check_access_token, checks: :database) %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :database)
%li %li
%code= health_check_url(token: current_application_settings.health_check_access_token, checks: :migrations) %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :migrations)
%hr %hr
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
Current Status: Current Status:
- if @errors.blank? - if @errors.blank?
= icon('circle', class: 'cgreen') = icon('circle', class: 'cgreen')
Healthy Healthy
- else - else
= icon('warning', class: 'cred') = icon('warning', class: 'cred')
Unhealthy Unhealthy
.panel-body .panel-body
- if @errors.blank? - if @errors.blank?
No Health Problems Detected No Health Problems Detected
- else - else
= @errors = @errors
- @no_container = true
- page_title "Logs" - page_title "Logs"
- loggers = [Gitlab::GitLogger, Gitlab::AppLogger, - loggers = [Gitlab::GitLogger, Gitlab::AppLogger,
Gitlab::ProductionLogger, Gitlab::SidekiqLogger, Gitlab::ProductionLogger, Gitlab::SidekiqLogger,
Gitlab::RepositoryCheckLogger] Gitlab::RepositoryCheckLogger]
%ul.nav-links.log-tabs = render 'admin/background_jobs/head'
- loggers.each do |klass|
%li{ class: (klass == Gitlab::GitLogger ? 'active' : '') } %div{ class: (container_class) }
= link_to klass::file_name, "##{klass::file_name_noext}", %ul.nav-links.log-tabs
'data-toggle' => 'tab' - loggers.each do |klass|
.row-content-block %li{ class: (klass == Gitlab::GitLogger ? 'active' : '') }
To prevent performance issues admin logs output the last 2000 lines = link_to klass::file_name, "##{klass::file_name_noext}",
.tab-content 'data-toggle' => 'tab'
- loggers.each do |klass| .row-content-block
.tab-pane{ class: (klass == Gitlab::GitLogger ? 'active' : ''), To prevent performance issues admin logs output the last 2000 lines
id: klass::file_name_noext } .tab-content
.file-holder#README - loggers.each do |klass|
.file-title .tab-pane{ class: (klass == Gitlab::GitLogger ? 'active' : ''),
%i.fa.fa-file id: klass::file_name_noext }
= klass::file_name .file-holder#README
.pull-right .file-title
= link_to '#', class: 'log-bottom' do %i.fa.fa-file
%i.fa.fa-arrow-down = klass::file_name
Scroll down .pull-right
.file-content.logs = link_to '#', class: 'log-bottom' do
%ol %i.fa.fa-arrow-down
- klass.read_latest.each do |line| Scroll down
%li .file-content.logs
%p= line %ol
- klass.read_latest.each do |line|
%li
%p= line
- @no_container = true
- page_title "Projects" - page_title "Projects"
= render 'shared/show_aside' = render 'shared/show_aside'
= render "admin/dashboard/head"
.row.prepend-top-default %div{ class: (container_class) }
%aside.col-md-3 .row.prepend-top-default
.panel.admin-filter %aside.col-md-3
= form_tag admin_namespaces_projects_path, method: :get, class: '' do .panel.admin-filter
.form-group = form_tag admin_namespaces_projects_path, method: :get, class: '' do
= label_tag :name, 'Name:' .form-group
= text_field_tag :name, params[:name], class: "form-control" = label_tag :name, 'Name:'
= text_field_tag :name, params[:name], class: "form-control"
.form-group .form-group
= label_tag :namespace_id, "Namespace" = label_tag :namespace_id, "Namespace"
= namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large' = namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large'
.form-group .form-group
%strong Activity %strong Activity
.checkbox .checkbox
= label_tag :with_push do = label_tag :with_push do
= check_box_tag :with_push, 1, params[:with_push] = check_box_tag :with_push, 1, params[:with_push]
%span Projects with push events %span Projects with push events
.checkbox .checkbox
= label_tag :abandoned do = label_tag :abandoned do
= check_box_tag :abandoned, 1, params[:abandoned] = check_box_tag :abandoned, 1, params[:abandoned]
%span No activity over 6 month %span No activity over 6 month
.checkbox .checkbox
= label_tag :with_archived do = label_tag :with_archived do
= check_box_tag :with_archived, 1, params[:with_archived] = check_box_tag :with_archived, 1, params[:with_archived]
%span Show archived projects %span Show archived projects
%fieldset %fieldset
%strong Visibility level: %strong Visibility level:
.visibility-levels .visibility-levels
- Project.visibility_levels.each do |label, level| - Project.visibility_levels.each do |label, level|
.checkbox .checkbox
%label %label
= check_box_tag 'visibility_levels[]', level, params[:visibility_levels].present? && params[:visibility_levels].include?(level.to_s) = check_box_tag 'visibility_levels[]', level, params[:visibility_levels].present? && params[:visibility_levels].include?(level.to_s)
%span.descr %span.descr
= visibility_level_icon(level) = visibility_level_icon(level)
= label = label
%fieldset %fieldset
%strong Problems %strong Problems
.checkbox .checkbox
= label_tag :last_repository_check_failed do = label_tag :last_repository_check_failed do
= check_box_tag :last_repository_check_failed, 1, params[:last_repository_check_failed] = check_box_tag :last_repository_check_failed, 1, params[:last_repository_check_failed]
%span Last repository check failed %span Last repository check failed
= hidden_field_tag :sort, params[:sort] = hidden_field_tag :sort, params[:sort]
= button_tag "Search", class: "btn submit btn-primary" = button_tag "Search", class: "btn submit btn-primary"
= link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel" = link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
%section.col-md-9 %section.col-md-9
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
Projects (#{@projects.total_count}) Projects (#{@projects.total_count})
.controls .controls
.dropdown.inline .dropdown.inline
%button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'} %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
%span.light %span.light
- if @sort.present? - if @sort.present?
= sort_options_hash[@sort] = sort_options_hash[@sort]
- else - else
= sort_title_recently_created
%b.caret
%ul.dropdown-menu
%li
= link_to admin_namespaces_projects_path(sort: sort_value_recently_created) do
= sort_title_recently_created = sort_title_recently_created
= link_to admin_namespaces_projects_path(sort: sort_value_oldest_created) do %b.caret
= sort_title_oldest_created %ul.dropdown-menu
= link_to admin_namespaces_projects_path(sort: sort_value_recently_updated) do %li
= sort_title_recently_updated = link_to admin_namespaces_projects_path(sort: sort_value_recently_created) do
= link_to admin_namespaces_projects_path(sort: sort_value_oldest_updated) do = sort_title_recently_created
= sort_title_oldest_updated = link_to admin_namespaces_projects_path(sort: sort_value_oldest_created) do
= link_to admin_namespaces_projects_path(sort: sort_value_largest_repo) do = sort_title_oldest_created
= sort_title_largest_repo = link_to admin_namespaces_projects_path(sort: sort_value_recently_updated) do
= link_to 'New Project', new_project_path, class: "btn btn-sm btn-success" = sort_title_recently_updated
%ul.well-list = link_to admin_namespaces_projects_path(sort: sort_value_oldest_updated) do
- @projects.each do |project| = sort_title_oldest_updated
%li = link_to admin_namespaces_projects_path(sort: sort_value_largest_repo) do
.list-item-name = sort_title_largest_repo
%span{ class: visibility_level_color(project.visibility_level) } = link_to 'New Project', new_project_path, class: "btn btn-sm btn-success"
= visibility_level_icon(project.visibility_level) %ul.well-list
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project] - @projects.each do |project|
.pull-right %li
- if project.archived .list-item-name
%span.label.label-warning archived %span{ class: visibility_level_color(project.visibility_level) }
%span.label.label-gray = visibility_level_icon(project.visibility_level)
= repository_size(project) = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project]
= link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-sm" .pull-right
= link_to 'Destroy', [project.namespace.becomes(Namespace), project], data: { confirm: remove_project_message(project) }, method: :delete, class: "btn btn-sm btn-remove" - if project.archived
- if @projects.blank? %span.label.label-warning archived
.nothing-here-block 0 projects matches %span.label.label-gray
= paginate @projects, theme: "gitlab" = repository_size(project)
= link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-sm"
= link_to 'Destroy', [project.namespace.becomes(Namespace), project], data: { confirm: remove_project_message(project) }, method: :delete, class: "btn btn-sm btn-remove"
- if @projects.blank?
.nothing-here-block 0 projects matches
= paginate @projects, theme: "gitlab"
This diff is collapsed.
- page_title "Admin Area" - page_title "Admin Area"
- header_title "Admin Area", admin_root_path - header_title "Admin Area", admin_root_path
- sidebar "admin" - nav "admin"
= render template: "layouts/application" = render template: "layouts/application"
%ul.nav.nav-sidebar %ul.nav-links.scrolling-tabs
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do .fade-left
= link_to admin_root_path, title: 'Overview' do = nav_link(controller: %w(dashboard admin projects users groups builds), html_options: {class: 'home'}) do
= icon('dashboard fw') = link_to admin_root_path, title: 'Overview', class: 'shortcuts-tree' do
%span %span
Overview Overview
= nav_link(controller: [:admin, :projects]) do = nav_link(controller: %w(background_jobs logs health_check)) do
= link_to admin_namespaces_projects_path, title: 'Projects' do = link_to admin_background_jobs_path, title: 'Monitoring' do
= icon('cube fw')
%span %span
Projects Monitoring
= nav_link(controller: :users) do
= link_to admin_users_path, title: 'Users' do
= icon('user fw')
%span
Users
= nav_link(controller: :groups) do
= link_to admin_groups_path, title: 'Groups' do
= icon('group fw')
%span
Groups
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to admin_deploy_keys_path, title: 'Deploy Keys' do = link_to admin_deploy_keys_path, title: 'Deploy Keys' do
= icon('key fw')
%span %span
Deploy Keys Deploy Keys
= nav_link path: ['runners#index', 'runners#show'] do = nav_link path: ['runners#index', 'runners#show'] do
= link_to admin_runners_path, title: 'Runners' do = link_to admin_runners_path, title: 'Runners' do
= icon('cog fw')
%span %span
Runners Runners
%span.count= number_with_delimiter(Ci::Runner.count(:all))
= nav_link path: 'builds#index' do
= link_to admin_builds_path, title: 'Builds' do
= icon('link fw')
%span
Builds
%span.count= number_with_delimiter(Ci::Build.count(:all))
= nav_link(controller: :logs) do
= link_to admin_logs_path, title: 'Logs' do
= icon('file-text fw')
%span
Logs
= nav_link(controller: :health_check) do
= link_to admin_health_check_path, title: 'Health Check' do
= icon('medkit fw')
%span
Health Check
= nav_link(controller: :broadcast_messages) do = nav_link(controller: :broadcast_messages) do
= link_to admin_broadcast_messages_path, title: 'Messages' do = link_to admin_broadcast_messages_path, title: 'Messages' do
= icon('bullhorn fw')
%span %span
Messages Messages
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to admin_hooks_path, title: 'Hooks' do = link_to admin_hooks_path, title: 'Hooks' do
= icon('external-link fw')
%span %span
Hooks Hooks
= nav_link(controller: :background_jobs) do
= link_to admin_background_jobs_path, title: 'Background Jobs' do
= icon('cog fw')
%span
Background Jobs
= nav_link(controller: :appearances) do = nav_link(controller: :appearances) do
= link_to admin_appearances_path, title: 'Appearances' do = link_to admin_appearances_path, title: 'Appearances' do
= icon('image')
%span %span
Appearance Appearance
= nav_link(controller: :applications) do = nav_link(controller: :applications) do
= link_to admin_applications_path, title: 'Applications' do = link_to admin_applications_path, title: 'Applications' do
= icon('cloud fw')
%span %span
Applications Applications
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to admin_application_settings_services_path, title: 'Service Templates' do = link_to admin_application_settings_services_path, title: 'Service Templates' do
= icon('copy fw')
%span %span
Service Templates Service Templates
= nav_link(controller: :labels) do = nav_link(controller: :labels) do
= link_to admin_labels_path, title: 'Labels' do = link_to admin_labels_path, title: 'Labels' do
= icon('tags fw')
%span %span
Labels Labels
= nav_link(controller: :abuse_reports) do = nav_link(controller: :abuse_reports) do
= link_to admin_abuse_reports_path, title: "Abuse Reports" do = link_to admin_abuse_reports_path, title: "Abuse Reports" do
= icon('exclamation-circle fw')
%span %span
Abuse Reports Abuse Reports
%span.count= number_with_delimiter(AbuseReport.count(:all)) %span.badge.count= number_with_delimiter(AbuseReport.count(:all))
- if askimet_enabled? - if askimet_enabled?
= nav_link(controller: :spam_logs) do = nav_link(controller: :spam_logs) do
= link_to admin_spam_logs_path, title: "Spam Logs" do = link_to admin_spam_logs_path, title: "Spam Logs" do
= icon('exclamation-triangle fw')
%span %span
Spam Logs Spam Logs
%span.count= number_with_delimiter(SpamLog.count(:all))
= nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do
= link_to admin_application_settings_path, title: 'Settings' do = link_to admin_application_settings_path, title: 'Settings' do
= icon('cogs fw')
%span %span
Settings Settings
.fade-right
...@@ -5,28 +5,36 @@ Feature: Admin Active Tab ...@@ -5,28 +5,36 @@ Feature: Admin Active Tab
Scenario: On Admin Home Scenario: On Admin Home
Given I visit admin page Given I visit admin page
Then the active main tab should be Home Then the active main tab should be Overview
And no other main tabs should be active And no other main tabs should be active
Scenario: On Admin Projects Scenario: On Admin Projects
Given I visit admin projects page Given I visit admin projects page
Then the active main tab should be Projects Then the active main tab should be Overview
And the active sub tab should be Projects
And no other main tabs should be active And no other main tabs should be active
And no other sub tabs should be active
Scenario: On Admin Groups Scenario: On Admin Groups
Given I visit admin groups page Given I visit admin groups page
Then the active main tab should be Groups Then the active main tab should be Overview
And the active sub tab should be Groups
And no other main tabs should be active And no other main tabs should be active
And no other sub tabs should be active
Scenario: On Admin Users Scenario: On Admin Users
Given I visit admin users page Given I visit admin users page
Then the active main tab should be Users Then the active main tab should be Overview
And the active sub tab should be Users
And no other main tabs should be active And no other main tabs should be active
And no other sub tabs should be active
Scenario: On Admin Logs Scenario: On Admin Logs
Given I visit admin logs page Given I visit admin logs page
Then the active main tab should be Logs Then the active main tab should be Monitoring
And the active sub tab should be Logs
And no other main tabs should be active And no other main tabs should be active
And no other sub tabs should be active
Scenario: On Admin Messages Scenario: On Admin Messages
Given I visit admin messages page Given I visit admin messages page
...@@ -40,5 +48,7 @@ Feature: Admin Active Tab ...@@ -40,5 +48,7 @@ Feature: Admin Active Tab
Scenario: On Admin Resque Scenario: On Admin Resque
Given I visit admin Resque page Given I visit admin Resque page
Then the active main tab should be Resque Then the active main tab should be Monitoring
And the active sub tab should be Resque
And no other main tabs should be active And no other main tabs should be active
And no other sub tabs should be active
class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedSidebarActiveTab include SharedActiveTab
step 'the active main tab should be Home' do step 'the active main tab should be Overview' do
ensure_active_main_tab('Overview') ensure_active_main_tab('Overview')
end end
step 'the active main tab should be Projects' do step 'the active sub tab should be Projects' do
ensure_active_main_tab('Projects') ensure_active_sub_tab('Projects')
end end
step 'the active main tab should be Groups' do step 'the active sub tab should be Groups' do
ensure_active_main_tab('Groups') ensure_active_sub_tab('Groups')
end end
step 'the active main tab should be Users' do step 'the active sub tab should be Users' do
ensure_active_main_tab('Users') ensure_active_sub_tab('Users')
end
step 'the active main tab should be Logs' do
ensure_active_main_tab('Logs')
end end
step 'the active main tab should be Hooks' do step 'the active main tab should be Hooks' do
ensure_active_main_tab('Hooks') ensure_active_main_tab('Hooks')
end end
step 'the active main tab should be Resque' do step 'the active main tab should be Monitoring' do
ensure_active_main_tab('Background Jobs') ensure_active_main_tab('Monitoring')
end end
step 'the active main tab should be Messages' do step 'the active sub tab should be Resque' do
ensure_active_main_tab('Messages') ensure_active_sub_tab('Background Jobs')
end end
step 'no other main tabs should be active' do step 'the active sub tab should be Logs' do
expect(page).to have_selector('.nav-sidebar > li.active', count: 1) ensure_active_sub_tab('Logs')
end end
def ensure_active_main_tab(content) step 'the active main tab should be Messages' do
expect(find('.nav-sidebar > li.active')).to have_content(content) ensure_active_main_tab('Messages')
end end
end end
...@@ -12,9 +12,11 @@ describe "Admin::Hooks", feature: true do ...@@ -12,9 +12,11 @@ describe "Admin::Hooks", feature: true do
describe "GET /admin/hooks" do describe "GET /admin/hooks" do
it "should be ok" do it "should be ok" do
visit admin_root_path visit admin_root_path
page.within ".sidebar-wrapper" do
page.within ".layout-nav" do
click_on "Hooks" click_on "Hooks"
end end
expect(current_path).to eq(admin_hooks_path) expect(current_path).to eq(admin_hooks_path)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment