2012-07-26 21:25:44 +01:00
|
|
|
projs = @projects.map do |pr|
|
|
|
|
[
|
2014-01-21 04:51:49 +00:00
|
|
|
content_tag(:div, image_tag(visibility_icon(pr.visibility)), class: 'table-sort-left') +
|
|
|
|
content_tag(:div, link_to(pr.name_with_owner, pr), class: 'table-sort-right'),
|
2012-07-26 21:25:44 +01:00
|
|
|
|
2014-01-21 04:51:49 +00:00
|
|
|
truncate(pr.description || '', length: 60).gsub(/\n|\r|\t/, ' '),
|
2012-07-26 21:25:44 +01:00
|
|
|
|
|
|
|
if can? :remove_project, @repository
|
|
|
|
link_to(
|
2014-01-21 04:51:49 +00:00
|
|
|
remove_project_platform_repository_path(@platform, @repository, project_id: pr.id),
|
2014-03-14 21:55:28 +00:00
|
|
|
method: :delete, data: { confirm: t("layout.confirm") }) do
|
2014-01-21 04:51:49 +00:00
|
|
|
content_tag(:span, " ".html_safe, class: 'delete')
|
2012-07-26 21:25:44 +01:00
|
|
|
end
|
|
|
|
else
|
|
|
|
''
|
|
|
|
end
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
json.sEcho params[:sEcho].to_i || -1
|
|
|
|
json.iTotalRecords @total_projects
|
2012-07-27 13:40:13 +01:00
|
|
|
json.iTotalDisplayRecords @projects.count
|
2012-07-26 21:25:44 +01:00
|
|
|
json.aaData projs
|