summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:25:34 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:25:34 +0200
commitc2f02fc1a4b88e1c01cb3562168322d0c5debba3 (patch)
treebcfc20e755dcdb8e07e7aa6600643e3d76585a0b /app/helpers/projects_helper.rb
parent5be6cbac6fd50f6e97c483f78de667ce5628a3ce (diff)
downloadgitlab-ce-c2f02fc1a4b88e1c01cb3562168322d0c5debba3.tar.gz
Refactor star and fork buttons
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index ae65985ce75..74c8d4dad06 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -84,53 +84,6 @@ module ProjectsHelper
@project.milestones.active.order("due_date, title ASC")
end
- def link_to_toggle_star(title, starred)
- cls = 'star-btn btn'
-
- toggle_text =
- if starred
- ' Unstar'
- else
- ' Star'
- end
-
- toggle_html = content_tag('span', class: 'toggle') do
- icon('star') + toggle_text
- end
-
- count_html = content_tag('span', class: 'count') do
- @project.star_count.to_s
- end
-
- link_opts = {
- title: title,
- class: cls,
- method: :post,
- remote: true,
- data: { type: 'json' }
- }
-
- path = toggle_star_namespace_project_path(@project.namespace, @project)
-
- content_tag 'span', class: starred ? 'turn-on' : 'turn-off' do
- link_to(path, link_opts) do
- toggle_html + ' ' + count_html
- end
- end
- end
-
- def link_to_toggle_fork
- html = content_tag('span') do
- icon('code-fork') + ' Fork'
- end
-
- count_html = content_tag(:span, class: 'count') do
- @project.forks_count.to_s
- end
-
- html + count_html
- end
-
def project_for_deploy_key(deploy_key)
if deploy_key.projects.include?(@project)
@project