Archived
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0028a21307 | ||
|
|
58051caac1 | ||
|
|
5e9c6924e2 | ||
|
|
a845a9d41b | ||
|
|
72bd04099e | ||
|
|
2258fd30e6 | ||
|
|
b7142c884b | ||
|
|
f4e88616c7 | ||
|
|
9d45df1c5a | ||
|
|
f59452ffc4 | ||
|
|
69d588b9ef |
No files matched your search
@@ -289,14 +289,13 @@ var orbitDesktop = function(dom){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var ca = $e.attr("content-holder");
|
var ca = $e.attr("content-holder");
|
||||||
|
|
||||||
var a = function(){
|
var a = function(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : t,
|
type : t,
|
||||||
dataType : responsetype,
|
dataType : responsetype,
|
||||||
url : $e.attr("href"),
|
url : $e.attr("href"),
|
||||||
success : function(data){
|
success : function(data){
|
||||||
if(typeof data == "string" && t != "delete"){
|
if(typeof data == "string"){
|
||||||
if(ca)
|
if(ca)
|
||||||
$(ca).html(data);
|
$(ca).html(data);
|
||||||
else{
|
else{
|
||||||
@@ -309,12 +308,10 @@ var orbitDesktop = function(dom){
|
|||||||
window.o[o.data_method][exe](data,$e);
|
window.o[o.data_method][exe](data,$e);
|
||||||
if(t == "delete"){
|
if(t == "delete"){
|
||||||
if($e.attr("delete-item")=="true"){
|
if($e.attr("delete-item")=="true"){
|
||||||
var li_to_delete = $e.parentsUntil("li[item=true]");
|
var li_to_delete = $e.parentsUntil("li[item=true]").find("li[item=true]");
|
||||||
li_to_delete.slideUp();
|
li_to_delete.slideUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
error : function(x){
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -682,8 +682,8 @@ legend {
|
|||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
.sign-in .btn {
|
.sign-in .btn {
|
||||||
padding: 4px 0;
|
|
||||||
display: block;
|
display: block;
|
||||||
|
padding: 4px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
@@ -711,7 +711,7 @@ legend {
|
|||||||
.sign-in .checkbox {
|
.sign-in .checkbox {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
bottom: 37px;
|
bottom: 47px;
|
||||||
}
|
}
|
||||||
.sign-in .switchboard {
|
.sign-in .switchboard {
|
||||||
color: #08C;
|
color: #08C;
|
||||||
@@ -766,4 +766,4 @@ legend {
|
|||||||
#main-wrap .wrap-inner {
|
#main-wrap .wrap-inner {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,17 @@
|
|||||||
top: 0px;
|
top: 0px;
|
||||||
left: -10px;
|
left: -10px;
|
||||||
right: -10px;
|
right: -10px;
|
||||||
height: 40px;
|
|
||||||
z-index: 1041;
|
z-index: 1041;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
height: 40px;
|
||||||
}
|
}
|
||||||
#orbit-bar .orbitlogo {
|
#orbit-bar .orbitlogo {
|
||||||
width: 20px;
|
width: 50px;
|
||||||
height: 20px;
|
height: 40px;
|
||||||
|
padding: 0!important;
|
||||||
background-size: 70%;
|
background-size: 70%;
|
||||||
display: inline-block;
|
display: block;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-image: url(<%= asset_path 'orbit-logo.svg' %>);
|
background-image: url(<%= asset_path 'orbit-logo.svg' %>);
|
||||||
@@ -19,8 +20,23 @@
|
|||||||
/* For Suck IE */
|
/* For Suck IE */
|
||||||
background-image: url(<%= asset_path 'orbit-logo.png' %>)\9;
|
background-image: url(<%= asset_path 'orbit-logo.png' %>)\9;
|
||||||
}
|
}
|
||||||
|
#orbit-bar .dropdown-menu li > a {
|
||||||
|
padding: 0 20px;
|
||||||
|
display: block;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
#orbit-bar .dropdown-menu li i {
|
||||||
|
float: left;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
line-height: 30px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
#orbit-bar.navbar .nav > li > a {
|
#orbit-bar.navbar .nav > li > a {
|
||||||
color: #EEE;
|
color: #EEE;
|
||||||
|
padding: 0 15px;
|
||||||
|
display: block;
|
||||||
text-shadow: 0 -1px 0 #000;
|
text-shadow: 0 -1px 0 #000;
|
||||||
border-right: 1px solid #363636;
|
border-right: 1px solid #363636;
|
||||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||||
@@ -34,6 +50,11 @@
|
|||||||
background-color: #0095CF;
|
background-color: #0095CF;
|
||||||
text-shadow: 0 -1px 0 #014380;
|
text-shadow: 0 -1px 0 #014380;
|
||||||
}
|
}
|
||||||
|
#orbit-bar.navbar .nav > li > a > [class^="icon"],
|
||||||
|
#orbit-bar.navbar .nav > li > a > [class*=" icon"] {
|
||||||
|
line-height: 40px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
#orbit-bar.navbar .nav li.dropdown.open > .dropdown-toggle,
|
#orbit-bar.navbar .nav li.dropdown.open > .dropdown-toggle,
|
||||||
#orbit-bar.navbar .nav li.dropdown.active > .dropdown-toggle,
|
#orbit-bar.navbar .nav li.dropdown.active > .dropdown-toggle,
|
||||||
#orbit-bar.navbar .nav li.dropdown.open.active > .dropdown-toggle {
|
#orbit-bar.navbar .nav li.dropdown.open.active > .dropdown-toggle {
|
||||||
@@ -41,9 +62,7 @@
|
|||||||
text-shadow: 0 -1px 0 #014380;
|
text-shadow: 0 -1px 0 #014380;
|
||||||
}
|
}
|
||||||
#orbit-bar .navbar-inner {
|
#orbit-bar .navbar-inner {
|
||||||
height: 40px;
|
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
min-height: 40px;
|
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
-webkit-border-radius: 0px;
|
-webkit-border-radius: 0px;
|
||||||
-moz-border-radius: 0px;
|
-moz-border-radius: 0px;
|
||||||
@@ -66,6 +85,10 @@
|
|||||||
right: auto;
|
right: auto;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
}
|
}
|
||||||
|
#orbit-bar .nav > li {
|
||||||
|
display: block;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
#orbit-bar .nav [class^="icon"],
|
#orbit-bar .nav [class^="icon"],
|
||||||
#orbit-bar .nav [class*=" icon"] {
|
#orbit-bar .nav [class*=" icon"] {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
@@ -92,17 +115,45 @@
|
|||||||
#orbit-bar .modal .input-prepend {
|
#orbit-bar .modal .input-prepend {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
#orbit-bar .modal .other-sign-in {
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
border-bottom: 1px solid #EDEDED;
|
||||||
|
}
|
||||||
|
#orbit-bar .modal .other-sign-in .btn {
|
||||||
|
padding: 4px 0;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#orbit-bar .modal .other-sign-in p {
|
||||||
|
position: absolute;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
background-color: #FFF;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-left: -25px;
|
||||||
|
line-height: 30px;
|
||||||
|
left: 50%;
|
||||||
|
bottom: -15px;
|
||||||
|
font-size: 1.3em;
|
||||||
|
color: #B1B1B1;
|
||||||
|
}
|
||||||
|
|
||||||
/*Search*/
|
/*Search*/
|
||||||
#orbit-bar #search {
|
#orbit-bar #search {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 8px 10px 0;
|
padding: 0 10px;
|
||||||
border-right: 1px solid #363636;
|
border-right: 1px solid #363636;
|
||||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
#orbit-bar #search form {
|
#orbit-bar #search form {
|
||||||
margin-bottom: 8px;
|
margin: 8px 0;
|
||||||
}
|
}
|
||||||
#orbit-bar #search input[type="text"] {
|
#orbit-bar #search input[type="text"] {
|
||||||
height: 14px;
|
height: 14px;
|
||||||
@@ -110,6 +161,7 @@
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
padding-left: 25px;
|
padding-left: 25px;
|
||||||
padding-right: 25px;
|
padding-right: 25px;
|
||||||
|
display: block;
|
||||||
-webkit-border-radius: 12px;
|
-webkit-border-radius: 12px;
|
||||||
-moz-border-radius: 12px;
|
-moz-border-radius: 12px;
|
||||||
-o-border-radius: 12px;
|
-o-border-radius: 12px;
|
||||||
@@ -122,15 +174,16 @@
|
|||||||
#orbit-bar #search .search-clear {
|
#orbit-bar #search .search-clear {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color: #A3A3A3;
|
color: #A3A3A3;
|
||||||
top: 14px;
|
top: 16px;
|
||||||
}
|
}
|
||||||
#orbit-bar #search .icon-search {
|
#orbit-bar #search .icon-search {
|
||||||
left: 13px;
|
left: 15px;
|
||||||
top: 15px;
|
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
|
width: 1.25em;
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
#orbit-bar #search .search-clear {
|
#orbit-bar #search .search-clear {
|
||||||
right: 14px;
|
right: 13px;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
}
|
}
|
||||||
#orbit-bar #search .search-clear:hover {
|
#orbit-bar #search .search-clear:hover {
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
require 'timeout'
|
|
||||||
|
|
||||||
class Admin::ImportDataController < OrbitBackendController
|
class Admin::ImportDataController < OrbitBackendController
|
||||||
# helper Admin::PagePartsHelper
|
# helper Admin::PagePartsHelper
|
||||||
# include Admin::FrontendWidgetInterface
|
# include Admin::FrontendWidgetInterface
|
||||||
|
open_for_user
|
||||||
|
open_for_admin
|
||||||
|
|
||||||
def get_teacher_data
|
def get_teacher_data
|
||||||
uri = URI("https://localhost:8000/teachers.xml")
|
uri = URI("https://localhost:8000/teachers.xml")
|
||||||
|
|
||||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
#uri.query = URI.encode_www_form(params)
|
#uri.query = URI.encode_www_form(params)
|
||||||
@@ -77,14 +78,11 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
teachers = User.all
|
teachers = User.all
|
||||||
|
|
||||||
teachers.each do |hash|
|
teachers.each do |hash|
|
||||||
# if hash.ntu_seq.present?
|
if hash.ntu_seq.present?
|
||||||
if hash.user_id.present?
|
ntu_seq = hash.ntu_seq
|
||||||
# ntu_seq = hash.ntu_seq
|
books_xml = Nokogiri::XML( \
|
||||||
u_account = hash.user_id
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||||
books_xml = Nokogiri::XML( \
|
@books = books_xml.xpath("//Book").map do |book_node|
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
|
||||||
@books = books_xml.xpath("//Book").map do |book_node|
|
|
||||||
{
|
{
|
||||||
author: (book_node>"Authors").text,
|
author: (book_node>"Authors").text,
|
||||||
year: (book_node>"PublishYear").text,
|
year: (book_node>"PublishYear").text,
|
||||||
@@ -95,14 +93,14 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if @books.present?
|
if @books.present?
|
||||||
@books.each do |b|
|
@books.each do |b|
|
||||||
@book = WritingBook.new
|
@book = WritingBook.new
|
||||||
I18n.locale = :zh_tw
|
I18n.locale = :zh_tw
|
||||||
@book.authors = b[:author]
|
@book.authors = b[:author]
|
||||||
@book.paper_title = b[:title]
|
@book.paper_title = b[:title]
|
||||||
@book.book_title = b[:book_title]
|
@book.book_title = b[:book_title]
|
||||||
@book.note = b[:remarks]
|
@book.note = b[:remarks]
|
||||||
@book.publisher = b[:publisher]
|
@book.publisher = b[:publisher]
|
||||||
I18n.locale = :en
|
I18n.locale = :en
|
||||||
@book.authors = b[:author]
|
@book.authors = b[:author]
|
||||||
@book.paper_title = b[:title]
|
@book.paper_title = b[:title]
|
||||||
@@ -110,13 +108,13 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
@book.note = b[:remarks]
|
@book.note = b[:remarks]
|
||||||
@book.publisher = b[:publisher]
|
@book.publisher = b[:publisher]
|
||||||
@book.year = b[:year]
|
@book.year = b[:year]
|
||||||
@book.create_user_id = hash.id
|
@book.create_user_id = hash.id
|
||||||
@book.save
|
@book.save
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "No books by Teacher"
|
puts "No books by Teacher"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -129,13 +127,10 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
teachers = User.all
|
teachers = User.all
|
||||||
|
|
||||||
teachers.each do |hash|
|
teachers.each do |hash|
|
||||||
# if hash.ntu_seq.present?
|
if hash.ntu_seq.present?
|
||||||
if hash.user_id.present?
|
ntu_seq = hash.ntu_seq
|
||||||
# ntu_seq = hash.ntu_seq
|
|
||||||
u_account = hash.user_id
|
|
||||||
conference_xml = Nokogiri::XML( \
|
conference_xml = Nokogiri::XML( \
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||||
{
|
{
|
||||||
@@ -203,14 +198,11 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
teachers = User.all
|
teachers = User.all
|
||||||
|
|
||||||
teachers.each do |hash|
|
teachers.each do |hash|
|
||||||
# if hash.ntu_seq.present?
|
if hash.ntu_seq.present?
|
||||||
if hash.user_id.present?
|
ntu_seq = hash.ntu_seq
|
||||||
# ntu_seq = hash.ntu_seq
|
|
||||||
u_account = hash.user_id
|
|
||||||
paper_xml = Nokogiri::XML( \
|
paper_xml = Nokogiri::XML( \
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
|
||||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||||
{
|
{
|
||||||
author: (paper_node>"Authors").text,
|
author: (paper_node>"Authors").text,
|
||||||
@@ -260,7 +252,6 @@ class Admin::ImportDataController < OrbitBackendController
|
|||||||
|
|
||||||
@journal_paper.create_user_id = hash.id
|
@journal_paper.create_user_id = hash.id
|
||||||
@journal_paper.save!
|
@journal_paper.save!
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "No journal paper by Teacher"
|
puts "No journal paper by Teacher"
|
||||||
@@ -275,13 +266,10 @@ def sync_conference_data
|
|||||||
@user = User.find("#{params[:user_id]}")
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
# teachers.each do |hash|
|
# teachers.each do |hash|
|
||||||
# if @user.sid.present?
|
if @user.sid.present?
|
||||||
if @user.user_id.present?
|
ntu_seq = @user.sid
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.user_id
|
|
||||||
conference_xml = Nokogiri::XML( \
|
conference_xml = Nokogiri::XML( \
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||||
{
|
{
|
||||||
@@ -336,30 +324,22 @@ def sync_conference_data
|
|||||||
puts "No conference by Teacher"
|
puts "No conference by Teacher"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html { redirect_to request.referer }
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
redirect_to request.referer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def sync_journal_paper_data
|
def sync_journal_paper_data
|
||||||
|
|
||||||
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
||||||
@journal_data.delete_all
|
@journal_data.delete_all
|
||||||
@user = User.find("#{params[:user_id]}")
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
# teachers.each do |hash|
|
# teachers.each do |hash|
|
||||||
# if @user.sid.present?
|
if @user.sid.present?
|
||||||
if @user.user_id.present?
|
ntu_seq = @user.sid
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.user_id
|
|
||||||
paper_xml = Nokogiri::XML( \
|
paper_xml = Nokogiri::XML( \
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
|
||||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||||
{
|
{
|
||||||
author: (paper_node>"Authors").text,
|
author: (paper_node>"Authors").text,
|
||||||
@@ -418,13 +398,7 @@ def sync_conference_data
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
redirect_to request.referer
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html { redirect_to request.referer }
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sync_book_data
|
def sync_book_data
|
||||||
@@ -433,13 +407,10 @@ def sync_book_data
|
|||||||
@user = User.find("#{params[:user_id]}")
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
# teachers.each do |hash|
|
# teachers.each do |hash|
|
||||||
# if @user.sid.present?
|
if @user.sid.present?
|
||||||
if @user.user_id.present?
|
ntu_seq = @user.sid
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.user_id
|
|
||||||
books_xml = Nokogiri::XML( \
|
books_xml = Nokogiri::XML( \
|
||||||
# open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
|
||||||
@books = books_xml.xpath("//Book").map do |book_node|
|
@books = books_xml.xpath("//Book").map do |book_node|
|
||||||
{
|
{
|
||||||
author: (book_node>"Authors").text,
|
author: (book_node>"Authors").text,
|
||||||
@@ -471,32 +442,24 @@ def sync_book_data
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
redirect_to request.referer
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html { redirect_to request.referer }
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def sync_conference_data_auto
|
def sync_conference_data_auto
|
||||||
@user = User.all
|
@user = User.all
|
||||||
@user.each do |user|
|
@user.each do |user|
|
||||||
if user.user_id.present?
|
@conference_data = WritingConference.where(create_user_id: "#{user.id}")
|
||||||
next if !user.email.include? "ntu.edu.tw"
|
@conference_data.delete_all
|
||||||
u_account = user.user_id
|
# @user = User.find("#{params[:user_id]}")
|
||||||
@conference_xml = nil
|
|
||||||
begin
|
# teachers.each do |hash|
|
||||||
timeout(60) do
|
if user.sid.present?
|
||||||
@conference_xml = Nokogiri::XML( \
|
ntu_seq = user.sid
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
conference_xml = Nokogiri::XML( \
|
||||||
end
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||||
rescue Timeout::Error
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
next
|
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||||
end
|
|
||||||
@conference_papers = @conference_xml.xpath("//Paper").map do |cp_node|
|
|
||||||
{
|
{
|
||||||
author: (cp_node>"Authors").text,
|
author: (cp_node>"Authors").text,
|
||||||
year: (cp_node>"PublishYear").text,
|
year: (cp_node>"PublishYear").text,
|
||||||
@@ -509,8 +472,6 @@ end
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if @conference_papers.present?
|
if @conference_papers.present?
|
||||||
WritingConference.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@conference_papers.each do |b|
|
@conference_papers.each do |b|
|
||||||
@conference_paper = WritingConference.new
|
@conference_paper = WritingConference.new
|
||||||
I18n.locale = :zh_tw
|
I18n.locale = :zh_tw
|
||||||
@@ -548,8 +509,9 @@ end
|
|||||||
@conference_paper.save!
|
@conference_paper.save!
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
puts "No conference by Teacher"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -557,19 +519,17 @@ end
|
|||||||
def sync_journal_paper_data_auto
|
def sync_journal_paper_data_auto
|
||||||
@user = User.all
|
@user = User.all
|
||||||
@user.each do |user|
|
@user.each do |user|
|
||||||
if user.user_id.present?
|
@journal_data = WritingJournal.where(create_user_id: "#{user_id}")
|
||||||
next if !user.email.include? "ntu.edu.tw"
|
@journal_data.delete_all
|
||||||
u_account = user.user_id
|
# @user = User.find("#{params[:user_id]}")
|
||||||
@paper_xml = nil
|
|
||||||
begin
|
# teachers.each do |hash|
|
||||||
timeout(60) do
|
if user.sid.present?
|
||||||
@paper_xml = Nokogiri::XML( \
|
ntu_seq = user.sid
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
paper_xml = Nokogiri::XML( \
|
||||||
end
|
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||||
rescue Timeout::Error
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||||
next
|
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||||
end
|
|
||||||
@journal_papers = @paper_xml.xpath("//Paper").map do |paper_node|
|
|
||||||
{
|
{
|
||||||
author: (paper_node>"Authors").text,
|
author: (paper_node>"Authors").text,
|
||||||
year: (paper_node>"PublishYear").text,
|
year: (paper_node>"PublishYear").text,
|
||||||
@@ -585,9 +545,6 @@ def sync_journal_paper_data_auto
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if @journal_papers.present?
|
if @journal_papers.present?
|
||||||
|
|
||||||
WritingJournal.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@journal_papers.each do |b|
|
@journal_papers.each do |b|
|
||||||
@journal_paper = WritingJournal.new
|
@journal_paper = WritingJournal.new
|
||||||
I18n.locale = :zh_tw
|
I18n.locale = :zh_tw
|
||||||
@@ -628,7 +585,7 @@ def sync_journal_paper_data_auto
|
|||||||
@journal_paper.save!
|
@journal_paper.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts "Sync "+u_account+"\r\n"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -636,20 +593,16 @@ end
|
|||||||
def sync_book_data_auto
|
def sync_book_data_auto
|
||||||
@user = User.all
|
@user = User.all
|
||||||
@user.each do |user|
|
@user.each do |user|
|
||||||
if user.user_id.present?
|
@books_data = WritingBook.where(create_user_id: "#{user_id}")
|
||||||
next if !user.email.include? "ntu.edu.tw"
|
@books_data.delete_all
|
||||||
u_account = user.user_id
|
# @user = User.find("#{params[:user_id]}")
|
||||||
@books_xml = nil
|
|
||||||
begin
|
# teachers.each do |hash|
|
||||||
timeout(60) do
|
if user.sid.present?
|
||||||
@books_xml = Nokogiri::XML( \
|
ntu_seq = user.sid
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
books_xml = Nokogiri::XML( \
|
||||||
end
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||||
rescue Timeout::Error
|
@books = books_xml.xpath("//Book").map do |book_node|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
@books = @books_xml.xpath("//Book").map do |book_node|
|
|
||||||
{
|
{
|
||||||
author: (book_node>"Authors").text,
|
author: (book_node>"Authors").text,
|
||||||
year: (book_node>"PublishYear").text,
|
year: (book_node>"PublishYear").text,
|
||||||
@@ -659,11 +612,7 @@ def sync_book_data_auto
|
|||||||
book_title: (book_node>"BookTitle").text
|
book_title: (book_node>"BookTitle").text
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if @books.present?
|
if @books.present?
|
||||||
|
|
||||||
WritingBook.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@books.each do |b|
|
@books.each do |b|
|
||||||
@book = WritingBook.new
|
@book = WritingBook.new
|
||||||
I18n.locale = :zh_tw
|
I18n.locale = :zh_tw
|
||||||
@@ -731,4 +680,73 @@ end
|
|||||||
@bulletin.save!
|
@bulletin.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# def get_page_data
|
||||||
|
# f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
|
||||||
|
# page_xml = Nokogiri::XML(f)
|
||||||
|
# #open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
|
# @pages = page_xml.xpath("//management-page").map do |cp_node|
|
||||||
|
# {
|
||||||
|
# menu_title: (cp_node>"menu-title").text,
|
||||||
|
# content: (cp_node>"content").text
|
||||||
|
# }
|
||||||
|
# end
|
||||||
|
|
||||||
|
# if @pages.present?
|
||||||
|
# @i=0
|
||||||
|
# @pages.each do |b|
|
||||||
|
|
||||||
|
# get_variables_for_new
|
||||||
|
# @page = Page.new
|
||||||
|
|
||||||
|
# @page.parent = "4f45f3b9e9d02c5db900005d"
|
||||||
|
# @page.design = "50ac424983e75219d2000021"
|
||||||
|
# @page.theme_id = "50ac424a83e75219d2000025"
|
||||||
|
# @page.menu_enabled_for= ["en", "zh_tw", ""]
|
||||||
|
# @page.enabled_for= ["en", "zh_tw", ""]
|
||||||
|
# @page.is_published = false
|
||||||
|
# if b[:menu_title].blank?
|
||||||
|
# @page.title = 'No Title Present'
|
||||||
|
# @i += 1
|
||||||
|
# @page.name = "#{@i}Page"
|
||||||
|
# else
|
||||||
|
# @i += 1
|
||||||
|
# @page.title = b[:menu_title]
|
||||||
|
# @page.name = "#{@i}Page"
|
||||||
|
# end
|
||||||
|
# if b[:content].blank?
|
||||||
|
# @page.content = "No Content Present"
|
||||||
|
# else
|
||||||
|
# @page.content = b[:content]
|
||||||
|
# end
|
||||||
|
# @page.save!
|
||||||
|
# end
|
||||||
|
# else
|
||||||
|
# puts "No Page Data"
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
|
|
||||||
|
# def get_variables_for_new
|
||||||
|
# @designs = Design.all.entries
|
||||||
|
# @themes = Design.first.themes
|
||||||
|
# @module_apps = ModuleApp.for_frontend_select
|
||||||
|
# @app_frontend_urls = nil
|
||||||
|
# @categories = nil
|
||||||
|
# @tags = nil
|
||||||
|
# @page_frontend_data_counts = nil
|
||||||
|
# @frontend_styles = nil
|
||||||
|
# @selected={
|
||||||
|
# :design => @designs.first,
|
||||||
|
# :theme=> @themes.first,
|
||||||
|
# :module_app=>nil,#@module_apps.first
|
||||||
|
# :app_frontend_url=> nil, #@module_apps.first
|
||||||
|
# :category=>nil,
|
||||||
|
# :tag=>nil,
|
||||||
|
# :page_frontend_data_count=>nil,
|
||||||
|
# :frontend_style => nil
|
||||||
|
# }
|
||||||
|
# end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -19,7 +19,7 @@ class SessionsController < Devise::SessionsController
|
|||||||
if !resource.blank?
|
if !resource.blank?
|
||||||
resource_name = resource.class.to_s.downcase
|
resource_name = resource.class.to_s.downcase
|
||||||
sign_in(resource_name, resource)
|
sign_in(resource_name, resource)
|
||||||
session[:user_id_type] = "myntucoph"
|
session[:user_id_type] = "myntumb"
|
||||||
redirect_to after_sign_in_path_for(resource)
|
redirect_to after_sign_in_path_for(resource)
|
||||||
else
|
else
|
||||||
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||||
@@ -30,8 +30,8 @@ class SessionsController < Devise::SessionsController
|
|||||||
def destroy
|
def destroy
|
||||||
@user_id_type = session[:user_id_type]
|
@user_id_type = session[:user_id_type]
|
||||||
sign_out
|
sign_out
|
||||||
if @user_id_type == "myntucoph"
|
if @user_id_type == "myntumb"
|
||||||
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://cophlogin.ntu.edu.tw"
|
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://management.ntu.edu.tw"
|
||||||
else
|
else
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Imported Announcement Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Book Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Conference Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Journal Paper Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Imported Page Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Successfully Imported Teacher Data!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Book Data Synced Successfully!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Conference Paper Data Synced Successfully!</p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>Journal Paper Data Synced Successfully!</p>
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<h3 class="login-logo"><%= t(:login) %></h3>
|
<h3 class="login-logo"><%= t(:login) %></h3>
|
||||||
<div class="other-sign-in">
|
<div class="other-sign-in">
|
||||||
<% @request_hosts = request.host_with_port.split(".") %>
|
<% @request_hosts = request.host_with_port.split(".") %>
|
||||||
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://cophlogin.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://management.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
||||||
<p>or</p>
|
<p>or</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-block">
|
<div class="form-block">
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
||||||
<div class="other-sign-in">
|
<div class="other-sign-in">
|
||||||
<% @request_hosts = request.host_with_port.split(".") %>
|
<% @request_hosts = request.host_with_port.split(".") %>
|
||||||
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://cophlogin.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://management.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
||||||
<p>or</p>
|
<p>or</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-prepend">
|
<div class="input-prepend">
|
||||||
|
|||||||
@@ -24,5 +24,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<%= render 'layouts/orbit_bar' %>
|
<%= render 'layouts/orbit_bar' %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
|
<!--<div id="sign-footer">
|
||||||
|
<p>Rulingcom</p>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Executable → Regular
+1
-1
@@ -351,8 +351,8 @@ en:
|
|||||||
brief_intro : "Brief Intro."
|
brief_intro : "Brief Intro."
|
||||||
complete_list : "Complete List"
|
complete_list : "Complete List"
|
||||||
frontend_page : "Frontend Page"
|
frontend_page : "Frontend Page"
|
||||||
phone_number: "Phone Number"
|
|
||||||
sync_data: "Synchronize"
|
sync_data: "Synchronize"
|
||||||
|
phone_number: "Phone Number"
|
||||||
picture: Picture
|
picture: Picture
|
||||||
placeholder: Field Hint
|
placeholder: Field Hint
|
||||||
plugins: Plugins
|
plugins: Plugins
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -354,8 +354,8 @@ zh_tw:
|
|||||||
brief_intro : "摘要"
|
brief_intro : "摘要"
|
||||||
complete_list : "完整列表"
|
complete_list : "完整列表"
|
||||||
frontend_page : "前台呈現"
|
frontend_page : "前台呈現"
|
||||||
phone_number: "電話"
|
|
||||||
sync_data: "同步資料"
|
sync_data: "同步資料"
|
||||||
|
phone_number: "電話"
|
||||||
picture: 圖片
|
picture: 圖片
|
||||||
placeholder: 欄位提示文字
|
placeholder: 欄位提示文字
|
||||||
plugins: 學術資訊
|
plugins: 學術資訊
|
||||||
|
|||||||
Executable → Regular
File mode changed.
+4
-1
@@ -7,12 +7,15 @@ Orbit::Application.routes.draw do
|
|||||||
resources :passwords, :except => [:index, :show, :destroy]
|
resources :passwords, :except => [:index, :show, :destroy]
|
||||||
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
||||||
end
|
end
|
||||||
|
|
||||||
devise_scope :user do
|
devise_scope :user do
|
||||||
get 'user_login' => 'sessions#create'
|
get 'user_login' => 'sessions#create'
|
||||||
match 'user_logout' => 'sessions#destroy'
|
match 'user_logout' => 'sessions#destroy'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
match "saml_login" => 'saml_logins#index'
|
||||||
|
|
||||||
|
|
||||||
mount Resque::Server, :at => "/admin/resque"
|
mount Resque::Server, :at => "/admin/resque"
|
||||||
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
#encoding: utf-8
|
|
||||||
namespace :teacher do
|
|
||||||
task :import, [:department,:category] => :environment do |t, args|
|
|
||||||
department = "#{args.department}"
|
|
||||||
teacher_role = Role.where(:key=>"teacher").first
|
|
||||||
role_fulltime = RoleStatus.where(:key=>"1.fulltime").first
|
|
||||||
role_adjunct = RoleStatus.where(:key=>"2.adjunct").first
|
|
||||||
role_category = RoleCategory.where(:key=>"#{args.category}").first
|
|
||||||
@teacher = []
|
|
||||||
CSV.foreach("#{Rails.root}/#{department}.csv") do |row|
|
|
||||||
@teacher.push(row)
|
|
||||||
end
|
|
||||||
@teacher.each do |teacher|
|
|
||||||
sex = "unknown"
|
|
||||||
if teacher[2]=="男"
|
|
||||||
sex = "male"
|
|
||||||
elsif teacher[2]=="女"
|
|
||||||
sex = "female"
|
|
||||||
end
|
|
||||||
|
|
||||||
role_status = ""
|
|
||||||
if teacher[3].include? "兼任"
|
|
||||||
role_status = role_adjunct
|
|
||||||
else
|
|
||||||
role_status = role_fulltime
|
|
||||||
end
|
|
||||||
|
|
||||||
if teacher[1].blank?
|
|
||||||
teacher[1] = " "
|
|
||||||
end
|
|
||||||
|
|
||||||
user_data = {
|
|
||||||
:user_id => teacher[5].split("@")[0],
|
|
||||||
:password => "password",
|
|
||||||
:first_name_translations =>{"zh_tw"=>teacher[0].split(teacher[0][0])[1],"en"=>teacher[1].split(" ")[1]},
|
|
||||||
:last_name_translations => {"zh_tw"=>teacher[0][0],"en"=>teacher[1].split(" ")[0]},
|
|
||||||
:roles => [teacher_role],
|
|
||||||
:role_statuses => [role_status],
|
|
||||||
:role_categorys => [role_category],
|
|
||||||
:office_tel => teacher[4],
|
|
||||||
:email => teacher[5],
|
|
||||||
:confirmation_token => nil,
|
|
||||||
:confirmed_at => Time.now,
|
|
||||||
:approved => true,
|
|
||||||
:sex => sex
|
|
||||||
}
|
|
||||||
|
|
||||||
if User.where(:email=>teacher[5]).count == 0
|
|
||||||
user = User.new(user_data)
|
|
||||||
user.save
|
|
||||||
else
|
|
||||||
user = User.where(:email=>teacher[5]).first
|
|
||||||
user.update_attributes(user_data)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
<% show_office_field.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
if !@member.get_attribute_value(rf).blank?
|
||||||
|
if !@member.get_attribute_value(rf)['val'].blank?
|
||||||
|
@rodata = @member.get_attribute_value(rf)['val']
|
||||||
|
elsif !@member.get_attribute_value(rf)[I18n.locale].blank?
|
||||||
|
@rodata = @member.get_attribute_value(rf)[I18n.locale]
|
||||||
|
else
|
||||||
|
@rodata = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
|
||||||
|
%>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<% if (rf.title == "Office" || rf.title == "研究室")%>
|
||||||
|
<td><%= rf.title %></td>
|
||||||
|
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||||
|
</tr>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
<% show_research_field.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
if !@member.get_attribute_value(rf).blank?
|
||||||
|
if !@member.get_attribute_value(rf)['val'].blank?
|
||||||
|
@rodata = @member.get_attribute_value(rf)['val']
|
||||||
|
elsif !@member.get_attribute_value(rf)[I18n.locale].blank?
|
||||||
|
@rodata = @member.get_attribute_value(rf)[I18n.locale]
|
||||||
|
else
|
||||||
|
@rodata = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
|
||||||
|
%>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<% if (rf.title == "Research Field"|| rf.title == "研究領域")%>
|
||||||
|
<td><%= rf.title %></td>
|
||||||
|
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||||
|
</tr>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
Vendored
+1
-1
@@ -80,7 +80,7 @@
|
|||||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||||
<ul class="o-members-info">
|
<ul class="o-members-info">
|
||||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale) rescue ""
|
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||||
if @job_title != 'NoData' and !@job_title.blank?
|
if @job_title != 'NoData' and !@job_title.blank?
|
||||||
%>
|
%>
|
||||||
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
||||||
|
|||||||
vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js
Vendored
-10
@@ -92,16 +92,6 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
|
|||||||
width: $(".overview").width() - 20
|
width: $(".overview").width() - 20
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initializePersonalBook.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initializePersonalBook.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initializePersonalBook.coAuthorformCallback = function(data){
|
this.initializePersonalBook.coAuthorformCallback = function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
|||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
@per_column = 5
|
@per_column = 5
|
||||||
@userid = current_user.id
|
|
||||||
case @view_by
|
case @view_by
|
||||||
when "abstract"
|
when "abstract"
|
||||||
@per_column = 1
|
@per_column = 1
|
||||||
@@ -70,4 +70,4 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
|||||||
def books_window
|
def books_window
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
+13
-4
@@ -84,13 +84,22 @@ class WritingBook
|
|||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = []
|
||||||
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
|
title << self.authors if self.authors.present?
|
||||||
title << self.paper_title if self.paper_title.present?
|
|
||||||
|
# title << self.paper_title if self.paper_title.present?
|
||||||
title << self.book_title if self.book_title.present?
|
title << self.book_title if self.book_title.present?
|
||||||
title << self.publisher if self.publisher.present?
|
title << self.publisher if self.publisher.present?
|
||||||
title << self.pages if self.pages.present?
|
title << self.isbn if self.isbn.present?
|
||||||
|
|
||||||
|
if !self.publish_date.nil?
|
||||||
|
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]+"/"+pd[1]
|
||||||
|
elsif !self.year.blank?
|
||||||
|
title << self.year
|
||||||
|
end
|
||||||
|
|
||||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
+1
-4
@@ -57,9 +57,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_book_data_path(:user_id=>@userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,4 +67,4 @@
|
|||||||
<%= publication_record w, @view_by%>
|
<%= publication_record w, @view_by%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
Vendored
Executable → Regular
File mode changed.
+1
-4
@@ -42,10 +42,7 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){
|
|||||||
this.initializeConferencePapers.cancelpaper = function(){
|
this.initializeConferencePapers.cancelpaper = function(){
|
||||||
o.highlight_sub_menu_item(0);
|
o.highlight_sub_menu_item(0);
|
||||||
}
|
}
|
||||||
this.initializeConferencePapers.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
var uploadFiles = function(){
|
var uploadFiles = function(){
|
||||||
$('#add_plugin_file a.add').click(function(){
|
$('#add_plugin_file a.add').click(function(){
|
||||||
var new_id = $(this).prev().attr('value');
|
var new_id = $(this).prev().attr('value');
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
|
|||||||
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
||||||
page = params[:page]
|
page = params[:page]
|
||||||
page ||= 1
|
page ||= 1
|
||||||
@userid = current_user.id
|
|
||||||
if @view_by.nil?
|
if @view_by.nil?
|
||||||
@writing_conferences = @writing_conferences.asc(:paper_title)
|
@writing_conferences = @writing_conferences.asc(:paper_title)
|
||||||
else
|
else
|
||||||
|
|||||||
Vendored
Executable → Regular
+13
-3
@@ -84,13 +84,23 @@ class WritingConference
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = ["#{self.paper_title}"]
|
title = []
|
||||||
|
|
||||||
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]
|
||||||
|
elsif !self.year.blank?
|
||||||
|
title << self.year
|
||||||
|
end
|
||||||
|
|
||||||
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.conference_title if self.conference_title.present?
|
title << self.conference_title if self.conference_title.present?
|
||||||
title << self.sponsor if self.sponsor.present?
|
|
||||||
title << self.location if self.location.present?
|
title << self.location if self.location.present?
|
||||||
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
|
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
|
||||||
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
-4
@@ -58,10 +58,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_conference_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Conference Papers</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Vendored
Executable → Regular
File mode changed.
-5
@@ -33,7 +33,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
|||||||
}
|
}
|
||||||
this.initializeJournalPapers.paperDelete = function(data,dom){
|
this.initializeJournalPapers.paperDelete = function(data,dom){
|
||||||
var parent = dom.parent().parent().parent();
|
var parent = dom.parent().parent().parent();
|
||||||
// console.log(parent);
|
|
||||||
if(data.success){
|
if(data.success){
|
||||||
parent.hide("slide",function(){parent.remove();});
|
parent.hide("slide",function(){parent.remove();});
|
||||||
o.notify(data.msg,"success");
|
o.notify(data.msg,"success");
|
||||||
@@ -43,10 +42,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
|||||||
this.initializeJournalPapers.cancelpaper = function(){
|
this.initializeJournalPapers.cancelpaper = function(){
|
||||||
o.highlight_sub_menu_item(0);
|
o.highlight_sub_menu_item(0);
|
||||||
}
|
}
|
||||||
this.initializeJournalPapers.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
var uploadFiles = function(){
|
var uploadFiles = function(){
|
||||||
$('#add_plugin_file a.add').click(function(){
|
$('#add_plugin_file a.add').click(function(){
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
|
|||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
@per_column = 5
|
@per_column = 5
|
||||||
@userid = current_user.id
|
|
||||||
case @view_by
|
case @view_by
|
||||||
when "abstract"
|
when "abstract"
|
||||||
@per_column = 1
|
@per_column = 1
|
||||||
|
|||||||
-1
@@ -81,7 +81,6 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
|||||||
"ajax-remote" => "delete",
|
"ajax-remote" => "delete",
|
||||||
"confirm-message" => t("sure?"),
|
"confirm-message" => t("sure?"),
|
||||||
"callback-method" => "paperDelete",
|
"callback-method" => "paperDelete",
|
||||||
"response-type" => "json",
|
|
||||||
"delete-item" => "true",
|
"delete-item" => "true",
|
||||||
:class => "journal_paper_delete admbg2 admtxt",
|
:class => "journal_paper_delete admbg2 admtxt",
|
||||||
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
||||||
|
|||||||
Vendored
Executable → Regular
+15
-5
@@ -90,13 +90,23 @@ class WritingJournal
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = ["#{self.paper_title}"]
|
title = []
|
||||||
|
|
||||||
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]
|
||||||
|
elsif !self.year.blank?
|
||||||
|
title << self.year
|
||||||
|
end
|
||||||
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.journal_title if self.journal_title.present?
|
title << self.journal_title if self.journal_title.present?
|
||||||
|
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||||
|
title << self.issue_no if (self.issue_no.present? && self.issue_no != "0")
|
||||||
|
title << "pp"+self.form_to_start+"-"+self.form_to_end if (self.form_to_start.present? && self.form_to_start != "0")
|
||||||
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
|
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
|
||||||
title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
title.join(', ')
|
||||||
title << "From Page: "+self.form_to_start if (self.form_to_start.present? && self.form_to_start != "0")
|
|
||||||
title << "To Page: "+self.form_to_end if (self.form_to_end.present? && self.form_to_end != "0")
|
|
||||||
title.join(', ')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_writing_journal_files=(var)
|
def new_writing_journal_files=(var)
|
||||||
|
|||||||
+1
-4
@@ -58,9 +58,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Journal Papers</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,4 +68,4 @@
|
|||||||
<%= publication_record w, @view_by%>
|
<%= publication_record w, @view_by%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
Vendored
Executable → Regular
-2
@@ -77,7 +77,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% if is_admin? %>
|
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||||
@@ -88,7 +87,6 @@
|
|||||||
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|||||||
Reference in new issue
Block a user