Add Brief intro. for all personal plugins

Add Share Setting for Personal Plugins ( if have old data must be add default value "field: is_hidden => false " )
Apply New UI to Member Plugin Edit Page
Personal Plugin Summary fix
Academic Info. list fix

Updated Import method in teachers to make all false positives.

Updated Data import and sync code

Updated Books,Conference, Journal to display properly in the frontend

Journal title being imported correctly now

Fixed Import data to import journal level types, fixed writing journal
This commit is contained in:
Spen authored and saurabhbhatia committed 2013-09-26 14:45:43 +08:00
1 parent 7990d4388c
commit cd8448d447
7 files changed
+66 -33

No files matched your search

+47 -16
View File
@@ -22,31 +22,38 @@ class Admin::ImportDataController < OrbitBackendController
@roles = Role.all
@teacher = User.new
I18n.locale = :zh_tw
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = "Please Fill the Name"
if !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
else
@teacher.first_name = hash['teacher_zh_tw']
end
I18n.locale = :en
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = "Please Fill the Name"
end
I18n.locale = :en
if !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif !hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
@teacher.first_name = "Please Fill the Name"
end
#@teacher.first_name = hash['teacher_en']
@teacher.ntu_seq = hash['ntu_seq']
@teacher.sid = hash['ntu_seq']
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
@teacher.password = "testpass"
@i += 10
if hash['email'].blank?
@teacher.email = "#{@i}@ntu.edu.tw"
if !hash['email'].blank?
@user = User.where(email: "#{hash['email']}")
if @user.length == 0
@teacher.email = hash['email']
elsif @user.length > 0
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
end
else
@teacher.email = hash['email']
@teacher.email = "#{@i}@ntu.edu.tw"
end
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@@ -130,7 +137,8 @@ class Admin::ImportDataController < OrbitBackendController
title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
location: (cp_node>"Location").text,
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
conference_title: (cp_node>"PublishOn").text,
remarks: (cp_node>"Remarks").text
}
end
@@ -144,6 +152,12 @@ class Admin::ImportDataController < OrbitBackendController
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
I18n.locale = :en
@conference_paper.authors = b[:author]
@@ -152,9 +166,17 @@ class Admin::ImportDataController < OrbitBackendController
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year]
@conference_paper.create_user_id = hash.id
@conference_paper.save!
end
else
@@ -191,7 +213,7 @@ class Admin::ImportDataController < OrbitBackendController
endpage:(paper_node>"EndPage").text,
subgroup:(paper_node>"subgroup").text,
remarks: (paper_node>"Remarks").text,
cate: ((paper_node>"subgroup")>"group").text
cate: ((paper_node>"subgroup")>"Group").text
}
end
if @journal_papers.present?
@@ -202,21 +224,30 @@ class Admin::ImportDataController < OrbitBackendController
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title].first
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
I18n.locale = :en
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title].first
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
@journal_paper.year = b[:year]
@journal_paper.vol_no = b[:volumeno]
@journal_paper.form_to_start = b[:beginpage]
@journal_paper.form_to_end = b[:endpage]
if !b[:cate].blank?
@level_type = JournalLevelType.where(:key => b[:cate])
if @level_type.present?
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
end
end
@journal_paper.create_user_id = hash.id
@journal_paper.save!
end