summaryrefslogtreecommitdiff
path: root/app/helpers/boards_helper.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-10-12 12:50:47 +0100
committerPhil Hughes <me@iamphill.com>2016-10-12 12:50:47 +0100
commitf76f569bb87803b14c763427fc2875cca7dda892 (patch)
tree36323b0f248a57bae612ec1c5a5487ed98d120a5 /app/helpers/boards_helper.rb
parent53b3c62e0f889d077ee5b19703c3e04384c85c03 (diff)
downloadgitlab-ce-f76f569bb87803b14c763427fc2875cca7dda892.tar.gz
Moved data attribute values into helper method
Diffstat (limited to 'app/helpers/boards_helper.rb')
-rw-r--r--app/helpers/boards_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb
new file mode 100644
index 00000000000..b7247ffa8b2
--- /dev/null
+++ b/app/helpers/boards_helper.rb
@@ -0,0 +1,12 @@
+module BoardsHelper
+ def board_data
+ board = @board || @boards.first
+
+ {
+ endpoint: namespace_project_boards_path(@project.namespace, @project),
+ board_id: board.id,
+ disabled: !can?(current_user, :admin_list, @project),
+ issue_link_base: namespace_project_issues_path(@project.namespace, @project)
+ }
+ end
+end