Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
056e622d7a | ||
|
|
30646b12ab |
No files matched your search
@@ -11,8 +11,8 @@ gem "net-ldap", "~> 0.3.1"
|
||||
gem 'devise', '1.5.3'
|
||||
gem 'exception_notification' # Send error trace
|
||||
gem 'execjs'
|
||||
gem 'jquery-rails', '3.0.4'
|
||||
gem 'jquery-ui-rails', "4.0.5"
|
||||
gem 'jquery-rails', '2.1.4'
|
||||
gem 'jquery-ui-rails'
|
||||
gem "select2-rails", '3.3.1'
|
||||
gem 'kaminari'
|
||||
gem 'time_difference'
|
||||
@@ -97,8 +97,6 @@ group :test, :development do
|
||||
gem "watchr"
|
||||
gem "spork"
|
||||
gem "capybara"
|
||||
#gem 'rack-mini-profiler'
|
||||
gem "better_errors"
|
||||
# gem 'yard'
|
||||
# gem "bluecloth"
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require jquery.ui.all
|
||||
//= require jquery-ui
|
||||
//= require desktop/jquery.form
|
||||
//= require desktop/jquery.tinyscrollbar
|
||||
//= require desktop/jquery.miniColors.min
|
||||
|
||||
@@ -168,7 +168,7 @@ var orbitDesktop = function(dom){
|
||||
o.loadIconCache();
|
||||
var custom_load = window.location.hash;
|
||||
if(!custom_load){
|
||||
$(o.contentHolder).empty().load("/desktop/desktop_container",function(){
|
||||
$(o.contentHolder).empty().load("/desktop/desktop",function(){
|
||||
o.desktopData["d_desktop"] = "";
|
||||
o.initializeDesktop("d_desktop","",false);
|
||||
})
|
||||
@@ -605,11 +605,10 @@ var orbitDesktop = function(dom){
|
||||
|
||||
this.menu_item = function(dom,customload,submenuitem){
|
||||
if(!customload)customload=false;
|
||||
var target = dom.attr("id"),
|
||||
url = dom.attr("href"),
|
||||
submenu_pass = ( dom.attr("sub-menu") == "false" ? false : true);
|
||||
var target = dom.attr("id");
|
||||
var url = dom.attr("href");
|
||||
if(!url)return false;
|
||||
|
||||
|
||||
o.data_method = dom.attr("callback-method");
|
||||
if(o.currenthtml!=target){
|
||||
if(o.desktopData[o.currentface] == "undefined"){
|
||||
@@ -630,37 +629,33 @@ var orbitDesktop = function(dom){
|
||||
window.o[o.data_method](target,url,cache);
|
||||
}
|
||||
}
|
||||
if( submenu_pass ){
|
||||
try {
|
||||
if(!customload){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||
try {
|
||||
if(!customload){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||
} else {
|
||||
if(submenuitem){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
||||
} else {
|
||||
if(submenuitem){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
||||
} else {
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||
}
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||
}
|
||||
} catch(EX){}
|
||||
}
|
||||
}
|
||||
} catch(EX){}
|
||||
header_ani();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
if( submenu_pass ){
|
||||
try{
|
||||
if(!customload){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
|
||||
}else{
|
||||
if(submenuitem)
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"),o.desktopData[o.currentface]);
|
||||
else
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
|
||||
}
|
||||
}catch(EX){}
|
||||
}
|
||||
try{
|
||||
if(!customload){
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
|
||||
}else{
|
||||
if(submenuitem)
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"),o.desktopData[o.currentface]);
|
||||
else
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),o.desktopData[o.currentface]);
|
||||
}
|
||||
}catch(EX){}
|
||||
|
||||
// cache = (o.lastlink == "/desktop/app_manager" ? false : true);
|
||||
cache = (o.lastlink == "/desktop/app_manager" ? false : true);
|
||||
if(typeof o.data_method != "undefined"){
|
||||
if(o.data_method != ""){
|
||||
window.o[o.data_method](target,url,cache);
|
||||
@@ -1100,7 +1095,7 @@ var orbitDesktop = function(dom){
|
||||
data : options,
|
||||
success : function(data){
|
||||
if(data.success == "true"){
|
||||
if(dom.is(":checked")){
|
||||
if(dom.is(":checked")){ console.log("true");
|
||||
elementSettingsData[$e.data("id")].sections.push({"id" : dom.data("section"),"name":sectionDetails.name});
|
||||
o.notify("Added to " + sectionDetails.name,"success");
|
||||
}else{
|
||||
@@ -1124,16 +1119,20 @@ var orbitDesktop = function(dom){
|
||||
var info_open = function(){
|
||||
if($appinfo.is(":hidden")){
|
||||
$('.overview').stop().animate({'width': '+=480'},0 , function(){
|
||||
// $('.tinycanvas').tinyscrollbar_update('relative');
|
||||
$('.tinycanvas').tinyscrollbar_update();
|
||||
});
|
||||
$appinfo
|
||||
.css({
|
||||
'display': 'block',
|
||||
'margin-left': -480
|
||||
}).fadeIn(200)
|
||||
})
|
||||
.delay(300)
|
||||
.animate({
|
||||
'margin-left': 0
|
||||
}, 500, 'easeInOutQuint');
|
||||
}
|
||||
} else {
|
||||
$('.tinycanvas').tinyscrollbar_update();
|
||||
}
|
||||
}
|
||||
|
||||
var info_close = function(){
|
||||
@@ -1144,11 +1143,13 @@ var orbitDesktop = function(dom){
|
||||
'margin-left': -480
|
||||
},500 , 'easeInOutQuint', function(){
|
||||
$('.overview').animate({'width': '-=480'}, 0, function(){
|
||||
// $('.tinycanvas').tinyscrollbar_update();
|
||||
$('.tinycanvas').tinyscrollbar_update();
|
||||
});
|
||||
$(this).fadeOut(300).attr("style","");
|
||||
$(this).attr("style","");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$('.tinycanvas').tinyscrollbar_update();
|
||||
}
|
||||
}
|
||||
$(window).on('keydown', function(){
|
||||
if($('#searchbox').val() == 'Search'){
|
||||
|
||||
@@ -44,13 +44,7 @@ $(function(){
|
||||
startCollapsed: true,
|
||||
disableNesting: 'no-nest',
|
||||
update: function(event, ui) {
|
||||
var position = null;
|
||||
if($(ui.item).closest('ol').hasClass('item-groups')) {
|
||||
position = $(ui.item).index() - 1;
|
||||
} else {
|
||||
position = $(ui.item).index();
|
||||
};
|
||||
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position } );
|
||||
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: ui.item.index() } );
|
||||
}
|
||||
});
|
||||
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
|
||||
|
||||
@@ -55,13 +55,6 @@
|
||||
} else {
|
||||
$viewPage.find('.content').load(url, function(){
|
||||
$viewPage.clone(true).appendTo( $pageslide.empty() ).show();
|
||||
if($('#filter-default-tag').length) {
|
||||
$('#filter-default-tag').fastLiveFilter('.add-default-tags-list', '.filter-item', '.tag');
|
||||
addTagsTab();
|
||||
$('#view-page .card').cardCheck({
|
||||
item: $('#view-page input[type="checkbox"]'),
|
||||
});
|
||||
};
|
||||
if(callback)callback.call(this,$viewPage,element);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,573 @@
|
||||
# encoding: utf-8
|
||||
|
||||
require 'net/http'
|
||||
require 'open-uri'
|
||||
|
||||
class Admin::ImportDataController < OrbitBackendController
|
||||
helper Admin::PagePartsHelper
|
||||
include Admin::FrontendWidgetInterface
|
||||
|
||||
def get_teacher_data
|
||||
uri = URI("https://localhost:8000/teachers.xml")
|
||||
|
||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
#uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
@teacher_data = Hash.from_xml(res.body)
|
||||
@teachers = @teacher_data["objects"]
|
||||
@i = 5000
|
||||
@teachers.each do |hash|
|
||||
# @roles = Role.skip(1).first
|
||||
@roles = Role.all
|
||||
@teacher = User.new
|
||||
I18n.locale = :zh_tw
|
||||
if !hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
|
||||
@teacher.first_name = hash['teacher_en']
|
||||
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||
@teacher.first_name = "Please Fill the Name"
|
||||
end
|
||||
|
||||
I18n.locale = :en
|
||||
if !hash['teacher_en'].blank?
|
||||
@teacher.first_name = hash['teacher_en']
|
||||
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
|
||||
@teacher.first_name = "Please Fill the Name"
|
||||
end
|
||||
|
||||
#@teacher.first_name = hash['teacher_en']
|
||||
@teacher.ntu_seq = hash['ntu_seq']
|
||||
@teacher.sid = hash['ntu_seq']
|
||||
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
|
||||
@teacher.password = "testpass"
|
||||
@i += 10
|
||||
if !hash['email'].blank?
|
||||
@user = User.where(email: "#{hash['email']}")
|
||||
if @user.length == 0
|
||||
@teacher.email = hash['email']
|
||||
elsif @user.length > 0
|
||||
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
|
||||
end
|
||||
else
|
||||
@teacher.email = "#{@i}@ntu.edu.tw"
|
||||
end
|
||||
|
||||
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||
@teacher.user_id = "defaultuser"
|
||||
elsif hash['teacher_en'].blank?
|
||||
@teacher.user_id = hash['teacher_zh_tw']
|
||||
elsif hash['teacher_zh_tw']
|
||||
@teacher.user_id = hash['teacher_en']
|
||||
end
|
||||
@teacher.save!
|
||||
end
|
||||
end
|
||||
|
||||
def get_book_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.sid.present?
|
||||
ntu_seq = hash.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,
|
||||
title: (book_node>"DocTitle").text,
|
||||
remarks: (book_node>"Remarks").text,
|
||||
publisher: (book_node>"Publisher").text,
|
||||
book_title: (book_node>"BookTitle").text
|
||||
}
|
||||
end
|
||||
if @books.present?
|
||||
@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]
|
||||
I18n.locale = :en
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.year = b[:year]
|
||||
@book.create_user_id = hash.id
|
||||
@book.save
|
||||
end
|
||||
else
|
||||
puts "No books by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_conference_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.sid.present?
|
||||
ntu_seq = hash.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,
|
||||
title: (cp_node>"PaperTitle").text,
|
||||
conference: (cp_node>"PublishOn").text,
|
||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||
conference_title: (cp_node>"PublishOn").text,
|
||||
remarks: (cp_node>"Remarks").text
|
||||
}
|
||||
end
|
||||
if @conference_papers.present?
|
||||
@conference_papers.each do |b|
|
||||
@conference_paper = WritingConference.new
|
||||
I18n.locale = :zh_tw
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
|
||||
@conference_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
@conference_paper.note = b[:remarks]
|
||||
|
||||
@conference_paper.location = b[:location]
|
||||
@conference_paper.year = b[:year]
|
||||
@conference_paper.create_user_id = hash.id
|
||||
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No conference by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_journal_paper_data
|
||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
teachers = User.all
|
||||
|
||||
teachers.each do |hash|
|
||||
if hash.sid.present?
|
||||
ntu_seq = hash.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,
|
||||
title: (paper_node>"PaperTitle").text,
|
||||
journal: (paper_node>"PublishOn").text,
|
||||
volume:(paper_node>"Volume").text,
|
||||
volumeno:(paper_node>"VolumeNo").text,
|
||||
beginpage:(paper_node>"BeginPage").text,
|
||||
endpage:(paper_node>"EndPage").text,
|
||||
subgroup:(paper_node>"subgroup").text,
|
||||
remarks: (paper_node>"Remarks").text,
|
||||
cate: ((paper_node>"subgroup")>"Group").text
|
||||
}
|
||||
end
|
||||
if @journal_papers.present?
|
||||
@journal_papers.each do |b|
|
||||
@journal_paper = WritingJournal.new
|
||||
I18n.locale = :zh_tw
|
||||
@journal_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@journal_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
@journal_paper.year = b[:year]
|
||||
@journal_paper.vol_no = b[:volumeno]
|
||||
@journal_paper.form_to_start = b[:beginpage]
|
||||
@journal_paper.form_to_end = b[:endpage]
|
||||
if !b[:cate].blank?
|
||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||
if @level_type.present?
|
||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||
end
|
||||
end
|
||||
|
||||
@journal_paper.create_user_id = hash.id
|
||||
@journal_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No journal paper by Teacher"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def sync_conference_data
|
||||
@conference_data = WritingConference.where(create_user_id: "#{params[: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,
|
||||
title: (cp_node>"PaperTitle").text,
|
||||
conference: (cp_node>"PublishOn").text,
|
||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||
conference_title: (cp_node>"PublishOn").text,
|
||||
remarks: (cp_node>"Remarks").text
|
||||
}
|
||||
end
|
||||
if @conference_papers.present?
|
||||
@conference_papers.each do |b|
|
||||
@conference_paper = WritingConference.new
|
||||
I18n.locale = :zh_tw
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
|
||||
@conference_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@conference_paper.authors = b[:author]
|
||||
if b[:title].blank?
|
||||
@conference_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
@conference_paper.note = b[:remarks]
|
||||
|
||||
@conference_paper.location = b[:location]
|
||||
@conference_paper.year = b[:year]
|
||||
@conference_paper.create_user_id = @user.id
|
||||
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
puts "No conference by Teacher"
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
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?
|
||||
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,
|
||||
title: (paper_node>"PaperTitle").text,
|
||||
journal: (paper_node>"PublishOn").text,
|
||||
volume:(paper_node>"Volume").text,
|
||||
volumeno:(paper_node>"VolumeNo").text,
|
||||
beginpage:(paper_node>"BeginPage").text,
|
||||
endpage:(paper_node>"EndPage").text,
|
||||
subgroup:(paper_node>"subgroup").text,
|
||||
remarks: (paper_node>"Remarks").text,
|
||||
cate: ((paper_node>"subgroup")>"Group").text
|
||||
}
|
||||
end
|
||||
if @journal_papers.present?
|
||||
@journal_papers.each do |b|
|
||||
@journal_paper = WritingJournal.new
|
||||
I18n.locale = :zh_tw
|
||||
@journal_paper.authors = b[:author]
|
||||
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@journal_paper.authors = b[:author]
|
||||
|
||||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
|
||||
@journal_paper.journal_title = b[:journal]
|
||||
@journal_paper.note = b[:remarks]
|
||||
@journal_paper.year = b[:year]
|
||||
@journal_paper.vol_no = b[:volumeno]
|
||||
@journal_paper.form_to_start = b[:beginpage]
|
||||
@journal_paper.form_to_end = b[:endpage]
|
||||
|
||||
if !b[:cate].blank?
|
||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||
if @level_type.present?
|
||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||
end
|
||||
end
|
||||
|
||||
@journal_paper.create_user_id = @user.id
|
||||
@journal_paper.save!
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def sync_book_data
|
||||
@books_data = WritingBook.where(create_user_id: "#{params[: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,
|
||||
title: (book_node>"DocTitle").text,
|
||||
remarks: (book_node>"Remarks").text,
|
||||
publisher: (book_node>"Publisher").text,
|
||||
book_title: (book_node>"BookTitle").text
|
||||
}
|
||||
end
|
||||
if @books.present?
|
||||
@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]
|
||||
I18n.locale = :en
|
||||
@book.authors = b[:author]
|
||||
@book.paper_title = b[:title]
|
||||
@book.book_title = b[:book_title]
|
||||
@book.note = b[:remarks]
|
||||
@book.publisher = b[:publisher]
|
||||
@book.year = b[:year]
|
||||
@book.create_user_id = @user.id
|
||||
@book.save
|
||||
end
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
format.html
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_announcement_data
|
||||
uri = URI("https://localhost:8000/announcements.xml")
|
||||
|
||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||
#uri.query = URI.encode_www_form(params)
|
||||
res = Net::HTTP.get_response(uri)
|
||||
|
||||
@announcement_data = Hash.from_xml(res.body)
|
||||
@announcements = @announcement_data["objects"]
|
||||
@announcements.each do |hash|
|
||||
@bulletin = Bulletin.new
|
||||
|
||||
I18n.locale = :zh_tw
|
||||
if hash['announcement_title_zh_tw'].blank?
|
||||
@bulletin.title = hash['announcement_title_en']
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||
@bulletin.title = "Please Fill the Name"
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
else
|
||||
@bulletin.title = hash['announcement_title_zh_tw']
|
||||
@bulletin.text = hash['announcement_content_zh_tw']
|
||||
end
|
||||
|
||||
I18n.locale = :en
|
||||
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||
@bulletin.title = "Please Fill the Name"
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
|
||||
elsif hash['announcement_title_en'].blank?
|
||||
@bulletin.title = hash['announcement_zh_tw']
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
|
||||
elsif hash['announcement_title_zh_tw'].blank?
|
||||
@bulletin.title = hash['announcement_title_en']
|
||||
@bulletin.text = hash['announcement_content_en']
|
||||
end
|
||||
@bulletin.category_id = "51d2a16438178423c2000001"
|
||||
@bulletin.is_pending = true
|
||||
|
||||
@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
|
||||
@@ -27,7 +27,7 @@ class Admin::ItemsController < OrbitBackendController
|
||||
|
||||
def update_position
|
||||
item = Item.find(params[:id])
|
||||
item.shift_to(params[:parent_id], params[:position].to_i)
|
||||
item.shift_to(params[:parent_id], params[:position].to_i - 1)
|
||||
render :nothing => true, status: 200
|
||||
end
|
||||
|
||||
|
||||
@@ -274,6 +274,8 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
else
|
||||
user.move_below(user_at_position)
|
||||
end
|
||||
elsif to_go > User.count
|
||||
user.move_to_bottom
|
||||
end
|
||||
end
|
||||
render nothing: true, status: 200
|
||||
|
||||
@@ -19,7 +19,7 @@ class DesktopController< ApplicationController
|
||||
render :layout => "compatibility"
|
||||
end
|
||||
|
||||
def desktop_container
|
||||
def desktop
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
|
||||
@@ -12,16 +12,7 @@ class FrontController < ApplicationController
|
||||
end
|
||||
|
||||
def show_footer
|
||||
@page = Page.find(:all, :conditions => {:name => /terms/i})
|
||||
@name = @page.first.name
|
||||
@url = "/#{@name}"
|
||||
|
||||
if !@site.enable_terms_of_use
|
||||
render :text => (@site.footer + "<a href='#{@url}'>Terms of Use</a>")
|
||||
else
|
||||
render :text => @site.footer
|
||||
end
|
||||
|
||||
render :text => @site.footer
|
||||
end
|
||||
|
||||
def show_menu
|
||||
@@ -30,15 +21,7 @@ class FrontController < ApplicationController
|
||||
end
|
||||
|
||||
def show_site_sub_menu
|
||||
@page = Page.find(:all, :conditions => {:name => /sitemap/i})
|
||||
@name = @page.first.name
|
||||
@url = "/#{@name}"
|
||||
|
||||
if !@site.sitemap_menu_in_header
|
||||
render :text => (@site.sub_menu + "<a href='#{@url}'>Sitemap</a>")
|
||||
else
|
||||
render :text => @site.sub_menu
|
||||
end
|
||||
render :text => @site.sub_menu
|
||||
end
|
||||
|
||||
def show_sitemap
|
||||
@@ -60,11 +43,6 @@ class FrontController < ApplicationController
|
||||
@tags = module_app.sorted_tags_for_cloud
|
||||
end
|
||||
|
||||
def show_terms_of_use
|
||||
@site = Site.first rescue nil
|
||||
@terms = @site.terms_of_use
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def menu_level(page, current_page, current, menu)
|
||||
|
||||
@@ -43,7 +43,7 @@ class MobileController < ApplicationController
|
||||
|
||||
def page
|
||||
@page_title = t('mobile.page')
|
||||
@page_contexts = get_sorted_page_from_structure
|
||||
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
|
||||
end
|
||||
|
||||
def page_content
|
||||
@@ -57,12 +57,4 @@ class MobileController < ApplicationController
|
||||
@no_footer = true if request.path =~ /app/
|
||||
end
|
||||
|
||||
def get_sorted_page_from_structure
|
||||
page_contexts = Item.structure_ordered_items.inject([]){ |pages, page|
|
||||
pages << page.page_contexts.where(archived: false).limit(1)[0] if page.is_a?(Page) && !page.page_contexts.blank?
|
||||
pages
|
||||
}
|
||||
Kaminari.paginate_array(page_contexts).page(params[:page]).per(15)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -9,7 +9,7 @@ class PagesController < ApplicationController
|
||||
|
||||
if @item
|
||||
delayed_impressionist(@item)
|
||||
render_page
|
||||
render_page
|
||||
else
|
||||
redirect_to '/admin/dashboards',:notice=>t(:need_home)
|
||||
# render :text => t(:need_home)
|
||||
@@ -19,7 +19,6 @@ class PagesController < ApplicationController
|
||||
def show
|
||||
#begin
|
||||
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||
|
||||
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||
delayed_impressionist(@item)
|
||||
case @item.class.to_s
|
||||
@@ -27,7 +26,7 @@ class PagesController < ApplicationController
|
||||
if params[:clicked_field_name]
|
||||
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
|
||||
else
|
||||
render_page(params.except(:controller, :action, :page_name)) unless save_from_no_lang_for_page
|
||||
render_page(params) unless save_from_no_lang_for_page
|
||||
end
|
||||
when 'Link'
|
||||
redirect_to(@item[:url]) unless save_from_no_lang_for_page
|
||||
@@ -114,7 +113,7 @@ class PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def check_frontend_open
|
||||
if Site.first.frontend_open && current_user.nil? #Need to be change
|
||||
if !Site.first.frontend_closed && current_user.nil? #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
+8
-10
@@ -46,17 +46,15 @@ class Item
|
||||
|
||||
def shift_to(new_parent, position)
|
||||
position = position.to_i
|
||||
new_parent = Item.find(new_parent)
|
||||
current_position_sibling = find_by_parent_and_position(new_parent, position)
|
||||
if current_position_sibling
|
||||
if self.position > current_position_sibling.position
|
||||
self.move_above(current_position_sibling)
|
||||
else
|
||||
self.move_below(current_position_sibling)
|
||||
unless self.parent_id.to_s.eql?(new_parent) && self.position == position
|
||||
new_parent = Item.find(new_parent)
|
||||
current_position_sibling = find_by_parent_and_position(new_parent, position)
|
||||
if current_position_sibling
|
||||
move_above(current_position_sibling)
|
||||
elsif self.parent != new_parent
|
||||
self.parent = new_parent
|
||||
save
|
||||
end
|
||||
elsif self.parent != new_parent
|
||||
self.parent = new_parent
|
||||
save
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+2
-4
@@ -12,11 +12,9 @@ class Site
|
||||
field :private_key, :type => Binary
|
||||
field :public_key, :type => Binary
|
||||
|
||||
field :frontend_open, :type => Boolean, :default => true
|
||||
field :frontend_closed, :type => Boolean, :default => false
|
||||
field :backend_openness_on, :type => Boolean, :default => false
|
||||
field :desktop_closed, :type => Boolean, :default => false
|
||||
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
||||
field :enable_terms_of_use, :type => Boolean, :default => false
|
||||
|
||||
field :title_always_on, :type => Boolean, :default => false
|
||||
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
||||
@@ -36,7 +34,7 @@ class Site
|
||||
field :title, localize: true
|
||||
field :footer, localize: true
|
||||
field :sub_menu, localize: true
|
||||
field :terms_of_use, localize: true
|
||||
field :terms_of_user, localize: true
|
||||
field :google_analytics
|
||||
field :default_locale
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Imported Announcement Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Book Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Conference Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Journal Paper Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Imported Page Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Successfully Imported Teacher Data!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Book Data Synced Successfully!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Conference Paper Data Synced Successfully!</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>Journal Paper Data Synced Successfully!</p>
|
||||
@@ -5,6 +5,6 @@ $("#tags_index").html("<%= j render 'index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
$('.card').cardCheck({
|
||||
item: $('.card input[type="checkbox"]'),
|
||||
check: $('.card input[type="checkbox"]'),
|
||||
});
|
||||
checkedLength()
|
||||
@@ -7,7 +7,6 @@
|
||||
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
|
||||
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
|
||||
<% elsif @r_tag.eql?('sitemap') %>
|
||||
<% elsif @r_tag.eql?('terms_of_use') %>
|
||||
<% elsif @r_tag.eql?('breadcrumb') %>
|
||||
<% else %>
|
||||
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<li class="map-block <%= 'disabled' if !sitemap_block.show_in_sitemap_for(temp_locale) %>">
|
||||
<li>
|
||||
<h6>
|
||||
<input type="checkbox" id="<%= sitemap_block.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
|
||||
<input type="checkbox" class="toggle-check" data-deploy="right">
|
||||
<span><%= sitemap_block_counter + 1 %> <%= sitemap_block.title_translations[temp_locale] %></span>
|
||||
</h6>
|
||||
<ul>
|
||||
<% sitemap_block.children.each_with_index do |child, i| %>
|
||||
<li "clear <%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
|
||||
<li "<%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
|
||||
<h6>
|
||||
<input type="checkbox" id="<%= child.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
|
||||
<input type="checkbox" class="toggle-check" data-deploy="right">
|
||||
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>
|
||||
</h6>
|
||||
</li>
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
<div class="nav-name"><strong>Classification</strong></div>
|
||||
|
||||
<div class="nav-name"><strong>Classification</strong></div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<li class="active">
|
||||
<a href="#sidebar-nav" data-toggle="tab">Sidebar Nav</a>
|
||||
@@ -113,10 +114,10 @@
|
||||
<!-- Openness -->
|
||||
<div id="openness" class="tab-pane fade">
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t('site.frontend_open')%></label>
|
||||
<label class="control-label muted"><%= I18n.t('site.frontend_closed')%></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :frontend_open , :class=>"toggle-check"%>
|
||||
<span class="help-block">If Checked, the frontend will be open for all users.</span>
|
||||
<%= f.check_box :frontend_closed , :class=>"toggle-check"%>
|
||||
<span class="help-block">Only can be viewed by users logged in</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
@@ -190,7 +191,7 @@
|
||||
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<label class="checkbox inline btn btn-danger fileupload-remove">
|
||||
<% if @site.default_image.file.present? %>
|
||||
<% if @site.default_image.file %>
|
||||
<label class="checkbox">
|
||||
<%= check_box_tag 'site[remove_default_image]' %>
|
||||
<%= t(:delete_) %>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
<!-- Always shoe in the title bar -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t :always_display_title %>
|
||||
<label class="control-label muted">Always show in the title bar
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :title_always_on, :class => "toggle-check" %>
|
||||
@@ -70,28 +70,12 @@
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- CKeditor Site Footer -->
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||
<label class="control-label muted"><%= t('site.footer')%></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :footer_translations do |f| %>
|
||||
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.footer_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
<!-- Sitemap menu in Header -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Sitemap menu in header
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
|
||||
<input type="checkbox" class="toggle-check" data-disabled="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -102,25 +86,27 @@
|
||||
<label class="control-label muted">Terms of Use
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :enable_terms_of_use, :class => "toggle-check" %>
|
||||
<input type="checkbox" class="toggle-check terms" data-disabled="true" checked="checked">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CKeditor Site Footer -->
|
||||
<!-- CKeditor Default Terms of Use -->
|
||||
<div class="control-group input-content hide">
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||
<label class="control-label muted"><%= t('site.default_terms_of_use')%></label>
|
||||
<label class="control-label muted">Default Terms of Use</label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :terms_of_use_translations do |f| %>
|
||||
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_use_translations[locale] rescue nil) %>
|
||||
<%= f.fields_for :terms_of_user_translations do |f| %>
|
||||
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_user_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Form Actions -->
|
||||
<div class="form-actions">
|
||||
<%= f.submit t("submit"), :class => "btn btn-primary" %>
|
||||
|
||||
@@ -12,67 +12,28 @@
|
||||
<% 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 %>
|
||||
|
||||
<section>
|
||||
<h3>Sitemap</h3>
|
||||
<div>
|
||||
|
||||
<div id="sitemap">
|
||||
<ul id="map-tree-language" class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %>>
|
||||
<a data-toggle="tab" href="#<%= locale %>">
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<ul id="map-tree-language" class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href="#<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content map-tree-content">
|
||||
<div class="line"></div>
|
||||
|
||||
<% @site_valid_locales.each_with_index do |temp_locale, i| %>
|
||||
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in active">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
|
||||
</ul>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.site-map').masonry({
|
||||
itemSelector: '.map-block',
|
||||
columnWidth: 260
|
||||
});
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
$('.site-map').masonry({
|
||||
itemSelector: '.map-block',
|
||||
columnWidth: 260
|
||||
});
|
||||
})
|
||||
});
|
||||
$(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') %>")
|
||||
} else {
|
||||
$(this).text("<%= t('on_upcase') %>")
|
||||
}
|
||||
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?temp_locale=' + $(this).attr('temp_locale'));
|
||||
});
|
||||
$(document).on('click', 'h6 .onoff', function () {
|
||||
$(this).parents(".map-block").toggleClass("disabled");
|
||||
if($(this).parents("h6").parents("li").attr("class").indexOf("disabled") > 0){
|
||||
$(this).text("<%= t('off_upcase') %>")
|
||||
$(this).parents(".map-block").find('li').addClass('disabled')
|
||||
$(this).parents(".map-block").find('checkbox').text("<%= t('off_upcase') %>")
|
||||
// $(this).parents(".map-block").find('li checkbox').attr('disabled', 'disabled')
|
||||
} else {
|
||||
$(this).text("<%= t('on_upcase') %>")
|
||||
$(this).parents(".map-block").find('li').removeClass('disabled')
|
||||
$(this).parents(".map-block").find('checkbox').text("<%= t('on_upcase') %>")
|
||||
// $(this).parents(".map-block").find('li checkbox').removeAttr("disabled")
|
||||
}
|
||||
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true&temp_locale=' + $(this).attr('temp_locale'));
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -4,6 +4,6 @@ $("#tags_index").html("<%= j render 'index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
$('.card').cardCheck({
|
||||
item: $('.card input[type="checkbox"]'),
|
||||
check: $('.card input[type="checkbox"]'),
|
||||
});
|
||||
checkedLength()
|
||||
@@ -1,9 +1,8 @@
|
||||
<% if @data.present? %>
|
||||
<%= render :partial => 'shared/search_header',:locals=>{:items=>@data} %>
|
||||
<%= render @partial %>
|
||||
<% if @paginate %>
|
||||
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
|
||||
<% elsif @page_part.module_app %>
|
||||
<%= @page_part.module_app.get_registration.default_widget_setting.link_to_more_tag(request,params) %>
|
||||
<% end %>
|
||||
<%= render :partial => 'shared/search_header',:locals=>{:items=>@data} %>
|
||||
|
||||
<%= render @partial %>
|
||||
<% if @paginate and !@data.blank? %>
|
||||
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
|
||||
<% elsif @page_part.module_app %>
|
||||
<%= @page_part.module_app.get_registration.default_widget_setting.link_to_more_tag(request,params) %>
|
||||
<% end %>
|
||||
File renamed without changes.
@@ -2,9 +2,9 @@
|
||||
<div id="side">
|
||||
<div id="rwidget" class="wh2 thmc4">
|
||||
<ul class="docklist">
|
||||
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/desktop_container" class="widget_fn wh2 hh2" id='home' onclick="return false;" sub-menu="false"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
|
||||
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/desktop" class="widget_fn wh2 hh2" id='home' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
|
||||
<ul class="dock_child hh2 thmc4" style="width: 120px;">
|
||||
<li class="dock_item"><a callback-method='initializeAppManager' href="<%= desktop_app_manager_path %>" class="widget_fn wh2 hh2" id="d_app_manager" onclick="return false;" sub-menu="false"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
|
||||
<li class="dock_item"><a callback-method='initializeAppManager' href="<%= desktop_app_manager_path %>" class="widget_fn wh2 hh2" id="d_app_manager" onclick="return false;"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
|
||||
<li class="dock_item"><a callback-method='initializeSettings' href="<%= desktop_settings_path %>" custom-load="settings" class="widget_fn wh2 hh2" id="d_settings" onclick="return false;"><span class="widget_icon"><img src="" alt="Settings" id="settings_icon" width="30" height="30"/></span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -92,22 +92,10 @@
|
||||
orbitDesktop.prototype.sectionId = "<%= @section.id %>";
|
||||
orbitDesktop.prototype.currentLanguage = "<%= I18n.locale %>";
|
||||
orbitDesktop.prototype.currentUsername = "<%= @currentusername %>";
|
||||
//uselessfunction();
|
||||
var od = new orbitDesktop("#ajax_container");
|
||||
var getInternetExplorerVersion = function(){
|
||||
var rv = -1; // Return value assumes failure.
|
||||
if (navigator.appName == 'Microsoft Internet Explorer')
|
||||
{
|
||||
var ua = navigator.userAgent;
|
||||
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
|
||||
if (re.exec(ua) != null)
|
||||
rv = parseFloat( RegExp.$1 );
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
var version = getInternetExplorerVersion();
|
||||
if( version != -1){
|
||||
if(version < 9){
|
||||
if($.browser.msie){
|
||||
if($.browser.version < 9){
|
||||
$.fx.off = true;
|
||||
o.notify("We turn off the animation (javascript) for you, but still you can turn it on",10);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<%= @terms.html_safe %>
|
||||
@@ -27,20 +27,4 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<% @url_path = "#{request.fullpath}".scan(/admin/)%>
|
||||
<% if (@site.default_image.present? && (!@url_path.include? "admin"))%>
|
||||
<style>
|
||||
#orbit-bar .orbitlogo {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-size: 70%;
|
||||
display: inline-block;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url(<%= @site.default_image %>);
|
||||
/* For Suck IE */
|
||||
background-image: url(<%= @site.default_image%>)\9;
|
||||
}
|
||||
</style>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -44,7 +44,6 @@ public_r_tags:
|
||||
- sitemap
|
||||
- breadcrumb
|
||||
- tag_cloud
|
||||
- terms_of_use
|
||||
|
||||
page_part_kinds:
|
||||
- text
|
||||
|
||||
@@ -390,7 +390,6 @@ en:
|
||||
footer: Site footer
|
||||
footer_help: Footer Guide
|
||||
frontend_closed: Frontend Closed
|
||||
frontend_open: Frontend Open
|
||||
header: Site header
|
||||
info: Site information
|
||||
keywords: Site keywords
|
||||
|
||||
@@ -2,7 +2,6 @@ en:
|
||||
add_category: Add category
|
||||
add_link: Add link
|
||||
add_page: Add page
|
||||
add_tags: Add Tags
|
||||
add_to_default: Add to default
|
||||
alternative: Alternative
|
||||
approval_setting: Approval Setting
|
||||
@@ -71,5 +70,4 @@ en:
|
||||
error:
|
||||
tag: Error when updating category
|
||||
tag: Error when updating tag
|
||||
url_alt: Alternative text
|
||||
use_default: Use Default
|
||||
url_alt: Alternative text
|
||||
@@ -2,7 +2,6 @@ zh_tw:
|
||||
add_category: 新增類別
|
||||
add_link: 新增連結
|
||||
add_page: 新增頁面
|
||||
add_tags: Add Tags
|
||||
add_to_default: 加入預設
|
||||
alternative: 註解
|
||||
approval_setting: 審核設定
|
||||
@@ -72,4 +71,3 @@ zh_tw:
|
||||
tag: 更新類別時發生錯誤
|
||||
tag: 更新標籤時發生錯誤
|
||||
url_alt: 註解
|
||||
use_default: Use Default
|
||||
@@ -385,7 +385,6 @@ zh_tw:
|
||||
thumbnail: 縮圖
|
||||
site:
|
||||
frontend_closed: 前台關閉?
|
||||
frontend_open: 前台關閉 ?
|
||||
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
||||
default_image: 預設圖像
|
||||
description: 網站描述
|
||||
|
||||
+1
-3
@@ -10,8 +10,6 @@ development:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
|
||||
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
@@ -24,4 +22,4 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: test_site_new
|
||||
database: test_site
|
||||
+12
-2
@@ -201,6 +201,16 @@ Orbit::Application.routes.draw do
|
||||
get 'preference'
|
||||
end
|
||||
|
||||
get "import_data/get_teacher_data"
|
||||
get "import_data/get_book_data"
|
||||
get "import_data/get_conference_data"
|
||||
get "import_data/get_journal_paper_data"
|
||||
get "import_data/get_announcement_data"
|
||||
get "import_data/get_page_data"
|
||||
get "import_data/sync_book_data"
|
||||
get "import_data/sync_journal_paper_data"
|
||||
get "import_data/sync_conference_data"
|
||||
|
||||
resources :tags do
|
||||
collection do
|
||||
post 'add_to_default'
|
||||
@@ -273,7 +283,7 @@ Orbit::Application.routes.draw do
|
||||
|
||||
match "/desktop/compatibility" => "desktop#compatibility"
|
||||
match "desktop" => "desktop#index"
|
||||
match "/desktop/desktop_container" => "desktop#desktop_container"
|
||||
match "/desktop/desktop" => "desktop#desktop"
|
||||
match '/desktop/appactivation'=>'desktop#appactivation'
|
||||
match '/desktop/app_manager'=>'desktop#app_manager'
|
||||
match '/desktop/allsections'=>'desktop#allsections'
|
||||
@@ -328,7 +338,7 @@ Orbit::Application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
controller_paths :front, %w[show_breadcrumb show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap show_tag_cloud show_terms_of_use]
|
||||
controller_paths :front, %w[show_breadcrumb show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap show_tag_cloud]
|
||||
# controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
|
||||
|
||||
# scope 'app' do
|
||||
|
||||
+27
-41
@@ -197,48 +197,37 @@ module OrbitCoreLib
|
||||
end
|
||||
end
|
||||
|
||||
def skip_authorization(arg = nil)
|
||||
if arg
|
||||
key = arg.shift
|
||||
prepend_before_filter key[0] => key[1] {|f| f.no_authorization}
|
||||
else
|
||||
prepend_before_filter {|f| f.no_authorization}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
protected
|
||||
def can_use
|
||||
setup_vars
|
||||
unless @no_authorization
|
||||
if @user_type
|
||||
@user_type.each do |user_type|
|
||||
open = false
|
||||
visitor = false
|
||||
case user_type
|
||||
when :admin
|
||||
open ||= check_admin
|
||||
when :manager
|
||||
open ||= check_manager
|
||||
when :sub_manager
|
||||
open ||= check_sub_manager
|
||||
when :approver
|
||||
open ||= check_sub_manager
|
||||
when :visitor
|
||||
set_current_user
|
||||
open ||= true
|
||||
visitor ||= true
|
||||
end
|
||||
check_backend_openness if visitor
|
||||
authenticate_user! unless visitor
|
||||
redirect_to root_url unless open
|
||||
set_current_user
|
||||
if @user_type
|
||||
@user_type.each do |user_type|
|
||||
open = false
|
||||
visitor = false
|
||||
case user_type
|
||||
when :admin
|
||||
open ||= check_admin
|
||||
when :manager
|
||||
open ||= check_manager
|
||||
when :sub_manager
|
||||
open ||= check_sub_manager
|
||||
when :approver
|
||||
open ||= check_sub_manager
|
||||
when :visitor
|
||||
open ||= true
|
||||
visitor ||= true
|
||||
end
|
||||
else
|
||||
authenticate_user!
|
||||
check_user_can_use
|
||||
check_backend_openness if visitor
|
||||
authenticate_user! unless visitor
|
||||
redirect_to root_url unless open
|
||||
end
|
||||
else
|
||||
authenticate_user!
|
||||
check_user_can_use
|
||||
end
|
||||
end
|
||||
|
||||
@@ -259,14 +248,10 @@ module OrbitCoreLib
|
||||
end
|
||||
|
||||
def open_for(var)
|
||||
@user_type ||= []
|
||||
@user_type ||= []
|
||||
@user_type << var
|
||||
end
|
||||
|
||||
def no_authorization
|
||||
@no_authorization = true
|
||||
end
|
||||
|
||||
def check_user_can_use
|
||||
unless current_or_guest_user.admin? || @module_app.is_manager?(current_or_guest_user) || @module_app.is_sub_manager?(current_or_guest_user) || @module_app.can_approve?(current_or_guest_user)
|
||||
redirect_to root_url
|
||||
@@ -274,8 +259,9 @@ module OrbitCoreLib
|
||||
end
|
||||
|
||||
def setup_vars
|
||||
@app_title ||= controller_path.split('/')[1].singularize rescue nil
|
||||
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} ) rescue nil
|
||||
@app_title ||= controller_path.split('/')[1].singularize
|
||||
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
|
||||
# raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -125,7 +125,6 @@ module ParserCommon
|
||||
def parse_sub_menus_edit(body = nil, page = nil, edit=nil)
|
||||
body.css('sub_menu').each do |sub_menu|
|
||||
menu_page = Page.find(sub_menu['id']) rescue nil
|
||||
|
||||
res = ''
|
||||
if menu_page && menu_page.visible_children.size > 0
|
||||
res << "<div class='category_list'>"
|
||||
@@ -246,15 +245,6 @@ module ParserCommon
|
||||
sitemap.swap(fragment)
|
||||
end
|
||||
|
||||
# terms_of_use
|
||||
def parse_terms_of_uses_edit(body = nil, page = nil, edit=nil)
|
||||
terms_of_use = body.css('terms_of_use').first
|
||||
url = front_show_terms_of_use_path
|
||||
options = "?inner=true"
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load' path='#{url + options}'></div>")
|
||||
terms_of_use.swap(fragment)
|
||||
end
|
||||
|
||||
# page_contents
|
||||
def parse_contents_edit(body, page, edit=nil)
|
||||
public_r_tags = []
|
||||
@@ -296,8 +286,8 @@ module ParserCommon
|
||||
when 'default_widget'
|
||||
"/panel/orbit_app/widget/#{part.widget_style}?inner=true"
|
||||
else
|
||||
# raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
|
||||
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" rescue ''
|
||||
raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
|
||||
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
|
||||
end
|
||||
|
||||
categories_str=(!part[:category].blank? ? part[:category] : category).collect{|t| "category_id[]=#{t}"}.join('&')
|
||||
|
||||
@@ -222,9 +222,4 @@ module ParserFrontEnd
|
||||
def generate_tag_clouds(*args)
|
||||
"<div class='dymanic_load' path='#{front_show_tag_cloud_path(args[0])}'></div>"
|
||||
end
|
||||
|
||||
# tag_cloud
|
||||
def generate_terms_of_uses(*args)
|
||||
"<div class='dymanic_load' path='#{front_show_terms_of_use_path}'></div>"
|
||||
end
|
||||
end
|
||||
vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js
Vendored
+5
@@ -92,6 +92,11 @@ 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.coAuthorformCallback = function(data){
|
||||
if(data.success){
|
||||
|
||||
+1
@@ -8,6 +8,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||
|
||||
@per_column = 5
|
||||
|
||||
@userid = current_user.id
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalBook::Desktop::PersonalBooksHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_book_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ class WritingBook
|
||||
title << self.publisher if self.publisher.present?
|
||||
title << self.pages if self.pages.present?
|
||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||
title.join(', ')
|
||||
title.join(', ')
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
+5
@@ -57,6 +57,11 @@
|
||||
</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>
|
||||
|
||||
Vendored
+2
@@ -75,6 +75,8 @@
|
||||
<% 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_book_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_book_back_end_personal_book_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
+4
@@ -42,6 +42,10 @@ 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(){
|
||||
|
||||
+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
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_conference_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ class WritingConference
|
||||
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
|
||||
|
||||
+5
@@ -58,7 +58,12 @@
|
||||
</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>
|
||||
</div>
|
||||
|
||||
+4
@@ -75,7 +75,11 @@
|
||||
<% 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_conference_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_conference_back_end_personal_conference_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<div class="pagination pagination-centered">
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalDiploma::Desktop::PersonalDiplomasHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_conference_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalExperience::Desktop::PersonalExperiencesHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_conference_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -64,11 +64,11 @@ module Panel::PersonalHonor::Desktop::PersonalHonorsHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_book_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+4
@@ -42,6 +42,10 @@ 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(){
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
|
||||
page ||= 1
|
||||
|
||||
@per_column = 5
|
||||
|
||||
|
||||
@userid = current_user.id
|
||||
case @view_by
|
||||
when "abstract"
|
||||
@per_column = 1
|
||||
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
||||
def publication_record publication, view
|
||||
|
||||
content_tag :li,
|
||||
"item" => "true",
|
||||
"data-id" => publication.id.to_s,
|
||||
@@ -89,13 +88,12 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
||||
|
||||
def link_publication_file publication
|
||||
publication.writing_journal_files.map{|file|
|
||||
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class WritingJournal
|
||||
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)
|
||||
|
||||
+4
@@ -58,6 +58,10 @@
|
||||
</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 Books</a></div>
|
||||
</div>
|
||||
|
||||
<div class="hh1 hp sdm">
|
||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||
</div>
|
||||
|
||||
Vendored
+2
@@ -80,6 +80,8 @@
|
||||
<% 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' %>
|
||||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_journal_back_end_personal_journal_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
Vendored
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalLab::Desktop::PersonalLabsHelper
|
||||
def link_publication_file publication
|
||||
publication.lab_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -71,11 +71,11 @@ module Panel::PersonalPatent::Desktop::PersonalPatentsHelper
|
||||
def link_publication_file publication
|
||||
publication.writing_patent_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -72,11 +72,11 @@ module Panel::PersonalProject::Desktop::PersonalProjectsHelper
|
||||
def link_publication_file publication
|
||||
publication.project_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
+2
-2
@@ -72,11 +72,11 @@ module Panel::PersonalResearch::Desktop::PersonalResearchsHelper
|
||||
def link_publication_file publication
|
||||
publication.research_files.map{|file|
|
||||
link_to(image_tag(check_file_type(file.file.url)) + \
|
||||
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
|
||||
content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"),
|
||||
file.file.url,
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
|
||||
"title" => file.title_translations[I18n.locale.to_s])
|
||||
}.inject(:+)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user