[issue #76] Fixed bug with JSON generation.
This commit is contained in:
parent
7c50b2c3f5
commit
49082c2a8d
|
@ -68,7 +68,7 @@ class RepositoriesController < ApplicationController
|
|||
# else
|
||||
# @projects = Project.addable_to_repository(@repository.id).paginate(:page => params[:project_page])
|
||||
# end
|
||||
render 'projects_list'
|
||||
render :projects_list
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
{"sEcho": <%= params[:sEcho] || -1 %>,
|
||||
"iTotalRecords": <%= @total_projects %>,
|
||||
"iTotalDisplayRecords": <%= @total_project %>,
|
||||
"aaData":[
|
||||
<% @projects.each do |project| %>
|
||||
['<%= link_to(project.owner.uname, project.owner) %>',
|
||||
'<%= link_to(project.name, project) %>',
|
||||
'<%= link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id) %>'
|
||||
],
|
||||
<% end %>
|
||||
]}
|
||||
{
|
||||
"sEcho": <%=h params[:sEcho].to_i || -1 %>,
|
||||
"iTotalRecords": <%= @total_projects %>,
|
||||
"iTotalDisplayRecords": <%= @total_project %>,
|
||||
"aaData": [
|
||||
<% @projects.each do |project| %>
|
||||
[
|
||||
"<%=j link_to project.owner.uname, project.owner %>",
|
||||
"<%=j link_to project.name, project %>",
|
||||
"<%=j link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id) %>"
|
||||
]<%= project == @projects.last ? '' : ',' %>
|
||||
<% end %>
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -2,16 +2,12 @@
|
|||
= raw datatable(columns, {:sort_by => "[1, 'asc']", :ajax_source => "#{url_for :controller => :repositories, :action => :projects_list, :id => @repository.id}" })
|
||||
|
||||
%table.table.datatable
|
||||
%tr
|
||||
%th.first= t("activerecord.attributes.user.uname")
|
||||
%th= t("activerecord.attributes.project.name")
|
||||
%th.last
|
||||
-# @projects.each do |project|
|
||||
%tr{:class => cycle("odd", "even")}
|
||||
%td
|
||||
= link_to project.owner.uname + '/' + project.name, project_path(project)
|
||||
%td.last
|
||||
#{link_to t("layout.show"), project_path(project)} | #{link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id)}
|
||||
%thead
|
||||
%tr
|
||||
%th.first= t("activerecord.attributes.user.uname")
|
||||
%th= t("activerecord.attributes.project.name")
|
||||
%th.last
|
||||
%tbody
|
||||
|
||||
= content_for :javascripts do
|
||||
= javascript_include_tag 'jquery.dataTables.min.js'
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
%h2.title
|
||||
= t("layout.projects.list_header")
|
||||
.inner
|
||||
= render :partial => 'shared/search_form'
|
||||
-#= render :partial => 'shared/search_form'
|
||||
= render :partial => 'proj_list', :object => @projects
|
||||
-#.actions-bar.wat-cf
|
||||
.actions
|
||||
|
|
Loading…
Reference in New Issue