Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb5579c064 | ||
|
|
b1c7c1b4c8 |
No files matched your search
@@ -18,7 +18,6 @@ gem 'kaminari'
|
|||||||
gem 'time_difference'
|
gem 'time_difference'
|
||||||
gem "acts_as_unvlogable"
|
gem "acts_as_unvlogable"
|
||||||
gem 'youtube_it'
|
gem 'youtube_it'
|
||||||
gem 'gotcha'
|
|
||||||
|
|
||||||
# gem "memcached", "~> 1.4.3"
|
# gem "memcached", "~> 1.4.3"
|
||||||
# gem "memcache-client"
|
# gem "memcache-client"
|
||||||
|
|||||||
@@ -1,58 +1,30 @@
|
|||||||
var banners = [];
|
|
||||||
var banner_index = 0;
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$.each($(".dymanic_load"),function(){
|
$.each($(".dymanic_load"),function(){
|
||||||
if($(this).attr("path")==''){
|
if($(this).attr("path")==''){$(this).html("App setting Failed");}
|
||||||
$(this).html("App setting Failed");
|
|
||||||
}else{
|
if($(this).attr("path")!=''){
|
||||||
// Check if this App is AD_Banner
|
ajax_load_proc($(this),$(this).attr("path"));
|
||||||
if($(this).attr("path").indexOf("show_banner")>0){
|
}
|
||||||
ajax_load_proc($(this),$(this).attr("path"),"true");
|
|
||||||
}else{
|
|
||||||
ajax_load_proc($(this),$(this).attr("path"),$(this).attr("path"));
|
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
});
|
|
||||||
|
|
||||||
$("#main_content").addClass("module");
|
$("#main_content").addClass("module");
|
||||||
});
|
});
|
||||||
|
|
||||||
function ajax_load_proc(wapper,url,isBanner){
|
function ajax_load_proc(wapper,url){
|
||||||
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
||||||
if (textSta == 'success') {
|
if (textSta == 'success') {
|
||||||
if(isBanner=="true"){
|
wapper.html(respText);
|
||||||
wapper.html(respText);
|
};
|
||||||
var banner = banners[banner_index];
|
if(textSta == 'error')
|
||||||
$(banner.banner_name+" > img").each(function(){
|
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
||||||
$(this).load(function(){ banner.image_loaded++; });
|
|
||||||
});
|
|
||||||
BannerCycle(banner_index);
|
|
||||||
banner_index++;
|
|
||||||
}else{
|
|
||||||
wapper.html(respText);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if(textSta == 'error')
|
|
||||||
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function BannerCycle(banner_index){
|
// Ad Banner FX code [start]
|
||||||
var banner = banners[banner_index];
|
function getTimeout() {
|
||||||
// Wait untill all images are loaded
|
return $(this).attr('time_to_next');
|
||||||
if (banner.image_loaded==$(banner.banner_name+" img").length){
|
}
|
||||||
$(banner.banner_name).cycle({
|
|
||||||
delay: -1000,
|
|
||||||
fx: banner.banner_fx,
|
|
||||||
timeout: banner.time_to_next,
|
|
||||||
pager: banner.banner_pager,
|
|
||||||
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
setTimeout("BannerCycle("+banner_index+")",500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(document).on('click', '.slideshow img', function()
|
$(document).on('click', '.slideshow img', function()
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
//= require basic/bootstrap
|
//= require basic/bootstrap
|
||||||
//= require kernel
|
//= require kernel
|
||||||
//= require lib/jquery.preload-min.js
|
//= require lib/jquery.preload-min.js
|
||||||
//= require lib/jquery.cycle.all.js
|
//= require lib/jquery.cycle.all.latest.js
|
||||||
@@ -40,7 +40,6 @@ class Admin::AdBannersController < OrbitBackendController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
@ad_banner = AdBanner.find(params[:id])
|
@ad_banner = AdBanner.find(params[:id])
|
||||||
render layout: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|||||||
@@ -34,30 +34,38 @@ class Admin::AuthorizationsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add_roles
|
def add_roles
|
||||||
roles = Role.find(params[:role_ids]) rescue nil
|
roles = Role.find(params[:role_ids]) rescue []
|
||||||
unless roles.nil?
|
users = []
|
||||||
|
roles.each do |role|
|
||||||
|
users += role.users.all.entries
|
||||||
|
end
|
||||||
|
unless roles.blank?
|
||||||
authorization = get_or_create_authorization
|
authorization = get_or_create_authorization
|
||||||
add_roles_to_auth(authorization, roles)
|
add_roles_to_auth(authorization, roles) unless @error
|
||||||
end
|
end
|
||||||
@users = authorization.authorized_users
|
@users = authorization.authorized_users
|
||||||
render 'admin/authorizations/reload_users'
|
render 'admin/authorizations/reload_users'
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_sub_roles
|
def add_sub_roles
|
||||||
sub_roles = SubRole.find(params[:sub_role_ids]) rescue nil
|
sub_roles = SubRole.find(params[:sub_role_ids]) rescue []
|
||||||
unless sub_roles.nil?
|
users = []
|
||||||
|
sub_roles.each do |sub_role|
|
||||||
|
users += sub_role.users.all.entries
|
||||||
|
end
|
||||||
|
unless sub_roles.blank?
|
||||||
authorization = get_or_create_authorization
|
authorization = get_or_create_authorization
|
||||||
add_sub_roles_to_auth(authorization, sub_roles)
|
add_sub_roles_to_auth(authorization, sub_roles) unless @error
|
||||||
end
|
end
|
||||||
@users = authorization.authorized_users
|
@users = authorization.authorized_users
|
||||||
render 'admin/authorizations/reload_users'
|
render 'admin/authorizations/reload_users'
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_users
|
def add_users
|
||||||
users = User.find(params[:user_ids]) rescue nil
|
users = User.find(params[:user_ids]) rescue []
|
||||||
unless users.nil?
|
unless users.blank?
|
||||||
authorization = get_or_create_authorization
|
authorization = get_or_create_authorization
|
||||||
add_users_to_auth(authorization, users)
|
add_users_to_auth(authorization, users) unless @error
|
||||||
end
|
end
|
||||||
@users = authorization.authorized_users
|
@users = authorization.authorized_users
|
||||||
render 'admin/authorizations/reload_users'
|
render 'admin/authorizations/reload_users'
|
||||||
@@ -112,6 +120,10 @@ class Admin::AuthorizationsController < OrbitBackendController
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def add_managers_to_auth(users)
|
||||||
|
@module_app.add_managers(users)
|
||||||
|
end
|
||||||
|
|
||||||
def add_roles_to_auth(authorization, roles)
|
def add_roles_to_auth(authorization, roles)
|
||||||
authorization.add_roles(roles)
|
authorization.add_roles(roles)
|
||||||
end
|
end
|
||||||
@@ -139,7 +151,7 @@ class Admin::AuthorizationsController < OrbitBackendController
|
|||||||
@error = t(:no_data)
|
@error = t(:no_data)
|
||||||
end
|
end
|
||||||
when nil
|
when nil
|
||||||
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: @module_app.key)
|
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}")
|
||||||
else
|
else
|
||||||
auth = @object.get_authorization_by_title("#{@type}_#{@module_app.key}")
|
auth = @object.get_authorization_by_title("#{@type}_#{@module_app.key}")
|
||||||
unless auth
|
unless auth
|
||||||
@@ -150,6 +162,10 @@ class Admin::AuthorizationsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_managers_from_auth(users)
|
||||||
|
@module_app.remove_manager(users)
|
||||||
|
end
|
||||||
|
|
||||||
def remove_roles_form_auth(authorization, roles)
|
def remove_roles_form_auth(authorization, roles)
|
||||||
authorization.remove_roles(roles)
|
authorization.remove_roles(roles)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,573 +0,0 @@
|
|||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
require 'net/http'
|
|
||||||
require 'open-uri'
|
|
||||||
|
|
||||||
class Admin::ImportDataController < OrbitBackendController
|
|
||||||
helper Admin::PagePartsHelper
|
|
||||||
include Admin::FrontendWidgetInterface
|
|
||||||
|
|
||||||
def get_teacher_data
|
|
||||||
uri = URI("https://localhost:8000/teachers.xml")
|
|
||||||
|
|
||||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
|
||||||
#uri.query = URI.encode_www_form(params)
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
|
|
||||||
@teacher_data = Hash.from_xml(res.body)
|
|
||||||
@teachers = @teacher_data["objects"]
|
|
||||||
@i = 5000
|
|
||||||
@teachers.each do |hash|
|
|
||||||
# @roles = Role.skip(1).first
|
|
||||||
@roles = Role.all
|
|
||||||
@teacher = User.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
if !hash['teacher_zh_tw'].blank?
|
|
||||||
@teacher.first_name = hash['teacher_zh_tw']
|
|
||||||
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
|
|
||||||
@teacher.first_name = hash['teacher_en']
|
|
||||||
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
|
||||||
@teacher.first_name = "Please Fill the Name"
|
|
||||||
end
|
|
||||||
|
|
||||||
I18n.locale = :en
|
|
||||||
if !hash['teacher_en'].blank?
|
|
||||||
@teacher.first_name = hash['teacher_en']
|
|
||||||
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
|
|
||||||
@teacher.first_name = hash['teacher_zh_tw']
|
|
||||||
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
|
|
||||||
@teacher.first_name = "Please Fill the Name"
|
|
||||||
end
|
|
||||||
|
|
||||||
#@teacher.first_name = hash['teacher_en']
|
|
||||||
@teacher.ntu_seq = hash['ntu_seq']
|
|
||||||
@teacher.sid = hash['ntu_seq']
|
|
||||||
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
|
|
||||||
@teacher.password = "testpass"
|
|
||||||
@i += 10
|
|
||||||
if !hash['email'].blank?
|
|
||||||
@user = User.where(email: "#{hash['email']}")
|
|
||||||
if @user.length == 0
|
|
||||||
@teacher.email = hash['email']
|
|
||||||
elsif @user.length > 0
|
|
||||||
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@teacher.email = "#{@i}@ntu.edu.tw"
|
|
||||||
end
|
|
||||||
|
|
||||||
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
|
||||||
@teacher.user_id = "defaultuser"
|
|
||||||
elsif hash['teacher_en'].blank?
|
|
||||||
@teacher.user_id = hash['teacher_zh_tw']
|
|
||||||
elsif hash['teacher_zh_tw']
|
|
||||||
@teacher.user_id = hash['teacher_en']
|
|
||||||
end
|
|
||||||
@teacher.save!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_book_data
|
|
||||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
|
||||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
|
||||||
uri.query = URI.encode_www_form(params)
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
|
|
||||||
teachers = User.all
|
|
||||||
|
|
||||||
teachers.each do |hash|
|
|
||||||
if hash.sid.present?
|
|
||||||
ntu_seq = hash.sid
|
|
||||||
books_xml = Nokogiri::XML( \
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
|
||||||
@books = books_xml.xpath("//Book").map do |book_node|
|
|
||||||
{
|
|
||||||
author: (book_node>"Authors").text,
|
|
||||||
year: (book_node>"PublishYear").text,
|
|
||||||
title: (book_node>"DocTitle").text,
|
|
||||||
remarks: (book_node>"Remarks").text,
|
|
||||||
publisher: (book_node>"Publisher").text,
|
|
||||||
book_title: (book_node>"BookTitle").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @books.present?
|
|
||||||
@books.each do |b|
|
|
||||||
@book = WritingBook.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@book.authors = b[:author]
|
|
||||||
@book.paper_title = b[:title]
|
|
||||||
@book.book_title = b[:book_title]
|
|
||||||
@book.note = b[:remarks]
|
|
||||||
@book.publisher = b[:publisher]
|
|
||||||
I18n.locale = :en
|
|
||||||
@book.authors = b[:author]
|
|
||||||
@book.paper_title = b[:title]
|
|
||||||
@book.book_title = b[:book_title]
|
|
||||||
@book.note = b[:remarks]
|
|
||||||
@book.publisher = b[:publisher]
|
|
||||||
@book.year = b[:year]
|
|
||||||
@book.create_user_id = hash.id
|
|
||||||
@book.save
|
|
||||||
end
|
|
||||||
else
|
|
||||||
puts "No books by Teacher"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_conference_data
|
|
||||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
|
||||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
|
||||||
uri.query = URI.encode_www_form(params)
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
|
|
||||||
teachers = User.all
|
|
||||||
|
|
||||||
teachers.each do |hash|
|
|
||||||
if hash.sid.present?
|
|
||||||
ntu_seq = hash.sid
|
|
||||||
conference_xml = Nokogiri::XML( \
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
|
||||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
|
||||||
{
|
|
||||||
author: (cp_node>"Authors").text,
|
|
||||||
year: (cp_node>"PublishYear").text,
|
|
||||||
title: (cp_node>"PaperTitle").text,
|
|
||||||
conference: (cp_node>"PublishOn").text,
|
|
||||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
|
||||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
|
||||||
conference_title: (cp_node>"PublishOn").text,
|
|
||||||
remarks: (cp_node>"Remarks").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @conference_papers.present?
|
|
||||||
@conference_papers.each do |b|
|
|
||||||
@conference_paper = WritingConference.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@conference_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@conference_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
if b[:conference_title].blank?
|
|
||||||
@conference_paper.conference_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.conference_title = b[:conference_title]
|
|
||||||
end
|
|
||||||
|
|
||||||
@conference_paper.note = b[:remarks]
|
|
||||||
I18n.locale = :en
|
|
||||||
@conference_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@conference_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
if b[:conference_title].blank?
|
|
||||||
@conference_paper.conference_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.conference_title = b[:conference_title]
|
|
||||||
end
|
|
||||||
@conference_paper.note = b[:remarks]
|
|
||||||
|
|
||||||
@conference_paper.location = b[:location]
|
|
||||||
@conference_paper.year = b[:year]
|
|
||||||
@conference_paper.create_user_id = hash.id
|
|
||||||
|
|
||||||
@conference_paper.save!
|
|
||||||
end
|
|
||||||
else
|
|
||||||
puts "No conference by Teacher"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def get_journal_paper_data
|
|
||||||
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
|
||||||
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
|
||||||
uri.query = URI.encode_www_form(params)
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
|
|
||||||
teachers = User.all
|
|
||||||
|
|
||||||
teachers.each do |hash|
|
|
||||||
if hash.sid.present?
|
|
||||||
ntu_seq = hash.sid
|
|
||||||
paper_xml = Nokogiri::XML( \
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
|
||||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
|
||||||
{
|
|
||||||
author: (paper_node>"Authors").text,
|
|
||||||
year: (paper_node>"PublishYear").text,
|
|
||||||
title: (paper_node>"PaperTitle").text,
|
|
||||||
journal: (paper_node>"PublishOn").text,
|
|
||||||
volume:(paper_node>"Volume").text,
|
|
||||||
volumeno:(paper_node>"VolumeNo").text,
|
|
||||||
beginpage:(paper_node>"BeginPage").text,
|
|
||||||
endpage:(paper_node>"EndPage").text,
|
|
||||||
subgroup:(paper_node>"subgroup").text,
|
|
||||||
remarks: (paper_node>"Remarks").text,
|
|
||||||
cate: ((paper_node>"subgroup")>"Group").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @journal_papers.present?
|
|
||||||
@journal_papers.each do |b|
|
|
||||||
@journal_paper = WritingJournal.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@journal_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@journal_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@journal_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
@journal_paper.journal_title = b[:journal]
|
|
||||||
@journal_paper.note = b[:remarks]
|
|
||||||
I18n.locale = :en
|
|
||||||
@journal_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@journal_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@journal_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
@journal_paper.journal_title = b[:journal]
|
|
||||||
@journal_paper.note = b[:remarks]
|
|
||||||
@journal_paper.year = b[:year]
|
|
||||||
@journal_paper.vol_no = b[:volumeno]
|
|
||||||
@journal_paper.form_to_start = b[:beginpage]
|
|
||||||
@journal_paper.form_to_end = b[:endpage]
|
|
||||||
if !b[:cate].blank?
|
|
||||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
|
||||||
if @level_type.present?
|
|
||||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@journal_paper.create_user_id = hash.id
|
|
||||||
@journal_paper.save!
|
|
||||||
end
|
|
||||||
else
|
|
||||||
puts "No journal paper by Teacher"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def sync_conference_data
|
|
||||||
@conference_data = WritingConference.where(create_user_id: "#{params[:user_id]}")
|
|
||||||
@conference_data.delete_all
|
|
||||||
@user = User.find("#{params[:user_id]}")
|
|
||||||
|
|
||||||
# teachers.each do |hash|
|
|
||||||
if @user.sid.present?
|
|
||||||
ntu_seq = @user.sid
|
|
||||||
conference_xml = Nokogiri::XML( \
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
|
||||||
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
|
||||||
{
|
|
||||||
author: (cp_node>"Authors").text,
|
|
||||||
year: (cp_node>"PublishYear").text,
|
|
||||||
title: (cp_node>"PaperTitle").text,
|
|
||||||
conference: (cp_node>"PublishOn").text,
|
|
||||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
|
||||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
|
||||||
conference_title: (cp_node>"PublishOn").text,
|
|
||||||
remarks: (cp_node>"Remarks").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @conference_papers.present?
|
|
||||||
@conference_papers.each do |b|
|
|
||||||
@conference_paper = WritingConference.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@conference_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@conference_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
if b[:conference_title].blank?
|
|
||||||
@conference_paper.conference_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.conference_title = b[:conference_title]
|
|
||||||
end
|
|
||||||
|
|
||||||
@conference_paper.note = b[:remarks]
|
|
||||||
I18n.locale = :en
|
|
||||||
@conference_paper.authors = b[:author]
|
|
||||||
if b[:title].blank?
|
|
||||||
@conference_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
if b[:conference_title].blank?
|
|
||||||
@conference_paper.conference_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@conference_paper.conference_title = b[:conference_title]
|
|
||||||
end
|
|
||||||
@conference_paper.note = b[:remarks]
|
|
||||||
|
|
||||||
@conference_paper.location = b[:location]
|
|
||||||
@conference_paper.year = b[:year]
|
|
||||||
@conference_paper.create_user_id = @user.id
|
|
||||||
|
|
||||||
@conference_paper.save!
|
|
||||||
end
|
|
||||||
else
|
|
||||||
puts "No conference by Teacher"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def sync_journal_paper_data
|
|
||||||
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
|
||||||
@journal_data.delete_all
|
|
||||||
@user = User.find("#{params[:user_id]}")
|
|
||||||
|
|
||||||
# teachers.each do |hash|
|
|
||||||
if @user.sid.present?
|
|
||||||
ntu_seq = @user.sid
|
|
||||||
paper_xml = Nokogiri::XML( \
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
|
||||||
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
|
||||||
{
|
|
||||||
author: (paper_node>"Authors").text,
|
|
||||||
year: (paper_node>"PublishYear").text,
|
|
||||||
title: (paper_node>"PaperTitle").text,
|
|
||||||
journal: (paper_node>"PublishOn").text,
|
|
||||||
volume:(paper_node>"Volume").text,
|
|
||||||
volumeno:(paper_node>"VolumeNo").text,
|
|
||||||
beginpage:(paper_node>"BeginPage").text,
|
|
||||||
endpage:(paper_node>"EndPage").text,
|
|
||||||
subgroup:(paper_node>"subgroup").text,
|
|
||||||
remarks: (paper_node>"Remarks").text,
|
|
||||||
cate: ((paper_node>"subgroup")>"Group").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @journal_papers.present?
|
|
||||||
@journal_papers.each do |b|
|
|
||||||
@journal_paper = WritingJournal.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@journal_paper.authors = b[:author]
|
|
||||||
|
|
||||||
if b[:title].blank?
|
|
||||||
@journal_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@journal_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
|
|
||||||
@journal_paper.journal_title = b[:journal]
|
|
||||||
@journal_paper.note = b[:remarks]
|
|
||||||
I18n.locale = :en
|
|
||||||
@journal_paper.authors = b[:author]
|
|
||||||
|
|
||||||
if b[:title].blank?
|
|
||||||
@journal_paper.paper_title = "No Title Present"
|
|
||||||
else
|
|
||||||
@journal_paper.paper_title = b[:title]
|
|
||||||
end
|
|
||||||
|
|
||||||
@journal_paper.journal_title = b[:journal]
|
|
||||||
@journal_paper.note = b[:remarks]
|
|
||||||
@journal_paper.year = b[:year]
|
|
||||||
@journal_paper.vol_no = b[:volumeno]
|
|
||||||
@journal_paper.form_to_start = b[:beginpage]
|
|
||||||
@journal_paper.form_to_end = b[:endpage]
|
|
||||||
|
|
||||||
if !b[:cate].blank?
|
|
||||||
@level_type = JournalLevelType.where(:key => b[:cate])
|
|
||||||
if @level_type.present?
|
|
||||||
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@journal_paper.create_user_id = @user.id
|
|
||||||
@journal_paper.save!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def sync_book_data
|
|
||||||
@books_data = WritingBook.where(create_user_id: "#{params[:user_id]}")
|
|
||||||
@books_data.delete_all
|
|
||||||
@user = User.find("#{params[:user_id]}")
|
|
||||||
|
|
||||||
# teachers.each do |hash|
|
|
||||||
if @user.sid.present?
|
|
||||||
ntu_seq = @user.sid
|
|
||||||
books_xml = Nokogiri::XML( \
|
|
||||||
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
|
||||||
@books = books_xml.xpath("//Book").map do |book_node|
|
|
||||||
{
|
|
||||||
author: (book_node>"Authors").text,
|
|
||||||
year: (book_node>"PublishYear").text,
|
|
||||||
title: (book_node>"DocTitle").text,
|
|
||||||
remarks: (book_node>"Remarks").text,
|
|
||||||
publisher: (book_node>"Publisher").text,
|
|
||||||
book_title: (book_node>"BookTitle").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
if @books.present?
|
|
||||||
@books.each do |b|
|
|
||||||
@book = WritingBook.new
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
@book.authors = b[:author]
|
|
||||||
@book.paper_title = b[:title]
|
|
||||||
@book.book_title = b[:book_title]
|
|
||||||
@book.note = b[:remarks]
|
|
||||||
@book.publisher = b[:publisher]
|
|
||||||
I18n.locale = :en
|
|
||||||
@book.authors = b[:author]
|
|
||||||
@book.paper_title = b[:title]
|
|
||||||
@book.book_title = b[:book_title]
|
|
||||||
@book.note = b[:remarks]
|
|
||||||
@book.publisher = b[:publisher]
|
|
||||||
@book.year = b[:year]
|
|
||||||
@book.create_user_id = @user.id
|
|
||||||
@book.save
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
|
||||||
|
|
||||||
format.html
|
|
||||||
format.json { render json: {"success"=>true}.to_json}
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def get_announcement_data
|
|
||||||
uri = URI("https://localhost:8000/announcements.xml")
|
|
||||||
|
|
||||||
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
|
||||||
#uri.query = URI.encode_www_form(params)
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
|
|
||||||
@announcement_data = Hash.from_xml(res.body)
|
|
||||||
@announcements = @announcement_data["objects"]
|
|
||||||
@announcements.each do |hash|
|
|
||||||
@bulletin = Bulletin.new
|
|
||||||
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
if hash['announcement_title_zh_tw'].blank?
|
|
||||||
@bulletin.title = hash['announcement_title_en']
|
|
||||||
@bulletin.text = hash['announcement_content_zh_tw']
|
|
||||||
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
|
||||||
@bulletin.title = "Please Fill the Name"
|
|
||||||
@bulletin.text = hash['announcement_content_zh_tw']
|
|
||||||
else
|
|
||||||
@bulletin.title = hash['announcement_title_zh_tw']
|
|
||||||
@bulletin.text = hash['announcement_content_zh_tw']
|
|
||||||
end
|
|
||||||
|
|
||||||
I18n.locale = :en
|
|
||||||
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
|
||||||
@bulletin.title = "Please Fill the Name"
|
|
||||||
@bulletin.text = hash['announcement_content_en']
|
|
||||||
|
|
||||||
elsif hash['announcement_title_en'].blank?
|
|
||||||
@bulletin.title = hash['announcement_zh_tw']
|
|
||||||
@bulletin.text = hash['announcement_content_en']
|
|
||||||
|
|
||||||
elsif hash['announcement_title_zh_tw'].blank?
|
|
||||||
@bulletin.title = hash['announcement_title_en']
|
|
||||||
@bulletin.text = hash['announcement_content_en']
|
|
||||||
end
|
|
||||||
@bulletin.category_id = "51d2a16438178423c2000001"
|
|
||||||
@bulletin.is_pending = true
|
|
||||||
|
|
||||||
@bulletin.save!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_page_data
|
|
||||||
f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
|
|
||||||
page_xml = Nokogiri::XML(f)
|
|
||||||
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
|
||||||
@pages = page_xml.xpath("//management-page").map do |cp_node|
|
|
||||||
{
|
|
||||||
menu_title: (cp_node>"menu-title").text,
|
|
||||||
content: (cp_node>"content").text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
if @pages.present?
|
|
||||||
@i=0
|
|
||||||
@pages.each do |b|
|
|
||||||
|
|
||||||
get_variables_for_new
|
|
||||||
@page = Page.new
|
|
||||||
|
|
||||||
@page.parent = "4f45f3b9e9d02c5db900005d"
|
|
||||||
@page.design = "50ac424983e75219d2000021"
|
|
||||||
@page.theme_id = "50ac424a83e75219d2000025"
|
|
||||||
@page.menu_enabled_for= ["en", "zh_tw", ""]
|
|
||||||
@page.enabled_for= ["en", "zh_tw", ""]
|
|
||||||
@page.is_published = false
|
|
||||||
if b[:menu_title].blank?
|
|
||||||
@page.title = 'No Title Present'
|
|
||||||
@i += 1
|
|
||||||
@page.name = "#{@i}Page"
|
|
||||||
else
|
|
||||||
@i += 1
|
|
||||||
@page.title = b[:menu_title]
|
|
||||||
@page.name = "#{@i}Page"
|
|
||||||
end
|
|
||||||
if b[:content].blank?
|
|
||||||
@page.content = "No Content Present"
|
|
||||||
else
|
|
||||||
@page.content = b[:content]
|
|
||||||
end
|
|
||||||
@page.save!
|
|
||||||
end
|
|
||||||
else
|
|
||||||
puts "No Page Data"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def get_variables_for_new
|
|
||||||
@designs = Design.all.entries
|
|
||||||
@themes = Design.first.themes
|
|
||||||
@module_apps = ModuleApp.for_frontend_select
|
|
||||||
@app_frontend_urls = nil
|
|
||||||
@categories = nil
|
|
||||||
@tags = nil
|
|
||||||
@page_frontend_data_counts = nil
|
|
||||||
@frontend_styles = nil
|
|
||||||
@selected={
|
|
||||||
:design => @designs.first,
|
|
||||||
:theme=> @themes.first,
|
|
||||||
:module_app=>nil,#@module_apps.first
|
|
||||||
:app_frontend_url=> nil, #@module_apps.first
|
|
||||||
:category=>nil,
|
|
||||||
:tag=>nil,
|
|
||||||
:page_frontend_data_count=>nil,
|
|
||||||
:frontend_style => nil
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -60,7 +60,7 @@ class Admin::SitesController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def preference
|
def preference
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -140,9 +140,7 @@ class ApplicationController < ActionController::Base
|
|||||||
# update session if passed
|
# update session if passed
|
||||||
session[:locale] = params[:locale] if params[:locale]
|
session[:locale] = params[:locale] if params[:locale]
|
||||||
browser_locale = condition = nil
|
browser_locale = condition = nil
|
||||||
default_locale = @site.default_locale if @site.default_locale.present?
|
|
||||||
# check if locale is valid for non site pages
|
# check if locale is valid for non site pages
|
||||||
|
|
||||||
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
|
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
|
||||||
condition = VALID_LOCALES.include?(session[:locale])
|
condition = VALID_LOCALES.include?(session[:locale])
|
||||||
elsif session[:locale]
|
elsif session[:locale]
|
||||||
@@ -154,7 +152,7 @@ class ApplicationController < ActionController::Base
|
|||||||
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
||||||
condition = @site.in_use_locales.include?(browser_locale)
|
condition = @site.in_use_locales.include?(browser_locale)
|
||||||
end
|
end
|
||||||
session[:locale] = condition ? ( browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
|
session[:locale] = condition ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
|
||||||
I18n.locale = session[:locale].to_sym
|
I18n.locale = session[:locale].to_sym
|
||||||
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
||||||
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
||||||
|
|||||||
@@ -340,11 +340,10 @@ class DesktopController< ApplicationController
|
|||||||
render :json=>b.to_json
|
render :json=>b.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
private
|
||||||
|
|
||||||
def check_desktop_open
|
def check_desktop_open
|
||||||
@site = Site.first
|
if Me.desktop_closed && current_user.nil? #Need to be change
|
||||||
if @site.desktop_closed #Need to be change
|
|
||||||
redirect_to '/admin/dashboards'
|
redirect_to '/admin/dashboards'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ module ApplicationHelper
|
|||||||
page_title = page.page_title ? page.page_title : page.title
|
page_title = page.page_title ? page.page_title : page.title
|
||||||
if page.root? && @site.title
|
if page.root? && @site.title
|
||||||
res << @site.title
|
res << @site.title
|
||||||
elsif @site.title && !@site.title_always_on
|
elsif @site.title && @site.title_always_on
|
||||||
res << @site.title + ' - ' + page_title
|
res << @site.title + ' - ' + page_title
|
||||||
else
|
else
|
||||||
res << page_title
|
res << page_title
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ module OrbitBackendHelper
|
|||||||
objects.join(' ')
|
objects.join(' ')
|
||||||
else
|
else
|
||||||
objects = Array(objects).map do |object|
|
objects = Array(objects).map do |object|
|
||||||
display_value(object.send(field)) rescue ''
|
display_value(object.send(field))
|
||||||
end
|
end
|
||||||
objects.join(', ')
|
objects.join(', ')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class AdBanner
|
|||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include Mongoid::MultiParameterAttributes
|
include Mongoid::MultiParameterAttributes
|
||||||
|
include OrbitCoreLib::ObjectAuthable
|
||||||
include OrbitTag::Taggable
|
include OrbitTag::Taggable
|
||||||
include OrbitModel::Authorizable
|
|
||||||
|
|
||||||
field :title
|
field :title
|
||||||
field :transition_msec,type: Integer
|
field :transition_msec,type: Integer
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
class AuthManager < Authorization
|
class AuthManager < Authorization
|
||||||
|
# belongs_to :manager_authorizable, polymorphic: true
|
||||||
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'managing_apps'
|
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'managing_apps'
|
||||||
end
|
end
|
||||||
@@ -7,7 +7,6 @@ class ModuleApp
|
|||||||
field :auth_approval_users, type: Array, default: nil
|
field :auth_approval_users, type: Array, default: nil
|
||||||
field :auth_manager_users, type: Array, default: nil
|
field :auth_manager_users, type: Array, default: nil
|
||||||
field :auth_sub_manager_users, type: Array, default: nil
|
field :auth_sub_manager_users, type: Array, default: nil
|
||||||
field :has_category, type: Boolean, default: false
|
|
||||||
field :key
|
field :key
|
||||||
field :title
|
field :title
|
||||||
field :sidebar_order,type: Integer,default: 0
|
field :sidebar_order,type: Integer,default: 0
|
||||||
@@ -190,8 +189,7 @@ class ModuleApp
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_auth_manager_users
|
def update_auth_manager_users
|
||||||
users = self.auth_manager_authorized_users
|
self.update_attribute(:auth_manager_users, self.auth_manager_authorized_users.map{|user| user.id})
|
||||||
self.update_attribute(:auth_manager_users, users.map{|user| user.id}) if users
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_auth_sub_manager_users
|
def update_auth_sub_manager_users
|
||||||
@@ -209,6 +207,21 @@ class ModuleApp
|
|||||||
managers.include?(user)
|
managers.include?(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def add_managers(users)
|
||||||
|
users = Array(users)
|
||||||
|
if auth_manager = self.auth_manager
|
||||||
|
auth_manager.update_attribute(:authorized_users, (auth_manager.authorized_users + users).uniq)
|
||||||
|
else
|
||||||
|
self.create_auth_manager(authorized_users: users)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove_managers(users)
|
||||||
|
users = Array(users)
|
||||||
|
users = users.delete_if{|user| user == current_user || is_admin?}
|
||||||
|
self.auth_manager.update_attribute(:authorized_users, auth_manager.authorized_users - users)
|
||||||
|
end
|
||||||
|
|
||||||
def is_manager?(user)
|
def is_manager?(user)
|
||||||
if user && !auth_manager_users.blank?
|
if user && !auth_manager_users.blank?
|
||||||
auth_manager_users.include?(user.id)
|
auth_manager_users.include?(user.id)
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class ModuleTag
|
|||||||
if self.new_record?
|
if self.new_record?
|
||||||
self.build_tag(name_translations: self.name_translations, is_default: self.is_default)
|
self.build_tag(name_translations: self.name_translations, is_default: self.is_default)
|
||||||
else
|
else
|
||||||
self.tag.attributes = {:name_translations => self.name_translations}
|
self.tag.name_translations = self.name_translations
|
||||||
self.tag.attributes = {:is_default => self.is_default}
|
self.tag.is_default = self.is_default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,6 +21,7 @@ class Site
|
|||||||
field :title_always_on, :type => Boolean, :default => false
|
field :title_always_on, :type => Boolean, :default => false
|
||||||
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
||||||
field :mail_settings, :type => Hash
|
field :mail_settings, :type => Hash
|
||||||
|
field :enabled_for, :type => Array, :default => nil
|
||||||
|
|
||||||
field :disk_space, :type => String
|
field :disk_space, :type => String
|
||||||
field :system_package_info, :type => Hash,:default=>{}
|
field :system_package_info, :type => Hash,:default=>{}
|
||||||
@@ -29,7 +30,6 @@ class Site
|
|||||||
field :department
|
field :department
|
||||||
|
|
||||||
mount_uploader :default_image, ImageUploader
|
mount_uploader :default_image, ImageUploader
|
||||||
mount_uploader :favicon, ImageUploader
|
|
||||||
|
|
||||||
field :search,:type => Hash
|
field :search,:type => Hash
|
||||||
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']
|
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
# class Tag < ProtoTag
|
||||||
|
# belongs_to :module_app
|
||||||
|
|
||||||
|
# end
|
||||||
|
|
||||||
class Tag
|
class Tag
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|||||||
@@ -1,31 +1,25 @@
|
|||||||
<%= form_for @ad_banner, url: admin_ad_banner_path(@ad_banner) do |f| %>
|
<div class="content">
|
||||||
<fieldset>
|
<%= form_for(:ad_banner, :url => admin_ad_banner_path(:ad_banner), :remote => true) do |f| %>
|
||||||
<legend><%= t("ad_banner.banner") %></legend>
|
<fieldset>
|
||||||
<label><%= t("ad_banner.banner_name") %></label>
|
<legend>Ad Banner</legend>
|
||||||
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
<label>Banner Name</label>
|
||||||
<span class="help-block"><%= t("ad_banner.banner_name_note") %></span>
|
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
||||||
<label for="timeout"><%= t("ad_banner.ste") %></label>
|
<span class="help-block">Banner Name only english</span>
|
||||||
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
<label for="timeout">Ste</label>
|
||||||
<span class="help-block"><%= t("ad_banner.ste_note") %></span>
|
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
||||||
<label><%= t("ad_banner.best_size") %></label>
|
<span class="help-block">Please enter the number of seconds</span>
|
||||||
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
<label>Best Size</label>
|
||||||
<span class="help-block"><%= t("ad_banner.best_size") %> EX:120x30 </span>
|
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
||||||
<label><%= t("ad_banner.effect") %></label>
|
<span class="help-block">Best Size EX:120x30 </span>
|
||||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
<label>Effect</label>
|
||||||
<div class="preview">
|
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||||
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
<div class="preview">
|
||||||
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
||||||
</div>
|
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
||||||
<span class="help-block"><%= t("ad_banner.effect") %></span>
|
</div>
|
||||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
<span class="help-block">Effect</span>
|
||||||
<%= f.submit t(:update_), class: 'btn btn-primary btn-small' %>
|
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||||
</fieldset>
|
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
|
||||||
<% end %>
|
</fieldset>
|
||||||
<script type="text/javascript">
|
<% end %>
|
||||||
$('select').on('change', function() {
|
</div>
|
||||||
$(".preview").cycle({
|
|
||||||
delay: -3000,
|
|
||||||
fx: $(this).val()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
<%= javascript_include_tag "lib/jquery.cycle.all.js"%>
|
|
||||||
|
|
||||||
<table class="table main-list">
|
<table class="table main-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -15,7 +13,7 @@
|
|||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
<% if is_admin?%>
|
<% if is_admin?%>
|
||||||
<li><%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner), :class => "open-slide" %></li>
|
<li><%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner)%></li>
|
||||||
<li><%= link_to 'Destroy', admin_ad_banner_path(ad_banner), method: :delete , :confirm => t(:sure?) %></li>
|
<li><%= link_to 'Destroy', admin_ad_banner_path(ad_banner), method: :delete , :confirm => t(:sure?) %></li>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -32,8 +30,12 @@
|
|||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<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: "icons-plus") + " " + t(:add_new), new_admin_ad_banner_path, :class => "btn btn-primary open-slide"%>
|
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), "#add-banner", :class => "btn btn-primary open-slide"%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="add-banner" class="nano" style="display:none">
|
||||||
|
<%= render 'new' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -1,31 +1,25 @@
|
|||||||
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
|
<div class="content">
|
||||||
<fieldset>
|
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
|
||||||
<legend><%= t("ad_banner.banner") %></legend>
|
<fieldset>
|
||||||
<label><%= t("ad_banner.banner_name") %></label>
|
<legend>Ad Banner</legend>
|
||||||
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
<label>Banner Name</label>
|
||||||
<span class="help-block"><%= t("ad_banner.banner_name_note") %></span>
|
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
||||||
<label for="timeout"><%= t("ad_banner.ste") %></label>
|
<span class="help-block">Banner Name only english</span>
|
||||||
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
<label for="timeout">Ste</label>
|
||||||
<span class="help-block"><%= t("ad_banner.ste_note") %></span>
|
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
||||||
<label><%= t("ad_banner.best_size") %></label>
|
<span class="help-block">Please enter the number of seconds</span>
|
||||||
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
<label>Best Size</label>
|
||||||
<span class="help-block"><%= t("ad_banner.best_size") %> EX:120x30 </span>
|
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
||||||
<label><%= t("ad_banner.effect") %></label>
|
<span class="help-block">Best Size EX:120x30 </span>
|
||||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
<label>Effect</label>
|
||||||
<div class="preview">
|
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||||
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
<div class="preview">
|
||||||
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
||||||
</div>
|
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
||||||
<span class="help-block"><%= t("ad_banner.effect") %></span>
|
</div>
|
||||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
<span class="help-block">Effect</span>
|
||||||
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
|
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||||
</fieldset>
|
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
|
||||||
<% end %>
|
</fieldset>
|
||||||
<script type="text/javascript">
|
<% end %>
|
||||||
$('select').on('change', function() {
|
</div>
|
||||||
$(".preview").cycle({
|
|
||||||
delay: -3000,
|
|
||||||
fx: $(this).val()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
<%= Rails.logger.info"@@@@@@@@@@@@@@@@"+design.inspect%>
|
|
||||||
<tr class="with_action">
|
<tr class="with_action">
|
||||||
<td class="span1"><%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %></td>
|
<td class="span1"><%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %></td>
|
||||||
<td class="span2">
|
<td class="span2">
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -91,5 +91,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%=javascript_include_tag "lib/items/update_cates_and_tags.js" %>
|
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>
|
||||||
<%= javascript_include_tag "lib/items/page_widget_edit_interface.js" %>
|
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
</h6>
|
</h6>
|
||||||
<ul>
|
<ul>
|
||||||
<% sitemap_block.children.each_with_index do |child, i| %>
|
<% sitemap_block.children.each_with_index do |child, i| %>
|
||||||
<li class="<%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
|
<li "clear <%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
|
||||||
<h6>
|
<h6>
|
||||||
<input type="checkbox" id="<%= child.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
|
<input type="checkbox" id="<%= child.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
|
||||||
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>
|
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>
|
||||||
|
|||||||
@@ -146,8 +146,6 @@
|
|||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted">Default Language</label>
|
<label class="control-label muted">Default Language</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= @site_in_use_locales %>
|
|
||||||
|
|
||||||
<% @site_in_use_locales.each do |locale| %>
|
<% @site_in_use_locales.each do |locale| %>
|
||||||
<%= check_box_tag :default_locale, locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
|
<%= check_box_tag :default_locale, locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
|
||||||
<%= I18nVariable.from_locale(locale) %>
|
<%= I18nVariable.from_locale(locale) %>
|
||||||
@@ -158,9 +156,10 @@
|
|||||||
<label class="control-label muted">Enable Language</label>
|
<label class="control-label muted">Enable Language</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<% @site_valid_locales.each do |valid_locale| %>
|
<% @site_valid_locales.each do |valid_locale| %>
|
||||||
<%= check_box_tag "site[in_use_locales][]", locale, @site.valid_locales.include?(locale), :class=>"toggle-check" %>
|
<%= check_box_tag 'site[enabled_for][]', valid_locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
|
||||||
<%= I18nVariable.from_locale(valid_locale) %>
|
<%= I18nVariable.from_locale(valid_locale) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= hidden_field_tag 'site[enabled_for][]', '' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -174,7 +173,7 @@
|
|||||||
<!-- if this page editing please add class "fileupload-edit" -->
|
<!-- if this page editing please add class "fileupload-edit" -->
|
||||||
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
|
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
|
||||||
<div class="fileupload-new thumbnail pull-left">
|
<div class="fileupload-new thumbnail pull-left">
|
||||||
<% if @site.default_image %>
|
<% if @site.default_image %>
|
||||||
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
|
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||||
@@ -189,41 +188,23 @@
|
|||||||
<%end%>
|
<%end%>
|
||||||
</span>
|
</span>
|
||||||
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
|
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
|
||||||
|
<div class="controls" data-toggle="buttons-checkbox">
|
||||||
</div>
|
<label class="checkbox inline btn btn-danger fileupload-remove">
|
||||||
</div>
|
<% if @site.default_image.file.present? %>
|
||||||
|
<label class="checkbox">
|
||||||
<div class="control-group">
|
<%= check_box_tag 'site[remove_default_image]' %>
|
||||||
<label class="control-label muted">Orbit Favicon</label>
|
<%= t(:delete_) %>
|
||||||
<div class="controls">
|
</label>
|
||||||
<!-- if this page editing please add class "fileupload-edit" -->
|
<% end %>
|
||||||
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
|
</label>
|
||||||
<div class="fileupload-new thumbnail pull-left">
|
|
||||||
<% if @site.favicon %>
|
|
||||||
<%= image_tag( @site.favicon, :size=>"120x120") rescue ''%>
|
|
||||||
<% else %>
|
|
||||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
|
||||||
<span class="btn btn-file">
|
|
||||||
<% if @site.favicon.file.present?%>
|
|
||||||
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
|
|
||||||
<%else%>
|
|
||||||
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
|
|
||||||
<%end%>
|
|
||||||
</span>
|
|
||||||
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Form Actions -->
|
<!-- Form Actions -->
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- CKeditor Site Header -->
|
<!-- CKeditor Site Header -->
|
||||||
<% @site_valid_locales.each do |locale|%>
|
<% @site_valid_locales.each do |locale|%>
|
||||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||||
@@ -69,15 +70,6 @@
|
|||||||
<%end%>
|
<%end%>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
<!-- Sitemap menu in Header -->
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label muted">Sitemap menu in header
|
|
||||||
</label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- CKeditor Site Footer -->
|
<!-- CKeditor Site Footer -->
|
||||||
@@ -93,6 +85,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<%end%>
|
<%end%>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
|
<!-- Sitemap menu in Header -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted">Sitemap menu in header
|
||||||
|
</label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- Terms of Use -->
|
<!-- Terms of Use -->
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
<% 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 %>
|
||||||
|
<h3>Sitemap</h3>
|
||||||
|
|
||||||
<div id="sitemap">
|
<div id="sitemap">
|
||||||
<ul id="map-tree-language" class="nav nav-pills">
|
<ul id="map-tree-language" class="nav nav-pills">
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<%= javascript_include_tag "lib/jquery.cycle.all.latest.js"%>
|
||||||
<div style='position:relative'>
|
<div style='position:relative'>
|
||||||
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
|
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
|
||||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
|
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
|
||||||
@@ -9,12 +10,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
var banner = {"banner_name":"#slideshow-<%= @ad_banner.title.dehumanize %>",
|
$(document).ready(function(){
|
||||||
"banner_fx":"<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
|
jQuery(function( $ ){
|
||||||
"banner_pager":".banner_nav-<%= @ad_banner.title.dehumanize %>",
|
|
||||||
"image_count":"<%= @ad_banner.ad_images.length %>",
|
$('#slideshow-<%= @ad_banner.title.dehumanize %>').cycle({
|
||||||
"image_loaded":0,
|
delay: -1000,
|
||||||
"time_to_next":<%= @ad_banner.transition_msec %>,
|
fx: "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
|
||||||
};
|
timeoutFn: getTimeout,
|
||||||
banners.push(banner);
|
pager: '.banner_nav-<%= @ad_banner.title.dehumanize %>',
|
||||||
</script>
|
pagerAnchorBuilder: function(idx, slide) {
|
||||||
|
return "<li><a href='#'></a></li>";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -28,7 +28,8 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<% if @site.default_image.present?%>
|
<% @url_path = "#{request.fullpath}".scan(/admin/)%>
|
||||||
|
<% if (@site.default_image.present? && (!@url_path.include? "admin"))%>
|
||||||
<style>
|
<style>
|
||||||
#orbit-bar .orbitlogo {
|
#orbit-bar .orbitlogo {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<%= javascript_include_tag "html5" %>
|
<%= javascript_include_tag "html5" %>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<%#= stylesheet_link_tag "module_widget" %>
|
<%#= stylesheet_link_tag "module_widget" %>
|
||||||
<%#= javascript_include_tag "module" %>
|
<%= javascript_include_tag "module" %>
|
||||||
<%#= javascript_include_tag "#{@app_title}/module_widget" %>
|
<%#= javascript_include_tag "#{@app_title}/module_widget" %>
|
||||||
<%= yield :page_specific_javascript %>
|
<%= yield :page_specific_javascript %>
|
||||||
<%= csrf_meta_tag %>
|
<%= csrf_meta_tag %>
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,8 @@ development:
|
|||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: test_site
|
database: test_site
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: test_site
|
database: test_site
|
||||||
@@ -22,4 +24,4 @@ production:
|
|||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: test_site
|
database: test_site_new
|
||||||
@@ -201,16 +201,6 @@ Orbit::Application.routes.draw do
|
|||||||
get 'preference'
|
get 'preference'
|
||||||
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"
|
|
||||||
|
|
||||||
resources :tags do
|
resources :tags do
|
||||||
collection do
|
collection do
|
||||||
post 'add_to_default'
|
post 'add_to_default'
|
||||||
|
|||||||
+11
-22
@@ -188,15 +188,6 @@ module OrbitCoreLib
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def open_for_user(arg = nil)
|
|
||||||
if arg
|
|
||||||
key = arg.shift
|
|
||||||
prepend_before_filter key[0] => key[1] {|f| f.open_for :user}
|
|
||||||
else
|
|
||||||
prepend_before_filter {|f| f.open_for :user}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def open_for_visitor(arg = nil)
|
def open_for_visitor(arg = nil)
|
||||||
if arg
|
if arg
|
||||||
key = arg.shift
|
key = arg.shift
|
||||||
@@ -223,29 +214,27 @@ module OrbitCoreLib
|
|||||||
setup_vars
|
setup_vars
|
||||||
unless @no_authorization
|
unless @no_authorization
|
||||||
if @user_type
|
if @user_type
|
||||||
@open = false
|
|
||||||
@visitor = false
|
|
||||||
@user_type.each do |user_type|
|
@user_type.each do |user_type|
|
||||||
|
open = false
|
||||||
|
visitor = false
|
||||||
case user_type
|
case user_type
|
||||||
when :admin
|
when :admin
|
||||||
@open ||= check_admin
|
open ||= check_admin
|
||||||
when :manager
|
when :manager
|
||||||
@open ||= check_manager
|
open ||= check_manager
|
||||||
when :sub_manager
|
when :sub_manager
|
||||||
@open ||= check_sub_manager
|
open ||= check_sub_manager
|
||||||
when :approver
|
when :approver
|
||||||
@open ||= check_sub_manager
|
open ||= check_sub_manager
|
||||||
when :user
|
|
||||||
@open ||= true
|
|
||||||
when :visitor
|
when :visitor
|
||||||
set_current_user
|
set_current_user
|
||||||
@open ||= true
|
open ||= true
|
||||||
@visitor ||= true
|
visitor ||= true
|
||||||
end
|
end
|
||||||
|
check_backend_openness if visitor
|
||||||
|
authenticate_user! unless visitor
|
||||||
|
redirect_to root_url unless open
|
||||||
end
|
end
|
||||||
check_backend_openness if @visitor
|
|
||||||
authenticate_user! unless @visitor
|
|
||||||
redirect_to root_url unless @open
|
|
||||||
else
|
else
|
||||||
authenticate_user!
|
authenticate_user!
|
||||||
check_user_can_use
|
check_user_can_use
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ module OrbitModel
|
|||||||
has_one :auth_approval, as: :approval_authorizable, dependent: :destroy
|
has_one :auth_approval, as: :approval_authorizable, dependent: :destroy
|
||||||
has_one :auth_sub_manager, as: :sub_manager_authorizable, dependent: :destroy
|
has_one :auth_sub_manager, as: :sub_manager_authorizable, dependent: :destroy
|
||||||
delegate :authorized_users, to: :auth_approval, prefix: true, allow_nil: true
|
delegate :authorized_users, to: :auth_approval, prefix: true, allow_nil: true
|
||||||
delegate :authorized_users, to: :auth_manager, prefix: true, allow_nil: true
|
|
||||||
delegate :authorized_users, to: :auth_sub_manager, prefix: true, allow_nil: true
|
delegate :authorized_users, to: :auth_sub_manager, prefix: true, allow_nil: true
|
||||||
send :include, InstanceMethods
|
send :include, InstanceMethods
|
||||||
end
|
end
|
||||||
|
|||||||
+78
-175
@@ -1,191 +1,94 @@
|
|||||||
namespace :new_ui do
|
namespace :new_ui do
|
||||||
|
|
||||||
MODULE_APPS = [ %w(announcement bulletin),
|
|
||||||
%w(archive archive_file),
|
|
||||||
%w(ask ask_question ask_category),
|
|
||||||
%w(asset asset),
|
|
||||||
%w(faq qa),
|
|
||||||
%w(gallery gallery_album gallery_category),
|
|
||||||
%w(location location),
|
|
||||||
%w(personal_book writing_book),
|
|
||||||
%w(personal_conference writing_conference),
|
|
||||||
%w(personal_experience experience),
|
|
||||||
%w(personal_honor honor),
|
|
||||||
%w(personal_journal writing_journal),
|
|
||||||
%w(personal_patent writing_patent),
|
|
||||||
%w(personal_project project),
|
|
||||||
%w(web_resource web_link)
|
|
||||||
] # app_key, model_name, category_name
|
|
||||||
|
|
||||||
task :migrate => :environment do
|
|
||||||
@db = Mongoid.database
|
|
||||||
migrate_tags
|
|
||||||
migrate_categories
|
|
||||||
migrate_approval_on_object
|
|
||||||
migrate_managers
|
|
||||||
end
|
|
||||||
|
|
||||||
# :category_name is optional, depends on the naming of the category model: if no conventional, specify it
|
# :category_name is optional, depends on the naming of the category model: if no conventional, specify it
|
||||||
task :migrate_categories, [:app_key, :model_name, :category_name] => :environment do |t, args|
|
task :migrate_categories, [:app_key, :model_name, :category_name] => :environment do |t, args|
|
||||||
migrate_categories(args)
|
@db = Mongoid.database
|
||||||
|
if args[:app_key] && args[:model_name]
|
||||||
|
migrate_category(args[:app_key], args[:model_name], args[:category_name])
|
||||||
|
else
|
||||||
|
module_apps = [ %w(announcement bulletin),
|
||||||
|
%w(archive archive_file),
|
||||||
|
%w(ask ask_question ask),
|
||||||
|
%w(asset asset),
|
||||||
|
%w(faq qa),
|
||||||
|
%w(gallery gallery_album gallery),
|
||||||
|
%w(personal_book writing_book),
|
||||||
|
%w(personal_conference writing_conference),
|
||||||
|
%w(personal_experience experience),
|
||||||
|
%w(personal_honor honor),
|
||||||
|
%w(personal_journal writing_journal),
|
||||||
|
%w(personal_patent writing_patent),
|
||||||
|
%w(personal_project project),
|
||||||
|
%w(web_resource web_link)
|
||||||
|
]
|
||||||
|
module_apps.each{|value_array| migrate_category(value_array[0], value_array[1], value_array[2])}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def migrate_category(app_key, model_name, category_name=nil)
|
||||||
|
category_name = model_name unless category_name
|
||||||
|
# # coll_cat = @db["#{category_name}_categories"]
|
||||||
|
# # categories = coll_cat.find if coll_cat
|
||||||
|
module_app = ModuleApp.where(key: app_key)[0]
|
||||||
|
if module_app.has_category
|
||||||
|
categories = "#{category_name}_categories".classify.constantize.admin_manager_all rescue nil
|
||||||
|
categories = "#{category_name}_categories".classify.constantize.all if categories.blank?
|
||||||
|
categories.each do |category|
|
||||||
|
new_category = module_app.categories.build
|
||||||
|
new_category.title_translations = category['title']
|
||||||
|
new_category.disable = category['disable']
|
||||||
|
new_category.save
|
||||||
|
model_name.classify.constantize.where("#{category_name}_category_id" => category['_id']).each do |object|
|
||||||
|
if object.id.is_a?(String)
|
||||||
|
object.destroy
|
||||||
|
else
|
||||||
|
object.category = new_category.id
|
||||||
|
object.remove_attribute("#{category_name}_category_id")
|
||||||
|
object.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if object_auths = ObjectAuth.where(obj_authable_type: "#{category_name.classify}Category")
|
||||||
|
object_auths.each do |object_auth|
|
||||||
|
case object_auth.title
|
||||||
|
when 'fact_check'
|
||||||
|
new_object_auth = new_category.get_object_auth_by_title("approval_#{module_app.key}")
|
||||||
|
else
|
||||||
|
new_object_auth = new_category.get_object_auth_by_title("category_#{module_app.key}")
|
||||||
|
end
|
||||||
|
object_auth.auth_users.each do |user|
|
||||||
|
new_object_auth.add_user_to_privilege_list(user)
|
||||||
|
end
|
||||||
|
object_auth.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
category.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :migrate_tags => :environment do
|
task :migrate_tags => :environment do
|
||||||
migrate_tags
|
tags = Tag.where(_type: 'Tag')
|
||||||
end
|
tags.each do |tag|
|
||||||
|
module_app = ModuleApp.find(tag.module_tag_id)
|
||||||
task :fix_tagged_ids => :environment do
|
new_tag = module_app.module_tags.build
|
||||||
fix_tagged_ids
|
new_tag.name_translations = tag['name']
|
||||||
end
|
new_tag.is_default = tag['is_default']
|
||||||
|
new_tag.save
|
||||||
def migrate_categories(args = nil)
|
n_tag = new_tag.tag
|
||||||
if args && args[:app_key] && args[:model_name]
|
n_tag.cloud_view_count = tag['cloud_view_count']
|
||||||
migrate_category(args[:app_key], args[:model_name], args[:category_name])
|
n_tag.view_count = tag['view_count']
|
||||||
else
|
n_tag.save
|
||||||
MODULE_APPS.each{|value_array| migrate_category(value_array[0], value_array[1], value_array[2])}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def migrate_category(app_key, model_name, category_name = nil)
|
|
||||||
@db ||= Mongoid.database
|
|
||||||
category_name = "#{model_name}_category" unless category_name
|
|
||||||
collection_category = @db[category_name.pluralize]
|
|
||||||
categories = collection_category.find.entries if collection_category
|
|
||||||
collection_model = @db[model_name.pluralize]
|
|
||||||
collection_buffer_category = @db['buffer_categories']
|
|
||||||
collection_prototype_auth = @db['prototype_auths']
|
|
||||||
if categories.present?
|
|
||||||
module_app = ModuleApp.where(key: app_key).first
|
|
||||||
if module_app.try(:has_category)
|
|
||||||
categories.each do |category|
|
|
||||||
new_category = module_app.categories.build
|
|
||||||
new_category.title_translations = category['title']
|
|
||||||
new_category.disable = category['disable']
|
|
||||||
new_category.save
|
|
||||||
collection_model.find("#{category_name}_id" => category['_id']).each do |object|
|
|
||||||
object['category_id'] = new_category.id
|
|
||||||
object.delete("#{category_name}_id")
|
|
||||||
collection_model.save object
|
|
||||||
collection_buffer_category.save ({ '_type' => 'BufferCategory', 'category_id' => new_category.id, 'categorizable_type' => model_name.camelize, 'categorizable_id' => object['_id'] })
|
|
||||||
end
|
|
||||||
object_auths = collection_prototype_auth.find(_type: 'ObjectAuth', obj_authable_id: category['_id'], '$or' => [{privilege_user_ids: {'$not' => {'$size' => 0}}}, {role_ids: {'$not' => {'$size' => 0}}}, {sub_role_ids: {'$not' => {'$size' => 0}}}]).entries
|
|
||||||
if object_auths.present?
|
|
||||||
object_auths.each do |object_auth|
|
|
||||||
if object_auth['title'].eql?('fact_check')
|
|
||||||
authorization = new_category.auth_approval || new_category.create_auth_approval(module_app_id: module_app.id, title: "category_approval_#{module_app.key}")
|
|
||||||
else
|
|
||||||
authorization = new_category.auth_sub_manager || new_category.create_auth_sub_manager(module_app_id: module_app.id, title: "category_authorization_#{module_app.key}")
|
|
||||||
end
|
|
||||||
add_users(object_auth, authorization)
|
|
||||||
collection_prototype_auth.remove(object_auth)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
collection_category.drop
|
|
||||||
collection_prototype_auth.remove(obj_authable_type: category_name.classify)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
collection_category.drop
|
|
||||||
collection_prototype_auth.remove(obj_authable_type: category_name.classify)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def fix_tagged_ids
|
|
||||||
Tag.all.each do |tag|
|
|
||||||
tag.taggings.each do |tagging|
|
tag.taggings.each do |tagging|
|
||||||
tagged_ids = tagging.taggable.tagged_ids
|
tagging.taggable.taggings.create(tag_id: n_tag.id)
|
||||||
unless tagged_ids.include?(tag.id.to_s)
|
|
||||||
tagged_ids << tag.id.to_s
|
|
||||||
tagging.taggable.update_attribute(:tagged_ids, tagged_ids)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
tag.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def migrate_tags
|
task :change_auth_naming => :environment do
|
||||||
@db ||= Mongoid.database
|
ObjectAuth.where(title: /submit_/).each do |auth|
|
||||||
tags = Tag.where(_type: 'Tag').entries
|
auth.update_attribute(:title, auth.title.gsub('submit_', 'category_'))
|
||||||
tags.each_with_index do |tag, i|
|
|
||||||
unless tag.tag_lease
|
|
||||||
if module_app = ModuleApp.find(tag[:module_tag_id])
|
|
||||||
new_tag = module_app.module_tags.build
|
|
||||||
new_tag.name_translations = tag['name']
|
|
||||||
new_tag.is_default = tag['is_default']
|
|
||||||
new_tag.save
|
|
||||||
n_tag = new_tag.tag
|
|
||||||
n_tag.cloud_view_count = tag['cloud_view_count']
|
|
||||||
n_tag.view_count = tag['view_count']
|
|
||||||
n_tag.save
|
|
||||||
tag.taggings.each do |tagging|
|
|
||||||
tagged_ids = tagging.taggable.tagged_ids
|
|
||||||
unless tagged_ids.include?(tag.id.to_s)
|
|
||||||
tagged_ids << tag.id.to_s
|
|
||||||
tagging.taggable.update_attribute(:tagged_ids, tagged_ids)
|
|
||||||
end
|
|
||||||
tagging.taggable.taggings.create(tag_id: n_tag.id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
tag.destroy
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
old_tags = Tag.where(_type: {'$ne' => 'Tag'}).delete
|
|
||||||
@db = Mongoid.database
|
|
||||||
@db['proto_tags'].drop
|
|
||||||
end
|
|
||||||
|
|
||||||
def migrate_approval_on_object
|
|
||||||
@db ||= Mongoid.database
|
|
||||||
collection_prototype_auth = @db['prototype_auths']
|
|
||||||
object_auths = collection_prototype_auth.find({_type: 'ObjectAuth', obj_authable_type: {'$in' => ["AdBanner", "PageContext"]}, '$or' => [{privilege_user_ids: {'$not' => {'$size' => 0}}}, {role_ids: {'$not' => {'$size' => 0}}}, {sub_role_ids: {'$not' => {'$size' => 0}}}]}).entries
|
|
||||||
object_auths.each do |object_auth|
|
|
||||||
case object_auth['obj_authable_type']
|
|
||||||
when 'AdBanner'
|
|
||||||
module_app = ModuleApp.where(key: 'ad_banner').first
|
|
||||||
when 'PageContext'
|
|
||||||
module_app = ModuleApp.where(key: 'page_content').first
|
|
||||||
end
|
|
||||||
if module_app
|
|
||||||
object = object_auth['obj_authable_type'].constantize.find(object_auth['obj_authable_id']) rescue nil
|
|
||||||
if object
|
|
||||||
authorization = object.create_auth_sub_manager(module_app_id: module_app.id, title: "#{object_auth['obj_authable_type'].underscore}_authorization_#{module_app.key}")
|
|
||||||
add_users(object_auth, authorization) if authorization
|
|
||||||
end
|
|
||||||
end
|
|
||||||
collection_prototype_auth.remove(object_auth)
|
|
||||||
end
|
|
||||||
collection_prototype_auth.remove(obj_authable_type: {'$in' => ["AdBanner", "PageContext"]})
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_users(object_auth, authorization)
|
|
||||||
if authorization
|
|
||||||
if object_auth['role_ids'].present?
|
|
||||||
roles = Role.find(object_auth['role_ids']) rescue nil
|
|
||||||
authorization.add_roles(roles) if roles
|
|
||||||
end
|
|
||||||
if object_auth['sub_role_ids'].present?
|
|
||||||
sub_roles = SubRole.find(object_auth['sub_role_ids']) rescue nil
|
|
||||||
authorization.add_sub_roles(sub_roles) if sub_roles
|
|
||||||
end
|
|
||||||
if object_auth['privilege_user_ids'].present?
|
|
||||||
users = User.find(object_auth['privilege_user_ids']) rescue nil
|
|
||||||
authorization.add_users(users) if users
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def migrate_managers
|
|
||||||
@db ||= Mongoid.database
|
|
||||||
collection_app_manager = @db['app_managers']
|
|
||||||
app_managers = collection_app_manager.find(managing_app_id: {'$not' => {'$size' => 0}}).entries
|
|
||||||
app_managers.each do |app_manager|
|
|
||||||
module_app = ModuleApp.find(app_manager['managing_app_id']) rescue nil
|
|
||||||
user = User.find(app_manager['user_id']) rescue nil
|
|
||||||
if module_app && user
|
|
||||||
authorization = module_app.auth_manager || module_app.create_auth_manager(module_app_id: module_app.id, title: module_app.key)
|
|
||||||
authorization.add_users(user)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
collection_app_manager.drop
|
|
||||||
end
|
end
|
||||||
|
|
||||||
task :reset_user_position => :environment do
|
task :reset_user_position => :environment do
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ en:
|
|||||||
ad_banner:
|
ad_banner:
|
||||||
ad_banner: Ad Banner
|
ad_banner: Ad Banner
|
||||||
banner: Banner
|
banner: Banner
|
||||||
banner_name: Banner Name
|
|
||||||
banner_name_note: Banner Name only english
|
|
||||||
ste: Transition Interval
|
|
||||||
ste_note: Please enter the number of seconds
|
|
||||||
best_size: Best Size
|
|
||||||
effect: Effect
|
|
||||||
all: All
|
all: All
|
||||||
categories: Categories
|
categories: Categories
|
||||||
add: Add
|
add: Add
|
||||||
@@ -3,12 +3,6 @@ zh_tw:
|
|||||||
ad_banner:
|
ad_banner:
|
||||||
ad_banner: 廣告輪播
|
ad_banner: 廣告輪播
|
||||||
banner: 橫幅
|
banner: 橫幅
|
||||||
banner_name: 橫幅名稱
|
|
||||||
banner_name_note: 橫幅名稱只能為英文
|
|
||||||
ste: 轉換間隔時間
|
|
||||||
ste_note: 請輸入秒數
|
|
||||||
best_size: 最佳尺寸
|
|
||||||
effect: 效果
|
|
||||||
all: 全部
|
all: 全部
|
||||||
categories: 類別
|
categories: 類別
|
||||||
add: 新增
|
add: 新增
|
||||||
+1
-3
@@ -11,9 +11,7 @@ module AdBanner
|
|||||||
update_info 'some update_info'
|
update_info 'some update_info'
|
||||||
|
|
||||||
taggable
|
taggable
|
||||||
authorizable do
|
authorizable
|
||||||
authorizable_on('AdBanner')
|
|
||||||
end
|
|
||||||
|
|
||||||
# front_end do
|
# front_end do
|
||||||
# app_page 'bulletins'
|
# app_page 'bulletins'
|
||||||
|
|||||||
Vendored
+5
-11
@@ -9,33 +9,27 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@ask_question = AskQuestion.new
|
@ask_question = AskQuestion.new
|
||||||
@categories = @module_app.categories.enabled
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@ask_question = AskQuestion.new(params[:ask_question])
|
@ask_question = AskQuestion.new(params[:ask_question])
|
||||||
if gotcha_valid? && @ask_question.save
|
if gotcha_valid? && @ask_question.save
|
||||||
@acknowledgement = AskAcknowledgement.last
|
@acknowledgement = AskAcknowledgement.last
|
||||||
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
|
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
|
||||||
|
#@ask_question.save
|
||||||
|
#redirect_to root_path
|
||||||
AskAdmin.all.each do |ask_admin|
|
AskAdmin.all.each do |ask_admin|
|
||||||
AskMailer.notice(ask_admin, @ask_question).deliver
|
AskMailer.notice(ask_admin, @ask_question).deliver
|
||||||
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
||||||
end
|
end
|
||||||
|
# redirect_to panel_ask_front_end_thank_you_path
|
||||||
# Render to create.js.erb
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
|
||||||
else
|
|
||||||
# Render to index.js.erb
|
|
||||||
respond_to do |format|
|
|
||||||
format.js { render :index }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def thank_you
|
def thank_you
|
||||||
@acknowledgement = AskAcknowledgement.last
|
@acknowledgement = AskAcknowledgement.last
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ $(document).ready(function(){
|
|||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :ask_category_id, class: 'control-label required' %>
|
<%= f.label :ask_category_id, class: 'control-label required' %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
|
<%= f.collection_select :ask_category_id, AskCategory.all, :id, :name %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|||||||
-1
@@ -1 +0,0 @@
|
|||||||
window.location.href = "<%= panel_ask_front_end_sorry_path %>";
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
<h3><%= t(:ask_fail, :scope => :ask) %> !</h3>
|
|
||||||
@@ -19,10 +19,8 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
namespace :front_end do
|
namespace :front_end do
|
||||||
match "ask_questions/thank_you" => "ask_questions#thank_you", :as => 'thank_you'
|
match "ask_questions/thank_you" => "ask_questions#thank_you", :as => 'thank_you'
|
||||||
match "ask_questions/sorry" => "ask_questions#sorry", :as => 'sorry'
|
|
||||||
resources :ask_questions
|
resources :ask_questions
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js
Vendored
-5
@@ -92,11 +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.coAuthorformCallback = function(data){
|
this.initializePersonalBook.coAuthorformCallback = function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
|
|||||||
-1
@@ -8,7 +8,6 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
|||||||
|
|
||||||
@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
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class WritingBook
|
|||||||
title << self.publisher if self.publisher.present?
|
title << self.publisher if self.publisher.present?
|
||||||
title << self.pages if self.pages.present?
|
title << self.pages if self.pages.present?
|
||||||
# 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
|
||||||
|
|||||||
-5
@@ -57,11 +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>
|
||||||
|
|||||||
Vendored
-2
@@ -75,8 +75,6 @@
|
|||||||
<% 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>
|
||||||
|
|||||||
-4
@@ -42,10 +42,6 @@ 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(){
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
|
|||||||
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
|
||||||
page = params[:page]
|
page = params[:page]
|
||||||
page ||= 1
|
page ||= 1
|
||||||
@userid = current_user.id
|
|
||||||
if @view_by.nil?
|
if @view_by.nil?
|
||||||
@writing_conferences = @writing_conferences.asc(:paper_title)
|
@writing_conferences = @writing_conferences.asc(:paper_title)
|
||||||
else
|
else
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ class WritingConference
|
|||||||
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
|
||||||
|
|||||||
-5
@@ -58,12 +58,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_conference_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Conference Papers</a></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
-4
@@ -75,11 +75,7 @@
|
|||||||
<% 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">
|
||||||
|
|||||||
-4
@@ -42,10 +42,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
|||||||
this.initializeJournalPapers.cancelpaper = function(){
|
this.initializeJournalPapers.cancelpaper = function(){
|
||||||
o.highlight_sub_menu_item(0);
|
o.highlight_sub_menu_item(0);
|
||||||
}
|
}
|
||||||
this.initializeJournalPapers.syncComplete = function(){
|
|
||||||
o.notify("Sync Complete","success");
|
|
||||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
var uploadFiles = function(){
|
var uploadFiles = function(){
|
||||||
$('#add_plugin_file a.add').click(function(){
|
$('#add_plugin_file a.add').click(function(){
|
||||||
|
|||||||
+1
-2
@@ -7,8 +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
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class WritingJournal
|
|||||||
title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||||
title << "From Page: "+self.form_to_start if (self.form_to_start.present? && self.form_to_start != "0")
|
title << "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 << "To Page: "+self.form_to_end if (self.form_to_end.present? && self.form_to_end != "0")
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_writing_journal_files=(var)
|
def new_writing_journal_files=(var)
|
||||||
|
|||||||
-4
@@ -58,10 +58,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Vendored
-2
@@ -80,8 +80,6 @@
|
|||||||
<% 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>
|
||||||
|
|||||||
Reference in new issue
Block a user