Archived
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22409c960b | ||
|
|
bc05eca7cc | ||
|
|
363a87ee2a | ||
|
|
81ab701425 | ||
|
|
ac8e169cd0 | ||
|
|
d615f1df6b | ||
|
|
dd36e3acfb | ||
|
|
be4f9a3be3 | ||
|
|
19b78c717a | ||
|
|
0b557117ff | ||
|
|
63a8f24f49 | ||
|
|
e9d2051d78 |
No files matched your search
@@ -289,14 +289,13 @@ var orbitDesktop = function(dom){
|
||||
return false;
|
||||
}
|
||||
var ca = $e.attr("content-holder");
|
||||
|
||||
var a = function(){
|
||||
$.ajax({
|
||||
type : t,
|
||||
dataType : responsetype,
|
||||
url : $e.attr("href"),
|
||||
success : function(data){
|
||||
if(typeof data == "string" && t != "delete"){
|
||||
if(typeof data == "string"){
|
||||
if(ca)
|
||||
$(ca).html(data);
|
||||
else{
|
||||
@@ -309,12 +308,10 @@ var orbitDesktop = function(dom){
|
||||
window.o[o.data_method][exe](data,$e);
|
||||
if(t == "delete"){
|
||||
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();
|
||||
}
|
||||
}
|
||||
},
|
||||
error : function(x){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -682,8 +682,8 @@ legend {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.sign-in .btn {
|
||||
padding: 4px 0;
|
||||
display: block;
|
||||
padding: 4px 0;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@@ -711,7 +711,7 @@ legend {
|
||||
.sign-in .checkbox {
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
bottom: 37px;
|
||||
bottom: 47px;
|
||||
}
|
||||
.sign-in .switchboard {
|
||||
color: #08C;
|
||||
@@ -766,4 +766,4 @@ legend {
|
||||
#main-wrap .wrap-inner {
|
||||
padding: 20px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,17 @@
|
||||
top: 0px;
|
||||
left: -10px;
|
||||
right: -10px;
|
||||
height: 40px;
|
||||
z-index: 1041;
|
||||
position: fixed;
|
||||
margin-bottom: 0;
|
||||
height: 40px;
|
||||
}
|
||||
#orbit-bar .orbitlogo {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
padding: 0!important;
|
||||
background-size: 70%;
|
||||
display: inline-block;
|
||||
display: block;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url(<%= asset_path 'orbit-logo.svg' %>);
|
||||
@@ -19,8 +20,23 @@
|
||||
/* For Suck IE */
|
||||
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 {
|
||||
color: #EEE;
|
||||
padding: 0 15px;
|
||||
display: block;
|
||||
text-shadow: 0 -1px 0 #000;
|
||||
border-right: 1px solid #363636;
|
||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||
@@ -34,6 +50,11 @@
|
||||
background-color: #0095CF;
|
||||
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.active > .dropdown-toggle,
|
||||
#orbit-bar.navbar .nav li.dropdown.open.active > .dropdown-toggle {
|
||||
@@ -41,9 +62,7 @@
|
||||
text-shadow: 0 -1px 0 #014380;
|
||||
}
|
||||
#orbit-bar .navbar-inner {
|
||||
height: 40px;
|
||||
border-width: 0;
|
||||
min-height: 40px;
|
||||
background-color: #333333;
|
||||
-webkit-border-radius: 0px;
|
||||
-moz-border-radius: 0px;
|
||||
@@ -66,6 +85,10 @@
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
}
|
||||
#orbit-bar .nav > li {
|
||||
display: block;
|
||||
line-height: 40px;
|
||||
}
|
||||
#orbit-bar .nav [class^="icon"],
|
||||
#orbit-bar .nav [class*=" icon"] {
|
||||
font-size: 1.5em;
|
||||
@@ -92,17 +115,45 @@
|
||||
#orbit-bar .modal .input-prepend {
|
||||
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*/
|
||||
#orbit-bar #search {
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
padding: 8px 10px 0;
|
||||
padding: 0 10px;
|
||||
border-right: 1px solid #363636;
|
||||
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
#orbit-bar #search form {
|
||||
margin-bottom: 8px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
#orbit-bar #search input[type="text"] {
|
||||
height: 14px;
|
||||
@@ -110,6 +161,7 @@
|
||||
font-size: 13px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
display: block;
|
||||
-webkit-border-radius: 12px;
|
||||
-moz-border-radius: 12px;
|
||||
-o-border-radius: 12px;
|
||||
@@ -122,15 +174,16 @@
|
||||
#orbit-bar #search .search-clear {
|
||||
position: absolute;
|
||||
color: #A3A3A3;
|
||||
top: 14px;
|
||||
top: 16px;
|
||||
}
|
||||
#orbit-bar #search .icon-search {
|
||||
left: 13px;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
font-size: 1.2em;
|
||||
width: 1.25em;
|
||||
margin-top: 0;
|
||||
}
|
||||
#orbit-bar #search .search-clear {
|
||||
right: 14px;
|
||||
right: 13px;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
#orbit-bar #search .search-clear:hover {
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
require 'net/http'
|
||||
require 'open-uri'
|
||||
require 'timeout'
|
||||
|
||||
class Admin::ImportDataController < OrbitBackendController
|
||||
# helper Admin::PagePartsHelper
|
||||
# include Admin::FrontendWidgetInterface
|
||||
open_for_user
|
||||
open_for_admin
|
||||
|
||||
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"}
|
||||
#uri.query = URI.encode_www_form(params)
|
||||
@@ -77,14 +78,11 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
# if hash.ntu_seq.present?
|
||||
if hash.user_id.present?
|
||||
# ntu_seq = hash.ntu_seq
|
||||
u_account = hash.user_id
|
||||
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/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
books_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
{
|
||||
author: (book_node>"Authors").text,
|
||||
year: (book_node>"PublishYear").text,
|
||||
@@ -95,14 +93,14 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
}
|
||||
end
|
||||
if @books.present?
|
||||
@books.each do |b|
|
||||
@book = WritingBook.new
|
||||
@books.each do |b|
|
||||
@book = WritingBook.new
|
||||
I18n.locale = :zh_tw
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
I18n.locale = :en
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@@ -110,13 +108,13 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.year = b[:year]
|
||||
@book.create_user_id = hash.id
|
||||
@book.save
|
||||
end
|
||||
@book.create_user_id = hash.id
|
||||
@book.save
|
||||
end
|
||||
else
|
||||
puts "No books by Teacher"
|
||||
puts "No books by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -129,13 +127,10 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
# if hash.ntu_seq.present?
|
||||
if hash.user_id.present?
|
||||
# ntu_seq = hash.ntu_seq
|
||||
u_account = hash.user_id
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
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/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||
{
|
||||
@@ -203,14 +198,11 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
# if hash.ntu_seq.present?
|
||||
if hash.user_id.present?
|
||||
# ntu_seq = hash.ntu_seq
|
||||
u_account = hash.user_id
|
||||
if hash.ntu_seq.present?
|
||||
ntu_seq = hash.ntu_seq
|
||||
paper_xml = Nokogiri::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/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||
{
|
||||
author: (paper_node>"Authors").text,
|
||||
@@ -260,7 +252,6 @@ class Admin::ImportDataController < OrbitBackendController
|
||||
|
||||
@journal_paper.create_user_id = hash.id
|
||||
@journal_paper.save!
|
||||
|
||||
end
|
||||
else
|
||||
puts "No journal paper by Teacher"
|
||||
@@ -275,13 +266,10 @@ def sync_conference_data
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
# if @user.sid.present?
|
||||
if @user.user_id.present?
|
||||
# ntu_seq = @user.sid
|
||||
u_account = @user.user_id
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
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/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||
{
|
||||
@@ -336,30 +324,22 @@ def sync_conference_data
|
||||
puts "No conference by Teacher"
|
||||
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
|
||||
|
||||
|
||||
def sync_journal_paper_data
|
||||
|
||||
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
||||
@journal_data.delete_all
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
# if @user.sid.present?
|
||||
if @user.user_id.present?
|
||||
# ntu_seq = @user.sid
|
||||
u_account = @user.user_id
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
paper_xml = Nokogiri::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/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||
{
|
||||
author: (paper_node>"Authors").text,
|
||||
@@ -418,13 +398,7 @@ def sync_conference_data
|
||||
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
|
||||
|
||||
def sync_book_data
|
||||
@@ -433,13 +407,10 @@ def sync_book_data
|
||||
@user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
# if @user.sid.present?
|
||||
if @user.user_id.present?
|
||||
# ntu_seq = @user.sid
|
||||
u_account = @user.user_id
|
||||
if @user.sid.present?
|
||||
ntu_seq = @user.sid
|
||||
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/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
{
|
||||
author: (book_node>"Authors").text,
|
||||
@@ -471,32 +442,24 @@ def sync_book_data
|
||||
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
|
||||
|
||||
|
||||
def sync_conference_data_auto
|
||||
@user = User.all
|
||||
@user.each do |user|
|
||||
if user.user_id.present?
|
||||
next if !user.email.include? "ntu.edu.tw"
|
||||
u_account = user.user_id
|
||||
@conference_xml = nil
|
||||
begin
|
||||
timeout(60) do
|
||||
@conference_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C"))
|
||||
end
|
||||
rescue Timeout::Error
|
||||
next
|
||||
end
|
||||
@conference_papers = @conference_xml.xpath("//Paper").map do |cp_node|
|
||||
@conference_data = WritingConference.where(create_user_id: "#{user.id}")
|
||||
@conference_data.delete_all
|
||||
# @user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if user.sid.present?
|
||||
ntu_seq = user.sid
|
||||
conference_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||
{
|
||||
author: (cp_node>"Authors").text,
|
||||
year: (cp_node>"PublishYear").text,
|
||||
@@ -509,8 +472,6 @@ end
|
||||
}
|
||||
end
|
||||
if @conference_papers.present?
|
||||
WritingConference.delete_all(conditions:{create_user_id: user.id})
|
||||
|
||||
@conference_papers.each do |b|
|
||||
@conference_paper = WritingConference.new
|
||||
I18n.locale = :zh_tw
|
||||
@@ -548,8 +509,9 @@ end
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No conference by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -557,19 +519,17 @@ end
|
||||
def sync_journal_paper_data_auto
|
||||
@user = User.all
|
||||
@user.each do |user|
|
||||
if user.user_id.present?
|
||||
next if !user.email.include? "ntu.edu.tw"
|
||||
u_account = user.user_id
|
||||
@paper_xml = nil
|
||||
begin
|
||||
timeout(60) do
|
||||
@paper_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=J"))
|
||||
end
|
||||
rescue Timeout::Error
|
||||
next
|
||||
end
|
||||
@journal_papers = @paper_xml.xpath("//Paper").map do |paper_node|
|
||||
@journal_data = WritingJournal.where(create_user_id: "#{user_id}")
|
||||
@journal_data.delete_all
|
||||
# @user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if user.sid.present?
|
||||
ntu_seq = user.sid
|
||||
paper_xml = Nokogiri::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"))
|
||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||
{
|
||||
author: (paper_node>"Authors").text,
|
||||
year: (paper_node>"PublishYear").text,
|
||||
@@ -585,9 +545,6 @@ def sync_journal_paper_data_auto
|
||||
}
|
||||
end
|
||||
if @journal_papers.present?
|
||||
|
||||
WritingJournal.delete_all(conditions:{create_user_id: user.id})
|
||||
|
||||
@journal_papers.each do |b|
|
||||
@journal_paper = WritingJournal.new
|
||||
I18n.locale = :zh_tw
|
||||
@@ -628,7 +585,7 @@ def sync_journal_paper_data_auto
|
||||
@journal_paper.save!
|
||||
end
|
||||
end
|
||||
puts "Sync "+u_account+"\r\n"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -636,20 +593,16 @@ end
|
||||
def sync_book_data_auto
|
||||
@user = User.all
|
||||
@user.each do |user|
|
||||
if user.user_id.present?
|
||||
next if !user.email.include? "ntu.edu.tw"
|
||||
u_account = user.user_id
|
||||
@books_xml = nil
|
||||
begin
|
||||
timeout(60) do
|
||||
@books_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}"))
|
||||
end
|
||||
rescue Timeout::Error
|
||||
next
|
||||
end
|
||||
|
||||
@books = @books_xml.xpath("//Book").map do |book_node|
|
||||
@books_data = WritingBook.where(create_user_id: "#{user_id}")
|
||||
@books_data.delete_all
|
||||
# @user = User.find("#{params[:user_id]}")
|
||||
|
||||
# teachers.each do |hash|
|
||||
if user.sid.present?
|
||||
ntu_seq = user.sid
|
||||
books_xml = Nokogiri::XML( \
|
||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||
@books = books_xml.xpath("//Book").map do |book_node|
|
||||
{
|
||||
author: (book_node>"Authors").text,
|
||||
year: (book_node>"PublishYear").text,
|
||||
@@ -659,11 +612,7 @@ def sync_book_data_auto
|
||||
book_title: (book_node>"BookTitle").text
|
||||
}
|
||||
end
|
||||
|
||||
if @books.present?
|
||||
|
||||
WritingBook.delete_all(conditions:{create_user_id: user.id})
|
||||
|
||||
@books.each do |b|
|
||||
@book = WritingBook.new
|
||||
I18n.locale = :zh_tw
|
||||
@@ -731,4 +680,73 @@ end
|
||||
@bulletin.save!
|
||||
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
|
||||
@@ -1,48 +1,9 @@
|
||||
class Admin::ModuleStoreController < OrbitBackendController
|
||||
|
||||
@@store = STORE_CONFIG[:store_settings]["url"]
|
||||
|
||||
def index
|
||||
@extensions = get_extensions
|
||||
end
|
||||
|
||||
def show
|
||||
@extension = get_extension(params[:id]) rescue nil
|
||||
end
|
||||
|
||||
def download
|
||||
#get extension related values
|
||||
extension = get_extension(params[:id]) rescue nil
|
||||
download_link = @@store + "/"+ extension["extension"]["extension"]["url"]
|
||||
downloaded_file_name = extension["extension_filename"]
|
||||
module_app_name = downloaded_file_name.split(/(.zip)/).first
|
||||
|
||||
#check if the directory exists or not
|
||||
@module_status = Dir.exists?("#{Rails.root}/vendor/built_in_modules/#{module_app_name}")
|
||||
if @module_status.eql?(true)
|
||||
flash[:notice] = "This module is already installed"
|
||||
else
|
||||
download_extension(download_link, downloaded_file_name,module_app_name)
|
||||
flash[:notice] = "This module has been successfully installed"
|
||||
end
|
||||
redirect_to admin_module_store_path
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def get_extensions
|
||||
JSON.parse(open("#{@@store}/api/extensions").read)
|
||||
end
|
||||
|
||||
def get_extension(id)
|
||||
JSON.parse(open("#{@@store}/api/extensions/#{id}").read)
|
||||
end
|
||||
|
||||
def download_extension(download_link, downloaded_file_name,module_app_name)
|
||||
puts %x(wget "#{download_link}")
|
||||
puts %x(unzip "#{downloaded_file_name}")
|
||||
puts %x(mv #{module_app_name} "#{Rails.root}/vendor/built_in_modules/")
|
||||
puts %x(rm "#{downloaded_file_name}")
|
||||
site_restart
|
||||
end
|
||||
end
|
||||
@@ -3,7 +3,6 @@ class Admin::SitesController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :get_site
|
||||
before_filter :git_branch
|
||||
|
||||
# def index
|
||||
# @site = Site.first
|
||||
@@ -108,43 +107,6 @@ class Admin::SitesController < OrbitBackendController
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
def update_manager
|
||||
end
|
||||
|
||||
def get_update_history
|
||||
@update_log = %x{git log --pretty=format:"%ad','%s" --date=short}.split("\n").map{|log| log.gsub("'","").split(",")}.to_json
|
||||
render :json => @update_log
|
||||
end
|
||||
|
||||
def check_updates
|
||||
%x(git fetch origin)
|
||||
@new_updates = %x(git log #{@branch}..origin/#{@branch} --pretty=format:"%ad','%s" --date=short).split("\n").map{|log| log.gsub("'","").split(",")}.to_json
|
||||
render :json => @new_updates
|
||||
end
|
||||
|
||||
def update_orbit
|
||||
result = ""
|
||||
need_stash = %x(git diff).blank?
|
||||
%x(git stash) unless need_stash
|
||||
%x(git fetch origin)
|
||||
pull_result = %x(git pull -r --ff-only 2>&1 origin #{@branch})
|
||||
|
||||
if pull_result.include? "fatal: Not possible to fast-forward, aborting."
|
||||
result = "failed"
|
||||
else
|
||||
result = "success"
|
||||
%x{bundle install}
|
||||
%x{touch tmp/restart.txt}
|
||||
end
|
||||
%x(git stash pop) unless need_stash
|
||||
|
||||
render :text => result
|
||||
end
|
||||
|
||||
def restart_server
|
||||
render :text => "success"
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def update_design(design)
|
||||
@@ -162,9 +124,5 @@ class Admin::SitesController < OrbitBackendController
|
||||
def get_site
|
||||
@site ||= Site.first
|
||||
end
|
||||
|
||||
def git_branch
|
||||
@branch = %x(git rev-parse --abbrev-ref HEAD).gsub("\n","")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
class Admin::TemplateStoreController < OrbitBackendController
|
||||
|
||||
|
||||
@@store_domain = STORE_CONFIG[:store_settings]["url"]
|
||||
@@store_domain = "http://store.tp.rulingcom.com"
|
||||
def index
|
||||
@store = @@store_domain
|
||||
@templates = JSON.parse(get_templates)
|
||||
@@ -33,4 +33,6 @@ class Admin::TemplateStoreController < OrbitBackendController
|
||||
response.body
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
@@ -197,8 +197,8 @@ class PagesController < ApplicationController
|
||||
else
|
||||
model = params[:app_action].classify.constantize rescue nil
|
||||
if !model.nil?
|
||||
item = model.where(:_id=>params[:id]).first
|
||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank? and !item.blank?
|
||||
item = model.find(params[:id])
|
||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
class SamlLoginsController < ApplicationController
|
||||
|
||||
require "net/http"
|
||||
require "uri"
|
||||
require 'rexml/document'
|
||||
include REXML
|
||||
|
||||
def index
|
||||
|
||||
if params[:wa] == "wsignoutcleanup1.0" #logout
|
||||
|
||||
redirect_to :root
|
||||
|
||||
else #login
|
||||
|
||||
|
||||
@wresult = params[:wresult]
|
||||
@wctx = params[:wctx]
|
||||
|
||||
@main_url = LIST[:sites][@wctx]['url']
|
||||
@main_public_key = LIST[:sites][@wctx]['key']
|
||||
|
||||
@doc = REXML::Document.new @wresult
|
||||
|
||||
public_key = OpenSSL::PKey::RSA.new(@main_public_key)
|
||||
encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text)
|
||||
|
||||
redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -19,7 +19,7 @@ class SessionsController < Devise::SessionsController
|
||||
if !resource.blank?
|
||||
resource_name = resource.class.to_s.downcase
|
||||
sign_in(resource_name, resource)
|
||||
session[:user_id_type] = "myntucoph"
|
||||
session[:user_id_type] = "myntumb"
|
||||
redirect_to after_sign_in_path_for(resource)
|
||||
else
|
||||
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
|
||||
@user_id_type = session[:user_id_type]
|
||||
sign_out
|
||||
if @user_id_type == "myntucoph"
|
||||
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://cophlogin.ntu.edu.tw"
|
||||
if @user_id_type == "myntumb"
|
||||
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://management.ntu.edu.tw"
|
||||
else
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
@@ -193,8 +193,8 @@ module ApplicationHelper
|
||||
stylesheets = ''
|
||||
stylesheets << "<link href='#{asset_path 'orbit_bar_bootstrap'}' rel='stylesheet' type='text/css' />\n"
|
||||
stylesheets << "<link href='#{page.design.css_reset.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.css_reset
|
||||
# stylesheets << "<link href='#{asset_path 'banner_nav.css'}' rel='stylesheet' type='text/css' />\n"
|
||||
# stylesheets << "<link href='#{asset_path 'default_widget.css'}' rel='stylesheet' type='text/css' />\n"
|
||||
stylesheets << "<link href='#{asset_path 'banner_nav.css'}' rel='stylesheet' type='text/css' />\n"
|
||||
stylesheets << "<link href='#{asset_path 'default_widget.css'}' rel='stylesheet' type='text/css' />\n"
|
||||
stylesheets << "<link href='#{page.design.css_default.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.css_default
|
||||
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
|
||||
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme
|
||||
|
||||
@@ -271,31 +271,17 @@ module OrbitBackendHelper
|
||||
# TODO: links to other actions
|
||||
# ===============================================================
|
||||
def footer(args={})
|
||||
|
||||
if args[:link_name]
|
||||
link_name = args[:link_name]
|
||||
else
|
||||
link_name = content_tag(:i, nil, :class => 'icon-plus') + ' ' + t(:add)
|
||||
end
|
||||
|
||||
paginate = args.has_key?(:paginate) ? args[:paginate] : true
|
||||
link = (is_manager? || is_sub_manager? rescue nil) && args.has_key?(:link) ? true : false
|
||||
if paginate || link
|
||||
@index_footer = content_tag :div, class: "bottomnav clearfix" do
|
||||
concat content_tag :div, link_to(link_name, args[:link].blank? ? '#' : send(args[:link]), :class => (args[:link_class] || 'btn btn-primary'), data: args[:link_data]), class: "action pull-right" if link
|
||||
concat content_tag :div, link_to(content_tag(:i, nil, :class => 'icon-plus') + ' ' + t(:add), args[:link].blank? ? '#' : send(args[:link]), :class => (args[:link_class] || 'btn btn-primary'), data: args[:link_data]), class: "action pull-right" if link
|
||||
concat content_tag :div, paginate(@objects, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]}), class: "pagination pagination-centered" if paginate
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_quick_link(quick, object, authorization, approvable)
|
||||
|
||||
if !quick[:link_option].blank?
|
||||
link_option = ",#{quick[:link_option]}"
|
||||
else
|
||||
link_option = ""
|
||||
end
|
||||
|
||||
case quick[:type]
|
||||
when 'approval'
|
||||
if show_approval_link(object)
|
||||
@@ -307,12 +293,12 @@ module OrbitBackendHelper
|
||||
end
|
||||
when 'edit'
|
||||
if authorization && approvable
|
||||
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: quick[:class], data: eval("#{quick[:data]}"))
|
||||
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}')"), class: quick[:class], data: eval("#{quick[:data]}"))
|
||||
end
|
||||
when 'delete'
|
||||
if show_delete_link(object)
|
||||
@delete_options = {title: quick[:title], warning: quick[:warning], cancel: quick[:cancel], submit: quick[:submit]}
|
||||
content_tag :li, link_to(t(quick[:translation] || :delete_), '#', rel: eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: "delete #{quick[:class] || 'text-error'}")
|
||||
content_tag :li, link_to(t(quick[:translation] || :delete_), '#', rel: eval("#{quick[:link]}('#{object.id}')"), class: "delete #{quick[:class] || 'text-error'}")
|
||||
end
|
||||
when 'detail'
|
||||
content_tag :li, link_to(t(quick[:translation] || :detail), '#', class: (quick[:class] || "detail-row"))
|
||||
|
||||
@@ -42,7 +42,7 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
||||
# end
|
||||
|
||||
version :thumb do
|
||||
process :resize_to_fit => [200, 200]
|
||||
process :resize_to_fit => [80, 80]
|
||||
end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
|
||||
@@ -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>
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
<li title="<%= t('preference') %>"><%= link_to admin_site_preference_path(@site), :class => active_for_action('sites', 'preference') do %><span><i class="icons-cog"></i></span><%end%></li>
|
||||
|
||||
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
||||
|
||||
<!-- <li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li>
|
||||
--> </ul>
|
||||
</div>
|
||||
|
||||
@@ -14,14 +14,8 @@
|
||||
<%= javascript_include_tag 'lib/retina' %>
|
||||
<%= javascript_include_tag 'lib/mudole_templates_status' %>
|
||||
</head>
|
||||
<!--
|
||||
<% @extensions.each do |extension|%>
|
||||
<%=link_to extension["title"], admin_module_store_show_path(extension["_slugs"][0])%>
|
||||
<%end%> -->
|
||||
|
||||
<%= flash[:notice] rescue nil%>
|
||||
|
||||
<table id="mt-list" class="table main-list">
|
||||
<table id="mt-list" class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<th class="first"><a href="#">Module Title</a></th>
|
||||
@@ -31,38 +25,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @extensions.each do |extension|%>
|
||||
<tr>
|
||||
<td class="detail-row">
|
||||
<div class="module_icon pull-left">
|
||||
<%= image_tag "module_icon.png"%>
|
||||
</div>
|
||||
<h5 class="mt_title"><span><%=link_to extension["title"], admin_module_store_show_path(extension["_slugs"][0])%></span></h5>
|
||||
<p class="mt_dev muted"><%=extension["author"]%></p>
|
||||
</td>
|
||||
<td class="detail-row">2013/07/12</td>
|
||||
<td>
|
||||
<%= extension["description"].html_safe%> <%= link_to 'Read More', admin_module_store_show_path(extension["_slugs"][0]) %>
|
||||
</td>
|
||||
<!-- <td class="active"><button class="act btn btn-mini" type="button">Uninstall</button></td>
|
||||
-->
|
||||
<% download_link = STORE_CONFIG[:store_settings]["url"] + "/"+ extension["extension"]["extension"]["url"]
|
||||
downloaded_file_name = extension["extension_filename"]
|
||||
module_app_name = downloaded_file_name.split(/(.zip)/).first
|
||||
@module_status = Dir.exists?("#{Rails.root}/vendor/built_in_modules/#{module_app_name}")
|
||||
%>
|
||||
<% if @module_status.eql?(true)%>
|
||||
<td class="active">Installed</td>
|
||||
<% else %>
|
||||
<td class="active"><%= link_to 'Download', admin_module_store_download_path(:id => extension["_slugs"][0]), :class=>"act btn btn-mini btn-success" %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!--
|
||||
<tr>
|
||||
<td class="detail-row">
|
||||
<div class="module_icon pull-left">
|
||||
@@ -118,5 +80,6 @@
|
||||
@detail
|
||||
</td>
|
||||
<td class="active"><button class="act btn btn-mini btn-info" type="button">Update</button></td>
|
||||
</tr> -->
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="side">
|
||||
<div id="item-info">
|
||||
<img src="/assets/module/thumb/mt<%= params[:m] %>.jpg" alt="" class="item-thumb">
|
||||
<h2 class="item-name"><%= @extension.first["title"] %></h2>
|
||||
<h2 class="item-name">Module Name</h2>
|
||||
<a id="download" href="">free download</a>
|
||||
<ul class="item-extra-info">
|
||||
<li><span class="title">downloads</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
||||
@@ -38,12 +38,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="main clearfix">
|
||||
<h3>Description</h3>
|
||||
<div id="desc-holder" class="paragraph"><%= @extension.first["description"].html_safe%></div>
|
||||
<h3>description</h3>
|
||||
<div id="desc-holder" class="paragraph">Pixel Union’s Jitensha defines storefront minimalism. Japanese for “bicycle,” Jitensha offers clean typography and easy usability, including full color, font, logo, and footer customization. With its painless social media and blog integration, Jitensha gorgeously accomodates every aspect of your business. Any questions before you launch? Don’t hesitate to email us: Support@PixelUnion.net.</div>
|
||||
<h3>screen shot</h3>
|
||||
<div id="screen-shot">
|
||||
<div class="holder">
|
||||
<%= image_tag "#{STORE_CONFIG[:store_settings]["url"]}/#{@extension.first['preview']['preview']['url']}"%>
|
||||
<img src="" alt="Thumbnail 1" class="preview item-thumb">
|
||||
<img src="" alt="Thumbnail 2" class="preview item-thumb">
|
||||
<img src="" alt="Thumbnail 3" class="preview item-thumb">
|
||||
<img src="" alt="Thumbnail 4" class="preview item-thumb">
|
||||
<img src="" alt="Thumbnail 5" class="preview item-thumb">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
<li title="<%= t('preference') %>"><%= link_to admin_site_preference_path(@site), :class => active_for_action('sites', 'preference') do %><span><i class="icons-cog"></i></span><%end%></li>
|
||||
|
||||
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
||||
|
||||
<!-- <li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li>
|
||||
--> </ul>
|
||||
</div>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
});
|
||||
})
|
||||
});
|
||||
$(document).on('click', 'li .map-block .onoff', function () {
|
||||
$(document).on('click', 'li .onoff', function () {
|
||||
$(this).parents("li").toggleClass("disabled");
|
||||
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
|
||||
$(this).text("<%= t('off_upcase') %>")
|
||||
|
||||
@@ -1,245 +0,0 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||
<% end %>
|
||||
<style type="text/css">
|
||||
.container{
|
||||
}
|
||||
|
||||
#new_update_container{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#update_progress{
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#update_status{
|
||||
/*display: none;*/
|
||||
}
|
||||
|
||||
#update_done{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#update_failed{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.panel{
|
||||
/*max-height: 400px;*/
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #DFDFDF;
|
||||
background: #FFF;
|
||||
box-shadow: 0px 0px 10px #CCC;
|
||||
}
|
||||
|
||||
.panel-heading{
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
padding: 10px 20px;
|
||||
|
||||
background-color: #fafafa;
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
|
||||
background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
|
||||
background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
|
||||
background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
|
||||
*zoom: 1;
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.table{
|
||||
margin: 0;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.pannel-body{
|
||||
max-height: 400px;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.pannel-body:hover{
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #AAA;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #666;
|
||||
}
|
||||
|
||||
.break{
|
||||
border-left: 1px solid #FCFCFC;
|
||||
border-right: 1px solid #DDD;
|
||||
padding: 10px 0;
|
||||
margin: 0 15px;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<div id="new_update_container">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-exclamation-sign"></i>
|
||||
<span class="break"></span>
|
||||
<span class="panel-title"><%= t("update_manager_.available_updates") %></span>
|
||||
<span id="num_new_updates" class="badge badge-important pull-right"></span>
|
||||
</div>
|
||||
<div class="pannel-body">
|
||||
<table class="table table-striped">
|
||||
<tbody id="new_update_table">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 55px;">
|
||||
<button id="update_btn" class="btn btn-primary pull-right" style="margin: 10px;"><i class="icon-inbox icon-white"></i> <%= t("update_manager_.system_update") %></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="update_status">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-info-sign"></i>
|
||||
<span class="break"></span>
|
||||
<span class="panel-title"><%= t("update_manager_.update_status") %></span>
|
||||
</div>
|
||||
<div class="pannel-body">
|
||||
<div id="update_done" class="alert alert-success" style="font-size: 16px; text-align: center; margin: 0px;">
|
||||
<i class="icon-ok-sign"> <%= t("update_manager_.update_done") %></i>
|
||||
</div>
|
||||
<div id="update_failed" class="alert alert-error" style="font-size: 16px; text-align: center; margin: 0px;">
|
||||
<i class="icon-remove"> <%= t("update_manager_.update_faild") %></i>
|
||||
</div>
|
||||
<div id="update_progress">
|
||||
<img src="http://ridepal.com/images/homeimg/preloader_transparent.gif" width="50"><br/>
|
||||
<span id="progress_msg"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 0; height: 65px;">
|
||||
<button id="chech_update_btn" class="btn btn-small btn-inverse pull-right"><i class="icon-refresh icon-white"></i> <%= t("update_manager_.check_update") %></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-th-list"></i>
|
||||
<span class="break"></span>
|
||||
<span class="panel-title"><%= t("update_manager_.update_history") %></span>
|
||||
<span id="num_updates" class="badge badge-success pull-right"></span>
|
||||
</div>
|
||||
<div class="pannel-body" id="update-history-body">
|
||||
<table class="table table-striped">
|
||||
<tbody id="update_history_table">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var update_logs;
|
||||
var update_log_display;
|
||||
var new_updates;
|
||||
|
||||
function get_update_history(){
|
||||
$.getJSON("<%= admin_site_get_update_history_path %>",function(data){
|
||||
update_logs = data;
|
||||
update_log_display = 0;
|
||||
$("#num_updates").text(update_logs.length);
|
||||
$("#update_history_table").html("");
|
||||
|
||||
show_update_history();
|
||||
});
|
||||
}
|
||||
|
||||
function show_update_history(){
|
||||
for(var i = 0; i<30; i++){
|
||||
var log = update_logs[update_log_display];
|
||||
update_log_display++;
|
||||
$("#update_history_table").append("<tr><td width=30%'>"+log[0]+"</td><td>"+log[1]+"</td></tr>");
|
||||
if((update_log_display+1)>update_logs.length) break;
|
||||
}
|
||||
}
|
||||
|
||||
function check_updates(){
|
||||
$("#progress_msg").html("<strong><%= t("update_manager_.checking_update") %></strong>");
|
||||
$("#new_update_container").fadeOut(function(){
|
||||
$("#update_done").fadeOut(function(){
|
||||
$("#update_status").fadeIn(function(){
|
||||
$("#update_progress").fadeIn();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$.getJSON("<%= admin_site_check_updates_path %>",function(data){
|
||||
new_updates = data;
|
||||
show_new_updates();
|
||||
});
|
||||
}
|
||||
|
||||
function show_new_updates(){
|
||||
if(new_updates.length){
|
||||
$("#num_new_updates").text(new_updates.length);
|
||||
$.each(new_updates,function(){
|
||||
$("#new_update_table").append("<tr><td>"+$(this)[0]+"</td><td>"+$(this)[1]+"</td></tr>");
|
||||
});
|
||||
$("#update_status").fadeOut(function(){$("#new_update_container").fadeIn();});
|
||||
}else{
|
||||
$("#update_progress").fadeOut(function(){$("#update_done").fadeIn();});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
check_updates();
|
||||
get_update_history();
|
||||
|
||||
$("#chech_update_btn").click(check_updates);
|
||||
|
||||
$("#update_btn").click(function(){
|
||||
$("#progress_msg").html("<strong><%= t("update_manager_.updating_orbit") %></strong>");
|
||||
$("#new_update_container").fadeOut(function(){
|
||||
$("#update_status").fadeIn();
|
||||
});
|
||||
$.get("<%= admin_site_update_orbit_path %>",function(result){
|
||||
if(result=="failed"){
|
||||
$("#chech_update_btn").hide();
|
||||
$("#update_progress").fadeOut(function(){$("#update_failed").fadeIn();});
|
||||
}else{
|
||||
$("#progress_msg").html("<strong><%= t("update_manager_.restart_server") %></strong>");
|
||||
$.get("<%= admin_site_restart_server_path %>",function(result){
|
||||
$("#update_progress").fadeOut(function(){$("#update_done").fadeIn();});
|
||||
$("#update_status").fadeIn();
|
||||
get_update_history();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#update-history-body").scroll(function () {
|
||||
if((update_log_display+1)<update_logs.length){
|
||||
var scroll_pos = ($("#update-history-body").scrollTop()+$("#update-history-body").height())/$("#update_history_table").height()*100;
|
||||
if(scroll_pos>90){
|
||||
show_update_history();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -21,7 +21,7 @@
|
||||
<ul class="nav nav-pills">
|
||||
<%= content_tag(:li, link_to(t(:edit),edit_admin_users_new_interface_path(user_for_listing))) if is_admin? %>
|
||||
<%= content_tag(:li, link_to(t("users.setting_privilege"),admin_users_new_interface_edit_privilege_path(user_for_listing))) if is_admin? and current_user.id != user_for_listing.id %>
|
||||
<%= content_tag(:li, link_to(t(:delete_),admin_users_new_interface_path(user_for_listing, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"text-error", :remote => true)) if is_admin? %>
|
||||
<%= content_tag(:li, link_to(t(:delete),admin_users_new_interface_path(user_for_listing, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"text-error", :remote => true)) if is_admin? %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<h3 class="login-logo"><%= t(:login) %></h3>
|
||||
<div class="other-sign-in">
|
||||
<% @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>
|
||||
</div>
|
||||
<div class="form-block">
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
||||
<div class="other-sign-in">
|
||||
<% @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>
|
||||
</div>
|
||||
<div class="input-prepend">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="sidebar-menu">
|
||||
<div class="scroller">
|
||||
<ul class="sidebar-nav">
|
||||
<% OrbitApp::Module::SideBarRegisition.all.sort{|x,y| x.get_module_app_key <=> y.get_module_app_key}.each do |t| %>
|
||||
<% OrbitApp::Module::SideBarRegisition.all.each do |t| %>
|
||||
<%= t.render_head(request, params, current_user, @module_app) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
|
||||
<div class="sub-nav-block-list">
|
||||
<% OrbitApp::Module::SideBarRegisition.all.sort{|x,y| x.get_module_app_key <=> y.get_module_app_key}.each do |t| %>
|
||||
<% OrbitApp::Module::SideBarRegisition.all.each do |t| %>
|
||||
<%= t.render(request, params, current_user, @module_app) %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -24,5 +24,9 @@
|
||||
<body>
|
||||
<%= render 'layouts/orbit_bar' %>
|
||||
<%= yield %>
|
||||
<!--<div id="sign-footer">
|
||||
<p>Rulingcom</p>
|
||||
</div>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,2 +0,0 @@
|
||||
data = File.open(File.join(Rails.root, 'config', 'store_config.yml')).read
|
||||
STORE_CONFIG = YAML::load(ERB.new(data).result(binding)).symbolize_keys
|
||||
@@ -80,3 +80,32 @@ default_widget_style:
|
||||
- style3
|
||||
- style4
|
||||
- style5
|
||||
|
||||
sites:
|
||||
www:
|
||||
url: www.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
ba:
|
||||
url: ba.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
acc:
|
||||
url: acc.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
finance:
|
||||
url: finance.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
ib:
|
||||
url: ib.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
im:
|
||||
url: im.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
emba:
|
||||
url: emba.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
ntugmba:
|
||||
url: ntugmba.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
ia:
|
||||
url: ia.management.ntu.edu.tw
|
||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||
Executable → Regular
+3
-13
@@ -86,6 +86,7 @@ en:
|
||||
user_list: Unit
|
||||
approval_: Approval
|
||||
approval_setting: Approval setting
|
||||
archive: Archive
|
||||
asset: Asset
|
||||
attributes: Attributes
|
||||
auth:
|
||||
@@ -261,6 +262,7 @@ en:
|
||||
text_area: Text Area
|
||||
text_field: Text Field
|
||||
locale: Locale
|
||||
location: Location
|
||||
login: Login
|
||||
logout: Logout
|
||||
mail:
|
||||
@@ -351,8 +353,8 @@ en:
|
||||
brief_intro : "Brief Intro."
|
||||
complete_list : "Complete List"
|
||||
frontend_page : "Frontend Page"
|
||||
phone_number: "Phone Number"
|
||||
sync_data: "Synchronize"
|
||||
phone_number: "Phone Number"
|
||||
picture: Picture
|
||||
placeholder: Field Hint
|
||||
plugins: Plugins
|
||||
@@ -531,18 +533,6 @@ en:
|
||||
success_: Successfully updated
|
||||
update_: Update
|
||||
update_at: Update at
|
||||
update_manager: Update Manager
|
||||
update_manager_:
|
||||
available_updates: Available Updates
|
||||
check_update: Check Update
|
||||
checking_update: Checking for Updates
|
||||
system_update: Install Updates
|
||||
update_done: System is update to date
|
||||
update_faild: Update failed. Merge is require in the update. Please login to server and update manually.
|
||||
update_history: Update Histroy
|
||||
update_status: Update Status
|
||||
updating_orbit: Updating Orbit. Please wait.
|
||||
restart_server: Restarting Server. Please wait.
|
||||
upload: Upload
|
||||
url: URL
|
||||
use_status: Use Statue
|
||||
|
||||
Executable → Regular
+3
-13
@@ -86,6 +86,7 @@ zh_tw:
|
||||
user_list: 使用者列表
|
||||
approval_: 審核
|
||||
approval_setting: 審核設定
|
||||
archive: 檔案室
|
||||
asset: 資產
|
||||
attributes: 屬性
|
||||
auth:
|
||||
@@ -263,6 +264,7 @@ zh_tw:
|
||||
text_area: 文字輸入方塊
|
||||
text_field: 文字輸入框
|
||||
locale: 位置
|
||||
location: 地標
|
||||
login: 登入
|
||||
logout: 登出
|
||||
mail:
|
||||
@@ -354,8 +356,8 @@ zh_tw:
|
||||
brief_intro : "摘要"
|
||||
complete_list : "完整列表"
|
||||
frontend_page : "前台呈現"
|
||||
phone_number: "電話"
|
||||
sync_data: "同步資料"
|
||||
phone_number: "電話"
|
||||
picture: 圖片
|
||||
placeholder: 欄位提示文字
|
||||
plugins: 學術資訊
|
||||
@@ -534,18 +536,6 @@ zh_tw:
|
||||
success_: 使用者已更新成功
|
||||
update_: 更新
|
||||
update_at: 最後更新時間
|
||||
update_manager: 更新管理員
|
||||
update_manager_:
|
||||
available_updates: 有可用更新
|
||||
check_update: 檢查更新
|
||||
checking_update: 檢查更新中
|
||||
system_update: 安裝更新
|
||||
update_done: 系統已是最新版本
|
||||
update_faild: 更新失敗. 更新需要合併程式碼. 請登入伺服器手動進行更新.
|
||||
update_history: 更新紀錄
|
||||
update_status: 更新狀態
|
||||
updating_orbit: 安裝更新中,請稍候.
|
||||
restart_server: 重啟伺服器中,請稍候.
|
||||
upload: 上傳
|
||||
url: 網址
|
||||
use_status: 使用狀態
|
||||
|
||||
Executable → Regular
File mode changed.
+4
-7
@@ -7,12 +7,15 @@ Orbit::Application.routes.draw do
|
||||
resources :passwords, :except => [:index, :show, :destroy]
|
||||
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
||||
end
|
||||
|
||||
|
||||
devise_scope :user do
|
||||
get 'user_login' => 'sessions#create'
|
||||
match 'user_logout' => 'sessions#destroy'
|
||||
end
|
||||
|
||||
match "saml_login" => 'saml_logins#index'
|
||||
|
||||
|
||||
mount Resque::Server, :at => "/admin/resque"
|
||||
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
||||
|
||||
@@ -217,11 +220,6 @@ Orbit::Application.routes.draw do
|
||||
get 'change_design'
|
||||
get 'reset_default_locale'
|
||||
get 'preference'
|
||||
get 'update_manager'
|
||||
get 'get_update_history'
|
||||
get 'check_updates'
|
||||
get 'update_orbit'
|
||||
get 'restart_server'
|
||||
end
|
||||
|
||||
get "import_data/get_teacher_data"
|
||||
@@ -280,7 +278,6 @@ Orbit::Application.routes.draw do
|
||||
|
||||
match 'module_store' => 'module_store#index'
|
||||
match 'module_store/show' => 'module_store#show'
|
||||
match 'module_store/download' => 'module_store#download'
|
||||
match 'template_store' => 'template_store#index'
|
||||
match 'template_store/download_theme' => "template_store#download_theme"
|
||||
match 'template_store/template/:id' => 'template_store#show', :as => :template_store_template
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
store_settings:
|
||||
url: "http://store.tp.rulingcom.com"
|
||||
@@ -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
|
||||
@@ -4,13 +4,9 @@ zh_tw:
|
||||
ad_banner: 廣告輪播
|
||||
banner: 橫幅
|
||||
banner_name: 橫幅名稱
|
||||
name_only_english: 橫幅名稱只能為英文
|
||||
edit_banner: 編輯橫幅
|
||||
enter_number: 請輸入數字
|
||||
enter_url: 請輸入網址
|
||||
banner_name_note: 橫幅名稱只能為英文
|
||||
ste: 轉換間隔時間
|
||||
number_seconds: 請輸入秒數
|
||||
number_milliseconds: 請輸入毫秒數
|
||||
ste_note: 請輸入秒數
|
||||
best_size: 最佳尺寸
|
||||
effect: 效果
|
||||
all: 全部
|
||||
@@ -20,4 +16,3 @@ zh_tw:
|
||||
size: 大小
|
||||
transition_interval: 轉換間隔時間
|
||||
transition_speed: 轉換速度
|
||||
type: 類型
|
||||
+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>
|
||||
<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>
|
||||
<% @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?
|
||||
%>
|
||||
<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
|
||||
});
|
||||
}
|
||||
|
||||
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){
|
||||
if(data.success){
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
@userid = current_user.id
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
@@ -70,4 +70,4 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||
def books_window
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
end
|
||||
+13
-4
@@ -84,13 +84,22 @@ class WritingBook
|
||||
|
||||
def create_link
|
||||
title = []
|
||||
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
|
||||
title << self.paper_title if self.paper_title.present?
|
||||
title << self.authors if self.authors.present?
|
||||
|
||||
# title << self.paper_title if self.paper_title.present?
|
||||
title << self.book_title if self.book_title.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.join(', ')
|
||||
title.join(', ')
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
+1
-4
@@ -57,9 +57,6 @@
|
||||
</ul>
|
||||
</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="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
@@ -70,4 +67,4 @@
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</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(){
|
||||
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(){
|
||||
$('#add_plugin_file a.add').click(function(){
|
||||
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)
|
||||
page = params[:page]
|
||||
page ||= 1
|
||||
@userid = current_user.id
|
||||
|
||||
if @view_by.nil?
|
||||
@writing_conferences = @writing_conferences.asc(:paper_title)
|
||||
else
|
||||
|
||||
Vendored
Executable → Regular
+13
-3
@@ -84,13 +84,23 @@ class WritingConference
|
||||
end
|
||||
|
||||
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.sponsor if self.sponsor.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 << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
||||
title.join(', ')
|
||||
title.join(', ')
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
-4
@@ -58,10 +58,6 @@
|
||||
</ul>
|
||||
</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="sdm_t hh1"><span class="icon-question-sign"></span></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){
|
||||
var parent = dom.parent().parent().parent();
|
||||
// console.log(parent);
|
||||
if(data.success){
|
||||
parent.hide("slide",function(){parent.remove();});
|
||||
o.notify(data.msg,"success");
|
||||
@@ -43,10 +42,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
||||
this.initializeJournalPapers.cancelpaper = function(){
|
||||
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(){
|
||||
$('#add_plugin_file a.add').click(function(){
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
@userid = current_user.id
|
||||
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
|
||||
-1
@@ -81,7 +81,6 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
||||
"ajax-remote" => "delete",
|
||||
"confirm-message" => t("sure?"),
|
||||
"callback-method" => "paperDelete",
|
||||
"response-type" => "json",
|
||||
"delete-item" => "true",
|
||||
:class => "journal_paper_delete admbg2 admtxt",
|
||||
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
||||
|
||||
Vendored
Executable → Regular
+15
-5
@@ -90,13 +90,23 @@ class WritingJournal
|
||||
end
|
||||
|
||||
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.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 << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||
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(', ')
|
||||
title.join(', ')
|
||||
end
|
||||
|
||||
def new_writing_journal_files=(var)
|
||||
|
||||
+1
-4
@@ -58,9 +58,6 @@
|
||||
</ul>
|
||||
</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="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
@@ -71,4 +68,4 @@
|
||||
<%= publication_record w, @view_by%>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
Vendored
Executable → Regular
-2
@@ -77,7 +77,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% if is_admin? %>
|
||||
<div class="bottomnav clearfix">
|
||||
<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' %>
|
||||
@@ -88,7 +87,6 @@
|
||||
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
|
||||
+24
-27
@@ -199,7 +199,6 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@survey.survey_questions.all.each do |question|
|
||||
new_question = @new_survey.survey_questions.new
|
||||
question.attributes.each do |key, value|
|
||||
@@ -211,32 +210,30 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# question.survey_question_options.all.each do |option|
|
||||
# new_option = new_question.survey_question_options.new
|
||||
# option.attributes.each do |key, value|
|
||||
# unless ['_id', 'survey_question_id'].include? key
|
||||
# if option.respond_to?(key + '_translations')
|
||||
# new_option.name_translations = value
|
||||
# else
|
||||
# new_option.write_attribute(key, value)
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# question.survey_question_radiogroups.all.each do |radiogroup|
|
||||
# new_radiogroup = new_question.survey_question_radiogroups.new
|
||||
# radiogroup.attributes.each do |key, value|
|
||||
# unless ['_id', 'survey_question_id'].include? key
|
||||
# if radiogroup.respond_to?(key + '_translations')
|
||||
# new_option.name_translations = value
|
||||
# else
|
||||
# new_radiogroup.write_attribute(key, value)
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
question.survey_question_options.all.each do |option|
|
||||
new_option = new_question.survey_question_options.new
|
||||
option.attributes.each do |key, value|
|
||||
unless ['_id', 'survey_question_id'].include? key
|
||||
if option.respond_to?(key + '_translations')
|
||||
new_option.send(key + '_translations=', value)
|
||||
else
|
||||
new_option.write_attribute(key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
question.survey_question_radiogroups.all.each do |radiogroup|
|
||||
new_radiogroup = new_question.survey_question_radiogroups.new
|
||||
radiogroup.attributes.each do |key, value|
|
||||
unless ['_id', 'survey_question_id'].include? key
|
||||
if radiogroup.respond_to?(key + '_translations')
|
||||
new_radiogroup.send(key + '_translations=', value)
|
||||
else
|
||||
new_radiogroup.write_attribute(key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@new_survey.create_user_id = current_user.id
|
||||
|
||||
Reference in new issue
Block a user