summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 8ccdf0736..7174575be 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -65,6 +65,20 @@ module ApplicationHelper
end
end
+ # Displays a link to edit group page if current user is admin
+ # Otherwise display only the group name
+ def link_to_group(group, options={})
+ if group.is_a?(Group)
+ name = h(group.name)
+ if (User.current.admin?)
+ only_path = options[:only_path].nil? ? true : options[:only_path]
+ link_to name, edit_group_path(group, :only_path => only_path)
+ else
+ name
+ end
+ end
+ end
+
# Displays a link to +issue+ with its subject.
# Examples:
#