BigW Consortium Gitlab

Commit de9886be by Douwe Maan

Restyle dashboard snippets visibility level tabs.

parent d37cf642
......@@ -162,10 +162,21 @@
border-color: #e7e9ed;
width: 140px;
.badge {
font-weight: normal;
background-color: #eee;
color: #78a;
}
&.active {
border-color: $gl-info;
background: $gl-info;
color: #fff;
.badge {
color: $gl-info;
background-color: white;
}
}
}
}
......@@ -147,7 +147,6 @@
.badge {
font-weight: normal;
background-color: #fff;
background-color: #eee;
color: #78a;
}
......
......@@ -110,22 +110,4 @@ module TabHelper
'active'
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
......@@ -9,27 +9,23 @@
= icon('plus')
New Snippet
.oneline
Share code pastes with others out of git repository
%ul.center-top-menu.no-top.no-bottom.snippet-scope-menu
= nav_tab :scope, nil do
= link_to dashboard_snippets_path do
.btn-group.btn-group-next.event-filter
= link_to dashboard_snippets_path, class: "btn btn-default #{"active" unless params[:scope]}" do
All
%span.badge
= 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
%span.badge
= 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
%span.badge
= 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
%span.badge
= 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