From 06e5e37c0b181f0da3fac114e684fe6b104212df Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 26 Nov 2014 16:09:45 +0800 Subject: [PATCH] added edit and file stuff --- app/controllers/admin/journal_papers_controller.rb | 3 +++ app/controllers/desktop/journal_papers_controller.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/controllers/admin/journal_papers_controller.rb b/app/controllers/admin/journal_papers_controller.rb index e284bdd..25d4a1d 100644 --- a/app/controllers/admin/journal_papers_controller.rb +++ b/app/controllers/admin/journal_papers_controller.rb @@ -38,6 +38,9 @@ class Admin::JournalPapersController < OrbitMemberController def edit @member = @journal_paper.member_profile + if params[:desktop] + render :layout => false + end end def create diff --git a/app/controllers/desktop/journal_papers_controller.rb b/app/controllers/desktop/journal_papers_controller.rb index df2eaff..59039ce 100644 --- a/app/controllers/desktop/journal_papers_controller.rb +++ b/app/controllers/desktop/journal_papers_controller.rb @@ -10,6 +10,7 @@ class Desktop::JournalPapersController < DesktopAdminController { "title" => "Add/Edit", "layout" => "form", + "new_file_attributes" => "journal_paper[journal_paper_files_attributes][{number}][journal_file]", "new_path" => "/admin/members/#{user.member_profile.to_param}/journal_papers/new" } ] @@ -28,8 +29,10 @@ class Desktop::JournalPapersController < DesktopAdminController "extension" => (jpf.journal_file.url.split(".").last rescue "") } end + { "id" => j.id.to_s, + "edit_url" => "/#{I18n.locale.to_s}/admin/jounal_papers/#{j.to_param}/edit", "paper_title" => j.paper_title, "journal_title" => j.journal_title, "keywords" => j.keywords,