2012-05-03 13:30:12 +00:00
|
|
|
class DesktopPublicationsController< ApplicationController
|
2012-05-04 12:28:12 +00:00
|
|
|
def journal_p
|
|
|
|
render "desktop/journal_p", :layout => false
|
|
|
|
end
|
2012-05-03 13:30:12 +00:00
|
|
|
|
|
|
|
def journal_p_list
|
|
|
|
render "desktop/journal_pages/list", :layout => false
|
|
|
|
end
|
|
|
|
|
|
|
|
def journal_p_add
|
2012-11-05 15:04:54 +00:00
|
|
|
debugger
|
2012-05-03 13:30:12 +00:00
|
|
|
render "desktop/journal_pages/add", :layout => false
|
|
|
|
end
|
|
|
|
|
2012-07-04 10:49:10 +00:00
|
|
|
def books
|
|
|
|
render "desktop/books", :layout => false
|
|
|
|
end
|
|
|
|
|
|
|
|
def books_list
|
|
|
|
render "desktop/books/list", :layout => false
|
|
|
|
end
|
|
|
|
|
|
|
|
def books_add
|
|
|
|
render "desktop/books/add", :layout => false
|
|
|
|
end
|
|
|
|
|
2012-07-04 11:12:02 +00:00
|
|
|
def seminar_p
|
|
|
|
render "desktop/seminar_p", :layout => false
|
|
|
|
end
|
|
|
|
|
|
|
|
def seminar_p_list
|
|
|
|
render "desktop/seminar_pages/list", :layout => false
|
|
|
|
end
|
|
|
|
|
|
|
|
def seminar_p_add
|
|
|
|
render "desktop/seminar_pages/add", :layout => false
|
|
|
|
end
|
|
|
|
|
2012-05-03 13:30:12 +00:00
|
|
|
def create_journal
|
2012-07-03 11:45:47 +00:00
|
|
|
Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
|
2012-05-03 13:30:12 +00:00
|
|
|
b = Array.new
|
|
|
|
b << {"success"=>"true"}
|
|
|
|
render :json=>b.to_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def getjournals
|
2012-06-26 13:09:33 +00:00
|
|
|
@journals = current_user.journals
|
2012-05-03 13:30:12 +00:00
|
|
|
data = Array.new
|
|
|
|
@journals.each do |journal|
|
|
|
|
@papers = journal.papers.all
|
|
|
|
data << {"title" => journal.title, "papers" => @papers}
|
|
|
|
end
|
|
|
|
render :json=>data.to_json
|
|
|
|
end
|
2012-06-28 09:31:48 +00:00
|
|
|
|
|
|
|
def delete_journal
|
|
|
|
@journals = Journal.find("")
|
|
|
|
@journals.delete
|
|
|
|
b = Array.new
|
|
|
|
b << {"success"=>"true"}
|
|
|
|
render :json=>b.to_json
|
|
|
|
end
|
2012-07-03 11:45:47 +00:00
|
|
|
|
|
|
|
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
|
2012-08-21 11:36:49 +00:00
|
|
|
|
2012-07-03 11:45:47 +00:00
|
|
|
b << {"success"=>"true"}
|
|
|
|
render :json=>b.to_json
|
|
|
|
end
|
2012-05-03 13:30:12 +00:00
|
|
|
end
|