Timeline ajax load fixed… a bit change in structure..
This commit is contained in:
1 parent
bacb1f1e63
commit
f20f36383e
7 files changed
+48
-33
No files matched your search
@@ -16,14 +16,16 @@ class DesktopOrbitController< ApplicationController
|
||||
end
|
||||
|
||||
def eventajaxload
|
||||
@limit = 15
|
||||
@fromdate = params["from"]
|
||||
@fromdate[0] = Integer(@fromdate[0])
|
||||
@fromdate[1] = Integer(@fromdate[1])
|
||||
@totalpapers = 0
|
||||
@lastpaper = current_user.papers.all.desc(:created_at).last
|
||||
@date = Date.new(Integer(@lastpaper.created_at.strftime("%Y")),Integer(@lastpaper.created_at.strftime("%m")))
|
||||
@data = Array.new
|
||||
while @totalpapers < 15
|
||||
if @lastpaper.created_at > Date.new(@fromdate[0],@fromdate[1])
|
||||
while @totalpapers < @limit
|
||||
if Date.new(@date.year,@date.month-1) > Date.new(@fromdate[0],@fromdate[1])
|
||||
break
|
||||
end
|
||||
if(@fromdate[1] == 12)
|
||||
|
||||
@@ -12,7 +12,7 @@ class DesktopPublicationsController< ApplicationController
|
||||
end
|
||||
|
||||
def create_journal
|
||||
Journal.create(user_id: current_user.id, title: "Google")
|
||||
Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
|
||||
b = Array.new
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
@@ -35,4 +35,15 @@ class DesktopPublicationsController< ApplicationController
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
def update_journal
|
||||
@journal = Journal.find("4ff2d6ebbd98eb02b9000017")
|
||||
@papers = @journal.papers
|
||||
@papers.each do |paper|
|
||||
paper.update_attributes(:user_id => current_user.id)
|
||||
end
|
||||
b = Array.new
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user