Compare commits
18 Commits
ntu_cph_ss
...
master
Author | SHA1 | Date |
---|---|---|
Manson Wang | 095157c0ae | |
Spen | ee6dcf238f | |
Spen | bfebed7cb8 | |
Manson Wang | e903bd0c39 | |
Spen | 3cd196e2a3 | |
Manson Wang | 1eaa0f1801 | |
Manson Wang | 822c23e841 | |
Harry Bomrah | ab94c79fdb | |
Bernie Chiu | d19223c873 | |
Spen | 77c00ac72f | |
Manson Wang | 92f1f44e4b | |
Manson Wang | 332658d394 | |
Manson Wang | e947af4c34 | |
Saurabh Bhatia | 37e58cd780 | |
Saurabh Bhatia | 2931676ecf | |
Spen | e71a343718 | |
Saurabh Bhatia | a108426412 | |
Manson Wang | a154d16a7e |
|
@ -20,7 +20,6 @@ gem "acts_as_unvlogable"
|
||||||
gem 'youtube_it'
|
gem 'youtube_it'
|
||||||
gem 'gotcha'
|
gem 'gotcha'
|
||||||
gem "geocoder"
|
gem "geocoder"
|
||||||
gem 'whenever', :require => false
|
|
||||||
|
|
||||||
# gem "memcached", "~> 1.4.3"
|
# gem "memcached", "~> 1.4.3"
|
||||||
# gem "memcache-client"
|
# gem "memcache-client"
|
||||||
|
|
|
@ -289,14 +289,13 @@ var orbitDesktop = function(dom){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var ca = $e.attr("content-holder");
|
var ca = $e.attr("content-holder");
|
||||||
|
|
||||||
var a = function(){
|
var a = function(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : t,
|
type : t,
|
||||||
dataType : responsetype,
|
dataType : responsetype,
|
||||||
url : $e.attr("href"),
|
url : $e.attr("href"),
|
||||||
success : function(data){
|
success : function(data){
|
||||||
if(typeof data == "string" && t != "delete"){
|
if(typeof data == "string"){
|
||||||
if(ca)
|
if(ca)
|
||||||
$(ca).html(data);
|
$(ca).html(data);
|
||||||
else{
|
else{
|
||||||
|
@ -309,12 +308,10 @@ var orbitDesktop = function(dom){
|
||||||
window.o[o.data_method][exe](data,$e);
|
window.o[o.data_method][exe](data,$e);
|
||||||
if(t == "delete"){
|
if(t == "delete"){
|
||||||
if($e.attr("delete-item")=="true"){
|
if($e.attr("delete-item")=="true"){
|
||||||
var li_to_delete = $e.parentsUntil("li[item=true]");
|
var li_to_delete = $e.parentsUntil("li[item=true]").find("li[item=true]");
|
||||||
li_to_delete.slideUp();
|
li_to_delete.slideUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
error : function(x){
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,98 +1,108 @@
|
||||||
var ListCheck = function(element) {
|
|
||||||
this.element = $(element);
|
|
||||||
this.element.data('exists', true);
|
|
||||||
if(this.element.context.parentNode.tagName == "TD") {
|
|
||||||
this.elementWrap = $(this.element.context.parentNode);
|
|
||||||
this.elementWrap.addClass('listCheck');
|
|
||||||
} else if(this.element.context.parentNode.tagName == "TH") {
|
|
||||||
this.elementWrap = $(this.element.context.parentNode);
|
|
||||||
this.elementWrap.addClass('listCheckHead');
|
|
||||||
}
|
|
||||||
this.element.before('<i class="icon-check-empty" />');
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.listCheck = function (callback) {
|
|
||||||
this.each(function (i) {
|
|
||||||
if(!$(this).data('exists')) {
|
|
||||||
new ListCheck(this);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
this.on(clickEvent, function(e) {
|
|
||||||
if($(this).prop('checked')) {
|
|
||||||
$(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
|
||||||
} else {
|
|
||||||
$(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
|
||||||
};
|
|
||||||
if ($(this).closest('.listCheckHead').length) {
|
|
||||||
$('.listCheck .list-check').prop('checked', $(this).prop('checked'));
|
|
||||||
if($(this).prop('checked')) {
|
|
||||||
$('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
|
||||||
} else {
|
|
||||||
$('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _isCheck = $('tbody .list-check').filter(':checked').length,
|
|
||||||
_defaultLength = $('tbody .list-check').length;
|
|
||||||
|
|
||||||
if(_isCheck > 0 && _isCheck < _defaultLength) {
|
|
||||||
$('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
|
|
||||||
} else if(!_isCheck) {
|
|
||||||
$('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
|
|
||||||
} else {
|
|
||||||
$('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
|
|
||||||
}
|
|
||||||
_isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
function clearCheck() {
|
|
||||||
$('.list-check').each(function() {
|
|
||||||
$(this).prop('checked', false);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
function actionSuccess(e) {
|
|
||||||
$("tbody .list-check").each(function() {
|
|
||||||
switch(e) {
|
|
||||||
case 'list-be-hide':
|
|
||||||
$(this).filter(':checked').closest('tr').addClass('checkHide');
|
|
||||||
break;
|
|
||||||
case 'list-be-show':
|
|
||||||
$(this).filter(':checked').closest('tr').removeClass('checkHide');
|
|
||||||
break;
|
|
||||||
case 'list-be-remove':
|
|
||||||
$(this).filter(':checked').closest('tr').fadeOut(300, function() {
|
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
|
|
||||||
});
|
|
||||||
clearCheck();
|
|
||||||
}
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var $t = null,
|
var ListCheckData = {},
|
||||||
_data = null;
|
ListCheck = function(element) {
|
||||||
clearCheck();
|
this.element = $(element);
|
||||||
$('.list-check').listCheck();
|
this.element.data('exists', true);
|
||||||
$('.list-active-btn').data('actionable', false).on(clickEvent, function(e) {
|
if(this.element.context.parentNode.tagName == "TD") {
|
||||||
$t = $(this)
|
this.elementWrap = $(this.element.context.parentNode);
|
||||||
_data = $(this).data()
|
this.elementWrap.addClass('listCheck');
|
||||||
_data.actionable ? $('#dialog').modal('show') : "";
|
} else if(this.element.context.parentNode.tagName == "TH") {
|
||||||
e.preventDefault();
|
this.elementWrap = $(this.element.context.parentNode);
|
||||||
});
|
this.elementWrap.addClass('listCheckHead');
|
||||||
$('.delete-item').on(clickEvent, function() {
|
}
|
||||||
var _v = [];
|
this.element.before('<i class="icon-check-empty" />');
|
||||||
$("tbody .list-check").each(function() {
|
};
|
||||||
this.checked && _v.push("ids[]="+this.value)
|
|
||||||
|
$.fn.listCheck = function () {
|
||||||
|
$(this).each(function() {
|
||||||
|
var $this = $(this),
|
||||||
|
$el = $this.find('input[type="checkbox"]');
|
||||||
|
$el.each(function (i) {
|
||||||
|
if(!$(this).data('exists')) {
|
||||||
|
new ListCheck(this);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$this.on(clickEvent, $el, function(e) {
|
||||||
|
if($(e.target).prop('checked')) {
|
||||||
|
$(e.target).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||||
|
} else {
|
||||||
|
$(e.target).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
|
};
|
||||||
|
if($(e.target).closest('th').hasClass('listCheckHead')) {
|
||||||
|
$this.find('.listCheck input[type="checkbox"]').prop('checked', $(e.target).prop('checked'));
|
||||||
|
if($(e.target).prop('checked')) {
|
||||||
|
$this.find('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||||
|
} else {
|
||||||
|
$this.find('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var _isCheck = $this.find('tbody').find($el).filter(':checked').length,
|
||||||
|
_defaultLength = $this.find('tbody').find($el).length;
|
||||||
|
|
||||||
|
if(_isCheck > 0 && _isCheck < _defaultLength) {
|
||||||
|
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
|
||||||
|
} else if(!_isCheck) {
|
||||||
|
$this.find('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
|
||||||
|
} else {
|
||||||
|
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
|
||||||
|
}
|
||||||
|
_isCheck ? $this.find('.list-active-btn').removeClass('disabled').data('actionable', true) : $this.find('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||||
|
});
|
||||||
|
$this.on(clickEvent, '.list-active-btn', function(e) {
|
||||||
|
if(!$(this).hasClass('disabled')) {
|
||||||
|
ListCheckData.url = $(this).attr('rel');
|
||||||
|
ListCheckData.name = $this.find('tbody').find('input[type="checkbox"]').attr('name');
|
||||||
|
ListCheckData.action = $(this).data('checkAction');
|
||||||
|
ListCheckData.values = [];
|
||||||
|
ListCheckData.element = $this
|
||||||
|
$this.find('tbody').find('input[type="checkbox"]').each(function (i) {
|
||||||
|
this.checked && ListCheckData.values.push("ids[]=" + this.value);
|
||||||
|
});
|
||||||
|
console.log(ListCheckData.values.join("&"));
|
||||||
|
$('#dialog').modal('show');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
var _t = $t.attr("rel");
|
clearCheck($(this));
|
||||||
if(_t.indexOf("?") > -1) {
|
};
|
||||||
$.ajax(_t + "&" + _v.join("&")).done(function() {
|
|
||||||
actionSuccess(_data.checkAction)
|
function clearCheck(element) {
|
||||||
|
element.find('input[type="checkbox"]').each(function() {
|
||||||
|
$(this).prop('checked', false).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
|
});
|
||||||
|
element.find('.list-active-btn').addClass('disabled');
|
||||||
|
};
|
||||||
|
|
||||||
|
function actionSuccess(e) {
|
||||||
|
ListCheckData.element.find('tbody').find('input[type="checkbox"]').each(function() {
|
||||||
|
switch(e) {
|
||||||
|
case 'list-be-hide':
|
||||||
|
$(this).filter(':checked').closest('tr').addClass('checkHide');
|
||||||
|
break;
|
||||||
|
case 'list-be-show':
|
||||||
|
$(this).filter(':checked').closest('tr').removeClass('checkHide');
|
||||||
|
break;
|
||||||
|
case 'list-be-remove':
|
||||||
|
$(this).filter(':checked').closest('tr').fadeOut(300, function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
|
||||||
|
});
|
||||||
|
clearCheck(ListCheckData.element);
|
||||||
|
}
|
||||||
|
$('.list-check').listCheck();
|
||||||
|
$('.delete-item').on(clickEvent, function() {
|
||||||
|
if(ListCheckData.url.indexOf("?") > -1) {
|
||||||
|
$.ajax(ListCheckData.url + "&" + ListCheckData.values.join("&")).done(function() {
|
||||||
|
actionSuccess(ListCheckData.action);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.ajax(_t + "?" + _v.join("&")).done(function() {
|
$.ajax(ListCheckData.url + "?" + ListCheckData.values.join("&")).done(function() {
|
||||||
actionSuccess(_data.checkAction)
|
actionSuccess(ListCheckData.action);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('#dialog').modal('hide');
|
$('#dialog').modal('hide');
|
||||||
|
|
|
@ -1,13 +1,20 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
$(".post_preview").click(function(){
|
$(".post_preview").click(function(){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
|
||||||
|
var preview_url = $(this).attr('url');
|
||||||
|
|
||||||
$.post($(this).attr('url'), $(".previewable").serialize() ,function(data){
|
$("form.previewable").ajaxSubmit({
|
||||||
$('#show_preview .modal').modal();
|
beforeSubmit: function(a,f,o){
|
||||||
|
o.dataType = 'script';
|
||||||
|
o.url = preview_url;
|
||||||
|
o.type = 'post';
|
||||||
|
},success: function(msg) {
|
||||||
|
$('#show_preview .modal').modal()
|
||||||
$('#show_preview .modal').height(function() {
|
$('#show_preview .modal').height(function() {
|
||||||
return $(window).height() * 0.7;
|
return $(window).height() * 0.7;
|
||||||
});
|
});
|
||||||
},'script');
|
}});
|
||||||
});
|
});
|
||||||
$(".preview_trigger").click(function(){
|
$(".preview_trigger").click(function(){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
@ -38,10 +45,10 @@ $(function() {
|
||||||
// o.url = url.nodeValue;
|
// o.url = url.nodeValue;
|
||||||
// o.type = 'post';
|
// o.type = 'post';
|
||||||
// },success: function(msg) {
|
// },success: function(msg) {
|
||||||
// $('#show_preview .modal').modal()
|
// $('#show_preview .modal').modal()
|
||||||
// $('#show_preview .modal').height(function() {
|
// $('#show_preview .modal').height(function() {
|
||||||
// return $(window).height() * 0.7;
|
// return $(window).height() * 0.7;
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// });
|
// });
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: 0 0 0 10px!important;
|
padding: 0 0 0 10px!important;
|
||||||
}
|
}
|
||||||
.listCheckHead .list-check,
|
.listCheckHead input[type="checkbox"],
|
||||||
.listCheck .list-check {
|
.listCheck input[type="checkbox"] {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: -12px 0 0 -1px;
|
margin: -12px 0 0 -1px;
|
||||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
|
|
@ -1,734 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
require 'net/http'
|
|
||||||
require 'open-uri'
|
|
||||||
require 'timeout'
|
|
||||||
|
|
||||||
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.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|
|
|
||||||
{
|
|
||||||
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.ntu_seq.present?
|
|
||||||
if hash.user_id.present?
|
|
||||||
# ntu_seq = hash.ntu_seq
|
|
||||||
u_account = hash.user_id
|
|
||||||
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://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.ntu_seq.present?
|
|
||||||
if hash.user_id.present?
|
|
||||||
# ntu_seq = hash.ntu_seq
|
|
||||||
u_account = hash.user_id
|
|
||||||
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"))
|
|
||||||
@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?
|
|
||||||
if @user.user_id.present?
|
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.user_id
|
|
||||||
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://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 { redirect_to request.referer }
|
|
||||||
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?
|
|
||||||
if @user.user_id.present?
|
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.user_id
|
|
||||||
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"))
|
|
||||||
@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 { redirect_to request.referer }
|
|
||||||
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?
|
|
||||||
if @user.user_id.present?
|
|
||||||
# ntu_seq = @user.sid
|
|
||||||
u_account = @user.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|
|
|
||||||
{
|
|
||||||
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 { redirect_to request.referer }
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
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|
|
|
||||||
{
|
|
||||||
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?
|
|
||||||
WritingConference.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@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
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
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|
|
|
||||||
{
|
|
||||||
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?
|
|
||||||
|
|
||||||
WritingJournal.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@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
|
|
||||||
puts "Sync "+u_account+"\r\n"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
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|
|
|
||||||
{
|
|
||||||
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?
|
|
||||||
|
|
||||||
WritingBook.delete_all(conditions:{create_user_id: user.id})
|
|
||||||
|
|
||||||
@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
|
|
||||||
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
|
|
||||||
end
|
|
|
@ -1,9 +1,48 @@
|
||||||
class Admin::ModuleStoreController < OrbitBackendController
|
class Admin::ModuleStoreController < OrbitBackendController
|
||||||
|
|
||||||
|
@@store = STORE_CONFIG[:store_settings]["url"]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@extensions = get_extensions
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@extension = get_extension(params[:id]) rescue nil
|
||||||
end
|
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
|
end
|
|
@ -36,6 +36,26 @@ class Admin::PagesController < Admin::ItemsController
|
||||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||||
end
|
end
|
||||||
if @item.update_attributes(params[:page])
|
if @item.update_attributes(params[:page])
|
||||||
|
unless params[:page]['frontend_field'].nil?
|
||||||
|
frontend_class = []
|
||||||
|
frontend_field_name = []
|
||||||
|
frontend_sat_to_link = []
|
||||||
|
|
||||||
|
params[:page]['frontend_field'].each do |field|
|
||||||
|
frontend_class << field['class']
|
||||||
|
frontend_field_name << field['field_name']
|
||||||
|
frontend_sat_to_link << field['sat_to_link']
|
||||||
|
end
|
||||||
|
|
||||||
|
@item['frontend_class'] = frontend_class
|
||||||
|
@item['frontend_field_name'] = frontend_field_name
|
||||||
|
@item['frontend_sat_to_link'] = frontend_sat_to_link
|
||||||
|
end
|
||||||
|
|
||||||
|
@item['tag'] = params[:page]['tag'] == nil ? [] : params[:page]['tag']
|
||||||
|
|
||||||
|
@item.save
|
||||||
|
|
||||||
render 'admin/items/reload_items'
|
render 'admin/items/reload_items'
|
||||||
else
|
else
|
||||||
@error = error_messages_for(@item)
|
@error = error_messages_for(@item)
|
||||||
|
|
|
@ -3,6 +3,7 @@ class Admin::SitesController < OrbitBackendController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :is_admin?
|
before_filter :is_admin?
|
||||||
before_filter :get_site
|
before_filter :get_site
|
||||||
|
before_filter :git_branch
|
||||||
|
|
||||||
# def index
|
# def index
|
||||||
# @site = Site.first
|
# @site = Site.first
|
||||||
|
@ -71,7 +72,10 @@ class Admin::SitesController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def system_info
|
def system_info
|
||||||
|
@disk_free = `df -h /`.gsub("\n","<br/>").html_safe
|
||||||
|
@nginx_version = %x[/opt/nginx/sbin/nginx -v 2>&1].gsub("\n","<br/> ").html_safe
|
||||||
|
@mongo_version = `mongod --version`.split("\n")[0].html_safe
|
||||||
|
@linux_version = `lsb_release -d`.split(":")[1].html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_engine
|
def search_engine
|
||||||
|
@ -107,6 +111,43 @@ class Admin::SitesController < OrbitBackendController
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
end
|
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
|
protected
|
||||||
|
|
||||||
def update_design(design)
|
def update_design(design)
|
||||||
|
@ -124,5 +165,9 @@ class Admin::SitesController < OrbitBackendController
|
||||||
def get_site
|
def get_site
|
||||||
@site ||= Site.first
|
@site ||= Site.first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def git_branch
|
||||||
|
@branch = %x(git rev-parse --abbrev-ref HEAD).gsub("\n","")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,22 +1,95 @@
|
||||||
|
require 'net/http'
|
||||||
|
require 'uri'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'zip/zip'
|
||||||
class Admin::TemplateStoreController < OrbitBackendController
|
class Admin::TemplateStoreController < OrbitBackendController
|
||||||
|
|
||||||
|
|
||||||
@@store_domain = "http://store.tp.rulingcom.com"
|
@@store_domain = STORE_CONFIG[:store_settings]["url"]
|
||||||
def index
|
def index
|
||||||
@store = @@store_domain
|
@store = @@store_domain
|
||||||
|
@design_ids = Design.all.map{|d| d.template_store_id}
|
||||||
@templates = JSON.parse(get_templates)
|
@templates = JSON.parse(get_templates)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@store = @@store_domain
|
@store = @@store_domain
|
||||||
|
@design_ids = Design.all.map{|d| d.template_store_id}
|
||||||
@template = JSON.parse(get_template(params[:id])) rescue nil
|
@template = JSON.parse(get_template(params[:id])) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_theme
|
def download_theme
|
||||||
render :json => {"success"=>true}.to_json
|
url = @@store_domain + params["url"]
|
||||||
|
url_base = url.split('/')[2]
|
||||||
|
url_path = '/'+url.split('/')[3..-1].join('/')
|
||||||
|
Net::HTTP.start(url_base) do |http|
|
||||||
|
open("public/#{params['slug']}.zip", "wb") do |file|
|
||||||
|
http.get(url_path) do |str|
|
||||||
|
file.write(str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
upload_package("#{params['slug']}.zip", params["id"])
|
||||||
|
File.delete("public/#{params['slug']}.zip")
|
||||||
|
render :json => {"success"=>true,"url"=>@@store_domain + params["url"]}.to_json
|
||||||
end
|
end
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def upload_package(package_name,template_store_id)
|
||||||
|
|
||||||
|
temp_file = Tempfile.new("temp_file")
|
||||||
|
original_file = File.open("#{Rails.root}/public/#{package_name}")
|
||||||
|
temp_file.write(original_file.read.force_encoding('UTF-8'))
|
||||||
|
temp_file.rewind
|
||||||
|
filename = File.basename(original_file,".zip")
|
||||||
|
unzip_design(temp_file, filename, template_store_id)
|
||||||
|
temp_file.close
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def unzip_design(file, zip_name, template_store_id)
|
||||||
|
Zip::ZipFile.open(file) { |zip_file|
|
||||||
|
design = Design.new.from_json(zip_file.read("#{zip_name}/info.json"))
|
||||||
|
design.template_store_id = template_store_id
|
||||||
|
Dir.mktmpdir('f_path') { |dir|
|
||||||
|
themes_entries = []
|
||||||
|
javascripts_entries = []
|
||||||
|
images_entries = []
|
||||||
|
|
||||||
|
zip_file.entries.each do |entry|
|
||||||
|
case (path = entry.to_s)
|
||||||
|
when /\A(#{zip_name})\/(default\.css)\z/ #for default css
|
||||||
|
design.build_css_default(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(reset\.css)\z/ #for reset css
|
||||||
|
design.build_css_reset(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(layout\.html)\z/ #for layout html
|
||||||
|
design.build_layout(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(themes)\/.*(\.css)\z/ #for themes css
|
||||||
|
themes_entries << entry
|
||||||
|
when /\A(#{zip_name})\/(javascripts)\/.*(\.js)\z/ #for js
|
||||||
|
javascripts_entries << entry
|
||||||
|
when /\A(#{zip_name})\/(images)\/.*((\.jpg)|(\.png)|(\.gif))\z/ #for img
|
||||||
|
images_entries << entry
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
['themes', 'javascripts', 'images'].each do |type|
|
||||||
|
eval("#{type}_entries").each do |entry|
|
||||||
|
eval("design.#{type}").build(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
design.save
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_temp_file(zip_file, dir, entry)
|
||||||
|
filename = File.basename(entry.to_s)
|
||||||
|
temp_file = File.new(dir + '/' + filename, 'w+')
|
||||||
|
temp_file.write (zip_file.read entry ).force_encoding('UTF-8')
|
||||||
|
temp_file
|
||||||
|
end
|
||||||
|
|
||||||
def get_template(id)
|
def get_template(id)
|
||||||
uri = URI.parse("#{@@store_domain}/api/templates/#{id}")
|
uri = URI.parse("#{@@store_domain}/api/templates/#{id}")
|
||||||
http = Net::HTTP.new(uri.host, uri.port)
|
http = Net::HTTP.new(uri.host, uri.port)
|
||||||
|
@ -33,6 +106,4 @@ class Admin::TemplateStoreController < OrbitBackendController
|
||||||
response.body
|
response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,6 +1,7 @@
|
||||||
class OrbitBackendController < ApplicationController
|
class OrbitBackendController < ApplicationController
|
||||||
include OrbitCategory::Categorizing
|
include OrbitCategory::Categorizing
|
||||||
include OrbitCoreLib::Authorization
|
include OrbitCoreLib::Authorization
|
||||||
|
include OrbitCoreLib::PermissionUtility
|
||||||
include OrbitTag::Tagging
|
include OrbitTag::Tagging
|
||||||
include AdminHelper
|
include AdminHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
|
@ -197,8 +197,8 @@ class PagesController < ApplicationController
|
||||||
else
|
else
|
||||||
model = params[:app_action].classify.constantize rescue nil
|
model = params[:app_action].classify.constantize rescue nil
|
||||||
if !model.nil?
|
if !model.nil?
|
||||||
item = model.find(params[:id])
|
item = model.where(:_id=>params[:id]).first
|
||||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank?
|
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank? and !item.blank?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
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
|
|
|
@ -1,40 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
class SessionsController < Devise::SessionsController
|
|
||||||
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
|
|
||||||
|
|
||||||
|
|
||||||
def create
|
|
||||||
@site = Site.first
|
|
||||||
|
|
||||||
private_key = OpenSSL::PKey::RSA.new(@site.private_key)
|
|
||||||
wresult = private_key.private_decrypt(request.params['wresult'])
|
|
||||||
|
|
||||||
@ids = wresult.split("@")
|
|
||||||
|
|
||||||
login_uid = @ids[0]
|
|
||||||
|
|
||||||
resource = User.first(conditions:{user_id: login_uid})
|
|
||||||
|
|
||||||
if !resource.blank?
|
|
||||||
resource_name = resource.class.to_s.downcase
|
|
||||||
sign_in(resource_name, resource)
|
|
||||||
session[:user_id_type] = "myntucoph"
|
|
||||||
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."
|
|
||||||
redirect_to :root
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
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"
|
|
||||||
else
|
|
||||||
redirect_to root_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -193,8 +193,8 @@ module ApplicationHelper
|
||||||
stylesheets = ''
|
stylesheets = ''
|
||||||
stylesheets << "<link href='#{asset_path 'orbit_bar_bootstrap'}' rel='stylesheet' type='text/css' />\n"
|
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='#{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 '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 '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
|
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 }
|
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
|
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme
|
||||||
|
|
|
@ -12,13 +12,13 @@ module OrbitBackendHelper
|
||||||
|
|
||||||
def show_form_status_field(object)
|
def show_form_status_field(object)
|
||||||
#by_object = (!object.is_expired? and object.is_pending?)
|
#by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
|
||||||
by_user
|
by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_approval_link(object)
|
def show_approval_link(object)
|
||||||
by_object = (!object.is_expired? and object.is_pending?)
|
by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
|
||||||
by_object and by_user
|
by_object and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -271,17 +271,31 @@ module OrbitBackendHelper
|
||||||
# TODO: links to other actions
|
# TODO: links to other actions
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
def footer(args={})
|
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
|
paginate = args.has_key?(:paginate) ? args[:paginate] : true
|
||||||
link = (is_manager? || is_sub_manager? rescue nil) && args.has_key?(:link) ? true : false
|
link = (is_manager? || is_sub_manager? rescue nil) && args.has_key?(:link) ? true : false
|
||||||
if paginate || link
|
if paginate || link
|
||||||
@index_footer = content_tag :div, class: "bottomnav clearfix" do
|
@index_footer = content_tag :div, class: "bottomnav clearfix" do
|
||||||
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, 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, 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
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_quick_link(quick, object, authorization, approvable)
|
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]
|
case quick[:type]
|
||||||
when 'approval'
|
when 'approval'
|
||||||
if show_approval_link(object)
|
if show_approval_link(object)
|
||||||
|
@ -292,13 +306,13 @@ module OrbitBackendHelper
|
||||||
content_tag :li, link_to(t(quick[:translation] || :authorization_), eval("#{quick[:link]}"), class: "preview_trigger #{quick[:class]}")
|
content_tag :li, link_to(t(quick[:translation] || :authorization_), eval("#{quick[:link]}"), class: "preview_trigger #{quick[:class]}")
|
||||||
end
|
end
|
||||||
when 'edit'
|
when 'edit'
|
||||||
if authorization && approvable
|
if authorization && approvable || is_manager?
|
||||||
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}')"), class: quick[:class], data: eval("#{quick[:data]}"))
|
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]}"))
|
||||||
end
|
end
|
||||||
when 'delete'
|
when 'delete'
|
||||||
if show_delete_link(object)
|
if show_delete_link(object)
|
||||||
@delete_options = {title: quick[:title], warning: quick[:warning], cancel: quick[:cancel], submit: quick[:submit]}
|
@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}')"), class: "delete #{quick[:class] || 'text-error'}")
|
content_tag :li, link_to(t(quick[:translation] || :delete_), '#', rel: eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: "delete #{quick[:class] || 'text-error'}")
|
||||||
end
|
end
|
||||||
when 'detail'
|
when 'detail'
|
||||||
content_tag :li, link_to(t(quick[:translation] || :detail), '#', class: (quick[:class] || "detail-row"))
|
content_tag :li, link_to(t(quick[:translation] || :detail), '#', class: (quick[:class] || "detail-row"))
|
||||||
|
@ -307,7 +321,17 @@ module OrbitBackendHelper
|
||||||
content_tag :li, link_to(t(quick[:translation] || :rejected_reason) + ' ' + truncate(object.not_checked_reason, :length => 10), '#', rel: "tooltip", 'data-original-title' => (wrap_string_with(object.not_checked_reason, :line_width => 24)), class: "reject_info #{quick[:class]}")
|
content_tag :li, link_to(t(quick[:translation] || :rejected_reason) + ' ' + truncate(object.not_checked_reason, :length => 10), '#', rel: "tooltip", 'data-original-title' => (wrap_string_with(object.not_checked_reason, :line_width => 24)), class: "reject_info #{quick[:class]}")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class])
|
if quick[:define_link]
|
||||||
|
if quick[:condition_option]
|
||||||
|
if eval("#{quick[:condition_option]}")
|
||||||
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -419,6 +443,10 @@ module OrbitBackendHelper
|
||||||
res << "<li class='active'>#{t(:search_engine)}</li>"
|
res << "<li class='active'>#{t(:search_engine)}</li>"
|
||||||
when 'site_info'
|
when 'site_info'
|
||||||
res << "<li class='active'>#{t(:site_info)}</li>"
|
res << "<li class='active'>#{t(:site_info)}</li>"
|
||||||
|
when 'update_manager'
|
||||||
|
res << "<li class='active'>#{t(:update_manager)}</li>"
|
||||||
|
when 'system_info'
|
||||||
|
res << "<li class='active'>#{t("site.system_preference")}</li>"
|
||||||
end
|
end
|
||||||
when 'items'
|
when 'items'
|
||||||
res << "<li class='active'>#{t(:structure)}</li>"
|
res << "<li class='active'>#{t(:structure)}</li>"
|
||||||
|
|
|
@ -2,28 +2,30 @@ class CronMail < ActionMailer::Base
|
||||||
default :from => "orbit_test@rulingcom.com"
|
default :from => "orbit_test@rulingcom.com"
|
||||||
|
|
||||||
def get_settings
|
def get_settings
|
||||||
# @@smtp_settings = {
|
@site = Site.first
|
||||||
# :address => "smtp.gmail.com",
|
@@smtp_settings = {
|
||||||
# :port => '587',
|
:enable_starttls_auto => @site['site_settings']['enable_starttls_auto'],
|
||||||
# :domain => "smtp.gmail.com",
|
:address => @site['site_settings']['address'],
|
||||||
# :authentication => "plain",
|
:port => @site['site_settings']['port'],
|
||||||
# :user_name => "redmine@rulingcom.com",
|
:domain => @site['site_settings']['domain'],
|
||||||
# :password => "rulingredmine",
|
:authentication => @site['site_settings']['authentication'],
|
||||||
# :tls => true,
|
:user_name => @site['site_settings']['user_name'],
|
||||||
# :enable_starttls_auto => true
|
:password => @site['site_settings']['password']
|
||||||
# }
|
|
||||||
@@smtp_settings = {
|
|
||||||
:address => @site['mail_settings']['address'],
|
|
||||||
:port => @site['mail_settings']['port'],
|
|
||||||
:domain => @site['mail_settings']['domain'],
|
|
||||||
:authentication => @site['mail_settings']['authentication'],
|
|
||||||
:user_name => @site['mail_settings']['user_name'],
|
|
||||||
:password => @site['mail_settings']['password'],
|
|
||||||
:tls => @site['mail_settings']['tls'],
|
|
||||||
:enable_starttls_auto => @site['mail_settings']['enable_starttls_auto']
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.smtp_settings
|
||||||
|
@site = Site.first
|
||||||
|
@@smtp_settings = {
|
||||||
|
:enable_starttls_auto => @site['site_settings']['enable_starttls_auto'],
|
||||||
|
:address => @site['site_settings']['address'],
|
||||||
|
:port => @site['site_settings']['port'],
|
||||||
|
:domain => @site['site_settings']['domain'],
|
||||||
|
:authentication => @site['site_settings']['authentication'],
|
||||||
|
:user_name => @site['site_settings']['user_name'],
|
||||||
|
:password => @site['site_settings']['password']
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def time_check(msg)
|
def time_check(msg)
|
||||||
get_settings
|
get_settings
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Design
|
||||||
field :intro, :type => String
|
field :intro, :type => String
|
||||||
field :title, :type => String
|
field :title, :type => String
|
||||||
field :version, :type => String
|
field :version, :type => String
|
||||||
|
field :template_store_id, :type => String
|
||||||
|
|
||||||
mount_uploader :zip_file, AssetUploader
|
mount_uploader :zip_file, AssetUploader
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,7 @@ class ModuleApp
|
||||||
# authorization
|
# authorization
|
||||||
def update_auth_approval_users
|
def update_auth_approval_users
|
||||||
user_ids = self.auth_approvals.inject([]) do |users, auth|
|
user_ids = self.auth_approvals.inject([]) do |users, auth|
|
||||||
|
auth = auth.class.find(auth.id)
|
||||||
users += auth.authorized_users.map{|user| user.id}
|
users += auth.authorized_users.map{|user| user.id}
|
||||||
end
|
end
|
||||||
self.update_attribute(:auth_approval_users, user_ids.uniq)
|
self.update_attribute(:auth_approval_users, user_ids.uniq)
|
||||||
|
|
|
@ -42,7 +42,7 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
||||||
# end
|
# end
|
||||||
|
|
||||||
version :thumb do
|
version :thumb do
|
||||||
process :resize_to_fit => [80, 80]
|
process :resize_to_fit => [200, 200]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add a white list of extensions which are allowed to be uploaded.
|
# 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,10 @@
|
||||||
|
|
||||||
<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('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="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>
|
<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>
|
||||||
--> </ul>
|
|
||||||
|
<li title="<%= t("site.system_preference") %>"><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><span><i class="icons-info-2"></i></span><%end%></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-nav-arrow"></div>
|
<div class="sub-nav-arrow"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,8 +14,14 @@
|
||||||
<%= javascript_include_tag 'lib/retina' %>
|
<%= javascript_include_tag 'lib/retina' %>
|
||||||
<%= javascript_include_tag 'lib/mudole_templates_status' %>
|
<%= javascript_include_tag 'lib/mudole_templates_status' %>
|
||||||
</head>
|
</head>
|
||||||
|
<!--
|
||||||
|
<% @extensions.each do |extension|%>
|
||||||
|
<%=link_to extension["title"], admin_module_store_show_path(extension["_slugs"][0])%>
|
||||||
|
<%end%> -->
|
||||||
|
|
||||||
<table id="mt-list" class="table main-list">
|
<%= flash[:notice] rescue nil%>
|
||||||
|
|
||||||
|
<table id="mt-list" class="table main-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="sort-header">
|
<tr class="sort-header">
|
||||||
<th class="first"><a href="#">Module Title</a></th>
|
<th class="first"><a href="#">Module Title</a></th>
|
||||||
|
@ -25,6 +31,38 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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>
|
<tr>
|
||||||
<td class="detail-row">
|
<td class="detail-row">
|
||||||
<div class="module_icon pull-left">
|
<div class="module_icon pull-left">
|
||||||
|
@ -80,6 +118,5 @@
|
||||||
@detail
|
@detail
|
||||||
</td>
|
</td>
|
||||||
<td class="active"><button class="act btn btn-mini btn-info" type="button">Update</button></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 class="side">
|
||||||
<div id="item-info">
|
<div id="item-info">
|
||||||
<img src="/assets/module/thumb/mt<%= params[:m] %>.jpg" alt="" class="item-thumb">
|
<img src="/assets/module/thumb/mt<%= params[:m] %>.jpg" alt="" class="item-thumb">
|
||||||
<h2 class="item-name">Module Name</h2>
|
<h2 class="item-name"><%= @extension.first["title"] %></h2>
|
||||||
<a id="download" href="">free download</a>
|
<a id="download" href="">free download</a>
|
||||||
<ul class="item-extra-info">
|
<ul class="item-extra-info">
|
||||||
<li><span class="title">downloads</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
<li><span class="title">downloads</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
||||||
|
@ -38,16 +38,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main clearfix">
|
<div class="main clearfix">
|
||||||
<h3>description</h3>
|
<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>
|
<div id="desc-holder" class="paragraph"><%= @extension.first["description"].html_safe%></div>
|
||||||
<h3>screen shot</h3>
|
<h3>screen shot</h3>
|
||||||
<div id="screen-shot">
|
<div id="screen-shot">
|
||||||
<div class="holder">
|
<div class="holder">
|
||||||
<img src="" alt="Thumbnail 1" class="preview item-thumb">
|
<%= image_tag "#{STORE_CONFIG[:store_settings]["url"]}/#{@extension.first['preview']['preview']['url']}"%>
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
|
|
||||||
<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('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="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>
|
<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>
|
||||||
--> </ul>
|
|
||||||
|
<li title="<%= t("site.system_preference") %>"><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><span><i class="icons-info-2"></i></span><%end%></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-nav-arrow"></div>
|
<div class="sub-nav-arrow"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
|
<%= f.text_field :domain, :value => (@site['site_settings']['domain'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.password' %></label>
|
<label class="control-label muted"><%= t 'mail.password' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
|
<%= f.password_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
<h1><%= I18n.t("site.system_preference") %></h1>
|
|
||||||
<ul class="nav nav-tabs" id="myTab">
|
|
||||||
<li class="active"><a href="#summary" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_summary") %></a></li>
|
|
||||||
<li><a href="#commits" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_commits") %></a></li>
|
|
||||||
<li><a href="#backups" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_backups") %></a></li>
|
|
||||||
<li><a href="#resque_logs" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_logs") %></a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="tab-content">
|
|
||||||
<div class="tab-pane active in" id="summary">
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.disk_space") %>:</h2>
|
|
||||||
<%= content_tag :p,@site.disk_space.gsub(/\n/,"<br />").html_safe if @site.disk_space %>
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.code_update_at") %>: </h2>
|
|
||||||
<% @site.system_package_info.each do |index,value| %>
|
|
||||||
<h2><%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:</h2>
|
|
||||||
<%= content_tag :p,value %>
|
|
||||||
<% end %>
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.weekness_report") %>:<%= '' %></h2>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="commits">
|
|
||||||
<% if @git_commit_list_file %>
|
|
||||||
<% @git_commit_list_file.lines do |line|%>
|
|
||||||
<%= line %><br/>
|
|
||||||
<% end%>
|
|
||||||
<% else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="backups">
|
|
||||||
<%if @db_backup_list_file %>
|
|
||||||
<% @db_backup_list_file.lines do |line|%>
|
|
||||||
<%=line %><br/>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="resque_logs">
|
|
||||||
<%if @db_backup_list_file %>
|
|
||||||
<% @resque_logs_file.lines do |line|%>
|
|
||||||
<%=line %><br/>
|
|
||||||
<% end if @resque_logs_file%>
|
|
||||||
<%else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -48,7 +48,7 @@
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
$(document).on('click', 'li .onoff', function () {
|
$(document).on('click', 'li .map-block .onoff', function () {
|
||||||
$(this).parents("li").toggleClass("disabled");
|
$(this).parents("li").toggleClass("disabled");
|
||||||
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
|
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
|
||||||
$(this).text("<%= t('off_upcase') %>")
|
$(this).text("<%= t('off_upcase') %>")
|
||||||
|
|
|
@ -1,5 +1,126 @@
|
||||||
|
<%= stylesheet_link_tag "lib/wrap-nav" %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
|
<%= stylesheet_link_tag "lib/fileupload.css" %>
|
||||||
|
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||||
|
<%= stylesheet_link_tag "lib/list-check.css" %>
|
||||||
|
|
||||||
|
<%= javascript_include_tag "lib/site_set" %>
|
||||||
|
<%= javascript_include_tag "lib/list-check" %>
|
||||||
|
|
||||||
<% content_for :side_bar do %>
|
<% 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'} %>
|
<%= 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 %>
|
<% end %>
|
||||||
|
|
||||||
system_info.html.erb
|
<form class="form-horizontal main-forms">
|
||||||
|
<fieldset>
|
||||||
|
<div class="input-area">
|
||||||
|
<div class="nav-name"><strong><%= t("preferences.classification") %></strong></div>
|
||||||
|
<ul class="nav nav-pills language-nav">
|
||||||
|
<li class="active"><a href="#overview" data-toggle="tab"><%= t("site.system_preference_.tab_summary") %></a></li>
|
||||||
|
<li><a href="#mail-cron-logs" data-toggle="tab"><%= t("site.system_preference_.tab_send_reminders_log") %></a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<!-- Overview -->
|
||||||
|
<div id="overview" class="tab-pane fade in active">
|
||||||
|
<h3 class="muted"><%= t("site.system_preference_.summary.disk_space") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @disk_free %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
<h3 class="muted">Nginx <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @nginx_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
</span>
|
||||||
|
<h3 class="muted">MongoDB <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @mongo_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
<h3 class="muted">Linux <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @linux_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Email Log -->
|
||||||
|
<div id="mail-cron-logs" class="tab-pane fade">
|
||||||
|
<ul class="nav nav-pills">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#send-log" data-toggle="tab"><%= t(:email_log) %></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#waiting-sent" data-toggle="tab"><%= t(:email_queue) %></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane fade in active list-check" id="send-log">
|
||||||
|
<p class="">
|
||||||
|
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
|
||||||
|
</p>
|
||||||
|
<table class="table main-list table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<input type="checkbox" name="to_delete[]" value="b" />
|
||||||
|
</th>
|
||||||
|
<th><%= t(:sent_date) %></th>
|
||||||
|
<th><%= t(:subject) %></th>
|
||||||
|
<th><%= t(:mail_to) %></th>
|
||||||
|
<th><%= t(:mail_user) %></th>
|
||||||
|
<th><%= t(:mail_from_app) %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane fade in list-check" id="waiting-sent">
|
||||||
|
<p class="">
|
||||||
|
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
|
||||||
|
</p>
|
||||||
|
<table class="table main-list table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<input type="checkbox" name="to_delete[]" value="b" />
|
||||||
|
</th>
|
||||||
|
<th><%= t(:sent_date) %></th>
|
||||||
|
<th><%= t(:subject) %></th>
|
||||||
|
<th><%= t(:mail_to) %></th>
|
||||||
|
<th><%= t(:mail_from_app) %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||||
|
<div class="modal-header">
|
||||||
|
<a class="close" data-dismiss="modal">×</a>
|
||||||
|
<h3><%= t(:sure?) %></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<span class="text-warning text-center"><%= t(:this_action_can_not_be_restore) %></span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
|
||||||
|
<button class="delete-item btn btn-danger"><%= t(:delete_) %></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,245 @@
|
||||||
|
<% 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>
|
|
@ -60,7 +60,11 @@
|
||||||
<span class="item-price">Free</span>
|
<span class="item-price">Free</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<%= link_to "Download", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-primary download-link' %>
|
<% if @design_ids.include?(template["_id"]["$oid"]) %>
|
||||||
|
<%= link_to "Installed", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-success download-link', "disabled"=>"disabled", "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "Download", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-primary download-link', "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -71,20 +75,20 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(){
|
(function(){
|
||||||
$("a.download-link").on(clickEvent,function(){
|
$("a.download-link").on(clickEvent,function(){
|
||||||
var el = $(this),
|
if($(this).attr("disabled") == "disabled")return false;
|
||||||
downloadurl = $(this).data("url");
|
var el = $(this);
|
||||||
|
|
||||||
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "<%= admin_template_store_download_theme_path %>",
|
url : "<%= admin_template_store_download_theme_path %>",
|
||||||
data : {"url" : downloadurl},
|
data : el.data(),
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post"
|
||||||
success : function(data){
|
}).done(function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
||||||
}
|
}
|
||||||
}
|
}).fail(function(){
|
||||||
|
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
<div id="item-info">
|
<div id="item-info">
|
||||||
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
|
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
|
||||||
<h2 class="item-name"><%= @template['title'] %></h2>
|
<h2 class="item-name"><%= @template['title'] %></h2>
|
||||||
<%= link_to "Download", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-primary download-link' %>
|
<% if @design_ids.include?(@template["_id"]["$oid"]) %>
|
||||||
|
<%= link_to "Installed", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-success download-link', "disabled"=>"disabled", "data-name"=>@template['title'], "data-slug"=>@template["_slugs"][0], "data-id"=>@template["_id"]["$oid"] %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "Download", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-primary download-link', "data-name"=>@template['title'], "data-slug"=>@template["_slugs"][0], "data-id"=>@template["_id"]["$oid"] %>
|
||||||
|
<% end %>
|
||||||
<ul class="item-extra-info">
|
<ul class="item-extra-info">
|
||||||
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
||||||
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
|
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
|
||||||
|
@ -64,21 +68,22 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(){
|
(function(){
|
||||||
$("a.download-link").on(clickEvent,function(){
|
$("a.download-link").on(clickEvent,function(){
|
||||||
var el = $(this),
|
if($(this).attr("disabled") == "disabled")return false;
|
||||||
downloadurl = $(this).data("url");
|
var el = $(this);
|
||||||
|
|
||||||
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "<%= admin_template_store_download_theme_path %>",
|
url : "<%= admin_template_store_download_theme_path %>",
|
||||||
data : {"url" : downloadurl},
|
data : el.data(),
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post"
|
||||||
success : function(data){
|
}).done(function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
||||||
}
|
}
|
||||||
}
|
}).fail(function(){
|
||||||
|
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<ul class="nav nav-pills">
|
<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(: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("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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
<div id="module-content">
|
<div id="module-content">
|
||||||
<div class="nano">
|
<div class="nano">
|
||||||
<div class="content">
|
<div class="content list-check">
|
||||||
<%=render :partial => @right_partial %>
|
<%=render :partial => @right_partial %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,62 +1,59 @@
|
||||||
|
<section id="main-wrap">
|
||||||
|
|
||||||
<div class="sign-in have-other-sign-in">
|
<div class="sign-in have-other-sign-in">
|
||||||
|
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
||||||
<% flash.each do |key, msg| %>
|
-->
|
||||||
<%= content_tag :p, msg, :class => [key, "alert alert-error"] %>
|
<% flash.each do |key, msg| %>
|
||||||
|
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="form">
|
||||||
<div class="form">
|
<h3 class="login-logo">Log In to Orbit</h3>
|
||||||
<h3 class="login-logo"><%= t(:login) %></h3>
|
<div>
|
||||||
<div class="other-sign-in">
|
<input name="utf8" type="hidden" value="" />
|
||||||
<% @request_hosts = request.host_with_port.split(".") %>
|
<input name="authenticity_token" type="hidden" value="" />
|
||||||
<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>
|
|
||||||
<p>or</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="other-sign-in">
|
||||||
|
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
||||||
|
<p>or</p>
|
||||||
|
</div> -->
|
||||||
<div class="form-block">
|
<div class="form-block">
|
||||||
<div class="form-list clearfix">
|
<div class="form-list clearfix">
|
||||||
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'content'} do |f| %>
|
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||||
|
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'content'} do |f| %>
|
||||||
|
|
||||||
<div class="control-group clear">
|
<div class="control-group clear">
|
||||||
<label for="user_email">
|
<label for="user_email">
|
||||||
<i class="icon-user"></i>
|
<i class="icon-user"></i>
|
||||||
</label>
|
</label>
|
||||||
<%= f.text_field :user_id, :placeholder => t("users.user_id") %>
|
<%= f.text_field :user_id, :placeholder => t("users.user_id"), :id=>"user_email" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group clear">
|
<div class="control-group clear">
|
||||||
<label for="user_password">
|
<label for="user_password">
|
||||||
<i class="icon-lock"></i>
|
<i class="icon-lock"></i>
|
||||||
</label>
|
</label>
|
||||||
<%= f.password_field :password, :placeholder => t(:dots) %>
|
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
||||||
</div>
|
</div>
|
||||||
<!-- <label class="checkbox">
|
<br/>
|
||||||
<input type="checkbox" value="">
|
<label class="checkbox">
|
||||||
<small>Remember me</small>
|
<% if devise_mapping.rememberable? -%>
|
||||||
</label> -->
|
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
|
||||||
|
<% end -%>
|
||||||
|
</label>
|
||||||
|
|
||||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||||
<% end %>
|
</form>
|
||||||
|
|
||||||
<!-- <form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
|
||||||
<div class="control-group clear">
|
|
||||||
<label for="user_email">
|
|
||||||
<i class="icon-user"></i>
|
|
||||||
</label>
|
|
||||||
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
|
|
||||||
</div>
|
|
||||||
<div class="control-group clear">
|
|
||||||
<label for="user_password">
|
|
||||||
<i class="icons-mail"></i>
|
|
||||||
</label>
|
|
||||||
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
|
|
||||||
</div>
|
|
||||||
<button class="btn btn-primary" type="submit">Submit</button>
|
|
||||||
</form> -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="switchboard"><span>Forgot Password ?</span> <i class="icons-arrow-left-2"></i></div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="register">
|
<div class="pull-right">
|
||||||
|
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<!-- <div class="register">
|
||||||
<button class="btn btn-inverse" type="submit">Register</button>
|
<button class="btn btn-inverse" type="submit">Register</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
|
@ -56,11 +56,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
||||||
<div class="other-sign-in">
|
|
||||||
<% @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>
|
|
||||||
<p>or</p>
|
|
||||||
</div>
|
|
||||||
<div class="input-prepend">
|
<div class="input-prepend">
|
||||||
<span class="add-on">
|
<span class="add-on">
|
||||||
<i class="icon-user"></i>
|
<i class="icon-user"></i>
|
||||||
|
@ -89,4 +84,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
|
@ -1,7 +1,7 @@
|
||||||
<div id="sidebar-menu">
|
<div id="sidebar-menu">
|
||||||
<div class="scroller">
|
<div class="scroller">
|
||||||
<ul class="sidebar-nav">
|
<ul class="sidebar-nav">
|
||||||
<% OrbitApp::Module::SideBarRegisition.all.each do |t| %>
|
<% OrbitApp::Module::SideBarRegisition.all.sort{|x,y| x.get_module_app_key <=> y.get_module_app_key}.each do |t| %>
|
||||||
<%= t.render_head(request, params, current_user, @module_app) %>
|
<%= t.render_head(request, params, current_user, @module_app) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sub-nav-block-list">
|
<div class="sub-nav-block-list">
|
||||||
<% OrbitApp::Module::SideBarRegisition.all.each do |t| %>
|
<% OrbitApp::Module::SideBarRegisition.all.sort{|x,y| x.get_module_app_key <=> y.get_module_app_key}.each do |t| %>
|
||||||
<%= t.render(request, params, current_user, @module_app) %>
|
<%= t.render(request, params, current_user, @module_app) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
function InsertPreviewImage(){
|
function InsertPreviewImage(){
|
||||||
if($("iframe").contents().find('.news_image').length){
|
if($("iframe").contents().find('.news_image').length){
|
||||||
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' height='240' /></a>");
|
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' /></a>");
|
||||||
}else{
|
}else{
|
||||||
setTimeout(InsertPreviewImage,1000);
|
setTimeout(InsertPreviewImage,1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,15 +63,5 @@ Orbit::Application.configure do
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.perform_deliveries = true
|
config.action_mailer.perform_deliveries = true
|
||||||
config.action_mailer.raise_delivery_errors = true
|
config.action_mailer.raise_delivery_errors = true
|
||||||
config.action_mailer.smtp_settings = {
|
|
||||||
:enable_starttls_auto => true,
|
|
||||||
:openssl_verify_mode => 'none',
|
|
||||||
:address => 'smtp.sendgrid.net',
|
|
||||||
:port => '587',
|
|
||||||
:domain => "new.tp.rulingcom.com",
|
|
||||||
:authentication => "plain",
|
|
||||||
:user_name => "rulingcom",
|
|
||||||
:password => "bjo4xjp6"
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
if defined?(PhusionPassenger)
|
||||||
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
||||||
|
if forked
|
||||||
|
Resque.redis.client.disconnect
|
||||||
|
Resque.redis = Redis.new(:host => 'localhost', :port => 6379)
|
||||||
|
Resque.redis.namespace = Site.first.resque_namespace rescue APP_CONFIG['orbit']
|
||||||
|
else
|
||||||
|
# We're in conservative spawning mode. We don't need to do anything.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,2 @@
|
||||||
|
data = File.open(File.join(Rails.root, 'config', 'store_config.yml')).read
|
||||||
|
STORE_CONFIG = YAML::load(ERB.new(data).result(binding)).symbolize_keys
|
|
@ -80,27 +80,3 @@ default_widget_style:
|
||||||
- style3
|
- style3
|
||||||
- style4
|
- style4
|
||||||
- style5
|
- style5
|
||||||
|
|
||||||
sites:
|
|
||||||
coph:
|
|
||||||
url: coph.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzpqn0cXyC98jZ2hk4F8W\n0K7qgNSqHvH8unxCbgEuxWvkUA1ld2NMfsj9fTl9f2UlhPtwiaZchVAFSDjpYeQD\nH3A5XtlonUXfTD5XdnKBvk6WtKl7cFuyhIazcxp3MA8/cmSuGbXIjyZLMiUkElZg\n5CZ/1n+yhGFjXQz/d4d8W7sN7AjmhHjTi5vgJF4fkaSr1g6TwWJfLhhzzYsva2z/\nDRkQl3OpUEbSQP1X9/RmManDrYpn7Wrqi9Joqu7rPk0Grki8lCo5T/kaEsQ0wKte\nt7N9QRCBM/f2tOYoH+elitnOJq9zAtAtGaw80xso/GkjMHhcmPnI2YZ90yy1Fvau\nOwIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
dph:
|
|
||||||
url: dph.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0wNXuqsY6iHiPORSA+M1\nQzzoepGnJGSP92VszqTp7M+rDf6R98J+jFzG4YkMMUaFids4sXTwVp3zfgmhfl5k\nLJiufcXk9U5HYQ5b88kW+8BOAj9GBMQ7tDTw5hkFGL98anAAxZgW/FVovlAr3jv7\nei5/MBRPwctuOYhR4s9Mh47tbCnMFOswyjErEp5OfkbTo+qar44f2m4d1RVPTM1k\n0RCU65+0syw+hYgg01yRuWkSNzHie5FOVD7CujWeTD2CVZFh72kaGLp99ExOtrM3\n7AzS8duVmty/f7RG8DiJdB4a/mcHjcanlBLcowoo3FaaA1Arg1DkdjH0zwB2UVMs\nEQIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
ntuhpm:
|
|
||||||
url: ntuhpm.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/kK75YjD3Yvv9wacE0+\ncImWxnVcVFXhtG5T8Hm0tkit3OroJ2BobWHe23QBThnzXCF4+S1XosYw60XPNAKk\nrmImHry9lG2iz/UfXwj49AfMHOw0tpOcf2UHiVAZUKb9zZRAEDL6WbhVQ5C/9jZ1\nKWtrcArRxck1tivgT5tUaKrCHrnj9/jo6eAHiKg0CsEfS0hlXQFfo7/2kBZc0oBq\ntuVyoDADaY1PoyvqzHxZC3eyUTjURVa0+Lkpw9d9jbSUNnf2XfEi51Rt79PlrtNj\naxsQ2UKhz0xYouTXQPt9Mc+vxow9bvd1CPr52ywX37sjRlmOQ4gpcxEPa21bRevW\nwwIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
epm:
|
|
||||||
url: epm.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0pl5F02WcZC+YLDuowl7\nE2VbgXS/V4R1/pRryGCkuZFBQ5DRw6055dhDp8lribEUYRTk8Y8EUIM+8A1A80Y1\nJqaAhF/ZUE7Io1boqdf0XeRgAmQF4bCphLCSVTz6v2AeAQaS7btUqrLr3t7Ldbso\nbnXQ8qKxsBGTtuvIID5zx2JyRuO1U740KEbt7l5Nnb6zSYYHayOHzsS4FS4HmCa/\nK+1jQcnpis1k7tp/s3tif/9a8t4IjwuxyKI6PEUoyGTZYG9hyrTvoTGobR9g+r6s\n8IluoAauG6IlSjl92sL6D6p+BYS3VsFn+2mznrjgKl9TVt8HfQSgECgfyUAS/OgC\n3wIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
ieh:
|
|
||||||
url: ieh.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvtmUdzHwAE+b1Bt2HGSr\ny/o8rA4fWIpc9zTn4jXkAoH7yQMO0WsneMn1KxE0eUmhHiGaZGQLGrixxQ9ZG9DP\n1fe41IGRKZRt7ep5rpXQFCXxEwBV+CAmdVpwGM0ji3l9tL4CwKkX+ObmUiorQZLG\nAxQHAWpFdM7foiTNw37vqTm8TDIcCu0HXSV+Mb6IydbpQbvYTHdHN2wlgfIa41qU\nWhYqHckKimvApJCsIDHd8ZF32EuOaalfGFvYB7de7Z1Tn9YLvIqgPgIj6o89q4UK\n5EAr1E6kKX9jk3ru5r0u/EEL0zADdbJAWuops4a+XRdPaZMXqngdlEbcxwKTryU+\ncwIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
omih:
|
|
||||||
url: omih.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwgyfe4FFBnE6If3TH/L7\nVm43BYEunoK6ItBC9VccUGrhT3ZD5gAdnNC5OkR8HIUEBxtzvD57CsHaaGKrxxAf\nd8XJh5nXZCg5RaoQVaBNjFBmOPm4jZAWPUFPuGRow8Uzs/LzA5HNew196g+qWayB\nglTyX2TJUAADyx6Peq4ZNqEBBB68n4DyugXzfvlk0yXsrLDtbM44bzOhRuosKa7Y\nung+IonA5lqr2mJDrTMDOupIAgW6/4xO7ww2e/pMOVtfoVSw+5YfXFBGCbRjGKwT\nZ4b7whRBBuRd1lgWhQrzOikb+/NtEVQWLpWPpSeTFx5sIUyb5PmQTXtRxZX1xNcS\neQIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
mph:
|
|
||||||
url: mph.ntu.edu.tw
|
|
||||||
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7rlich0iWAWKUhT7pHji\nOHeEURjnykiX5ElkBD7twy5UyagiD9wVeBOi7mElaJjcR84WfoZVTJVbI08/a5KY\neFURiOy4CigwIFyiDKhwMH5XETuQD96JFqClZGgfxaZAtt9IEpqE3HbqGpPh/0Oc\noLP6Pez8icDYqShZrrZioQZ9XshlZJ6Xt2iStMHNucKHrptMylvtHo6sp/Uy00jC\nubbtH7cvAbQf/Ee/jbGWWMyVwjko1h8u1pMtQlXIC6R0UP6yfCAg7c/0P9eb33OE\n2B6t9i/7kdqTysyKvf6jdDeJeyDYxZVFFXEETu5TzffdhrEK67KAot3J3hi0Qwq7\nvQIDAQAB\n-----END PUBLIC KEY-----\n"
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,6 @@ en:
|
||||||
user_list: Unit
|
user_list: Unit
|
||||||
approval_: Approval
|
approval_: Approval
|
||||||
approval_setting: Approval setting
|
approval_setting: Approval setting
|
||||||
archive: Archive
|
|
||||||
asset: Asset
|
asset: Asset
|
||||||
attributes: Attributes
|
attributes: Attributes
|
||||||
auth:
|
auth:
|
||||||
|
@ -193,6 +192,8 @@ en:
|
||||||
link: Editing link
|
link: Editing link
|
||||||
page: Editing page
|
page: Editing page
|
||||||
email: Email
|
email: Email
|
||||||
|
email_log: Email Log
|
||||||
|
email_queue: Waiting to be sent
|
||||||
enable: Enable
|
enable: Enable
|
||||||
enabled_for: Enabled for
|
enabled_for: Enabled for
|
||||||
end: End
|
end: End
|
||||||
|
@ -224,11 +225,13 @@ en:
|
||||||
groups: Groups
|
groups: Groups
|
||||||
help: Help
|
help: Help
|
||||||
hidden: Hidden
|
hidden: Hidden
|
||||||
|
is_hidden: Hidden
|
||||||
hide: Hide
|
hide: Hide
|
||||||
hits: Hits
|
hits: Hits
|
||||||
homepage: Homepage
|
homepage: Homepage
|
||||||
horizontal: Horizontal
|
horizontal: Horizontal
|
||||||
hot: Hot
|
hot: Hot
|
||||||
|
is_hot: Hot
|
||||||
image: Image
|
image: Image
|
||||||
images: Images
|
images: Images
|
||||||
info: Information
|
info: Information
|
||||||
|
@ -262,7 +265,6 @@ en:
|
||||||
text_area: Text Area
|
text_area: Text Area
|
||||||
text_field: Text Field
|
text_field: Text Field
|
||||||
locale: Locale
|
locale: Locale
|
||||||
location: Location
|
|
||||||
login: Login
|
login: Login
|
||||||
logout: Logout
|
logout: Logout
|
||||||
mail:
|
mail:
|
||||||
|
@ -276,6 +278,9 @@ en:
|
||||||
setting: Mail settings
|
setting: Mail settings
|
||||||
tls: TLS
|
tls: TLS
|
||||||
user_name: User Name
|
user_name: User Name
|
||||||
|
mail_from_app: Mail From App
|
||||||
|
mail_to: Mail To
|
||||||
|
mail_user: Mail User
|
||||||
manager: Manager
|
manager: Manager
|
||||||
markup: Markup
|
markup: Markup
|
||||||
markup_options: Markup options
|
markup_options: Markup options
|
||||||
|
@ -342,19 +347,20 @@ en:
|
||||||
public_r_tag: System Widget
|
public_r_tag: System Widget
|
||||||
text: Text Area
|
text: Text Area
|
||||||
passed: Approved
|
passed: Approved
|
||||||
|
is_checked: Approved
|
||||||
password: Password
|
password: Password
|
||||||
password_change: Change password
|
password_change: Change password
|
||||||
password_confirmation: Password confirmation
|
password_confirmation: Password confirmation
|
||||||
password_current: Current password
|
password_current: Current password
|
||||||
pending: Pending
|
pending: Pending
|
||||||
|
is_pending: Pending
|
||||||
personal_plugins:
|
personal_plugins:
|
||||||
author : "Author"
|
author : "Author"
|
||||||
edit_brief_intro : "Edit Brief Intro."
|
edit_brief_intro : "Edit Brief Intro."
|
||||||
brief_intro : "Brief Intro."
|
brief_intro : "Brief Intro."
|
||||||
complete_list : "Complete List"
|
complete_list : "Complete List"
|
||||||
frontend_page : "Frontend Page"
|
frontend_page : "Frontend Page"
|
||||||
phone_number: "Phone Number"
|
phone_number: "Phone Number"
|
||||||
sync_data: "Synchronize"
|
|
||||||
picture: Picture
|
picture: Picture
|
||||||
placeholder: Field Hint
|
placeholder: Field Hint
|
||||||
plugins: Plugins
|
plugins: Plugins
|
||||||
|
@ -390,6 +396,7 @@ en:
|
||||||
register: Register
|
register: Register
|
||||||
registered: Registered
|
registered: Registered
|
||||||
rejected: Rejected
|
rejected: Rejected
|
||||||
|
is_rejected: Rejected
|
||||||
rejected_reason: 'Reason:'
|
rejected_reason: 'Reason:'
|
||||||
rejected_reason_empty: "Approval rejected, no referencable information"
|
rejected_reason_empty: "Approval rejected, no referencable information"
|
||||||
related_links: Related Links
|
related_links: Related Links
|
||||||
|
@ -427,6 +434,7 @@ en:
|
||||||
index: Index
|
index: Index
|
||||||
summary: Summary
|
summary: Summary
|
||||||
thumbnail: Thumbnail
|
thumbnail: Thumbnail
|
||||||
|
sent_date: Sent Date
|
||||||
settings: Site Setting
|
settings: Site Setting
|
||||||
site:
|
site:
|
||||||
backend_openness_on: Backend Openness
|
backend_openness_on: Backend Openness
|
||||||
|
@ -457,6 +465,7 @@ en:
|
||||||
tab_commits: Commits
|
tab_commits: Commits
|
||||||
tab_summary: Summary
|
tab_summary: Summary
|
||||||
tab_logs: Logs
|
tab_logs: Logs
|
||||||
|
tab_send_reminders_log: Send reminders log
|
||||||
summary:
|
summary:
|
||||||
code_update_at: Code Update histroy
|
code_update_at: Code Update histroy
|
||||||
disk_space: Disk Free
|
disk_space: Disk Free
|
||||||
|
@ -486,6 +495,7 @@ en:
|
||||||
sub_role: Sub Role
|
sub_role: Sub Role
|
||||||
sub_role_field: Sub Role Field
|
sub_role_field: Sub Role Field
|
||||||
sub_role_info: " Sub Role Info."
|
sub_role_info: " Sub Role Info."
|
||||||
|
subject: Subject
|
||||||
subtitle: Subtitle
|
subtitle: Subtitle
|
||||||
submit: Submit
|
submit: Submit
|
||||||
submit_approval: Submit approval
|
submit_approval: Submit approval
|
||||||
|
@ -509,10 +519,12 @@ en:
|
||||||
text: Text
|
text: Text
|
||||||
theme: Theme
|
theme: Theme
|
||||||
themes: Themes
|
themes: Themes
|
||||||
|
this_action_can_not_be_restore: This action can not be restored, are you sure you want to delete?
|
||||||
title: Title
|
title: Title
|
||||||
to_search: Set as Search Key
|
to_search: Set as Search Key
|
||||||
to_show: Display in frontend
|
to_show: Display in frontend
|
||||||
top: Top
|
top: Top
|
||||||
|
is_top: Top
|
||||||
total_visitors: Total Visitors
|
total_visitors: Total Visitors
|
||||||
traffic: Traffic
|
traffic: Traffic
|
||||||
type: Field Type
|
type: Field Type
|
||||||
|
@ -533,6 +545,18 @@ en:
|
||||||
success_: Successfully updated
|
success_: Successfully updated
|
||||||
update_: Update
|
update_: Update
|
||||||
update_at: Update at
|
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
|
upload: Upload
|
||||||
url: URL
|
url: URL
|
||||||
use_status: Use Statue
|
use_status: Use Statue
|
||||||
|
|
|
@ -86,7 +86,6 @@ zh_tw:
|
||||||
user_list: 使用者列表
|
user_list: 使用者列表
|
||||||
approval_: 審核
|
approval_: 審核
|
||||||
approval_setting: 審核設定
|
approval_setting: 審核設定
|
||||||
archive: 檔案室
|
|
||||||
asset: 資產
|
asset: 資產
|
||||||
attributes: 屬性
|
attributes: 屬性
|
||||||
auth:
|
auth:
|
||||||
|
@ -193,6 +192,8 @@ zh_tw:
|
||||||
link: 編輯連結
|
link: 編輯連結
|
||||||
page: 編輯頁面
|
page: 編輯頁面
|
||||||
email: 電子郵件
|
email: 電子郵件
|
||||||
|
email_log: 寄送紀錄
|
||||||
|
email_queue: 待寄送郵件
|
||||||
enable: 開啟
|
enable: 開啟
|
||||||
enabled_for: 啟用
|
enabled_for: 啟用
|
||||||
end: 結束
|
end: 結束
|
||||||
|
@ -264,7 +265,6 @@ zh_tw:
|
||||||
text_area: 文字輸入方塊
|
text_area: 文字輸入方塊
|
||||||
text_field: 文字輸入框
|
text_field: 文字輸入框
|
||||||
locale: 位置
|
locale: 位置
|
||||||
location: 地標
|
|
||||||
login: 登入
|
login: 登入
|
||||||
logout: 登出
|
logout: 登出
|
||||||
mail:
|
mail:
|
||||||
|
@ -278,6 +278,9 @@ zh_tw:
|
||||||
setting: 電子郵件設定
|
setting: 電子郵件設定
|
||||||
tls: 電子郵件TLS
|
tls: 電子郵件TLS
|
||||||
user_name: 電子郵件帳號
|
user_name: 電子郵件帳號
|
||||||
|
mail_from_app: 寄送模組
|
||||||
|
mail_to: 收件者
|
||||||
|
mail_user: 寄件者
|
||||||
manager: 管理者
|
manager: 管理者
|
||||||
markup: 輸入模式
|
markup: 輸入模式
|
||||||
markup_options: 標註選項
|
markup_options: 標註選項
|
||||||
|
@ -345,19 +348,20 @@ zh_tw:
|
||||||
public_r_tag: 系統模塊
|
public_r_tag: 系統模塊
|
||||||
text: 文字區域
|
text: 文字區域
|
||||||
passed: 通過審核
|
passed: 通過審核
|
||||||
|
is_checked: 通過審核
|
||||||
password: 密碼
|
password: 密碼
|
||||||
password_change: 更改密碼
|
password_change: 更改密碼
|
||||||
password_confirmation: 確認密碼
|
password_confirmation: 確認密碼
|
||||||
password_current: 目前的密碼
|
password_current: 目前的密碼
|
||||||
pending: 待審核
|
pending: 待審核
|
||||||
|
is_pending: 待審核
|
||||||
personal_plugins:
|
personal_plugins:
|
||||||
author : "著作人"
|
author : "著作人"
|
||||||
edit_brief_intro : "編輯摘要"
|
edit_brief_intro : "編輯摘要"
|
||||||
brief_intro : "摘要"
|
brief_intro : "摘要"
|
||||||
complete_list : "完整列表"
|
complete_list : "完整列表"
|
||||||
frontend_page : "前台呈現"
|
frontend_page : "前台呈現"
|
||||||
phone_number: "電話"
|
phone_number: "電話"
|
||||||
sync_data: "同步資料"
|
|
||||||
picture: 圖片
|
picture: 圖片
|
||||||
placeholder: 欄位提示文字
|
placeholder: 欄位提示文字
|
||||||
plugins: 學術資訊
|
plugins: 學術資訊
|
||||||
|
@ -392,6 +396,7 @@ zh_tw:
|
||||||
register: 註冊
|
register: 註冊
|
||||||
registered: 已註冊
|
registered: 已註冊
|
||||||
rejected: 拒絕
|
rejected: 拒絕
|
||||||
|
is_rejected: 拒絕
|
||||||
rejected_reason: 拒絕原因:'
|
rejected_reason: 拒絕原因:'
|
||||||
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
|
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
|
||||||
related_links: 相關連結
|
related_links: 相關連結
|
||||||
|
@ -429,6 +434,7 @@ zh_tw:
|
||||||
index: 檢索
|
index: 檢索
|
||||||
summary: 摘要
|
summary: 摘要
|
||||||
thumbnail: 縮圖
|
thumbnail: 縮圖
|
||||||
|
sent_date: 寄送日期
|
||||||
settings: 基本設定
|
settings: 基本設定
|
||||||
site:
|
site:
|
||||||
frontend_closed: 前台關閉?
|
frontend_closed: 前台關閉?
|
||||||
|
@ -459,6 +465,7 @@ zh_tw:
|
||||||
tab_commits: 程式版本
|
tab_commits: 程式版本
|
||||||
tab_summary: 總覽
|
tab_summary: 總覽
|
||||||
tab_logs: 排程工作日誌
|
tab_logs: 排程工作日誌
|
||||||
|
tab_send_reminders_log: 寄送提醒紀錄
|
||||||
summary:
|
summary:
|
||||||
code_update_at: 程式更新紀錄
|
code_update_at: 程式更新紀錄
|
||||||
disk_space: 硬碟空間
|
disk_space: 硬碟空間
|
||||||
|
@ -488,6 +495,7 @@ zh_tw:
|
||||||
sub_role: 子身份
|
sub_role: 子身份
|
||||||
sub_role_field: 子身份欄位
|
sub_role_field: 子身份欄位
|
||||||
sub_role_info: 子身份資料
|
sub_role_info: 子身份資料
|
||||||
|
subject: 主題
|
||||||
subtitle: 副標題
|
subtitle: 副標題
|
||||||
submit: 送出
|
submit: 送出
|
||||||
submit_approval: 送出已核准
|
submit_approval: 送出已核准
|
||||||
|
@ -511,6 +519,7 @@ zh_tw:
|
||||||
text: 內文
|
text: 內文
|
||||||
theme: 套用頁面樣式
|
theme: 套用頁面樣式
|
||||||
themes: 主題
|
themes: 主題
|
||||||
|
this_action_can_not_be_restore: 刪除後將無法還原,您確定要刪除嗎?
|
||||||
title: 標題
|
title: 標題
|
||||||
to_search: 加入搜尋條件
|
to_search: 加入搜尋條件
|
||||||
to_show: 是否顯示於前台
|
to_show: 是否顯示於前台
|
||||||
|
@ -536,6 +545,18 @@ zh_tw:
|
||||||
success_: 使用者已更新成功
|
success_: 使用者已更新成功
|
||||||
update_: 更新
|
update_: 更新
|
||||||
update_at: 最後更新時間
|
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: 上傳
|
upload: 上傳
|
||||||
url: 網址
|
url: 網址
|
||||||
use_status: 使用狀態
|
use_status: 使用狀態
|
||||||
|
|
|
@ -8,13 +8,13 @@ defaults: &defaults
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: ntu_mb_orbit_2_new
|
database: orbit_site_new
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: ntu_mb_orbit_2_new
|
database: orbit_site_new
|
||||||
|
|
||||||
# set these environment variables on your prod server
|
# set these environment variables on your prod server
|
||||||
production:
|
production:
|
||||||
|
@ -24,4 +24,4 @@ production:
|
||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: ntu_mb_orbit_2_new
|
database: orbit_site_new
|
||||||
|
|
|
@ -7,13 +7,6 @@ Orbit::Application.routes.draw do
|
||||||
resources :passwords, :except => [:index, :show, :destroy]
|
resources :passwords, :except => [:index, :show, :destroy]
|
||||||
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
||||||
end
|
end
|
||||||
|
|
||||||
devise_scope :user do
|
|
||||||
get 'user_login' => 'sessions#create'
|
|
||||||
match 'user_logout' => 'sessions#destroy'
|
|
||||||
end
|
|
||||||
|
|
||||||
match "saml_login" => 'saml_logins#index'
|
|
||||||
|
|
||||||
mount Resque::Server, :at => "/admin/resque"
|
mount Resque::Server, :at => "/admin/resque"
|
||||||
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
||||||
|
@ -219,20 +212,12 @@ Orbit::Application.routes.draw do
|
||||||
get 'change_design'
|
get 'change_design'
|
||||||
get 'reset_default_locale'
|
get 'reset_default_locale'
|
||||||
get 'preference'
|
get 'preference'
|
||||||
|
get 'update_manager'
|
||||||
|
get 'get_update_history'
|
||||||
|
get 'check_updates'
|
||||||
|
get 'update_orbit'
|
||||||
|
get 'restart_server'
|
||||||
end
|
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"
|
|
||||||
get "import_data/sync_book_data_auto"
|
|
||||||
get "import_data/sync_journal_paper_data_auto"
|
|
||||||
get "import_data/sync_conference_data_auto"
|
|
||||||
|
|
||||||
resources :tags do
|
resources :tags do
|
||||||
collection do
|
collection do
|
||||||
|
@ -277,6 +262,7 @@ Orbit::Application.routes.draw do
|
||||||
|
|
||||||
match 'module_store' => 'module_store#index'
|
match 'module_store' => 'module_store#index'
|
||||||
match 'module_store/show' => 'module_store#show'
|
match 'module_store/show' => 'module_store#show'
|
||||||
|
match 'module_store/download' => 'module_store#download'
|
||||||
match 'template_store' => 'template_store#index'
|
match 'template_store' => 'template_store#index'
|
||||||
match 'template_store/download_theme' => "template_store#download_theme"
|
match 'template_store/download_theme' => "template_store#download_theme"
|
||||||
match 'template_store/template/:id' => 'template_store#show', :as => :template_store_template
|
match 'template_store/template/:id' => 'template_store#show', :as => :template_store_template
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Use this file to easily define all of your cron jobs.
|
|
||||||
#
|
|
||||||
# It's helpful, but not entirely necessary to understand cron before proceeding.
|
|
||||||
# http://en.wikipedia.org/wiki/Cron
|
|
||||||
|
|
||||||
# Example:
|
|
||||||
#
|
|
||||||
# set :output, "/path/to/my/cron_log.log"
|
|
||||||
#
|
|
||||||
every 1.day, :at => '11:00 pm' do
|
|
||||||
# command "/usr/bin/some_great_command"
|
|
||||||
# runner "MyModel.some_method"
|
|
||||||
rake "rake synchronize:data"
|
|
||||||
end
|
|
||||||
#
|
|
||||||
# every 4.days do
|
|
||||||
# runner "AnotherModel.prune_old_records"
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Learn more: http://github.com/javan/whenever
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
store_settings:
|
||||||
|
url: "http://store.tp.rulingcom.com"
|
|
@ -234,7 +234,7 @@ module OrbitCoreLib
|
||||||
when :sub_manager
|
when :sub_manager
|
||||||
@open ||= check_sub_manager
|
@open ||= check_sub_manager
|
||||||
when :approver
|
when :approver
|
||||||
@open ||= check_sub_manager
|
@open ||= check_approver
|
||||||
when :user
|
when :user
|
||||||
@open ||= true
|
@open ||= true
|
||||||
when :visitor
|
when :visitor
|
||||||
|
|
|
@ -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
|
|
|
@ -1,12 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
namespace :synchronize do
|
|
||||||
desc "synchronize tasks"
|
|
||||||
task :data => :environment do
|
|
||||||
p Admin::ImportDataController.new.sync_book_data_auto
|
|
||||||
puts "Book Data Synchronization Complete"
|
|
||||||
p Admin::ImportDataController.new.sync_journal_paper_data_auto
|
|
||||||
puts "Journal Paper Data Synchronization Complete"
|
|
||||||
p Admin::ImportDataController.new.sync_conference_data_auto
|
|
||||||
puts "Conference Data Synchronization Complete"
|
|
||||||
end
|
|
||||||
end
|
|
BIN
orbitdefault.zip
BIN
orbitdefault.zip
Binary file not shown.
|
@ -4,9 +4,13 @@ zh_tw:
|
||||||
ad_banner: 廣告輪播
|
ad_banner: 廣告輪播
|
||||||
banner: 橫幅
|
banner: 橫幅
|
||||||
banner_name: 橫幅名稱
|
banner_name: 橫幅名稱
|
||||||
banner_name_note: 橫幅名稱只能為英文
|
name_only_english: 橫幅名稱只能為英文
|
||||||
|
edit_banner: 編輯橫幅
|
||||||
|
enter_number: 請輸入數字
|
||||||
|
enter_url: 請輸入網址
|
||||||
ste: 轉換間隔時間
|
ste: 轉換間隔時間
|
||||||
ste_note: 請輸入秒數
|
number_seconds: 請輸入秒數
|
||||||
|
number_milliseconds: 請輸入毫秒數
|
||||||
best_size: 最佳尺寸
|
best_size: 最佳尺寸
|
||||||
effect: 效果
|
effect: 效果
|
||||||
all: 全部
|
all: 全部
|
||||||
|
@ -16,3 +20,4 @@ zh_tw:
|
||||||
size: 大小
|
size: 大小
|
||||||
transition_interval: 轉換間隔時間
|
transition_interval: 轉換間隔時間
|
||||||
transition_speed: 轉換速度
|
transition_speed: 轉換速度
|
||||||
|
type: 類型
|
||||||
|
|
|
@ -10,6 +10,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
|
params['bulletin']['image'] = nil
|
||||||
bulletin = Bulletin.new params
|
bulletin = Bulletin.new params
|
||||||
@preview_obj = bulletin.to_preview
|
@preview_obj = bulletin.to_preview
|
||||||
@preview_obj.save
|
@preview_obj.save
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||||
<ul class="o-members-info">
|
<ul class="o-members-info">
|
||||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale) rescue ""
|
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||||
if @job_title != 'NoData' and !@job_title.blank?
|
if @job_title != 'NoData' and !@job_title.blank?
|
||||||
%>
|
%>
|
||||||
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
||||||
|
|
|
@ -92,16 +92,6 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
|
||||||
width: $(".overview").width() - 20
|
width: $(".overview").width() - 20
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initializePersonalBook.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initializePersonalBook.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initializePersonalBook.coAuthorformCallback = function(data){
|
this.initializePersonalBook.coAuthorformCallback = function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
@per_column = 5
|
@per_column = 5
|
||||||
@userid = current_user.id
|
|
||||||
case @view_by
|
case @view_by
|
||||||
when "abstract"
|
when "abstract"
|
||||||
@per_column = 1
|
@per_column = 1
|
||||||
|
@ -70,4 +70,4 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||||
def books_window
|
def books_window
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
end
|
end
|
15
vendor/built_in_modules/personal_book/app/models/writing_book.rb
vendored
Executable file → Normal file
15
vendor/built_in_modules/personal_book/app/models/writing_book.rb
vendored
Executable file → Normal file
|
@ -84,13 +84,20 @@ class WritingBook
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = []
|
||||||
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
|
title << self.authors if self.authors.present?
|
||||||
title << self.paper_title if self.paper_title.present?
|
|
||||||
|
# title << self.paper_title if self.paper_title.present?
|
||||||
title << self.book_title if self.book_title.present?
|
title << self.book_title if self.book_title.present?
|
||||||
title << self.publisher if self.publisher.present?
|
title << self.publisher if self.publisher.present?
|
||||||
title << self.pages if self.pages.present?
|
title << self.isbn if self.isbn.present?
|
||||||
|
|
||||||
|
if !self.publish_date.nil?
|
||||||
|
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]+"/"+pd[1]
|
||||||
|
end
|
||||||
|
|
||||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -57,9 +57,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_book_data_path(:user_id=>@userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,4 +67,4 @@
|
||||||
<%= publication_record w, @view_by%>
|
<%= publication_record w, @view_by%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
7
vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb
vendored
Executable file → Normal file
7
vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb
vendored
Executable file → Normal file
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_book.year') %></th>
|
<th class="span1"><%= t('personal_book.year') %></th>
|
||||||
<th><%= t('personal_book.book_title') %></th>
|
<th><%= t('personal_book.book_title') %></th>
|
||||||
|
@ -75,9 +75,8 @@
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_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('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' %>
|
||||||
<%= 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>
|
</div>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
|
|
@ -42,10 +42,7 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){
|
||||||
this.initializeConferencePapers.cancelpaper = function(){
|
this.initializeConferencePapers.cancelpaper = function(){
|
||||||
o.highlight_sub_menu_item(0);
|
o.highlight_sub_menu_item(0);
|
||||||
}
|
}
|
||||||
this.initializeConferencePapers.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
var uploadFiles = function(){
|
var uploadFiles = function(){
|
||||||
$('#add_plugin_file a.add').click(function(){
|
$('#add_plugin_file a.add').click(function(){
|
||||||
var new_id = $(this).prev().attr('value');
|
var new_id = $(this).prev().attr('value');
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
|
||||||
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
||||||
page = params[:page]
|
page = params[:page]
|
||||||
page ||= 1
|
page ||= 1
|
||||||
@userid = current_user.id
|
|
||||||
if @view_by.nil?
|
if @view_by.nil?
|
||||||
@writing_conferences = @writing_conferences.asc(:paper_title)
|
@writing_conferences = @writing_conferences.asc(:paper_title)
|
||||||
else
|
else
|
||||||
|
|
14
vendor/built_in_modules/personal_conference/app/models/writing_conference.rb
vendored
Executable file → Normal file
14
vendor/built_in_modules/personal_conference/app/models/writing_conference.rb
vendored
Executable file → Normal file
|
@ -84,13 +84,21 @@ class WritingConference
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = ["#{self.paper_title}"]
|
title = []
|
||||||
|
|
||||||
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]
|
||||||
|
end
|
||||||
|
|
||||||
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.conference_title if self.conference_title.present?
|
title << self.conference_title if self.conference_title.present?
|
||||||
title << self.sponsor if self.sponsor.present?
|
|
||||||
title << self.location if self.location.present?
|
title << self.location if self.location.present?
|
||||||
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
|
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
|
||||||
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -58,10 +58,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_conference_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Conference Papers</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
7
vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/plugin/_profile.html.erb
vendored
Executable file → Normal file
7
vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/plugin/_profile.html.erb
vendored
Executable file → Normal file
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_conference.year') %></th>
|
<th class="span1"><%= t('personal_conference.year') %></th>
|
||||||
<th><%= t('module_name.personal_conference') %></th>
|
<th><%= t('module_name.personal_conference') %></th>
|
||||||
|
@ -75,9 +75,8 @@
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_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('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' %>
|
||||||
<%= 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>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('date_') %></th>
|
<th class="span2"><%= t('date_') %></th>
|
||||||
<th><%= t('personal_diploma.school_name') %></th>
|
<th><%= t('personal_diploma.school_name') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('date_') %></th>
|
<th class="span2"><%= t('date_') %></th>
|
||||||
<th><%= t('personal_experience.organizationt_title') %></th>
|
<th><%= t('personal_experience.organizationt_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_honor.year') %></th>
|
<th class="span1"><%= t('personal_honor.year') %></th>
|
||||||
<th><%= t('personal_honor.award_name') %></th>
|
<th><%= t('personal_honor.award_name') %></th>
|
||||||
|
|
|
@ -33,7 +33,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
||||||
}
|
}
|
||||||
this.initializeJournalPapers.paperDelete = function(data,dom){
|
this.initializeJournalPapers.paperDelete = function(data,dom){
|
||||||
var parent = dom.parent().parent().parent();
|
var parent = dom.parent().parent().parent();
|
||||||
// console.log(parent);
|
|
||||||
if(data.success){
|
if(data.success){
|
||||||
parent.hide("slide",function(){parent.remove();});
|
parent.hide("slide",function(){parent.remove();});
|
||||||
o.notify(data.msg,"success");
|
o.notify(data.msg,"success");
|
||||||
|
@ -43,10 +42,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
||||||
this.initializeJournalPapers.cancelpaper = function(){
|
this.initializeJournalPapers.cancelpaper = function(){
|
||||||
o.highlight_sub_menu_item(0);
|
o.highlight_sub_menu_item(0);
|
||||||
}
|
}
|
||||||
this.initializeJournalPapers.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
var uploadFiles = function(){
|
var uploadFiles = function(){
|
||||||
$('#add_plugin_file a.add').click(function(){
|
$('#add_plugin_file a.add').click(function(){
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
|
||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
@per_column = 5
|
@per_column = 5
|
||||||
@userid = current_user.id
|
|
||||||
case @view_by
|
case @view_by
|
||||||
when "abstract"
|
when "abstract"
|
||||||
@per_column = 1
|
@per_column = 1
|
||||||
|
|
|
@ -81,7 +81,6 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
||||||
"ajax-remote" => "delete",
|
"ajax-remote" => "delete",
|
||||||
"confirm-message" => t("sure?"),
|
"confirm-message" => t("sure?"),
|
||||||
"callback-method" => "paperDelete",
|
"callback-method" => "paperDelete",
|
||||||
"response-type" => "json",
|
|
||||||
"delete-item" => "true",
|
"delete-item" => "true",
|
||||||
:class => "journal_paper_delete admbg2 admtxt",
|
:class => "journal_paper_delete admbg2 admtxt",
|
||||||
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
||||||
|
|
18
vendor/built_in_modules/personal_journal/app/models/writing_journal.rb
vendored
Executable file → Normal file
18
vendor/built_in_modules/personal_journal/app/models/writing_journal.rb
vendored
Executable file → Normal file
|
@ -90,13 +90,21 @@ class WritingJournal
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = ["#{self.paper_title}"]
|
title = []
|
||||||
|
|
||||||
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
title << pd[0]
|
||||||
|
end
|
||||||
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.journal_title if self.journal_title.present?
|
title << self.journal_title if self.journal_title.present?
|
||||||
|
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||||
|
title << self.issue_no if (self.issue_no.present? && self.issue_no != "0")
|
||||||
|
title << "pp"+self.form_to_start+"-"+self.form_to_end if (self.form_to_start.present? && self.form_to_start != "0")
|
||||||
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
|
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
|
||||||
title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
title.join(', ')
|
||||||
title << "From Page: "+self.form_to_start if (self.form_to_start.present? && self.form_to_start != "0")
|
|
||||||
title << "To Page: "+self.form_to_end if (self.form_to_end.present? && self.form_to_end != "0")
|
|
||||||
title.join(', ')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_writing_journal_files=(var)
|
def new_writing_journal_files=(var)
|
||||||
|
|
|
@ -58,9 +58,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Journal Papers</a></div>
|
|
||||||
</div>
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,4 +68,4 @@
|
||||||
<%= publication_record w, @view_by%>
|
<%= publication_record w, @view_by%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
7
vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb
vendored
Executable file → Normal file
7
vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb
vendored
Executable file → Normal file
|
@ -44,7 +44,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_journal.year') %></th>
|
<th class="span1"><%= t('personal_journal.year') %></th>
|
||||||
<th><%= t('module_name.personal_journal') %></th>
|
<th><%= t('module_name.personal_journal') %></th>
|
||||||
|
@ -80,9 +80,8 @@
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.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('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' %>
|
||||||
<%= 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>
|
</div>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_lab.year') %></th>
|
<th class="span1"><%= t('personal_lab.year') %></th>
|
||||||
<th><%= t('personal_lab.lab_title') %></th>
|
<th><%= t('personal_lab.lab_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_patent.publication_date') %></th>
|
<th class="span2"><%= t('personal_patent.publication_date') %></th>
|
||||||
<th><%= t('personal_patent.patent_title') %></th>
|
<th><%= t('personal_patent.patent_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_project.period') %></th>
|
<th class="span2"><%= t('personal_project.period') %></th>
|
||||||
<th><%= t('personal_project.project_title') %></th>
|
<th><%= t('personal_project.project_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_research.publication_date') %></th>
|
<th class="span2"><%= t('personal_research.publication_date') %></th>
|
||||||
<th><%= t('personal_research.research_title') %></th>
|
<th><%= t('personal_research.research_title') %></th>
|
||||||
|
|
|
@ -199,6 +199,7 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@survey.survey_questions.all.each do |question|
|
@survey.survey_questions.all.each do |question|
|
||||||
new_question = @new_survey.survey_questions.new
|
new_question = @new_survey.survey_questions.new
|
||||||
question.attributes.each do |key, value|
|
question.attributes.each do |key, value|
|
||||||
|
@ -210,30 +211,32 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
question.survey_question_options.all.each do |option|
|
|
||||||
new_option = new_question.survey_question_options.new
|
# question.survey_question_options.all.each do |option|
|
||||||
option.attributes.each do |key, value|
|
# new_option = new_question.survey_question_options.new
|
||||||
unless ['_id', 'survey_question_id'].include? key
|
# option.attributes.each do |key, value|
|
||||||
if option.respond_to?(key + '_translations')
|
# unless ['_id', 'survey_question_id'].include? key
|
||||||
new_option.send(key + '_translations=', value)
|
# if option.respond_to?(key + '_translations')
|
||||||
else
|
# new_option.name_translations = value
|
||||||
new_option.write_attribute(key, value)
|
# else
|
||||||
end
|
# new_option.write_attribute(key, value)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
question.survey_question_radiogroups.all.each do |radiogroup|
|
# end
|
||||||
new_radiogroup = new_question.survey_question_radiogroups.new
|
|
||||||
radiogroup.attributes.each do |key, value|
|
# question.survey_question_radiogroups.all.each do |radiogroup|
|
||||||
unless ['_id', 'survey_question_id'].include? key
|
# new_radiogroup = new_question.survey_question_radiogroups.new
|
||||||
if radiogroup.respond_to?(key + '_translations')
|
# radiogroup.attributes.each do |key, value|
|
||||||
new_radiogroup.send(key + '_translations=', value)
|
# unless ['_id', 'survey_question_id'].include? key
|
||||||
else
|
# if radiogroup.respond_to?(key + '_translations')
|
||||||
new_radiogroup.write_attribute(key, value)
|
# new_option.name_translations = value
|
||||||
end
|
# else
|
||||||
end
|
# new_radiogroup.write_attribute(key, value)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
@new_survey.create_user_id = current_user.id
|
@new_survey.create_user_id = current_user.id
|
||||||
|
|
Reference in New Issue