Commit 8812d9de authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move groups and teams to tabs on dashboard. Remember tab with cookie

parent 96c627ed
window.dashboardPage = -> window.dashboardPage = ->
Pager.init 20, true Pager.init 20, true
initSidebarTab()
$(".event_filter_link").bind "click", (event) -> $(".event_filter_link").bind "click", (event) ->
event.preventDefault() event.preventDefault()
toggleFilter $(this) toggleFilter $(this)
...@@ -25,3 +26,14 @@ toggleFilter = (sender) -> ...@@ -25,3 +26,14 @@ toggleFilter = (sender) ->
event_filters.splice index, 1 event_filters.splice index, 1
$.cookie "event_filter", event_filters.join(",") $.cookie "event_filter", event_filters.join(",")
initSidebarTab = ->
key = "dashboard_sidebar_filter"
# store selection in cookie
$('.dash-sidebar-tabs a').on 'click', (e) ->
$.cookie(key, $(e.target).attr('id'))
# show tab from cookie
sidebar_filter = $.cookie(key)
$("#" + sidebar_filter).tab('show') if sidebar_filter
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
.side { .side {
@extend .pull-right; @extend .pull-right;
.projects_box, .ui-box {
margin: 3px;
}
.projects_box { .projects_box {
> .title { > .title {
padding: 2px 15px; padding: 2px 15px;
......
...@@ -16,3 +16,6 @@ ...@@ -16,3 +16,6 @@
%span.pull-right.light %span.pull-right.light
- if group.owner == current_user - if group.owner == current_user
%i.icon-wrench %i.icon-wrench
- if groups.blank?
%li
%h3.nothing_here_message You have no groups yet.
- if @teams.present? %ul.nav.nav-tabs.dash-sidebar-tabs
= render "teams", teams: @teams %li.active
- if @groups.present? = link_to 'Projects', '#projects', 'data-toggle' => 'tab', id: 'sidebar-projects-tab'
= render "groups", groups: @groups %li
= render "projects", projects: @projects = link_to 'Groups', '#groups', 'data-toggle' => 'tab', id: 'sidebar-groups-tab'
%div %li
= link_to 'Teams', '#teams', 'data-toggle' => 'tab', id: 'sidebar-teams-tab'
.tab-content
.tab-pane.active#projects
= render "projects", projects: @projects
.tab-pane#groups
= render "groups", groups: @groups
.tab-pane#teams
= render "teams", teams: @teams
.prepend-top-20
%span.rss-icon %span.rss-icon
= link_to dashboard_path(:atom, { private_token: current_user.private_token }) do = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
= image_tag "rss_ui.png", title: "feed" %strong
%strong News Feed %i.icon-rss
News Feed
%hr %hr
.gitlab-promo .gitlab-promo
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
%h5.title %h5.title
Teams Teams
%small %small
(#{@teams.count}) (#{teams.count})
%span.pull-right %span.pull-right
= link_to new_team_path, class: "btn btn-tiny info" do = link_to new_team_path, class: "btn btn-tiny info" do
%i.icon-plus %i.icon-plus
New Team New Team
%ul.well-list %ul.well-list
- @teams.each do |team| - teams.each do |team|
%li %li
= link_to team_path(id: team.path), class: dom_class(team) do = link_to team_path(id: team.path), class: dom_class(team) do
%strong.well-title= truncate(team.name, length: 35) %strong.well-title= truncate(team.name, length: 35)
...@@ -18,3 +18,6 @@ ...@@ -18,3 +18,6 @@
- tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id)
- if tm - if tm
= tm.access_human = tm.access_human
- if teams.blank?
%li
%h3.nothing_here_message You have no teams yet.
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