2012-03-27 16:50:00 +01:00
|
|
|
json.project do |proj|
|
|
|
|
proj.visibility project.visibility.to_s
|
|
|
|
|
|
|
|
proj.name project.name
|
|
|
|
proj.description project.description
|
|
|
|
proj.link project_path(project)
|
|
|
|
|
|
|
|
proj.role t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}").force_encoding(Encoding::UTF_8)
|
|
|
|
|
2012-03-29 17:27:33 +01:00
|
|
|
proj.leave_link remove_user_project_path(project) unless project.owner == current_user or !alone_member? project
|
|
|
|
proj.rights_class participant_class(alone_member?(project), project)
|
2012-03-30 15:51:57 +01:00
|
|
|
proj.title t("layout.relations.#{participant_class(alone_member?(project), project)}")
|
2012-03-27 16:50:00 +01:00
|
|
|
|
|
|
|
proj.owner do |owner|
|
|
|
|
owner.name project.owner.uname
|
|
|
|
owner.type project.owner.class.to_s.underscore
|
|
|
|
owner.link project.owner.class == User ? user_path(project.owner) : group_path(project.owner)
|
|
|
|
end
|
|
|
|
end
|