Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8ad13a9f5 | ||
|
|
7ed2afb405 |
No files matched your search
@@ -107,18 +107,15 @@ $(function() {
|
|||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#module_widget').on('change', '.checkbox-groups input', function(event) {
|
$('#module_widget').on('change', '.checkbox-groups input', function(event) {
|
||||||
var $checked = $(this);
|
var $checked = $(this);
|
||||||
if($checked.attr('type') == 'checkbox') {
|
if($checked.attr('type') == 'checkbox') {
|
||||||
if($checked.hasClass('select_all')) {
|
if($checked.hasClass('select_all') && $checked.prop('checked')) {
|
||||||
if($checked.prop('checked')){
|
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
||||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
|
} else if($checked.prop('checked') && !$checked.hasClass('lang-enable')) {
|
||||||
$checked.closest('.checkbox').siblings('.groups').find("input[type=hidden]").removeAttr('name');
|
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
||||||
}else{
|
} else {
|
||||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
|
||||||
$checked.closest('.checkbox').siblings('.groups').find("input[type=hidden]").attr('name', 'page_part['+$checked.closest('.checkbox-groups').data('for')+'][]');
|
|
||||||
}
|
|
||||||
} else if($checked.hasClass('lang-enable')) {
|
|
||||||
if($checked.prop('checked')) {
|
if($checked.prop('checked')) {
|
||||||
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
||||||
if(_status) {
|
if(_status) {
|
||||||
@@ -132,19 +129,6 @@ $(function() {
|
|||||||
$(this).find('input:eq(0)').prop('checked', true);
|
$(this).find('input:eq(0)').prop('checked', true);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
var checkboxes_size = $checked.closest('.groups').find("input[type=checkbox]").length,
|
|
||||||
checked_size = $checked.closest('.groups').find("input:checked").length;
|
|
||||||
if(checkboxes_size == checked_size)
|
|
||||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', true);
|
|
||||||
else
|
|
||||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
|
||||||
|
|
||||||
if(checked_size == 0)
|
|
||||||
$checked.closest('.groups').find("input[type=hidden]").attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]');
|
|
||||||
else
|
|
||||||
$checked.closest('.groups').find("input[type=hidden]").removeAttr('name');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||||
// the compiled file.
|
// the compiled file.
|
||||||
//
|
//
|
||||||
//= require mobile/jquery-1.7.1
|
//= require jquery
|
||||||
//= require lib/jquery.preload.min.js
|
//= require lib/jquery.preload.min.js
|
||||||
//= require cycle2
|
//= require cycle2
|
||||||
//= require mobile/jquery.mu.image.resize
|
//= require mobile/jquery.mu.image.resize
|
||||||
|
|||||||
-9266
File diff suppressed because it is too large.
Load diff
@@ -24,10 +24,10 @@ $('#index').live('pageinit',function(){
|
|||||||
});
|
});
|
||||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||||
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
||||||
// $('.slideshow').cycle({
|
$('.slideshow').cycle({
|
||||||
// fx: $effect,
|
fx: $effect,
|
||||||
// timeout: $timeout
|
timeout: $timeout
|
||||||
// });
|
});
|
||||||
$(".newlist").css({
|
$(".newlist").css({
|
||||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||||
})
|
})
|
||||||
@@ -113,10 +113,10 @@ $(window).bind("orientationchange", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||||
// $('.slideshow').cycle({
|
$('.slideshow').cycle({
|
||||||
// fx: $effect,
|
fx: $effect,
|
||||||
// timeout: $timeout
|
timeout: $timeout
|
||||||
// });
|
});
|
||||||
|
|
||||||
$(".newlist").css({
|
$(".newlist").css({
|
||||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||||
|
|||||||
@@ -171,19 +171,12 @@ div[data-role="page"] {
|
|||||||
float: left;
|
float: left;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
min-height: 490px;
|
min-height: 490px;
|
||||||
/*max-height: 490px;*/
|
max-height: 490px;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 0 10px 10px 0;
|
margin: 0 10px 10px 0;
|
||||||
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
||||||
}
|
}
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
.content .orbit-cycle-slideshow img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
#index .content .newpic {
|
#index .content .newpic {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
|
|||||||
@@ -0,0 +1,573 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
require 'net/http'
|
||||||
|
require 'open-uri'
|
||||||
|
|
||||||
|
class Admin::ImportDataController < OrbitBackendController
|
||||||
|
helper Admin::PagePartsHelper
|
||||||
|
include Admin::FrontendWidgetInterface
|
||||||
|
|
||||||
|
def get_teacher_data
|
||||||
|
uri = URI("https://localhost:8000/teachers.xml")
|
||||||
|
|
||||||
|
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
|
#uri.query = URI.encode_www_form(params)
|
||||||
|
res = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
|
@teacher_data = Hash.from_xml(res.body)
|
||||||
|
@teachers = @teacher_data["objects"]
|
||||||
|
@i = 5000
|
||||||
|
@teachers.each do |hash|
|
||||||
|
# @roles = Role.skip(1).first
|
||||||
|
@roles = Role.all
|
||||||
|
@teacher = User.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
if !hash['teacher_zh_tw'].blank?
|
||||||
|
@teacher.first_name = hash['teacher_zh_tw']
|
||||||
|
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
|
||||||
|
@teacher.first_name = hash['teacher_en']
|
||||||
|
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||||
|
@teacher.first_name = "Please Fill the Name"
|
||||||
|
end
|
||||||
|
|
||||||
|
I18n.locale = :en
|
||||||
|
if !hash['teacher_en'].blank?
|
||||||
|
@teacher.first_name = hash['teacher_en']
|
||||||
|
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
|
||||||
|
@teacher.first_name = hash['teacher_zh_tw']
|
||||||
|
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
|
||||||
|
@teacher.first_name = "Please Fill the Name"
|
||||||
|
end
|
||||||
|
|
||||||
|
#@teacher.first_name = hash['teacher_en']
|
||||||
|
@teacher.ntu_seq = hash['ntu_seq']
|
||||||
|
@teacher.sid = hash['ntu_seq']
|
||||||
|
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
|
||||||
|
@teacher.password = "testpass"
|
||||||
|
@i += 10
|
||||||
|
if !hash['email'].blank?
|
||||||
|
@user = User.where(email: "#{hash['email']}")
|
||||||
|
if @user.length == 0
|
||||||
|
@teacher.email = hash['email']
|
||||||
|
elsif @user.length > 0
|
||||||
|
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@teacher.email = "#{@i}@ntu.edu.tw"
|
||||||
|
end
|
||||||
|
|
||||||
|
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
|
||||||
|
@teacher.user_id = "defaultuser"
|
||||||
|
elsif hash['teacher_en'].blank?
|
||||||
|
@teacher.user_id = hash['teacher_zh_tw']
|
||||||
|
elsif hash['teacher_zh_tw']
|
||||||
|
@teacher.user_id = hash['teacher_en']
|
||||||
|
end
|
||||||
|
@teacher.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_book_data
|
||||||
|
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||||
|
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
|
uri.query = URI.encode_www_form(params)
|
||||||
|
res = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
|
teachers = User.all
|
||||||
|
|
||||||
|
teachers.each do |hash|
|
||||||
|
if hash.sid.present?
|
||||||
|
ntu_seq = hash.sid
|
||||||
|
books_xml = Nokogiri::XML( \
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||||
|
@books = books_xml.xpath("//Book").map do |book_node|
|
||||||
|
{
|
||||||
|
author: (book_node>"Authors").text,
|
||||||
|
year: (book_node>"PublishYear").text,
|
||||||
|
title: (book_node>"DocTitle").text,
|
||||||
|
remarks: (book_node>"Remarks").text,
|
||||||
|
publisher: (book_node>"Publisher").text,
|
||||||
|
book_title: (book_node>"BookTitle").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @books.present?
|
||||||
|
@books.each do |b|
|
||||||
|
@book = WritingBook.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@book.authors = b[:author]
|
||||||
|
@book.paper_title = b[:title]
|
||||||
|
@book.book_title = b[:book_title]
|
||||||
|
@book.note = b[:remarks]
|
||||||
|
@book.publisher = b[:publisher]
|
||||||
|
I18n.locale = :en
|
||||||
|
@book.authors = b[:author]
|
||||||
|
@book.paper_title = b[:title]
|
||||||
|
@book.book_title = b[:book_title]
|
||||||
|
@book.note = b[:remarks]
|
||||||
|
@book.publisher = b[:publisher]
|
||||||
|
@book.year = b[:year]
|
||||||
|
@book.create_user_id = hash.id
|
||||||
|
@book.save
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "No books by Teacher"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_conference_data
|
||||||
|
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||||
|
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
|
uri.query = URI.encode_www_form(params)
|
||||||
|
res = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
|
teachers = User.all
|
||||||
|
|
||||||
|
teachers.each do |hash|
|
||||||
|
if hash.sid.present?
|
||||||
|
ntu_seq = hash.sid
|
||||||
|
conference_xml = Nokogiri::XML( \
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||||
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
|
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||||
|
{
|
||||||
|
author: (cp_node>"Authors").text,
|
||||||
|
year: (cp_node>"PublishYear").text,
|
||||||
|
title: (cp_node>"PaperTitle").text,
|
||||||
|
conference: (cp_node>"PublishOn").text,
|
||||||
|
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||||
|
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||||
|
conference_title: (cp_node>"PublishOn").text,
|
||||||
|
remarks: (cp_node>"Remarks").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @conference_papers.present?
|
||||||
|
@conference_papers.each do |b|
|
||||||
|
@conference_paper = WritingConference.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@conference_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@conference_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
if b[:conference_title].blank?
|
||||||
|
@conference_paper.conference_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.conference_title = b[:conference_title]
|
||||||
|
end
|
||||||
|
|
||||||
|
@conference_paper.note = b[:remarks]
|
||||||
|
I18n.locale = :en
|
||||||
|
@conference_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@conference_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
if b[:conference_title].blank?
|
||||||
|
@conference_paper.conference_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.conference_title = b[:conference_title]
|
||||||
|
end
|
||||||
|
@conference_paper.note = b[:remarks]
|
||||||
|
|
||||||
|
@conference_paper.location = b[:location]
|
||||||
|
@conference_paper.year = b[:year]
|
||||||
|
@conference_paper.create_user_id = hash.id
|
||||||
|
|
||||||
|
@conference_paper.save!
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "No conference by Teacher"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get_journal_paper_data
|
||||||
|
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
|
||||||
|
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
|
uri.query = URI.encode_www_form(params)
|
||||||
|
res = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
|
teachers = User.all
|
||||||
|
|
||||||
|
teachers.each do |hash|
|
||||||
|
if hash.sid.present?
|
||||||
|
ntu_seq = hash.sid
|
||||||
|
paper_xml = Nokogiri::XML( \
|
||||||
|
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||||
|
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||||
|
{
|
||||||
|
author: (paper_node>"Authors").text,
|
||||||
|
year: (paper_node>"PublishYear").text,
|
||||||
|
title: (paper_node>"PaperTitle").text,
|
||||||
|
journal: (paper_node>"PublishOn").text,
|
||||||
|
volume:(paper_node>"Volume").text,
|
||||||
|
volumeno:(paper_node>"VolumeNo").text,
|
||||||
|
beginpage:(paper_node>"BeginPage").text,
|
||||||
|
endpage:(paper_node>"EndPage").text,
|
||||||
|
subgroup:(paper_node>"subgroup").text,
|
||||||
|
remarks: (paper_node>"Remarks").text,
|
||||||
|
cate: ((paper_node>"subgroup")>"Group").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @journal_papers.present?
|
||||||
|
@journal_papers.each do |b|
|
||||||
|
@journal_paper = WritingJournal.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@journal_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@journal_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@journal_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
@journal_paper.journal_title = b[:journal]
|
||||||
|
@journal_paper.note = b[:remarks]
|
||||||
|
I18n.locale = :en
|
||||||
|
@journal_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@journal_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@journal_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
@journal_paper.journal_title = b[:journal]
|
||||||
|
@journal_paper.note = b[:remarks]
|
||||||
|
@journal_paper.year = b[:year]
|
||||||
|
@journal_paper.vol_no = b[:volumeno]
|
||||||
|
@journal_paper.form_to_start = b[:beginpage]
|
||||||
|
@journal_paper.form_to_end = b[:endpage]
|
||||||
|
if !b[:cate].blank?
|
||||||
|
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||||
|
if @level_type.present?
|
||||||
|
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@journal_paper.create_user_id = hash.id
|
||||||
|
@journal_paper.save!
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "No journal paper by Teacher"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def sync_conference_data
|
||||||
|
@conference_data = WritingConference.where(create_user_id: "#{params[:user_id]}")
|
||||||
|
@conference_data.delete_all
|
||||||
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
|
# teachers.each do |hash|
|
||||||
|
if @user.sid.present?
|
||||||
|
ntu_seq = @user.sid
|
||||||
|
conference_xml = Nokogiri::XML( \
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
|
||||||
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
|
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
|
||||||
|
{
|
||||||
|
author: (cp_node>"Authors").text,
|
||||||
|
year: (cp_node>"PublishYear").text,
|
||||||
|
title: (cp_node>"PaperTitle").text,
|
||||||
|
conference: (cp_node>"PublishOn").text,
|
||||||
|
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||||
|
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||||
|
conference_title: (cp_node>"PublishOn").text,
|
||||||
|
remarks: (cp_node>"Remarks").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @conference_papers.present?
|
||||||
|
@conference_papers.each do |b|
|
||||||
|
@conference_paper = WritingConference.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@conference_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@conference_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
if b[:conference_title].blank?
|
||||||
|
@conference_paper.conference_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.conference_title = b[:conference_title]
|
||||||
|
end
|
||||||
|
|
||||||
|
@conference_paper.note = b[:remarks]
|
||||||
|
I18n.locale = :en
|
||||||
|
@conference_paper.authors = b[:author]
|
||||||
|
if b[:title].blank?
|
||||||
|
@conference_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
if b[:conference_title].blank?
|
||||||
|
@conference_paper.conference_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@conference_paper.conference_title = b[:conference_title]
|
||||||
|
end
|
||||||
|
@conference_paper.note = b[:remarks]
|
||||||
|
|
||||||
|
@conference_paper.location = b[:location]
|
||||||
|
@conference_paper.year = b[:year]
|
||||||
|
@conference_paper.create_user_id = @user.id
|
||||||
|
|
||||||
|
@conference_paper.save!
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "No conference by Teacher"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
|
||||||
|
format.html
|
||||||
|
format.json { render json: {"success"=>true}.to_json}
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def sync_journal_paper_data
|
||||||
|
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
|
||||||
|
@journal_data.delete_all
|
||||||
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
|
# teachers.each do |hash|
|
||||||
|
if @user.sid.present?
|
||||||
|
ntu_seq = @user.sid
|
||||||
|
paper_xml = Nokogiri::XML( \
|
||||||
|
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
|
||||||
|
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
|
||||||
|
{
|
||||||
|
author: (paper_node>"Authors").text,
|
||||||
|
year: (paper_node>"PublishYear").text,
|
||||||
|
title: (paper_node>"PaperTitle").text,
|
||||||
|
journal: (paper_node>"PublishOn").text,
|
||||||
|
volume:(paper_node>"Volume").text,
|
||||||
|
volumeno:(paper_node>"VolumeNo").text,
|
||||||
|
beginpage:(paper_node>"BeginPage").text,
|
||||||
|
endpage:(paper_node>"EndPage").text,
|
||||||
|
subgroup:(paper_node>"subgroup").text,
|
||||||
|
remarks: (paper_node>"Remarks").text,
|
||||||
|
cate: ((paper_node>"subgroup")>"Group").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @journal_papers.present?
|
||||||
|
@journal_papers.each do |b|
|
||||||
|
@journal_paper = WritingJournal.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@journal_paper.authors = b[:author]
|
||||||
|
|
||||||
|
if b[:title].blank?
|
||||||
|
@journal_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@journal_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
|
||||||
|
@journal_paper.journal_title = b[:journal]
|
||||||
|
@journal_paper.note = b[:remarks]
|
||||||
|
I18n.locale = :en
|
||||||
|
@journal_paper.authors = b[:author]
|
||||||
|
|
||||||
|
if b[:title].blank?
|
||||||
|
@journal_paper.paper_title = "No Title Present"
|
||||||
|
else
|
||||||
|
@journal_paper.paper_title = b[:title]
|
||||||
|
end
|
||||||
|
|
||||||
|
@journal_paper.journal_title = b[:journal]
|
||||||
|
@journal_paper.note = b[:remarks]
|
||||||
|
@journal_paper.year = b[:year]
|
||||||
|
@journal_paper.vol_no = b[:volumeno]
|
||||||
|
@journal_paper.form_to_start = b[:beginpage]
|
||||||
|
@journal_paper.form_to_end = b[:endpage]
|
||||||
|
|
||||||
|
if !b[:cate].blank?
|
||||||
|
@level_type = JournalLevelType.where(:key => b[:cate])
|
||||||
|
if @level_type.present?
|
||||||
|
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@journal_paper.create_user_id = @user.id
|
||||||
|
@journal_paper.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
|
||||||
|
format.html
|
||||||
|
format.json { render json: {"success"=>true}.to_json}
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def sync_book_data
|
||||||
|
@books_data = WritingBook.where(create_user_id: "#{params[:user_id]}")
|
||||||
|
@books_data.delete_all
|
||||||
|
@user = User.find("#{params[:user_id]}")
|
||||||
|
|
||||||
|
# teachers.each do |hash|
|
||||||
|
if @user.sid.present?
|
||||||
|
ntu_seq = @user.sid
|
||||||
|
books_xml = Nokogiri::XML( \
|
||||||
|
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
|
||||||
|
@books = books_xml.xpath("//Book").map do |book_node|
|
||||||
|
{
|
||||||
|
author: (book_node>"Authors").text,
|
||||||
|
year: (book_node>"PublishYear").text,
|
||||||
|
title: (book_node>"DocTitle").text,
|
||||||
|
remarks: (book_node>"Remarks").text,
|
||||||
|
publisher: (book_node>"Publisher").text,
|
||||||
|
book_title: (book_node>"BookTitle").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if @books.present?
|
||||||
|
@books.each do |b|
|
||||||
|
@book = WritingBook.new
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
@book.authors = b[:author]
|
||||||
|
@book.paper_title = b[:title]
|
||||||
|
@book.book_title = b[:book_title]
|
||||||
|
@book.note = b[:remarks]
|
||||||
|
@book.publisher = b[:publisher]
|
||||||
|
I18n.locale = :en
|
||||||
|
@book.authors = b[:author]
|
||||||
|
@book.paper_title = b[:title]
|
||||||
|
@book.book_title = b[:book_title]
|
||||||
|
@book.note = b[:remarks]
|
||||||
|
@book.publisher = b[:publisher]
|
||||||
|
@book.year = b[:year]
|
||||||
|
@book.create_user_id = @user.id
|
||||||
|
@book.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
|
||||||
|
format.html
|
||||||
|
format.json { render json: {"success"=>true}.to_json}
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get_announcement_data
|
||||||
|
uri = URI("https://localhost:8000/announcements.xml")
|
||||||
|
|
||||||
|
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
|
||||||
|
#uri.query = URI.encode_www_form(params)
|
||||||
|
res = Net::HTTP.get_response(uri)
|
||||||
|
|
||||||
|
@announcement_data = Hash.from_xml(res.body)
|
||||||
|
@announcements = @announcement_data["objects"]
|
||||||
|
@announcements.each do |hash|
|
||||||
|
@bulletin = Bulletin.new
|
||||||
|
|
||||||
|
I18n.locale = :zh_tw
|
||||||
|
if hash['announcement_title_zh_tw'].blank?
|
||||||
|
@bulletin.title = hash['announcement_title_en']
|
||||||
|
@bulletin.text = hash['announcement_content_zh_tw']
|
||||||
|
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||||
|
@bulletin.title = "Please Fill the Name"
|
||||||
|
@bulletin.text = hash['announcement_content_zh_tw']
|
||||||
|
else
|
||||||
|
@bulletin.title = hash['announcement_title_zh_tw']
|
||||||
|
@bulletin.text = hash['announcement_content_zh_tw']
|
||||||
|
end
|
||||||
|
|
||||||
|
I18n.locale = :en
|
||||||
|
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
|
||||||
|
@bulletin.title = "Please Fill the Name"
|
||||||
|
@bulletin.text = hash['announcement_content_en']
|
||||||
|
|
||||||
|
elsif hash['announcement_title_en'].blank?
|
||||||
|
@bulletin.title = hash['announcement_zh_tw']
|
||||||
|
@bulletin.text = hash['announcement_content_en']
|
||||||
|
|
||||||
|
elsif hash['announcement_title_zh_tw'].blank?
|
||||||
|
@bulletin.title = hash['announcement_title_en']
|
||||||
|
@bulletin.text = hash['announcement_content_en']
|
||||||
|
end
|
||||||
|
@bulletin.category_id = "51d2a16438178423c2000001"
|
||||||
|
@bulletin.is_pending = true
|
||||||
|
|
||||||
|
@bulletin.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_page_data
|
||||||
|
f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
|
||||||
|
page_xml = Nokogiri::XML(f)
|
||||||
|
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
|
||||||
|
@pages = page_xml.xpath("//management-page").map do |cp_node|
|
||||||
|
{
|
||||||
|
menu_title: (cp_node>"menu-title").text,
|
||||||
|
content: (cp_node>"content").text
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
if @pages.present?
|
||||||
|
@i=0
|
||||||
|
@pages.each do |b|
|
||||||
|
|
||||||
|
get_variables_for_new
|
||||||
|
@page = Page.new
|
||||||
|
|
||||||
|
@page.parent = "4f45f3b9e9d02c5db900005d"
|
||||||
|
@page.design = "50ac424983e75219d2000021"
|
||||||
|
@page.theme_id = "50ac424a83e75219d2000025"
|
||||||
|
@page.menu_enabled_for= ["en", "zh_tw", ""]
|
||||||
|
@page.enabled_for= ["en", "zh_tw", ""]
|
||||||
|
@page.is_published = false
|
||||||
|
if b[:menu_title].blank?
|
||||||
|
@page.title = 'No Title Present'
|
||||||
|
@i += 1
|
||||||
|
@page.name = "#{@i}Page"
|
||||||
|
else
|
||||||
|
@i += 1
|
||||||
|
@page.title = b[:menu_title]
|
||||||
|
@page.name = "#{@i}Page"
|
||||||
|
end
|
||||||
|
if b[:content].blank?
|
||||||
|
@page.content = "No Content Present"
|
||||||
|
else
|
||||||
|
@page.content = b[:content]
|
||||||
|
end
|
||||||
|
@page.save!
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "No Page Data"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get_variables_for_new
|
||||||
|
@designs = Design.all.entries
|
||||||
|
@themes = Design.first.themes
|
||||||
|
@module_apps = ModuleApp.for_frontend_select
|
||||||
|
@app_frontend_urls = nil
|
||||||
|
@categories = nil
|
||||||
|
@tags = nil
|
||||||
|
@page_frontend_data_counts = nil
|
||||||
|
@frontend_styles = nil
|
||||||
|
@selected={
|
||||||
|
:design => @designs.first,
|
||||||
|
:theme=> @themes.first,
|
||||||
|
:module_app=>nil,#@module_apps.first
|
||||||
|
:app_frontend_url=> nil, #@module_apps.first
|
||||||
|
:category=>nil,
|
||||||
|
:tag=>nil,
|
||||||
|
:page_frontend_data_count=>nil,
|
||||||
|
:frontend_style => nil
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
@@ -23,13 +23,6 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_mobile_api_openness
|
|
||||||
if !Site.first.mobile_api_openness_on
|
|
||||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def site_restart
|
def site_restart
|
||||||
Resque.enqueue(RestartServer)
|
Resque.enqueue(RestartServer)
|
||||||
end
|
end
|
||||||
@@ -153,15 +146,15 @@ class ApplicationController < ActionController::Base
|
|||||||
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])
|
||||||
#check if the default locale is present or not
|
#check if the default locale is present or not
|
||||||
elsif params[:locale]
|
elsif session[:locale]
|
||||||
condition = @site.in_use_locales.include?(params[:locale])
|
condition = @site.in_use_locales.include?(session[:locale])
|
||||||
elsif @site.default_locale.present?
|
|
||||||
default_locale = @site.default_locale
|
|
||||||
condition = @site.in_use_locales.include?(default_locale)
|
|
||||||
elsif @site.enable_language_detection
|
elsif @site.enable_language_detection
|
||||||
#check enable langauge detection
|
#check enable langauge detection
|
||||||
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)
|
||||||
|
elsif @site.default_locale.present?
|
||||||
|
default_locale = @site.default_locale
|
||||||
|
condition = @site.in_use_locales.include?(default_locale)
|
||||||
end
|
end
|
||||||
|
|
||||||
session[:locale] = condition ? (browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
|
session[:locale] = condition ? (browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
|
||||||
@@ -245,7 +238,7 @@ class ApplicationController < ActionController::Base
|
|||||||
redirect_to ret
|
redirect_to ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil, pagination = true)
|
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
||||||
if params[:filter] || params[:sort] || params[:new_filter]
|
if params[:filter] || params[:sort] || params[:new_filter]
|
||||||
@filter = params[:filter]
|
@filter = params[:filter]
|
||||||
new_filter = params[:new_filter]
|
new_filter = params[:new_filter]
|
||||||
@@ -353,11 +346,7 @@ class ApplicationController < ActionController::Base
|
|||||||
objects = get_bulletins_for_open_backend(objects)
|
objects = get_bulletins_for_open_backend(objects)
|
||||||
end
|
end
|
||||||
|
|
||||||
if pagination
|
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
|
||||||
else
|
|
||||||
filter_authorized_objects(objects)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_bulletins_for_open_backend(objects)
|
def get_bulletins_for_open_backend(objects)
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
|
|
||||||
def default_widget
|
def default_widget
|
||||||
@search = params["search_query"].blank? ? false : true
|
@search = params["search_query"].blank? ? false : true
|
||||||
|
|
||||||
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
||||||
clicked_field_name = params["clicked_field_name"].to_sym
|
clicked_field_name = params["clicked_field_name"].to_sym
|
||||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||||
@@ -70,10 +69,7 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:filter_category_id] and !params[:filter_category_id].blank?
|
if @paginate || @search
|
||||||
@data = get_filter_data.page(params[:page_main]).per(@data_limit)
|
|
||||||
|
|
||||||
elsif @paginate || @search
|
|
||||||
if @search
|
if @search
|
||||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
||||||
else #regular listing
|
else #regular listing
|
||||||
@@ -98,18 +94,6 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_filter_data
|
|
||||||
model = @default_widget["query"].classify.constantize
|
|
||||||
if params[:filter_category_id].is_a? Array
|
|
||||||
data = model.where(:category_id.in => params[:filter_category_id])
|
|
||||||
elsif params[:filter_category_id].is_a? String
|
|
||||||
data = model.where(:category_id => params[:filter_category_id])
|
|
||||||
end
|
|
||||||
data.available_for_lang(I18n.locale).can_display.desc(:is_top, :postdate)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_category_field_name
|
def get_category_field_name
|
||||||
@ori_class_name = @ori_class_name.constantize
|
@ori_class_name = @ori_class_name.constantize
|
||||||
@ori_class_name.fields.each_key do |key|
|
@ori_class_name.fields.each_key do |key|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class MobileController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
date_now = Time.now
|
date_now = Time.now
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
|
||||||
@ad_banner = AdBanner.find(:all, :conditions => {:title => /Home/i})[0]
|
@ad_banner = AdBanner.where(title: "Banner")[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def announcement
|
def announcement
|
||||||
|
|||||||
@@ -64,25 +64,23 @@ class PagesController < ApplicationController
|
|||||||
url = "/#{@item.path}"
|
url = "/#{@item.path}"
|
||||||
options = ''
|
options = ''
|
||||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}click=#{params[:click]}" unless params[:click].blank?
|
|
||||||
# options << "#{options.blank? ? '?' : '&'}part_id=#{params[:page_part_id]}" unless params[:page_part_id].blank?
|
|
||||||
|
|
||||||
if params[:category_id].is_a? Array
|
if params[:category_id].is_a? Array
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_category_id',params[:category_id])}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||||
elsif params[:category_id].is_a? String
|
elsif params[:category_id].is_a? String
|
||||||
options << "#{options.blank? ? '?' : '&'}filter_category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:tag_id].is_a? Array
|
if params[:tag_id].is_a? Array
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||||
elsif params[:category_id].is_a? String
|
elsif params[:category_id].is_a? String
|
||||||
options << "#{options.blank? ? '?' : '&'}filter_tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||||
# uri = URI::escape(url + options)
|
uri = URI::escape(url + options)
|
||||||
uri = url + options
|
|
||||||
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
||||||
redirect_to(uri)unless save_from_no_lang_for_page
|
redirect_to(uri)unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
@@ -96,7 +94,6 @@ class PagesController < ApplicationController
|
|||||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}image_id=#{params[:image_id]}" unless params[:image_id].blank?
|
|
||||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -108,96 +105,26 @@ class PagesController < ApplicationController
|
|||||||
protected
|
protected
|
||||||
|
|
||||||
def get_item
|
def get_item
|
||||||
# if params[:page_id]
|
|
||||||
# @item = Item.find(params[:page_id])
|
|
||||||
# elsif params[:same_page_id]
|
|
||||||
# @item = Item.find(params[:same_page_id])
|
|
||||||
# else
|
|
||||||
# category_ids = Array(params[:category_id]) unless params[:category_id].nil?
|
|
||||||
# tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
|
||||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
|
||||||
|
|
||||||
# default_query = { is_published: true, module_app_id: module_app.id, :app_frontend_url.in => [params[:app_action], 'default_widget'] }
|
|
||||||
# specific_categories = { :category => category_ids }
|
|
||||||
# in_categories = { :category.in => category_ids }
|
|
||||||
# nil_categories = { :category.in => [nil, []] }
|
|
||||||
# specific_tags = { :tag => tag_ids }
|
|
||||||
# in_tags = { :tag.in => tag_ids }
|
|
||||||
# nil_tags = { :tag.in => [nil, []] }
|
|
||||||
|
|
||||||
# if !category_ids.blank? && !tag_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(specific_tags)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(in_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(in_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
|
||||||
# elsif !category_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories)).first unless @item
|
|
||||||
# elsif !tag_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags)).first unless @item
|
|
||||||
# end
|
|
||||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
|
||||||
# @item = Item.where(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query).first unless @item
|
|
||||||
# end
|
|
||||||
# raise PageError, 'Missing Frontend Page' if @item.nil?
|
|
||||||
|
|
||||||
# if params[:page_id]
|
|
||||||
# @item = Item.find(params[:page_id])
|
|
||||||
# elsif params[:same_page_id]
|
|
||||||
# @item = Item.find(params[:same_page_id])
|
|
||||||
# else
|
|
||||||
# category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
|
||||||
# tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
|
||||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
|
||||||
# if !category_ids.blank? && !tag_ids.blank?
|
|
||||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
|
||||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
|
||||||
# elsif !category_ids.blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
|
||||||
# elsif !tag_ids.blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
|
||||||
# end
|
|
||||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
|
||||||
# # @item = Item.root.children.where(:module_app_id => module_app.id).first
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
|
||||||
# end
|
|
||||||
# raise PageError,'Missing Frontend Page' if @item.nil?
|
|
||||||
|
|
||||||
if params[:page_id]
|
if params[:page_id]
|
||||||
@item = Item.find(params[:page_id])
|
@item = Item.find(params[:page_id])
|
||||||
elsif params[:same_page_id]
|
elsif params[:same_page_id]
|
||||||
@item = Item.find(params[:same_page_id])
|
@item = Item.find(params[:same_page_id])
|
||||||
else
|
else
|
||||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||||
category_ids = params[:category_id] ? (params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]) : []
|
|
||||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||||
|
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||||
if !category_ids.blank?
|
if !category_ids.blank? && !tag_ids.blank?
|
||||||
@item = Item.where(:category => category_ids).first
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||||
else
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||||
if params[:action] && params[:action] == "show_from_link"
|
elsif !category_ids.blank?
|
||||||
model = params[:app_action].classify.constantize rescue nil
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||||
if !model.nil?
|
elsif !tag_ids.blank?
|
||||||
item = model.find(params[:id])
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||||
@item = Item.root.children.where(:module_app_id => module_app.id).first unless @item
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||||
@item = Item.where(:module_app_id => module_app.id).first unless @item
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||||
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||||
end
|
end
|
||||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class Site
|
|||||||
|
|
||||||
field :frontend_open, :type => Boolean, :default => true
|
field :frontend_open, :type => Boolean, :default => true
|
||||||
field :backend_openness_on, :type => Boolean, :default => false
|
field :backend_openness_on, :type => Boolean, :default => false
|
||||||
field :mobile_api_openness_on, :type => Boolean, :default => false
|
|
||||||
field :desktop_closed, :type => Boolean, :default => false
|
field :desktop_closed, :type => Boolean, :default => false
|
||||||
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
||||||
field :enable_terms_of_use, :type => Boolean, :default => false
|
field :enable_terms_of_use, :type => Boolean, :default => false
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Imported Announcement Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Book Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Conference Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Journal Paper Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Imported Page Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Successfully Imported Teacher Data!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Book Data Synced Successfully!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Conference Paper Data Synced Successfully!</p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>Journal Paper Data Synced Successfully!</p>
|
||||||
@@ -97,26 +97,25 @@
|
|||||||
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
|
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups" data-for="category">
|
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups">
|
||||||
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= content_tag :label, class: "checkbox" do %>
|
<%= content_tag :label, class: "checkbox" do %>
|
||||||
<%= check_box_tag nil, nil, (@part.category.size == @module_app_categories.size ? true : false), class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, false, class: "select_all" %> <%= t(:all) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-category">
|
<div class="groups" id="page-category">
|
||||||
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
||||||
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
||||||
<%= category.title %>
|
<%= category.title %>
|
||||||
<% end if @module_app_categories %>
|
<% end if @module_app_categories %>
|
||||||
<input type="hidden" value>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups" data-for="tag">
|
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups">
|
||||||
<%= f.label :tags, t(:tags), class: "control-label muted" %>
|
<%= f.label :tags, t(:tags), class: "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= content_tag :label, class: "checkbox" do %>
|
<%= content_tag :label, class: "checkbox" do %>
|
||||||
<%= check_box_tag nil, nil, (@part.tag.size == @module_app_tags.size ? true : false), class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-tags">
|
<div class="groups" id="page-tags">
|
||||||
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
|
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
|
||||||
@@ -163,8 +162,8 @@
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function toggleChecked(status) {
|
function toggleChecked(status) {
|
||||||
$(".checkbox").each( function() {
|
$(".checkbox").each( function() {
|
||||||
$(this).attr("checked",status);
|
$(this).attr("checked",status);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -132,21 +132,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label muted"><%= I18n.t('site.mobile_version')%></label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.check_box :mobile_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label muted"><%= I18n.t('site.mobile_api_openness_on') %></label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.check_box :mobile_api_openness_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
|
||||||
<span class="help-block">Make API available for Mobile Apps</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
|
|||||||
@@ -1,23 +1,19 @@
|
|||||||
<% if @menu_page.children.present? %>
|
<% if @menu_page %>
|
||||||
<div class='category_list'>
|
<div class='category_list'>
|
||||||
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
||||||
<ul class='list'>
|
<ul class='list'>
|
||||||
|
|
||||||
<% @menu_page.visible_children.each do |child| %>
|
<% @menu_page.visible_children.each do |child| %>
|
||||||
|
<% if @menu_page.visible_children.nil?%>
|
||||||
|
<p>Test</p>
|
||||||
|
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
|
||||||
|
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
||||||
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
|
||||||
<div class='category_list'>
|
|
||||||
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
|
||||||
<ul class='list'>
|
|
||||||
<% @menu_page.parent.parent.visible_children.each do |child| %>
|
|
||||||
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
|
||||||
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -386,7 +386,6 @@ en:
|
|||||||
thumbnail: Thumbnail
|
thumbnail: Thumbnail
|
||||||
site:
|
site:
|
||||||
backend_openness_on: Backend Openness
|
backend_openness_on: Backend Openness
|
||||||
mobile_api_openness_on: Mobile API Openness
|
|
||||||
default_image: Site default image
|
default_image: Site default image
|
||||||
description: Site description
|
description: Site description
|
||||||
description_help: Description Guide
|
description_help: Description Guide
|
||||||
@@ -400,7 +399,7 @@ en:
|
|||||||
keywords: Site keywords
|
keywords: Site keywords
|
||||||
keywords_help: Keyword Guide
|
keywords_help: Keyword Guide
|
||||||
language: Site language
|
language: Site language
|
||||||
mobile_version: Enable Mobile Web
|
mobile_version: Mobile version
|
||||||
openness: Openness
|
openness: Openness
|
||||||
search: Site Search
|
search: Site Search
|
||||||
search_help: Please Enter the search argument for Google search.
|
search_help: Please Enter the search argument for Google search.
|
||||||
|
|||||||
@@ -389,7 +389,6 @@ zh_tw:
|
|||||||
frontend_closed: 前台關閉?
|
frontend_closed: 前台關閉?
|
||||||
frontend_open: 開啟前台
|
frontend_open: 開啟前台
|
||||||
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
||||||
mobile_api_openness_on: 開啟手機API
|
|
||||||
enable_personal_desktop: 開啟個人桌面
|
enable_personal_desktop: 開啟個人桌面
|
||||||
default_image: 預設圖像
|
default_image: 預設圖像
|
||||||
description: 網站描述
|
description: 網站描述
|
||||||
|
|||||||
+3
-5
@@ -8,13 +8,11 @@ defaults: &defaults
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
|
|
||||||
# set these environment variables on your prod server
|
# set these environment variables on your prod server
|
||||||
production:
|
production:
|
||||||
@@ -24,4 +22,4 @@ production:
|
|||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
@@ -207,6 +207,16 @@ 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'
|
||||||
|
|||||||
@@ -3,18 +3,15 @@ production:
|
|||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8982
|
port: 8982
|
||||||
log_level: WARNING
|
log_level: WARNING
|
||||||
solr_home: solr
|
|
||||||
|
|
||||||
development:
|
development:
|
||||||
solr:
|
solr:
|
||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8982
|
port: 8982
|
||||||
log_level: INFO
|
log_level: INFO
|
||||||
solr_home: solr
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
solr:
|
solr:
|
||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8981
|
port: 8981
|
||||||
log_level: WARNING
|
log_level: WARNING
|
||||||
solr_home: solr
|
|
||||||
@@ -12,9 +12,9 @@ module DefaultWidgetTagHelper
|
|||||||
if param.is_a?(Array) and !param.blank?
|
if param.is_a?(Array) and !param.blank?
|
||||||
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
||||||
params.delete index
|
params.delete index
|
||||||
params_str = params_str + "&"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
||||||
content_tag :div,:class=> 'more' do
|
content_tag :div,:class=> 'more' do
|
||||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ module ParserFrontEnd
|
|||||||
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
||||||
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
||||||
body = Nokogiri::HTML(page.content)
|
body = Nokogiri::HTML(page.content)
|
||||||
|
|
||||||
if @edit
|
if @edit
|
||||||
body.css('.page_part').each do |page_part|
|
body.css('.page_part').each do |page_part|
|
||||||
part = PagePart.find(page_part['part_id']) rescue nil
|
part = PagePart.find(page_part['part_id']) rescue nil
|
||||||
@@ -40,16 +41,13 @@ module ParserFrontEnd
|
|||||||
end
|
end
|
||||||
|
|
||||||
body.css('orbit_front').each do |front|
|
body.css('orbit_front').each do |front|
|
||||||
|
|
||||||
if front['value']
|
if front['value']
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
||||||
else
|
else
|
||||||
ret = ''
|
ret = ''
|
||||||
part = PagePart.find(front['part_id']) if front['part_id']
|
part = PagePart.find(front['part_id']) if front['part_id']
|
||||||
ret << eval("\"#{front['path']}\"") rescue ''
|
ret << eval("\"#{front['path']}\"") rescue ''
|
||||||
ar = args.to_param
|
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args.present?
|
||||||
ar = URI.unescape(ar)
|
|
||||||
ret << (ret.include?("?") ? "&#{ar}" : "?#{ar}") if args.present?
|
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||||
end
|
end
|
||||||
front.swap(fragment)
|
front.swap(fragment)
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
namespace :gallery do
|
|
||||||
task :migrate_albums => :environment do
|
|
||||||
@albums = GalleryAlbum.all
|
|
||||||
@albums.each do |album|
|
|
||||||
newalbum = Album.new
|
|
||||||
newalbum.name = album.name
|
|
||||||
newalbum.description = album.description
|
|
||||||
newalbum.cover = album.cover
|
|
||||||
newalbum.cover_path = album.cover_path
|
|
||||||
newalbum.tag_names = album.tag_names
|
|
||||||
newalbum.category_id = album.category_id
|
|
||||||
newalbum.save!
|
|
||||||
@images = album.gallery_images
|
|
||||||
@images.each do |image|
|
|
||||||
img = newalbum.album_images.new
|
|
||||||
img.title = image.title
|
|
||||||
img.description = image.description
|
|
||||||
img.file = image.file
|
|
||||||
img.save!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -122,7 +122,7 @@ namespace :migrate do
|
|||||||
a.widgets = {}
|
a.widgets = {}
|
||||||
a.widgets[:widget1] = []
|
a.widgets[:widget1] = []
|
||||||
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
||||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"Album.all", "value"=>:id, "label"=>:name}}}
|
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||||
a.save
|
a.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace :new_ui do
|
|||||||
%w(ask ask_question ask_category),
|
%w(ask ask_question ask_category),
|
||||||
%w(asset asset),
|
%w(asset asset),
|
||||||
%w(faq qa),
|
%w(faq qa),
|
||||||
%w(gallery album gallery_category),
|
%w(gallery gallery_album gallery_category),
|
||||||
%w(location location),
|
%w(location location),
|
||||||
%w(personal_book writing_book),
|
%w(personal_book writing_book),
|
||||||
%w(personal_conference writing_conference),
|
%w(personal_conference writing_conference),
|
||||||
|
|||||||
+1
@@ -30,6 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "news_link" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= stylesheet_link_tag "announcement/bulletins_and_web_links" %>
|
<%= stylesheet_link_tag "announcement/bulletins_and_web_links" %>
|
||||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<%= stylesheet_link_tag "default_widget" %>
|
<%= stylesheet_link_tag "default_widget" %>
|
||||||
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
|
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
|
||||||
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
||||||
|
|
||||||
<div id="bulletin_widget">
|
<div id="bulletin_widget">
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
<%= stylesheet_link_tag "default_widget" %>
|
<%= stylesheet_link_tag "default_widget" %>
|
||||||
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||||
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||||
|
|
||||||
<div id="archive_file_widget">
|
<div id="archive_file_widget">
|
||||||
<%= render 'index' %>
|
<%= render 'index' %>
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
<%= stylesheet_link_tag "default_widget" %>
|
<%= stylesheet_link_tag "default_widget" %>
|
||||||
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||||
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||||
|
|
||||||
<div id="archive_file_widget">
|
<div id="archive_file_widget">
|
||||||
<%= render 'index' %>
|
<%= render 'index' %>
|
||||||
|
|||||||
Vendored
-2
@@ -12,9 +12,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%if user_signed_in? && is_manager?%>
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<%= link_to t(:delete_), panel_calendar_new_back_end_event_path(@event),:class => "btn bt-del", :method => :delete, :remote => true %>
|
<%= link_to t(:delete_), panel_calendar_new_back_end_event_path(@event),:class => "btn bt-del", :method => :delete, :remote => true %>
|
||||||
<%= link_to t(:edit), edit_panel_calendar_new_back_end_event_path(@event),:class => "btn btn-primary",:id=>"edit_event_btn" ,:remote => true %>
|
<%= link_to t(:edit), edit_panel_calendar_new_back_end_event_path(@event),:class => "btn btn-primary",:id=>"edit_event_btn" ,:remote => true %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
Vendored
+11
@@ -48,7 +48,18 @@
|
|||||||
<div id="event_quick_view" class="modal" style="width: 300px; display:none; margin:0 0 0 0;"></div>
|
<div id="event_quick_view" class="modal" style="width: 300px; display:none; margin:0 0 0 0;"></div>
|
||||||
<div id="event_create_space" class="modal" style="right: 8px; bottom: 50px; left: auto; top: auto; width: 400px; margin: 0;display:none;"></div>
|
<div id="event_create_space" class="modal" style="right: 8px; bottom: 50px; left: auto; top: auto; width: 400px; margin: 0;display:none;"></div>
|
||||||
<div id="calendar-loading">Loading...</div>
|
<div id="calendar-loading">Loading...</div>
|
||||||
|
<div class="form-actions form-fixed">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span8">
|
||||||
|
</div>
|
||||||
|
<%if is_manager?%>
|
||||||
|
<div class="span4">
|
||||||
|
<%= link_to "Add", new_panel_calendar_new_back_end_event_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var calendar = new Calendar("#calendar");
|
var calendar = new Calendar("#calendar");
|
||||||
</script>
|
</script>
|
||||||
|
<%end%>
|
||||||
@@ -228,8 +228,8 @@ var galleryAPI = function(){
|
|||||||
next = imagecount + 1;
|
next = imagecount + 1;
|
||||||
prev = imagecount - 1;
|
prev = imagecount - 1;
|
||||||
}
|
}
|
||||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||||
};
|
};
|
||||||
if(imageArray.length > 1)
|
if(imageArray.length > 1)
|
||||||
updateNavigation();
|
updateNavigation();
|
||||||
|
|||||||
+8
-6
@@ -8,7 +8,7 @@ var galleryAPI = function(){
|
|||||||
g = this;
|
g = this;
|
||||||
this.urlVars = rcom.getUrlVars();
|
this.urlVars = rcom.getUrlVars();
|
||||||
this.albumArea = $("#orbit_gallery");
|
this.albumArea = $("#orbit_gallery");
|
||||||
this.loadArea = "theater";
|
this.loadArea = null;
|
||||||
this.tagList = $(".taglist ul");
|
this.tagList = $(".taglist ul");
|
||||||
this.loading = $("#loading");
|
this.loading = $("#loading");
|
||||||
// this.authenticated = false;
|
// this.authenticated = false;
|
||||||
@@ -19,7 +19,7 @@ var galleryAPI = function(){
|
|||||||
if(photo_id){
|
if(photo_id){
|
||||||
var params = rcom.getUrlVars();
|
var params = rcom.getUrlVars();
|
||||||
var url = window.location.href.split("?")[0];
|
var url = window.location.href.split("?")[0];
|
||||||
params["image_id"] = photo_id;
|
params["id"] = photo_id;
|
||||||
for(i=0;i<params.length;i++){
|
for(i=0;i<params.length;i++){
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
url+="?"+params[i]+"="+params[params[i]];
|
url+="?"+params[i]+"="+params[params[i]];
|
||||||
@@ -34,7 +34,7 @@ var galleryAPI = function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadTheater = function(albumid,id){
|
this.loadTheater = function(id){
|
||||||
var imageArray;
|
var imageArray;
|
||||||
var imagecount = 0;
|
var imagecount = 0;
|
||||||
// var picHeight = 0;
|
// var picHeight = 0;
|
||||||
@@ -163,6 +163,7 @@ var galleryAPI = function(){
|
|||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){
|
$img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){
|
||||||
|
console.log(dom.attr("data-content"));
|
||||||
g.loadcomplete();
|
g.loadcomplete();
|
||||||
$img.fadeIn(200);
|
$img.fadeIn(200);
|
||||||
});;
|
});;
|
||||||
@@ -173,8 +174,9 @@ var galleryAPI = function(){
|
|||||||
$slidelist.stop().animate({'height':'0px'}, 300);
|
$slidelist.stop().animate({'height':'0px'}, 300);
|
||||||
$slidelist.find("ul").hide();
|
$slidelist.find("ul").hide();
|
||||||
if(rcom.getInternetExplorerVersion() == -1){
|
if(rcom.getInternetExplorerVersion() == -1){
|
||||||
|
|
||||||
if(pageurl!=window.location){
|
if(pageurl!=window.location){
|
||||||
pageurl = window.location.pathname+"?id="+albumid+"&controller_action=theater&image_id="+pageurl;
|
pageurl = window.location.pathname+"?id="+pageurl+"&controller_action=theater";
|
||||||
window.history.pushState({path:pageurl},'',pageurl);
|
window.history.pushState({path:pageurl},'',pageurl);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@@ -203,8 +205,8 @@ var galleryAPI = function(){
|
|||||||
next = imagecount + 1;
|
next = imagecount + 1;
|
||||||
prev = imagecount - 1;
|
prev = imagecount - 1;
|
||||||
}
|
}
|
||||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||||
};
|
};
|
||||||
if(imageArray.length > 1)
|
if(imageArray.length > 1)
|
||||||
updateNavigation();
|
updateNavigation();
|
||||||
|
|||||||
Vendored
+15
-15
@@ -6,32 +6,32 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
@image = AlbumImage.find(params[:id])
|
@image = GalleryImage.find(params[:id])
|
||||||
@albumid = @image.album_id
|
@albumid = @image.gallery_album_id
|
||||||
@album = Album.find(@albumid)
|
@album = GalleryAlbum.find(@albumid)
|
||||||
@images = @album.album_images.all
|
@images = @album.gallery_images.all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
images = params['images']
|
images = params['images']
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
img = AlbumImage.find(image)
|
img = GalleryImage.find(image)
|
||||||
img.delete
|
img.delete
|
||||||
end
|
end
|
||||||
if params['delete_cover'] == "true"
|
if params['delete_cover'] == "true"
|
||||||
album = Album.find(params['id'])
|
album = GalleryAlbum.find(params['id'])
|
||||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||||
end
|
end
|
||||||
render :json =>{"success"=>true}.to_json
|
render :json =>{"success"=>true}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_image
|
def update_image
|
||||||
image = AlbumImage.find(params[:image_id])
|
image = GalleryImage.find(params[:image_id])
|
||||||
image.update_attributes(params[:album_image])
|
image.update_attributes(params[:gallery_image])
|
||||||
image.save
|
image.save
|
||||||
@album = Album.find(image.album_id.to_s)
|
@album = GalleryAlbum.find(image.gallery_album_id.to_s)
|
||||||
@images = @album.album_images
|
@images = @album.gallery_images
|
||||||
@image_content = []
|
@image_content = []
|
||||||
@images.each do |image|
|
@images.each do |image|
|
||||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||||
@@ -42,11 +42,11 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
|||||||
def delete_photos
|
def delete_photos
|
||||||
images = params['images']
|
images = params['images']
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
img = AlbumImage.find(image)
|
img = GalleryImage.find(image)
|
||||||
img.delete
|
img.delete
|
||||||
end
|
end
|
||||||
if params['delete_cover'] == "true"
|
if params['delete_cover'] == "true"
|
||||||
album = Album.find(params['album_id'])
|
album = GalleryAlbum.find(params['album_id'])
|
||||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||||
end
|
end
|
||||||
render :json =>{"success"=>true}.to_json
|
render :json =>{"success"=>true}.to_json
|
||||||
@@ -57,13 +57,13 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
|||||||
tags = params[:tag_ids]
|
tags = params[:tag_ids]
|
||||||
i = nil
|
i = nil
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
img = AlbumImage.find(image)
|
img = GalleryImage.find(image)
|
||||||
img.tagged_ids = tags
|
img.tagged_ids = tags
|
||||||
img.save
|
img.save
|
||||||
i = img
|
i = img
|
||||||
end
|
end
|
||||||
@album = Album.find(i.album_id.to_s)
|
@album = GalleryAlbum.find(i.gallery_album_id.to_s)
|
||||||
@images = @album.album_images
|
@images = @album.gallery_images
|
||||||
@image_content = []
|
@image_content = []
|
||||||
@images.each do |image|
|
@images.each do |image|
|
||||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||||
|
|||||||
Vendored
+35
-42
@@ -1,5 +1,5 @@
|
|||||||
class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
open_for_visitor :only => [:index, :show, :get_album_json, :get_imgs_json, :imgs]
|
open_for_visitor :only => [:index, :show]
|
||||||
open_for_manager :except => [:index,:show,:update]
|
open_for_manager :except => [:index,:show,:update]
|
||||||
open_for_sub_manager :except => [:index, :show]
|
open_for_sub_manager :except => [:index, :show]
|
||||||
|
|
||||||
@@ -13,13 +13,12 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
@categories = get_categories_for_index
|
@categories = get_categories_for_index
|
||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
category_ids = @categories.collect{|t| t.id}
|
category_ids = @categories.collect{|t| t.id}
|
||||||
@albums = get_sorted_and_filtered("album", :category_id.in => category_ids)
|
@albums = get_sorted_and_filtered("gallery_album", :category_id.in => category_ids)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@album = Album.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@images = @album.album_images
|
@images = @album.gallery_images
|
||||||
@image_content = []
|
@image_content = []
|
||||||
@images.each do |image|
|
@images.each do |image|
|
||||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||||
@@ -34,12 +33,12 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
def new
|
def new
|
||||||
@categories = get_categories_for_index
|
@categories = get_categories_for_index
|
||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
@album = Album.new
|
@album = GalleryAlbum.new
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
album = Album.new(params[:album])
|
album = GalleryAlbum.new(params[:gallery_album])
|
||||||
album.save!
|
album.save!
|
||||||
redirect_to panel_gallery_back_end_albums_path
|
redirect_to panel_gallery_back_end_albums_path
|
||||||
end
|
end
|
||||||
@@ -47,38 +46,38 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
album = Album.find(params[:id])
|
album = GalleryAlbum.find(params[:id])
|
||||||
album.destroy
|
album.destroy
|
||||||
redirect_to panel_gallery_back_end_albums_path
|
redirect_to panel_gallery_back_end_albums_path
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@album = Album.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_cover
|
def set_cover
|
||||||
if params[:set_cover] == "true"
|
if params[:set_cover] == "true"
|
||||||
album = Album.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
image = AlbumImage.find(params[:image_id])
|
image = GalleryImage.find(params[:image_id])
|
||||||
album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]})
|
album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]})
|
||||||
else
|
else
|
||||||
album = Album.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
album.update_attributes({:cover_path => nil, :cover=>"default"})
|
album.update_attributes({:cover_path => nil, :cover=>"default"})
|
||||||
end
|
end
|
||||||
render :json =>{"success"=>true}.to_json
|
render :json =>{"success"=>true}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_album_json
|
def get_album_json
|
||||||
albums = Album.all
|
albums = GalleryAlbum.all
|
||||||
output = Array.new
|
output = Array.new
|
||||||
|
|
||||||
albums.each do |album|
|
albums.each do |album|
|
||||||
tag_names = Array.new
|
tag_names = Array.new
|
||||||
|
|
||||||
album.tag_ids.each do |tag|
|
album.tag_ids.each do |tag|
|
||||||
tag_names << get_tags.include?(tag)
|
tag_names << GalleryTag.find(tag)[I18n.locale]
|
||||||
end
|
end
|
||||||
if album.cover_path
|
if album.cover_path
|
||||||
cover_path = album.cover_path
|
cover_path = album.cover_path
|
||||||
@@ -97,27 +96,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_imgs_json
|
def get_imgs_json
|
||||||
album = Album.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
images = album.album_images.all
|
images = album.gallery_images.all
|
||||||
output = Array.new
|
output = Array.new
|
||||||
|
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
tags = Array.new
|
tags = Array.new
|
||||||
|
|
||||||
image.tag_ids.each do |tag|
|
image.tag_ids.each do |tag|
|
||||||
tags << get_tags.include?(tag)
|
tags << GalleryTag.find(tag)[I18n.locale]
|
||||||
end
|
|
||||||
|
|
||||||
if image.file.theater.present?
|
|
||||||
@image_file = image.file.theater.url
|
|
||||||
else
|
|
||||||
@image_file = image.file.url
|
|
||||||
end
|
end
|
||||||
|
|
||||||
output << {
|
output << {
|
||||||
image_title: image.title,
|
image_title: image.title,
|
||||||
image_description: image.description,
|
image_description: image.description,
|
||||||
image_file: { url: "http://#{request.host_with_port}#{@image_file}",
|
image_file: { url: "http://#{request.host_with_port}#{image.file.url}",
|
||||||
thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"},
|
thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"},
|
||||||
image_tag_names: tags}
|
image_tag_names: tags}
|
||||||
end
|
end
|
||||||
@@ -126,21 +119,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def imgs
|
def imgs
|
||||||
@album = Album.find(params[:album_id])
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
@tag_names = Array.new
|
@tag_names = Array.new
|
||||||
@images = @album.album_images.all
|
@images = @album.gallery_images.all
|
||||||
@output = Array.new
|
@output = Array.new
|
||||||
@images.each do |values|
|
@images.each do |values|
|
||||||
tags = Array.new
|
tags = Array.new
|
||||||
values.tag_ids.each do |tag|
|
values.tag_ids.each do |tag|
|
||||||
tags << get_tags.include?(tag)
|
tags << GalleryTag.find(tag)[I18n.locale]
|
||||||
end
|
end
|
||||||
@output << { _id: values.id,
|
@output << { _id: values.id,
|
||||||
theater_link: panel_gallery_back_end_album_image_path(values),
|
theater_link: panel_gallery_back_end_album_image_path(values),
|
||||||
description: values.description,
|
description: values.description,
|
||||||
title: values.title,
|
title: values.title,
|
||||||
file: values.file.as_json[:file],
|
file: values.file.as_json[:file],
|
||||||
gallery_album_id: values.album_id,
|
gallery_album_id: values.gallery_album_id,
|
||||||
tag_ids: values.tag_ids,
|
tag_ids: values.tag_ids,
|
||||||
tag_names: tags}
|
tag_names: tags}
|
||||||
end
|
end
|
||||||
@@ -150,11 +143,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
|
|
||||||
|
|
||||||
def upload_image
|
def upload_image
|
||||||
@album = Album.find(params[:album_id])
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
@files = params['files']
|
@files = params['files']
|
||||||
a = Array.new
|
a = Array.new
|
||||||
@files.each do |file|
|
@files.each do |file|
|
||||||
@image = @album.album_images.new
|
@image = @album.gallery_images.new
|
||||||
@image.file = file
|
@image.file = file
|
||||||
@image.save!
|
@image.save!
|
||||||
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
||||||
@@ -164,21 +157,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
|
|
||||||
def new_images
|
def new_images
|
||||||
if params[:last_image_id] != ""
|
if params[:last_image_id] != ""
|
||||||
@lastimage = AlbumImage.find(params[:last_image_id])
|
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||||
@album = Album.find(params[:album_id])
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
@newimages = @album.album_images.where(:created_at.gt => @lastimage.created_at)
|
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||||
else
|
else
|
||||||
@album = Album.find(params[:album_id])
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
@newimages = @album.album_images
|
@newimages = @album.gallery_images
|
||||||
end
|
end
|
||||||
render :layout=>false
|
render :layout=>false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def images_tags
|
def images_tags
|
||||||
album = Album.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
tags = Array.new
|
tags = Array.new
|
||||||
images = album.album_images.all
|
images = album.gallery_images.all
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||||
end
|
end
|
||||||
@@ -186,10 +179,10 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@album = Album.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
tagsToDestroy = []
|
tagsToDestroy = []
|
||||||
tagsToAdd = []
|
tagsToAdd = []
|
||||||
new_tags = params[:album][:tag_ids]
|
new_tags = params[:gallery_album][:tag_ids]
|
||||||
old_tags = @album.tagged_ids
|
old_tags = @album.tagged_ids
|
||||||
old_tags.each do |tag|
|
old_tags.each do |tag|
|
||||||
if !new_tags.include?(tag)
|
if !new_tags.include?(tag)
|
||||||
@@ -204,14 +197,14 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||||
@album.update_attributes(params[:album])
|
@album.update_attributes(params[:gallery_album])
|
||||||
redirect_to panel_gallery_back_end_album_path(@album)
|
redirect_to panel_gallery_back_end_album_path(@album)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||||
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
||||||
# tagsToAdd will contain all tag ids which ve to be added in tall album_images
|
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
|
||||||
@images = AlbumImage.all
|
@images = GalleryImage.all
|
||||||
@images.each do |image|
|
@images.each do |image|
|
||||||
image.tagged_ids.concat(tagsToAdd)
|
image.tagged_ids.concat(tagsToAdd)
|
||||||
tagsToDestroy.each do |tag|
|
tagsToDestroy.each do |tag|
|
||||||
|
|||||||
Vendored
+12
-12
@@ -1,16 +1,16 @@
|
|||||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||||
def index
|
def index
|
||||||
@albums = Album.where(:category_id.in => params[:category_id])
|
@albums = GalleryAlbum.where(:category_id.in => params[:category_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@album = Album.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@images = @album.album_images
|
@images = @album.gallery_images
|
||||||
end
|
end
|
||||||
|
|
||||||
def imgs
|
def imgs
|
||||||
@album = Album.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@images = @album.album_images.all
|
@images = @album.gallery_images.all
|
||||||
@output = Array.new
|
@output = Array.new
|
||||||
@images.each do |values|
|
@images.each do |values|
|
||||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
||||||
@@ -19,7 +19,7 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
|||||||
:description => values.description,
|
:description => values.description,
|
||||||
:title => values.title,
|
:title => values.title,
|
||||||
:file => values.file.as_json[:file],
|
:file => values.file.as_json[:file],
|
||||||
:gallery_album_id => values.album_id,
|
:gallery_album_id => values.gallery_album_id,
|
||||||
:tag_ids => values.tag_ids,
|
:tag_ids => values.tag_ids,
|
||||||
:tag_names => tags}
|
:tag_names => tags}
|
||||||
end
|
end
|
||||||
@@ -27,9 +27,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def images_tags
|
def images_tags
|
||||||
album = Album.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
tags = Array.new
|
tags = Array.new
|
||||||
images = album.album_images.all
|
images = album.gallery_images.all
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||||
end
|
end
|
||||||
@@ -37,10 +37,10 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def theater
|
def theater
|
||||||
@image = AlbumImage.find(params[:image_id])
|
@image = GalleryImage.find(params[:id])
|
||||||
@albumid = @image.album_id
|
@albumid = @image.gallery_album_id
|
||||||
@album = Album.find(@albumid)
|
@album = GalleryAlbum.find(@albumid)
|
||||||
@images = @album.album_images.all
|
@images = @album.gallery_images.all
|
||||||
tags = @album.tagged_ids
|
tags = @album.tagged_ids
|
||||||
@tagnames = Tag.find(tags).map{|t| t.name}
|
@tagnames = Tag.find(tags).map{|t| t.name}
|
||||||
@back_link = panel_gallery_front_end_album_path(@albumid)
|
@back_link = panel_gallery_front_end_album_path(@albumid)
|
||||||
|
|||||||
+19
-26
@@ -6,8 +6,8 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
|||||||
vertical = @part.widget_options['vertical'].to_i rescue 0
|
vertical = @part.widget_options['vertical'].to_i rescue 0
|
||||||
horizontal = @part.widget_options['horizontal'].to_i rescue 0
|
horizontal = @part.widget_options['horizontal'].to_i rescue 0
|
||||||
|
|
||||||
@album = Album.find(@part.widget_options['album_id']) rescue nil
|
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
||||||
@album_images = @album.album_images if @album
|
@album_images = @album.gallery_images if @album
|
||||||
|
|
||||||
|
|
||||||
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
||||||
@@ -16,34 +16,27 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
|||||||
@rnd = Random.new
|
@rnd = Random.new
|
||||||
@images = []
|
@images = []
|
||||||
|
|
||||||
if !@album_images.nil?
|
if @album_images.count > @total
|
||||||
if @album_images.count > @total
|
@randoms = []
|
||||||
@randoms = []
|
until @randoms.count == @total do
|
||||||
until @randoms.count == @total do
|
r = @rnd.rand(0...@album_images.count)
|
||||||
r = @rnd.rand(0...@album_images.count)
|
if !@randoms.include?r
|
||||||
if !@randoms.include?r
|
@randoms << r
|
||||||
@randoms << r
|
image = @album_images[r]
|
||||||
image = @album_images[r]
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
|
||||||
@images << values
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elsif @album_images.count == @total
|
|
||||||
@album_images.each do |image|
|
|
||||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
|
||||||
@images << values
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@album_images.each do |image|
|
|
||||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
|
||||||
@images << values
|
|
||||||
end
|
|
||||||
until @images.count == @total do
|
|
||||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
|
||||||
@images << values
|
@images << values
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elsif @album_images.count == @total
|
||||||
|
@album_images.each do |image|
|
||||||
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
@album_images.each do |image|
|
||||||
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
until @images.count == @total do
|
until @images.count == @total do
|
||||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||||
@images << values
|
@images << values
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
class Album
|
class GalleryAlbum
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ class Album
|
|||||||
field :tag_names
|
field :tag_names
|
||||||
|
|
||||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||||
has_many :album_images, :autosave => true, :dependent => :destroy
|
has_many :gallery_images, :autosave => true, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :album_images, :allow_destroy => true
|
accepts_nested_attributes_for :gallery_images, :allow_destroy => true
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -9,7 +9,7 @@ class GalleryCategory
|
|||||||
|
|
||||||
field :name, localize: true
|
field :name, localize: true
|
||||||
|
|
||||||
has_many :albums, :autosave => true, :dependent => :destroy
|
has_many :gallery_albums, :autosave => true, :dependent => :destroy
|
||||||
|
|
||||||
def title
|
def title
|
||||||
name
|
name
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
class AlbumImage
|
class GalleryImage
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include OrbitTag::Taggable
|
include OrbitTag::Taggable
|
||||||
@@ -10,6 +10,6 @@ class AlbumImage
|
|||||||
|
|
||||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||||
|
|
||||||
belongs_to :album
|
belongs_to :gallery_album
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -53,10 +53,6 @@ class GalleryUploader < CarrierWave::Uploader::Base
|
|||||||
process :resize_to_fill => [200, 200]
|
process :resize_to_fill => [200, 200]
|
||||||
end
|
end
|
||||||
|
|
||||||
version :theater do
|
|
||||||
process :resize_to_limit => [1920, 1080]
|
|
||||||
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.
|
||||||
# For images you might use something like this:
|
# For images you might use something like this:
|
||||||
# def extension_white_list
|
# def extension_white_list
|
||||||
|
|||||||
Vendored
+30
-2
@@ -6,7 +6,7 @@
|
|||||||
<div id="imgholder">
|
<div id="imgholder">
|
||||||
<div class="rslide" style="position:relative; width:100%;">
|
<div class="rslide" style="position:relative; width:100%;">
|
||||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||||
<div class="rslidenav">
|
<div class="rslidenav">
|
||||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="slidelist">
|
<div class="slidelist">
|
||||||
<ul id='galleryimagelist' style="display:none;">
|
<ul id='galleryimagelist' style="display:none;">
|
||||||
<% @images.each_with_index do |image,i| %>
|
<% @images.each_with_index do |image,i| %>
|
||||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -30,6 +30,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if is_admin? %>
|
||||||
|
<!-- #TODO or 類別屬於他 -->
|
||||||
|
<!-- tag part -->
|
||||||
|
<div id="tag_panel" class="my_scroll">
|
||||||
|
<div class="scrollbar">
|
||||||
|
<div class="track">
|
||||||
|
<div class="thumb">
|
||||||
|
<div class="end"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%
|
||||||
|
@locales = Array.new
|
||||||
|
@site_valid_locales.each do |locale|
|
||||||
|
@locales << locale
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%# if @authenticated %>
|
||||||
|
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
||||||
|
<%# end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%end%>
|
||||||
|
|
||||||
|
<!-- tag end -->
|
||||||
<div class="form-actions form-fixed pagination-right rghead">
|
<div class="form-actions form-fixed pagination-right rghead">
|
||||||
<div class="rgfn">
|
<div class="rgfn">
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@
|
|||||||
<div class="controls" data-toggle="buttons-checkbox">
|
<div class="controls" data-toggle="buttons-checkbox">
|
||||||
<%@tags.each do |tag|%>
|
<%@tags.each do |tag|%>
|
||||||
<label class="checkbox inline btn <%= 'active' if @album.tag_ids.include?(tag.id) %>">
|
<label class="checkbox inline btn <%= 'active' if @album.tag_ids.include?(tag.id) %>">
|
||||||
<%= check_box_tag 'album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
<%= check_box_tag 'gallery_album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
||||||
<%= tag.name %>
|
<%= tag.name %>
|
||||||
</label>
|
</label>
|
||||||
<%end %>
|
<%end %>
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<div class='rgphoto'>
|
<div class='rgphoto'>
|
||||||
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(@album,:image_id=>image) %>'>
|
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(image) %>'>
|
||||||
<img src='<%= image.file.thumb.url %>'/>
|
<img src='<%= image.file.thumb.url %>'/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
+4
-3
@@ -6,7 +6,7 @@
|
|||||||
<div id="imgholder">
|
<div id="imgholder">
|
||||||
<div class="rslide" style="position:relative; width:100%;">
|
<div class="rslide" style="position:relative; width:100%;">
|
||||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||||
<div class="rslidenav">
|
<div class="rslidenav">
|
||||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="slidelist">
|
<div class="slidelist">
|
||||||
<ul id='galleryimagelist' style="display:none;">
|
<ul id='galleryimagelist' style="display:none;">
|
||||||
<% @images.each_with_index do |image,i| %>
|
<% @images.each_with_index do |image,i| %>
|
||||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,7 +57,8 @@
|
|||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||||
var gallery = new galleryAPI();
|
var gallery = new galleryAPI();
|
||||||
gallery.initialize();
|
gallery.initialize();
|
||||||
gallery.loadTheater("<%= params[:id] %>","<%= params[:image_id] %>");
|
gallery.loadArea = "theater";
|
||||||
|
gallery.loadTheater("<%= params[:id] %>");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="albumname_edit">
|
<div class="albumname_edit">
|
||||||
<label for=""><%= t("gallery.album_name") %></label>
|
<label for=""><%= t("gallery.album_name") %></label>
|
||||||
<div class="inputui rginput rgih26 w380"><input type="text" name="album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
<div class="inputui rginput rgih26 w380"><input type="text" name="gallery_album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='description_loader'>
|
<div class='description_loader'>
|
||||||
|
|||||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<div class="rslide" style="position:relative; width:100%;">
|
<div class="rslide" style="position:relative; width:100%;">
|
||||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||||
<div class="rslidenav">
|
<div class="rslidenav">
|
||||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ module Gallery
|
|||||||
# image :image
|
# image :image
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# categories_query 'GalleryCategory.all'
|
categories_query 'GalleryCategory.all'
|
||||||
# tags_query 'GalleryTag.all'
|
# tags_query 'GalleryTag.all'
|
||||||
|
|
||||||
#* customize_widget "albums","gallery.widget.albums",:fields=>[],:style=>[],:options=>{"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
#* customize_widget "albums","gallery.widget.albums",:fields=>[],:style=>[],:options=>{"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||||
@@ -37,7 +37,7 @@ module Gallery
|
|||||||
style ["1","2"]
|
style ["1","2"]
|
||||||
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
|
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
|
||||||
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
|
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
|
||||||
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"Album.all", "value"=>:id, "label"=>:name}
|
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Vendored
-40
@@ -1,6 +1,5 @@
|
|||||||
class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
||||||
include AdminHelper
|
include AdminHelper
|
||||||
open_for_visitor :only => [:get_location_categories, :get_categorywise_locations]
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@locations = LocationInfo.all
|
@locations = LocationInfo.all
|
||||||
@@ -90,43 +89,4 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||||||
|
|
||||||
render :json => JSON.pretty_generate(@data)
|
render :json => JSON.pretty_generate(@data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_location_categories
|
|
||||||
check_mobile_api_openness
|
|
||||||
location_categories = get_categories_for_index
|
|
||||||
@data = Array.new
|
|
||||||
|
|
||||||
location_categories.each do |category|
|
|
||||||
I18n.locale = :en
|
|
||||||
name_en = category.title
|
|
||||||
I18n.locale = :zh_tw
|
|
||||||
name_zh_tw = category.title
|
|
||||||
category_id = category.id.to_s
|
|
||||||
@data << { name_en: name_en, name_zh_tw: name_zh_tw, category_id: category_id, location_link: "http://#{request.host_with_port}"+"/#{panel_location_back_end_locations_get_categorywise_locations_path}"+"?category_id=#{category_id}"}
|
|
||||||
end
|
|
||||||
|
|
||||||
render :json => JSON.pretty_generate(@data)
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_categorywise_locations
|
|
||||||
check_mobile_api_openness
|
|
||||||
location_infos = LocationInfo.where(:category_id => params[:category_id])
|
|
||||||
@data = Array.new
|
|
||||||
|
|
||||||
location_infos.each do |location|
|
|
||||||
|
|
||||||
picurl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.url}"
|
|
||||||
thumburl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.thumb.url}"
|
|
||||||
|
|
||||||
@data << { id: location.id.to_s,
|
|
||||||
name: location.name,
|
|
||||||
pic_url: picurl,
|
|
||||||
thumb_url: thumburl,
|
|
||||||
longitude: location.longitude,
|
|
||||||
latitude: location.latitude,
|
|
||||||
description: location.description }
|
|
||||||
end
|
|
||||||
|
|
||||||
render :json => JSON.pretty_generate(@data)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@@ -3,9 +3,6 @@ Rails.application.routes.draw do
|
|||||||
namespace :location do
|
namespace :location do
|
||||||
namespace :back_end do
|
namespace :back_end do
|
||||||
match 'location_categories/list' => "location_categories#list"
|
match 'location_categories/list' => "location_categories#list"
|
||||||
match "locations/get_locations" => "locations#get_locations"
|
|
||||||
match "locations/get_categorywise_locations" => "locations#get_categorywise_locations"
|
|
||||||
match "locations/get_location_categories" => "locations#get_location_categories"
|
|
||||||
resources :location_categories
|
resources :location_categories
|
||||||
match "locations/get_locations" => "locations#get_locations"
|
match "locations/get_locations" => "locations#get_locations"
|
||||||
match "locations/get_categories" => "locations#get_categories"
|
match "locations/get_categories" => "locations#get_categories"
|
||||||
|
|||||||
Vendored
-4
@@ -45,9 +45,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||||
<% if !member.office_tel.blank? %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -86,9 +84,7 @@
|
|||||||
<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>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
|
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
|
||||||
<% if !member.office_tel.blank? %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
Vendored
-125
@@ -1,125 +0,0 @@
|
|||||||
.default_member:after {
|
|
||||||
content: "";
|
|
||||||
clear: both;
|
|
||||||
display: block;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.default_member .member-pic {
|
|
||||||
float: left;
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
.default_member .member-pic img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
.default_member .member-data {
|
|
||||||
float: right;
|
|
||||||
width: 68%;
|
|
||||||
}
|
|
||||||
.default_member .member-data table {
|
|
||||||
width: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.default_member .member-data table td {
|
|
||||||
padding: 5px;
|
|
||||||
background-color: #ccc;
|
|
||||||
border: 1px solid #fff;
|
|
||||||
}
|
|
||||||
.default_member .member-data table td + td {
|
|
||||||
background-color: #ededed;
|
|
||||||
}
|
|
||||||
.default_member .member-module {
|
|
||||||
clear: both;
|
|
||||||
padding-top: 30px;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-nav ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
list-style: none;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-nav ul:after {
|
|
||||||
content: "";
|
|
||||||
clear: both;
|
|
||||||
display: block;
|
|
||||||
height: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-nav ul li {
|
|
||||||
float: left;
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-nav ul li a {
|
|
||||||
padding: 5px 8px;
|
|
||||||
line-height: 30px;
|
|
||||||
height: 30px;
|
|
||||||
border-radius: 3px;
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: #DDD;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-nav ul li.active a {
|
|
||||||
background-color: #0088CE;
|
|
||||||
color: #FFF;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-content {
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-content .module-pane {
|
|
||||||
display: none;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-content .module-pane table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.default_member .member-module .module-content .module-pane.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[class*="grid"] + [class*="grid"] {
|
|
||||||
margin-left: 2.12766%;
|
|
||||||
}
|
|
||||||
.grid12 {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.grid11 {
|
|
||||||
width: 91.4894%;
|
|
||||||
}
|
|
||||||
.grid10 {
|
|
||||||
width: 82.9787%;
|
|
||||||
}
|
|
||||||
.grid9 {
|
|
||||||
width: 74.4681%;
|
|
||||||
}
|
|
||||||
.grid8 {
|
|
||||||
width: 65.9574%;
|
|
||||||
}
|
|
||||||
.grid7 {
|
|
||||||
width: 57.4468%;
|
|
||||||
}
|
|
||||||
.grid6 {
|
|
||||||
width: 48.9362%;
|
|
||||||
}
|
|
||||||
.grid5 {
|
|
||||||
width: 40.4255%;
|
|
||||||
}
|
|
||||||
.grid4 {
|
|
||||||
width: 31.9149%;
|
|
||||||
}
|
|
||||||
.grid3 {
|
|
||||||
width: 23.4043%;
|
|
||||||
}
|
|
||||||
.grid2 {
|
|
||||||
width: 14.8936%;
|
|
||||||
}
|
|
||||||
.grid1 {
|
|
||||||
width: 6.38298%;
|
|
||||||
}
|
|
||||||
+1
-1
@@ -51,7 +51,7 @@ class Panel::MemberStaff::FrontEnd::MemberStaffListsController < OrbitWidgetCont
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@member = User.find(params[:id])
|
@member_list = User.find(params[:id])
|
||||||
# get_categorys
|
# get_categorys
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
-52
@@ -1,52 +0,0 @@
|
|||||||
<%
|
|
||||||
@status = @member.role_statuses.where(:role_id=>show_roles.id)
|
|
||||||
|
|
||||||
if !@status.blank?
|
|
||||||
%>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('status')%></td>
|
|
||||||
<td><%= show_attribute_value(@member.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%
|
|
||||||
@category = @member.role_categorys.where(:role_id=>show_roles.id)
|
|
||||||
|
|
||||||
if !@category.blank?
|
|
||||||
%>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('category')%></td>
|
|
||||||
<td><%= show_attribute_value(@member.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% show_roles.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
|
|
||||||
|
|
||||||
<%
|
|
||||||
if !@member.get_attribute_value(rf).blank?
|
|
||||||
if !@member.get_attribute_value(rf)['val'].blank?
|
|
||||||
@rodata = @member.get_attribute_value(rf)['val']
|
|
||||||
elsif !@member.get_attribute_value(rf)[I18n.locale].blank?
|
|
||||||
@rodata = @member.get_attribute_value(rf)[I18n.locale]
|
|
||||||
else
|
|
||||||
@rodata = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
|
|
||||||
%>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><%= rf.title %></td>
|
|
||||||
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<%= render :partial => 'show_sub_role',:collection=> @member.get_sub_roles_by_role(show_roles)%>
|
|
||||||
|
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<% show_sub_role.attribute_fields.where(:disabled=>false).asc(:_id).each do |item| %>
|
|
||||||
|
|
||||||
|
|
||||||
<%
|
|
||||||
|
|
||||||
if !@member.get_attribute_value(item).blank?
|
|
||||||
if !@member.get_attribute_value(item)['val'].blank?
|
|
||||||
@rodata = @member.get_attribute_value(item)['val']
|
|
||||||
elsif !@member.get_attribute_value(item)[I18n.locale].blank?
|
|
||||||
@rodata = @member.get_attribute_value(item)[I18n.locale]
|
|
||||||
else
|
|
||||||
@rodata = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if !@rodata.blank? and !@member.get_attribute_value(item).get_value_by_locale(I18n.locale).blank?
|
|
||||||
%>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><%= item.title %></td>
|
|
||||||
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(item).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% end -%>
|
|
||||||
+2
-8
@@ -44,10 +44,8 @@
|
|||||||
<%= @job_title %>
|
<%= @job_title %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_staff_front_end_member_staff_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>
|
||||||
<% if !member.office_tel.blank? %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||||
<% end %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||||
|
|
||||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||||
@@ -95,10 +93,8 @@
|
|||||||
<%= @job_title %>
|
<%= @job_title %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_staff_front_end_member_staff_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>
|
||||||
<% if !member.office_tel.blank? %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||||
<% end %>
|
|
||||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||||
|
|
||||||
|
|
||||||
@@ -169,9 +165,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td><span class="name"><%= link_to member.name, "mailto:#{member.email}" %></span></td>
|
<td><span class="name"><%= link_to member.name, "mailto:#{member.email}" %></span></td>
|
||||||
<% if !member.office_tel.blank? %>
|
|
||||||
<td><span class="tel"><%= member.office_tel %></span></td>
|
<td><span class="tel"><%= member.office_tel %></span></td>
|
||||||
<% end %>
|
|
||||||
<td>
|
<td>
|
||||||
<span class="business">
|
<span class="business">
|
||||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||||
|
|||||||
-44
@@ -1,44 +0,0 @@
|
|||||||
<div class="default_member">
|
|
||||||
<div class="member-data">
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('users.name')%></td>
|
|
||||||
<td><%= @member.name%></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('users.email')%></td>
|
|
||||||
<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
|
|
||||||
</tr>
|
|
||||||
<% if !@member.sid.blank? %>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('users.sid')%></td>
|
|
||||||
<td><%= @member.sid%></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% if !@member.office_tel.blank? %>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('users.office_tel')%></td>
|
|
||||||
<td><%= @member.office_tel%></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<tr>
|
|
||||||
<td><%= t('users.sex')%></td>
|
|
||||||
<td><%= t("users.#{@member.sex}") %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<%= render :partial=> "show_roles",:collection=>@member.roles.where(:disabled=>false).asc(:created_at) %>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="member-pic">
|
|
||||||
<%= image_tag(@member.avatar) %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<%= stylesheet_link_tag "member_staff/default_member" %>
|
|
||||||
|
|
||||||
+1
-1
@@ -10,7 +10,7 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
namespace :front_end do
|
namespace :front_end do
|
||||||
match "member_staff_lists" => "member_staff_lists#index"
|
match "member_staff_lists" => "member_staff_lists#index"
|
||||||
resources :member_staff_lists
|
resources :member_lists
|
||||||
end
|
end
|
||||||
namespace :widget do
|
namespace :widget do
|
||||||
match "index" => "member_staff_lists#index"
|
match "index" => "member_staff_lists#index"
|
||||||
|
|||||||
vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js
Vendored
+5
@@ -93,6 +93,11 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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){
|
||||||
o.notify(data.msg,"success");
|
o.notify(data.msg,"success");
|
||||||
|
|||||||
+1
@@ -8,6 +8,7 @@ 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
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Panel::PersonalBook::FrontEnd::WritingBooksController < OrbitWidgetControl
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
@writing_books = WritingBook.where(:is_hidden => false).desc(:year,:publish_date).page(params[:page]).per(10)
|
@writing_books = WritingBook.desc(:year).page(params[:page]).per(10)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -84,18 +84,11 @@ class WritingBook
|
|||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = []
|
||||||
title << self.authors if self.authors.present?
|
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.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.isbn if self.isbn.present?
|
title << self.pages if self.pages.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
|
||||||
|
|||||||
+4
-3
@@ -103,9 +103,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions form-fixed pagination-right">
|
<div class="form-actions form-fixed pagination-right">
|
||||||
<!-- <a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
||||||
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a> -->
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path, :class => 'btn btn-primary pull-right' %>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 新增</a>
|
||||||
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 設定</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="author_type_qe">
|
<div id="author_type_qe">
|
||||||
|
|||||||
+5
@@ -57,6 +57,11 @@
|
|||||||
</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
-2
@@ -1,7 +1,7 @@
|
|||||||
<%
|
<%
|
||||||
if @member
|
if @member
|
||||||
|
|
||||||
@writing_books = WritingBook.where(is_hidden: false, :create_user_id => @member.id).desc(:year,:publish_date)
|
@writing_books = WritingBook.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
|
||||||
|
|
||||||
@writing_book_intro = !PersonalBookIntro.where(:user_id => @member.id).blank? ? PersonalBookIntro.where(:user_id => @member.id).first : PersonalBookIntro.new
|
@writing_book_intro = !PersonalBookIntro.where(:user_id => @member.id).blank? ? PersonalBookIntro.where(:user_id => @member.id).first : PersonalBookIntro.new
|
||||||
%>
|
%>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
|
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= User.find(writing_book.create_user_id).name rescue '' %></td>
|
<td><%= writing_book.authors %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
+13
-24
@@ -2,37 +2,26 @@
|
|||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
<h1><%= t('module_name.personal_book') %></h1>
|
<h1><%= t('writing_book.list_writing_book') %></h1>
|
||||||
|
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th><%= t(:year) %></th>
|
||||||
|
<th><%= t(:title) %></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% @writing_books.each do |post| %>
|
||||||
<table class="table">
|
<tr>
|
||||||
<thead>
|
<td><%= post.year %></td>
|
||||||
<tr>
|
|
||||||
<th class="grid1"><%= t('personal_book.year') %></th>
|
|
||||||
<th class="grid1"><%= t('personal_book.book_paper_type') %></th>
|
|
||||||
<th class="grid8"><%= t('personal_book.book_title') %></th>
|
|
||||||
<th class="grid3"><%= t('personal_book.authors') %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<% @writing_books.each do |writing_book| %>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><%= writing_book.year %></td>
|
|
||||||
<td><%= writing_book.book_paper_type.title %></td>
|
|
||||||
<td>
|
<td>
|
||||||
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
|
<%= link_to post.create_link , panel_personal_book_front_end_writing_book_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= User.find(writing_book.create_user_id).name rescue '' %></td>
|
</tr>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
<%= paginate @writing_books, :params => {:inner => false}%>
|
<%= paginate @writing_books, :params => {:inner => false}%>
|
||||||
+29
-71
@@ -1,79 +1,37 @@
|
|||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<caption> <%= t("module_name.personal_book") %> </caption>
|
<caption> <%= t("writing_book") %> </caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if !@writing_book.year.blank? %>
|
<tr><th><%= t("writing_book.year")%></th><td><%= @writing_book.year %></td></tr>
|
||||||
<tr><th><%= t("personal_book.year")%></th><td><%= @writing_book.year %></td></tr>
|
<tr><th><%= t("writing_book.language")%></th><td><%= @writing_book.language %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_book.paper_title")%></th><td><%= @writing_book.paper_title %></td></tr>
|
||||||
|
<tr><th><%= t("writing_book.book_title")%></th><td><%= @writing_book.book_title %></td></tr>
|
||||||
<% if !@writing_book.language.blank? %>
|
<tr><th><%= t("writing_book.book_paper_type")%></th><td><%= @writing_book.book_paper_type.title if !@writing_book.book_paper_type.blank? %></td></tr>
|
||||||
<tr><th><%= t("personal_book.language")%></th><td><%= @writing_book.language %></td></tr>
|
<tr><th><%= t("writing_book.book_author_types")%></th><td><%= @book_author_types %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_book.extracted_chapters")%></th><td><%= @writing_book.extracted_chapters %></td></tr>
|
||||||
|
<tr><th><%= t("writing_book.publisher")%></th><td><%= @writing_book.publisher %></td></tr>
|
||||||
<% if !@writing_book.paper_title.blank? %>
|
<tr><th><%= t("writing_book.editor")%></th><td><%= @writing_book.editor %></td></tr>
|
||||||
<tr><th><%= t("personal_book.paper_title")%></th><td><%= @writing_book.paper_title %></td></tr>
|
<tr><th><%= t("writing_book.publish_date")%></th><td><%= @writing_book.publish_date %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_book.pages")%></th><td><%= @writing_book.pages %></td></tr>
|
||||||
|
<tr><th><%= t("writing_book.isbn")%></th><td><%= @writing_book.isbn %></td></tr>
|
||||||
<% if !@writing_book.book_title.blank? %>
|
<tr><th><%= t("writing_book.publication_date")%></th><td><%= @writing_book.publication_date %></td></tr>
|
||||||
<tr><th><%= t("personal_book.book_title")%></th><td><%= @writing_book.book_title %></td></tr>
|
<tr><th><%= t("writing_book.url")%></th><td><%= link_to t(:url), @writing_book.url, {:target => '_blank', :title => @writing_book.book_title} if !@writing_book.url.blank? %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_book.note")%></th><td><%= @writing_book.note %></td></tr>
|
||||||
|
<tr><th><%= t("writing_book.authors")%></th><td><%= "#{User.from_id(@writing_book.create_user_id).name rescue ''},#{@writing_book.authors rescue ''}"%></td></tr>
|
||||||
<% if !@writing_book.book_paper_type.blank? %>
|
<tr><th><%= t("writing_book.files")%></th>
|
||||||
<tr><th><%= t("personal_book.book_paper_type")%></th><td><%= @writing_book.book_paper_type.title if !@writing_book.book_paper_type.blank? %></td></tr>
|
<td>
|
||||||
<% end %>
|
<% if @writing_book.writing_book_files.size > 0 %>
|
||||||
|
<div>
|
||||||
<% if !@book_author_types.blank? %>
|
<i class="icons-paperclip"></i>
|
||||||
<tr><th><%= t("personal_book.author_type")%></th><td><%= @book_author_types %></td></tr>
|
<div class="showFile">
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.extracted_chapters.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.extracted_chapters")%></th><td><%= @writing_book.extracted_chapters %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.publisher.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.publisher")%></th><td><%= @writing_book.publisher %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.editor.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.editor")%></th><td><%= @writing_book.editor %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.publish_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.publish_date")%></th><td><%= @writing_book.publish_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.pages.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.pages")%></th><td><%= @writing_book.pages %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.isbn.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.isbn")%></th><td><%= @writing_book.isbn %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.publication_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.publication_date")%></th><td><%= @writing_book.publication_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.url.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.url")%></th><td><%= link_to t(:url), @writing_book.url, {:target => '_blank', :title => @writing_book.url} if !@writing_book.url.blank? %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<tr><th><%= t("personal_book.authors")%></th><td><%= "#{User.from_id(@writing_book.create_user_id).name rescue ''},#{@writing_book.authors rescue ''}"%></td></tr>
|
|
||||||
|
|
||||||
<% if @writing_book.writing_book_files.size > 0 %>
|
|
||||||
<tr><th><%= t("personal_book.files")%></th>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<div class="showFile">
|
|
||||||
<i class="icons-paperclip"></i>
|
|
||||||
<% @writing_book.writing_book_files.each do | wjfile | %>
|
<% @writing_book.writing_book_files.each do | wjfile | %>
|
||||||
<%= link_to wjfile.title, wjfile.file.url, {:target => '_blank', :title => wjfile.title} if wjfile.file.file %>
|
<%= link_to wjfile.title, wjfile.file.url, {:target => '_blank', :title => wjfile.title} if wjfile.file.file %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<% end %>
|
||||||
<% end %>
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
Vendored
+2
@@ -75,6 +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>
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ en:
|
|||||||
description : "File Description"
|
description : "File Description"
|
||||||
pages : "Pages"
|
pages : "Pages"
|
||||||
book_paper_type : "Book Paper Type"
|
book_paper_type : "Book Paper Type"
|
||||||
frontend:
|
|
||||||
writing_books: "Book Front-end"
|
|
||||||
|
|
||||||
create_success : "Successfully Create"
|
create_success : "Successfully Create"
|
||||||
update_success : "Successfully Update"
|
update_success : "Successfully Update"
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ zh_tw:
|
|||||||
book_paper_type : "專書類別"
|
book_paper_type : "專書類別"
|
||||||
publish_date : "出版日期"
|
publish_date : "出版日期"
|
||||||
editor : "主編"
|
editor : "主編"
|
||||||
frontend:
|
|
||||||
writing_books: "專書前台"
|
|
||||||
|
|
||||||
create_success : "新增完成!!"
|
create_success : "新增完成!!"
|
||||||
update_success : "更新完成!!"
|
update_success : "更新完成!!"
|
||||||
|
|||||||
+4
@@ -42,6 +42,10 @@ 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
@@ -8,7 +8,7 @@ class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitW
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
@writing_conferences = WritingConference.where(:is_hidden => false).desc(:year,:period_start_date).page(params[:page]).per(10)
|
@writing_conferences = WritingConference.desc(:year).page(params[:page]).per(10)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
+2
-10
@@ -84,17 +84,9 @@ class WritingConference
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = ["#{self.paper_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(', ')})"
|
||||||
|
|||||||
+4
-3
@@ -103,9 +103,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions form-fixed pagination-right">
|
<div class="form-actions form-fixed pagination-right">
|
||||||
<!-- <a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
||||||
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a> -->
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path, :class => 'btn btn-primary pull-right' %>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 新增</a>
|
||||||
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 設定</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
@@ -58,6 +58,11 @@
|
|||||||
</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>
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
<%
|
<%
|
||||||
if @member
|
if @member
|
||||||
|
|
||||||
@writing_conferences = WritingConference.where(is_hidden: false, :create_user_id => @member.id).desc(:year,:period_start_date)
|
@writing_conferences = WritingConference.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
|
||||||
|
|
||||||
@writing_conference_intro = !PersonalConferenceIntro.where(:user_id => @member.id).blank? ? PersonalConferenceIntro.where(:user_id => @member.id).first : PersonalConferenceIntro.new
|
@writing_conference_intro = !PersonalConferenceIntro.where(:user_id => @member.id).blank? ? PersonalConferenceIntro.where(:user_id => @member.id).first : PersonalConferenceIntro.new
|
||||||
%>
|
%>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
|
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= User.find(writing_conference.create_user_id).name rescue '' %></td>
|
<td><%= writing_conference.authors %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
+13
-19
@@ -2,31 +2,25 @@
|
|||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
<h1><%= t('module_name.personal_conference') %></h1>
|
<h1><%= t('writing_conference.list_writing_conference') %></h1>
|
||||||
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="grid1"><%= t('personal_conference.year') %></th>
|
|
||||||
<th class="grid8"><%= t('module_name.personal_conference') %></th>
|
|
||||||
<th class="grid3"><%= t('personal_conference.authors') %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<% @writing_conferences.each do |writing_conference| %>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th><%= t(:year) %></th>
|
||||||
|
<th><%= t(:title) %></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<% @writing_conferences.each do |post| %>
|
||||||
<td><%= writing_conference.year %></td>
|
<tr>
|
||||||
|
<td><%= post.year %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
|
<%= link_to post.create_link , panel_personal_conference_front_end_writing_conference_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= User.find(writing_conference.create_user_id).name rescue '' %></td>
|
</tr>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
|
||||||
|
|
||||||
<%= paginate @writing_conferences, :params => {:inner => false}%>
|
<%= paginate @writing_conferences, :params => {:inner => false}%>
|
||||||
+29
-68
@@ -1,75 +1,36 @@
|
|||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<caption> <%= t("module_name.personal_conference") %> </caption>
|
<caption> <%= t("writing_conference") %> </caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if !@writing_conference.year.blank? %>
|
<tr><th><%= t("writing_conference.year")%></th><td><%= @writing_conference.year %></td></tr>
|
||||||
<tr><th><%= t("personal_conference.year")%></th><td><%= @writing_conference.year %></td></tr>
|
<tr><th><%= t("writing_conference.language")%></th><td><%= @writing_conference.language %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_conference.paper_title")%></th><td><%= @writing_conference.paper_title %></td></tr>
|
||||||
|
<tr><th><%= t("writing_conference.conference_title")%></th><td><%= @writing_conference.conference_title %></td></tr>
|
||||||
<% if !@writing_conference.language.blank? %>
|
<tr><th><%= t("writing_conference.conference_paper_types")%></th><td><%= @conference_paper_types %></td></tr>
|
||||||
<tr><th><%= t("personal_conference.language")%></th><td><%= @writing_conference.language %></td></tr>
|
<tr><th><%= t("writing_conference.conference_author_types")%></th><td><%= @conference_author_types %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_conference.location")%></th><td><%= @writing_conference.location %></td></tr>
|
||||||
|
<tr><th><%= t("writing_conference.sponsor")%></th><td><%= @writing_conference.sponsor %></td></tr>
|
||||||
<% if !@writing_conference.paper_title.blank? %>
|
<tr><th><%= t("writing_conference.period_start_date")%></th><td><%= @writing_conference.period_start_date %></td></tr>
|
||||||
<tr><th><%= t("personal_conference.paper_title")%></th><td><%= @writing_conference.paper_title %></td></tr>
|
<tr><th><%= t("writing_conference.period_end_date")%></th><td><%= @writing_conference.period_end_date %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_conference.abstract")%></th><td><%= @writing_conference.abstract %></td></tr>
|
||||||
|
<tr><th><%= t("writing_conference.publication_date")%></th><td><%= @writing_conference.publication_date %></td></tr>
|
||||||
<% if !@writing_conference.conference_title.blank? %>
|
<tr><th><%= t("writing_conference.url")%></th><td><%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.conference_title} if !@writing_conference.url.blank? %></td></tr>
|
||||||
<tr><th><%= t("personal_conference.conference_title")%></th><td><%= @writing_conference.conference_title %></td></tr>
|
<tr><th><%= t("writing_conference.note")%></th><td><%= @writing_conference.note %></td></tr>
|
||||||
<% end %>
|
<tr><th><%= t("writing_conference.authors")%></th><td><%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@writing_conference.authors rescue ''}"%></td></tr>
|
||||||
|
<tr><th><%= t("writing_conference.files")%></th>
|
||||||
<% if !@conference_paper_types.blank? %>
|
<td>
|
||||||
<tr><th><%= t("personal_conference.paper_type")%></th><td><%= @conference_paper_types %></td></tr>
|
<% if @writing_conference.writing_conference_files.size > 0 %>
|
||||||
<% end %>
|
<div>
|
||||||
|
<i class="icons-paperclip"></i>
|
||||||
<% if !@conference_author_types.blank? %>
|
<div class="showFile">
|
||||||
<tr><th><%= t("personal_conference.author_type")%></th><td><%= @conference_author_types %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.location.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.location")%></th><td><%= @writing_conference.location %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.sponsor.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.sponsor")%></th><td><%= @writing_conference.sponsor %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.period_start_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.period_start_date")%></th><td><%= @writing_conference.period_start_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.period_end_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.period_end_date")%></th><td><%= @writing_conference.period_end_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.abstract.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.abstract")%></th><td><%= @writing_conference.abstract %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.publication_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.publication_date")%></th><td><%= @writing_conference.publication_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_conference.url.blank? %>
|
|
||||||
<tr><th><%= t("personal_conference.url")%></th><td><%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.url} if !@writing_conference.url.blank? %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<tr><th><%= t("personal_conference.authors")%></th><td><%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@personal_conference.authors rescue ''}"%></td></tr>
|
|
||||||
|
|
||||||
<% if @writing_conference.writing_conference_files.size > 0 %>
|
|
||||||
<tr><th><%= t("personal_conference.file")%></th>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<div class="showFile">
|
|
||||||
<i class="icons-paperclip"></i>
|
|
||||||
<% @writing_conference.writing_conference_files.each do | wsfile | %>
|
<% @writing_conference.writing_conference_files.each do | wsfile | %>
|
||||||
<%= link_to !wsfile.title.blank? ? wsfile.title : 'file', wsfile.file.url, {:target => '_blank', :title => wsfile.title} if wsfile.file.file %>
|
<%= link_to wsfile.title, wsfile.file.url, {:target => '_blank', :title => wsfile.title} if wsfile.file.file %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<% end %>
|
||||||
<% end %>
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
+4
@@ -75,7 +75,11 @@
|
|||||||
<% 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">
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ en:
|
|||||||
file : "File"
|
file : "File"
|
||||||
file_name : "File Name"
|
file_name : "File Name"
|
||||||
description : "File Description"
|
description : "File Description"
|
||||||
frontend:
|
|
||||||
writing_conferences: "Conference Paper Front-end"
|
|
||||||
|
|
||||||
create_success : "Successfully Create"
|
create_success : "Successfully Create"
|
||||||
update_success : "Successfully Update"
|
update_success : "Successfully Update"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ zh_tw:
|
|||||||
period_start_date : "起"
|
period_start_date : "起"
|
||||||
period_end_date : "訖"
|
period_end_date : "訖"
|
||||||
location : "地點"
|
location : "地點"
|
||||||
sponsor : "主辦單位"
|
sponsor : "贊助"
|
||||||
authors : "作者"
|
authors : "作者"
|
||||||
tags : "領域"
|
tags : "領域"
|
||||||
keywords : "關鍵字"
|
keywords : "關鍵字"
|
||||||
@@ -29,8 +29,6 @@ zh_tw:
|
|||||||
file : "檔案"
|
file : "檔案"
|
||||||
file_name : "檔案名稱"
|
file_name : "檔案名稱"
|
||||||
description : "描述"
|
description : "描述"
|
||||||
frontend:
|
|
||||||
writing_conferences: "研討會論文前台"
|
|
||||||
|
|
||||||
create_success : "新增完成!!"
|
create_success : "新增完成!!"
|
||||||
update_success : "更新完成!!"
|
update_success : "更新完成!!"
|
||||||
|
|||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
class Panel::PersonalDiploma::FrontEnd::DiplomasController < OrbitWidgetController
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
super
|
|
||||||
@app_title = 'personal_diploma'
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@diploma = Diploma.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<tr id="<%= dom_id diploma %>" class="with_action">
|
<tr id="<%= dom_id diploma %>" class="with_action">
|
||||||
<td class="span1"><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
|
<td class="span1"><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
|
||||||
<td class="span1">
|
<td class="span1">
|
||||||
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
|
<%= diploma.school_name %>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills hide">
|
<ul class="nav nav-pills hide">
|
||||||
<%if at_least_module_manager || diploma.diploma_category.cur_user_is_sub_manager_of(:edit)%>
|
<%if at_least_module_manager || diploma.diploma_category.cur_user_is_sub_manager_of(:edit)%>
|
||||||
|
|||||||
+4
-3
@@ -47,9 +47,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions form-fixed pagination-right">
|
<div class="form-actions form-fixed pagination-right">
|
||||||
<!-- <a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
||||||
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a> -->
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path, :class => 'btn btn-primary pull-right' %>
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 新增</a>
|
||||||
|
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 設定</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display:none;" class="modal" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div style="display:none;" class="modal" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
|
|||||||
+4
-10
@@ -21,11 +21,8 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="grid2"><%= t('personal_diploma.school_name') %></th>
|
|
||||||
<th class="grid2"><%= t('personal_diploma.country') %></th>
|
|
||||||
<th class="grid1"><%= t('personal_diploma.department') %></th>
|
|
||||||
<th class="grid1"><%= t('personal_diploma.degree') %></th>
|
|
||||||
<th class="grid3"><%= t('date_') %></th>
|
<th class="grid3"><%= t('date_') %></th>
|
||||||
|
<th class="grid9"><%= t('personal_diploma.school_name') %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -33,13 +30,10 @@
|
|||||||
<% @diplomas.each do |diploma| %>
|
<% @diplomas.each do |diploma| %>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
|
||||||
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
|
|
||||||
</td>
|
|
||||||
<td><%= diploma.country %></td>
|
|
||||||
<td><%= diploma.department %></td>
|
|
||||||
<td><%= diploma.degree %></td>
|
|
||||||
<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
|
<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
|
||||||
|
<td>
|
||||||
|
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Whitespace-only changes.
-45
@@ -1,45 +0,0 @@
|
|||||||
<% # encoding: utf-8 %>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<caption> <%= t("module_name.personal_diploma") %> </caption>
|
|
||||||
<tbody>
|
|
||||||
<% if !@diploma.year.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.school_name")%></th><td><%= @diploma.year %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.language.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.language")%></th><td><%= @diploma.language %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.school_name.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.school_name")%></th><td><%= @diploma.school_name %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.country.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.country")%></th><td><%= @diploma.country %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.department.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.department")%></th><td><%= @diploma.department %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.degree.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.degree")%></th><td><%= @diploma.degree %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.start_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.start_date")%></th><td><%= @diploma.start_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.end_date.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.end_date")%></th><td><%= @diploma.end_date %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@diploma.language.blank? %>
|
|
||||||
<tr><th><%= t("personal_diploma.url")%></th><td><%= link_to t(:url), @diploma.url, {:target => '_blank', :title => @diploma.url} if !@diploma.url.blank? %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<tr><th><%= t("personal_diploma.authors")%></th><td><%= User.from_id(@diploma.create_user_id).name rescue '' %></td></tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -34,8 +34,6 @@ en:
|
|||||||
country : "Country"
|
country : "Country"
|
||||||
department : "Department"
|
department : "Department"
|
||||||
degree : "Degree"
|
degree : "Degree"
|
||||||
frontend:
|
|
||||||
diplomas: "Diploma Front-end"
|
|
||||||
|
|
||||||
create_success : "Successfully Create"
|
create_success : "Successfully Create"
|
||||||
update_success : "Successfully Update"
|
update_success : "Successfully Update"
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ zh_tw:
|
|||||||
country : "國家"
|
country : "國家"
|
||||||
department : "系所"
|
department : "系所"
|
||||||
degree : "學位"
|
degree : "學位"
|
||||||
frontend:
|
|
||||||
diplomas: "學歷前台"
|
|
||||||
|
|
||||||
create_success : "新增完成!!"
|
create_success : "新增完成!!"
|
||||||
update_success : "更新完成!!"
|
update_success : "更新完成!!"
|
||||||
|
|||||||
+5
-5
@@ -13,11 +13,11 @@ module PersonalDiploma
|
|||||||
intro "I am intro"
|
intro "I am intro"
|
||||||
update_info 'some update_info'
|
update_info 'some update_info'
|
||||||
|
|
||||||
front_end do
|
# front_end do
|
||||||
app_page 'diplomas' do
|
# app_page 'diplomas' do
|
||||||
frontend_i18n "personal_diploma.frontend.diplomas"
|
# frontend_i18n "personal_diploma.frontend.diplomas"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
class Panel::PersonalExperience::FrontEnd::ExperiencesController < OrbitWidgetController
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
super
|
|
||||||
@app_title = 'personal_experience'
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@experience = Experience.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user