Commit f3f27fee authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Left-side navigation for group layout

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7b71a9e2
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
} }
} }
.project .event_filter { .sidenav .event_filter {
position: static; position: static;
float: left; float: left;
width: 100%; width: 100%;
......
body.project { body.sidenav {
padding: 0; padding: 0;
&.ui_mars { &.ui_mars {
...@@ -119,7 +119,7 @@ body.project { ...@@ -119,7 +119,7 @@ body.project {
} }
} }
.project-settings-nav { .sidebar-subnav {
margin-left: 0px; margin-left: 0px;
padding-left: 0px; padding-left: 0px;
......
...@@ -6,7 +6,7 @@ module GroupsHelper ...@@ -6,7 +6,7 @@ module GroupsHelper
def leave_group_message(group) def leave_group_message(group)
"Are you sure you want to leave \"#{group}\" group?" "Are you sure you want to leave \"#{group}\" group?"
end end
def should_user_see_group_roles?(user, group) def should_user_see_group_roles?(user, group)
if user if user
user.is_admin? || group.members.exists?(user_id: user.id) user.is_admin? || group.members.exists?(user_id: user.id)
...@@ -44,4 +44,12 @@ module GroupsHelper ...@@ -44,4 +44,12 @@ module GroupsHelper
path << "?#{options.to_param}" path << "?#{options.to_param}"
path path
end end
def group_settings_page?
if current_controller?('groups')
current_action?('edit') || current_action?('projects')
else
false
end
end
end end
%ul.nav.nav-pills.nav-stacked.nav-stacked-menu %ul.sidebar-subnav
= nav_link(path: 'groups#edit') do = nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group) do = link_to edit_group_path(@group) do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
......
.row .panel.panel-default
.col-md-2 .panel-heading
= render 'settings_nav' %strong= @group.name
.col-md-10 group settings:
.panel.panel-default .panel-body
.panel-heading = form_for @group, html: { multipart: true, class: "form-horizontal" }, authenticity_token: true do |f|
%strong= @group.name - if @group.errors.any?
group settings: .alert.alert-danger
.panel-body %span= @group.errors.full_messages.first
= form_for @group, html: { multipart: true, class: "form-horizontal" }, authenticity_token: true do |f| = render 'shared/group_form', f: f
- if @group.errors.any?
.alert.alert-danger
%span= @group.errors.full_messages.first
= render 'shared/group_form', f: f
.form-group .form-group
.col-sm-2 .col-sm-2
.col-sm-10 .col-sm-10
= image_tag group_icon(@group.to_param), alt: '', class: 'avatar s160' = image_tag group_icon(@group.to_param), alt: '', class: 'avatar s160'
%p.light %p.light
- if @group.avatar? - if @group.avatar?
You can change your group avatar here You can change your group avatar here
- else - else
You can upload a group avatar here You can upload a group avatar here
= render 'shared/choose_group_avatar_button', f: f = render 'shared/choose_group_avatar_button', f: f
- if @group.avatar? - if @group.avatar?
%hr %hr
= link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar" = link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar"
.form-actions .form-actions
= f.submit 'Save group', class: "btn btn-save" = f.submit 'Save group', class: "btn btn-save"
.panel.panel-danger .panel.panel-danger
.panel-heading Remove group .panel-heading Remove group
.panel-body .panel-body
%p %p
Removing group will cause all child projects and resources to be removed. Removing group will cause all child projects and resources to be removed.
%br %br
%strong Removed group can not be restored! %strong Removed group can not be restored!
= link_to 'Remove Group', @group, data: {confirm: 'Removed group can not be restored! Are you sure?'}, method: :delete, class: "btn btn-remove" = link_to 'Remove Group', @group, data: {confirm: 'Removed group can not be restored! Are you sure?'}, method: :delete, class: "btn btn-remove"
.row .panel.panel-default
.col-md-2 .panel-heading
= render 'settings_nav' %strong= @group.name
.col-md-10 projects:
.panel.panel-default - if can? current_user, :manage_group, @group
.panel-heading .panel-head-actions
%strong= @group.name = link_to new_project_path(namespace_id: @group.id), class: "btn btn-new" do
projects: %i.fa.fa-plus
- if can? current_user, :manage_group, @group New Project
.panel-head-actions %ul.well-list
= link_to new_project_path(namespace_id: @group.id), class: "btn btn-new" do - @projects.each do |project|
%i.fa.fa-plus %li
New Project .list-item-name
%ul.well-list = visibility_level_icon(project.visibility_level)
- @projects.each do |project| %strong= link_to project.name_with_namespace, project
%li %span.label.label-gray
.list-item-name = repository_size(project)
= visibility_level_icon(project.visibility_level) .pull-right
%strong= link_to project.name_with_namespace, project = link_to 'Members', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
%span.label.label-gray = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= repository_size(project) = link_to 'Remove', project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove"
.pull-right - if @projects.blank?
= link_to 'Members', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" .nothing-here-block This group has no projects yet
= link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Remove', project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank?
.nothing-here-block This group has no projects yet
= paginate @projects, theme: "gitlab" = paginate @projects, theme: "gitlab"
!!! 5 !!! 5
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head", title: group_head_title = render "layouts/head", title: group_head_title
%body{class: "#{app_theme} application", :'data-page' => body_data_page} %body{class: "#{app_theme} application sidenav", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "group: #{@group.name}" = render "layouts/head_panel", title: "group: #{@group.name}"
%nav.main-nav.navbar-collapse.collapse .page-with-sidebar
.container= render 'layouts/nav/group' .sidebar-wrapper
.container = render 'layouts/nav/group'
.content .content-wrapper
= render "layouts/flash" .container-fluid
= yield .content
= render "layouts/flash"
.clearfix
= yield
= yield :embedded_scripts
%ul %ul.nav.nav-sidebar.navbar-collapse.collapse
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do = link_to group_path(@group), title: "Home" do
%i.fa.fa-dashboard
Activity Activity
= nav_link(controller: [:group, :milestones]) do = nav_link(controller: [:group, :milestones]) do
= link_to group_milestones_path(@group) do = link_to group_milestones_path(@group) do
%i.fa.fa-clock-o
Milestones Milestones
= nav_link(path: 'groups#issues') do = nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do = link_to issues_group_path(@group) do
%i.fa.fa-exclamation-circle
Issues Issues
- if current_user - if current_user
%span.count= current_user.assigned_issues.opened.of_group(@group).count %span.count= current_user.assigned_issues.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do = nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do = link_to merge_requests_group_path(@group) do
%i.fa.fa-tasks
Merge Requests Merge Requests
- if current_user - if current_user
%span.count= current_user.cared_merge_requests.opened.of_group(@group).count %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
= nav_link(path: 'groups#members') do = nav_link(path: 'groups#members') do
= link_to "Members", members_group_path(@group) = link_to members_group_path(@group) do
%i.fa.fa-users
Members
- if can?(current_user, :manage_group, @group) - if can?(current_user, :manage_group, @group)
= nav_link(path: 'groups#edit') do = nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
= link_to edit_group_path(@group), class: "tab " do = link_to edit_group_path(@group), class: "tab no-highlight" do
%i.fa.fa-cogs
Settings Settings
%i.fa.fa-angle-down
- if group_settings_page?
= render 'groups/settings_nav'
!!! 5 !!! 5
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head", title: @project.name_with_namespace = render "layouts/head", title: @project.name_with_namespace
%body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id } %body{class: "#{app_theme} sidenav project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project) = render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete" = render "layouts/init_auto_complete"
......
!!! 5 !!! 5
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head", title: project_head_title = render "layouts/head", title: project_head_title
%body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id } %body{class: "#{app_theme} sidenav project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project) = render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete" = render "layouts/init_auto_complete"
......
%ul.project-settings-nav %ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do = nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), class: "stat-tab tab " do = link_to edit_project_path(@project), class: "stat-tab tab " do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
......
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