Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-30 07:14:05 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-30 15:40:34 +0400
commitc38b9a2f80111f8074f8e6ce36e63d68f519c581 (patch)
tree67bc366fa95a328dfec68202b685e9a3747f7fcc /app/helpers/tab_helper.rb
parenta03f318964bc5ffa8ef6d10fdc466cef84ecfe46 (diff)
Filter projects on dashboard
Diffstat (limited to 'app/helpers/tab_helper.rb')
-rw-r--r--app/helpers/tab_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb
index 740700c3009..a4bec87caa7 100644
--- a/app/helpers/tab_helper.rb
+++ b/app/helpers/tab_helper.rb
@@ -84,4 +84,17 @@ module TabHelper
'active'
end
end
+
+ # Use nav_tab for save controller/action but different params
+ def nav_tab key, value, &block
+ o = {}
+ o[:class] = ""
+ o[:class] << " active" if params[key] == value
+
+ if block_given?
+ content_tag(:li, capture(&block), o)
+ else
+ content_tag(:li, nil, o)
+ end
+ end
end