rosa-build/app/views/platforms/repositories/_project.json.jbuilder

24 lines
801 B
Plaintext
Raw Normal View History

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'),
2014-01-21 04:51:49 +00:00
truncate(pr.description || '', length: 60).gsub(/\n|\r|\t/, ' '),
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')
end
else
''
end
]
end
json.sEcho params[:sEcho].to_i || -1
json.iTotalRecords @total_projects
json.iTotalDisplayRecords @projects.count
json.aaData projs