Commit de9886be authored by Douwe Maan's avatar Douwe Maan

Restyle dashboard snippets visibility level tabs.

parent d37cf642
...@@ -162,10 +162,21 @@ ...@@ -162,10 +162,21 @@
border-color: #e7e9ed; border-color: #e7e9ed;
width: 140px; width: 140px;
.badge {
font-weight: normal;
background-color: #eee;
color: #78a;
}
&.active { &.active {
border-color: $gl-info; border-color: $gl-info;
background: $gl-info; background: $gl-info;
color: #fff; color: #fff;
.badge {
color: $gl-info;
background-color: white;
}
} }
} }
} }
...@@ -147,7 +147,6 @@ ...@@ -147,7 +147,6 @@
.badge { .badge {
font-weight: normal; font-weight: normal;
background-color: #fff;
background-color: #eee; background-color: #eee;
color: #78a; color: #78a;
} }
......
...@@ -110,22 +110,4 @@ module TabHelper ...@@ -110,22 +110,4 @@ module TabHelper
'active' 'active'
end end
end end
# Use nav_tab for save controller/action but different params
def nav_tab(key, value, &block)
o = {}
o[:class] = ""
if value.nil?
o[:class] << " active" if params[key].blank?
else
o[:class] << " active" if params[key] == value
end
if block_given?
content_tag(:li, capture(&block), o)
else
content_tag(:li, nil, o)
end
end
end end
...@@ -9,27 +9,23 @@ ...@@ -9,27 +9,23 @@
= icon('plus') = icon('plus')
New Snippet New Snippet
.oneline .btn-group.btn-group-next.event-filter
Share code pastes with others out of git repository = link_to dashboard_snippets_path, class: "btn btn-default #{"active" unless params[:scope]}" do
%ul.center-top-menu.no-top.no-bottom.snippet-scope-menu
= nav_tab :scope, nil do
= link_to dashboard_snippets_path do
All All
%span.badge %span.badge
= current_user.snippets.count = current_user.snippets.count
= nav_tab :scope, 'are_private' do
= link_to dashboard_snippets_path(scope: 'are_private') do = link_to dashboard_snippets_path(scope: 'are_private'), class: "btn btn-default #{"active" if params[:scope] == "are_private"}" do
Private Private
%span.badge %span.badge
= current_user.snippets.are_private.count = current_user.snippets.are_private.count
= nav_tab :scope, 'are_internal' do
= link_to dashboard_snippets_path(scope: 'are_internal') do = link_to dashboard_snippets_path(scope: 'are_internal'), class: "btn btn-default #{"active" if params[:scope] == "are_internal"}" do
Internal Internal
%span.badge %span.badge
= current_user.snippets.are_internal.count = current_user.snippets.are_internal.count
= nav_tab :scope, 'are_public' do
= link_to dashboard_snippets_path(scope: 'are_public') do = link_to dashboard_snippets_path(scope: 'are_public'), class: "btn btn-default #{"active" if params[:scope] == "are_public"}" do
Public Public
%span.badge %span.badge
= current_user.snippets.are_public.count = current_user.snippets.are_public.count
......
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