Compare commits
28 Commits
Author | SHA1 | Date |
---|---|---|
|
da874c582a | |
|
9837dd8f69 | |
|
b5d1809523 | |
|
5437848ac4 | |
|
320c6f6736 | |
|
91022f6010 | |
|
70c3afed01 | |
|
946dc0621b | |
|
47894ab6f3 | |
|
befb511492 | |
|
56ef57cdd8 | |
|
3b0dc9cd50 | |
|
35733da7ba | |
|
42decd3ff4 | |
|
8200baddbb | |
|
f715924929 | |
|
f851ad0e27 | |
|
e2d09c7379 | |
|
e5ea34d088 | |
|
5944a7fcb6 | |
|
341dc67a5f | |
|
25c1f191b2 | |
|
926102bf72 | |
|
1b5f6a79c7 | |
|
eb8495bcbd | |
|
5899a0f0d9 | |
|
042acadbdb | |
|
f6a1070b78 |
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.3 KiB |
|
@ -8,7 +8,9 @@ window.SocialShareButton =
|
||||||
title = encodeURIComponent($(el).parent().data('title'))
|
title = encodeURIComponent($(el).parent().data('title'))
|
||||||
img = encodeURIComponent($(el).parent().data("img"))
|
img = encodeURIComponent($(el).parent().data("img"))
|
||||||
fb_url = encodeURIComponent($(el).parent().data("fb_url"))
|
fb_url = encodeURIComponent($(el).parent().data("fb_url"))
|
||||||
|
summary = encodeURIComponent($(el).parent().data("summary"))
|
||||||
url = encodeURIComponent(location.href)
|
url = encodeURIComponent(location.href)
|
||||||
|
console.log($(el).parent().data())
|
||||||
switch site
|
switch site
|
||||||
when "weibo"
|
when "weibo"
|
||||||
SocialShareButton.openUrl("http://v.t.sina.com.cn/share/share.php?url=#{url}&pic=#{img}&title=#{title}&content=utf-8")
|
SocialShareButton.openUrl("http://v.t.sina.com.cn/share/share.php?url=#{url}&pic=#{img}&title=#{title}&content=utf-8")
|
||||||
|
@ -17,7 +19,7 @@ window.SocialShareButton =
|
||||||
when "douban"
|
when "douban"
|
||||||
SocialShareButton.openUrl("http://www.douban.com/recommend/?url=#{url}&title=#{title}&image=#{img}")
|
SocialShareButton.openUrl("http://www.douban.com/recommend/?url=#{url}&title=#{title}&image=#{img}")
|
||||||
when "facebook"
|
when "facebook"
|
||||||
SocialShareButton.openUrl("http://www.facebook.com/sharer.php?t=#{title}&u=#{fb_url}")
|
SocialShareButton.openUrl("http://www.facebook.com/sharer.php?s=100&p[title]=#{title}&p[url]=#{fb_url}&p[images][0]=#{img}")
|
||||||
when "qq"
|
when "qq"
|
||||||
SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}")
|
SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}")
|
||||||
when "tqq"
|
when "tqq"
|
||||||
|
|
|
@ -15,6 +15,11 @@ function load_tinymce() {
|
||||||
theme_advanced_statusbar_location : "bottom",
|
theme_advanced_statusbar_location : "bottom",
|
||||||
theme_advanced_resizing : true,
|
theme_advanced_resizing : true,
|
||||||
|
|
||||||
|
// Domain Absolute URLs
|
||||||
|
relative_urls : false,
|
||||||
|
remove_script_host : false,
|
||||||
|
document_base_url: window.location.protocol + '//' + window.location.host,
|
||||||
|
|
||||||
// Skin options
|
// Skin options
|
||||||
skin : "o2k7",
|
skin : "o2k7",
|
||||||
skin_variant : "silver",
|
skin_variant : "silver",
|
||||||
|
|
|
@ -101,7 +101,7 @@ div[data-role="page"] {
|
||||||
border: none;
|
border: none;
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
/*background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));*/
|
/*background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));*/
|
||||||
background-image: -webkit-linear-gradient(top, #5282A6, #133757);
|
background-image: -webkit-linear-gradient(top, #A02C5E, #300E1D);
|
||||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
|
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
|
||||||
}
|
}
|
||||||
.header h1.ui-title {
|
.header h1.ui-title {
|
||||||
|
@ -116,9 +116,9 @@ div[data-role="page"] {
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
/*color: #727272;*/
|
/*color: #727272;*/
|
||||||
color: #7CA6C5;
|
color: #C57CB3;
|
||||||
/*background-color: #252525;*/
|
/*background-color: #252525;*/
|
||||||
background-color: #144366;
|
background-color: #421528;
|
||||||
border-radius: 0 0 5px 5px;
|
border-radius: 0 0 5px 5px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
|
@ -135,14 +135,14 @@ div[data-role="page"] {
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
.header .ui-btn-up-a {
|
.header .ui-btn-up-a {
|
||||||
border: 1px solid #133547;
|
border: 1px solid #471334;
|
||||||
background-color: #0C4C64;
|
background-color: #600C64;
|
||||||
background-image: -webkit-gradient(linear, left top, left bottom, from( #0D6691 ), to( #0E3A4B ));
|
background-image: -webkit-gradient(linear, left top, left bottom, from( #910D86 ), to( #490E4B ));
|
||||||
background-image: -webkit-linear-gradient( #0D6691 , #0E3A4B );
|
background-image: -webkit-linear-gradient( #910D86 , #490E4B );
|
||||||
background-image: -moz-linear-gradient( #0D6691 , #0E3A4B );
|
background-image: -moz-linear-gradient( #910D86 , #490E4B );
|
||||||
background-image: -ms-linear-gradient( #0D6691 , #0E3A4B );
|
background-image: -ms-linear-gradient( #910D86 , #490E4B );
|
||||||
background-image: -o-linear-gradient( #0D6691 , #0E3A4B );
|
background-image: -o-linear-gradient( #910D86 , #490E4B );
|
||||||
background-image: linear-gradient( #0D6691 , #0E3A4B );
|
background-image: linear-gradient( #910D86 , #490E4B );
|
||||||
}
|
}
|
||||||
.header h1 img {
|
.header h1 img {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
|
@ -73,7 +73,7 @@ class FrontController < ApplicationController
|
||||||
res << " active" if (current_page.id.eql?(page.id) || current_page.descendant_of?(page))
|
res << " active" if (current_page.id.eql?(page.id) || current_page.descendant_of?(page))
|
||||||
res << "'>"
|
res << "'>"
|
||||||
root = "/"
|
root = "/"
|
||||||
res << "<a href='#{(page.class.to_s.eql?('Page') ? root + page.path : page.url)}'><span>#{page.title}</span></a>"
|
res << "<a href='#{(page.class.to_s.eql?('Page') ? root + page.path : page.url)}' target=#{(page.class.to_s.eql?('Page') ? '_self' : '_blank')} ><span>#{page.title}</span></a>"
|
||||||
if page.visible_children.size > 0 && current < menu.levels
|
if page.visible_children.size > 0 && current < menu.levels
|
||||||
res << "<span class='dot'></span>"
|
res << "<span class='dot'></span>"
|
||||||
res << menu_level(page, current_page, current + 1, menu)
|
res << menu_level(page, current_page, current + 1, menu)
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
class SessionsController < Devise::SessionsController
|
||||||
|
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
|
||||||
|
|
||||||
|
require 'net/http'
|
||||||
|
require 'uri'
|
||||||
|
|
||||||
|
def create
|
||||||
|
|
||||||
|
@user_id = params[:user][:user_id]
|
||||||
|
|
||||||
|
if @user_id == 'rulingcom'
|
||||||
|
|
||||||
|
resource = User.first(conditions:{user_id: @user_id})
|
||||||
|
|
||||||
|
if !resource.blank?
|
||||||
|
|
||||||
|
resource_name = resource.class.to_s.downcase
|
||||||
|
sign_in(resource_name, resource)
|
||||||
|
redirect_to after_sign_in_path_for(resource)
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||||
|
redirect_to :root
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
uri = URI('http://www.fgu.edu.tw/cgi-bin/check_intrant.pl')
|
||||||
|
response = Net::HTTP.post_form(uri, 'username' => @user_id, 'password' => params[:user][:password])
|
||||||
|
@response = response.body
|
||||||
|
|
||||||
|
if @response.include?("username=#{@user_id}")
|
||||||
|
|
||||||
|
resource = User.first(conditions:{user_id: @user_id})
|
||||||
|
|
||||||
|
if !resource.blank?
|
||||||
|
resource_name = resource.class.to_s.downcase
|
||||||
|
sign_in(resource_name, resource)
|
||||||
|
redirect_to after_sign_in_path_for(resource)
|
||||||
|
else
|
||||||
|
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||||
|
redirect_to :root
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||||
|
redirect_to :root
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
|
@ -220,7 +220,7 @@ module ApplicationHelper
|
||||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
||||||
end
|
end
|
||||||
javascripts << "<script type='text/javascript' src='/assets/lib/jquery.preload-min.js'></script>\n"
|
javascripts << "<script type='text/javascript' src='/assets/lib/jquery.preload-min.js'></script>\n"
|
||||||
javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
|
# javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
|
||||||
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
|
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
|
||||||
# javascripts << "<script type='text/javascript' src='/assets/social-share-button.js'></script>\n"
|
# javascripts << "<script type='text/javascript' src='/assets/social-share-button.js'></script>\n"
|
||||||
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
|
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
class GetRemoteAnnouncement
|
||||||
|
@queue = :high
|
||||||
|
|
||||||
|
def self.perform()
|
||||||
|
%x(ruby "#{Rails.root}/lib/remote_announcement.rb")
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,19 +1,3 @@
|
||||||
<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>
|
|
||||||
<script type='text/javascript'>
|
|
||||||
jQuery(function( $ ){
|
|
||||||
|
|
||||||
$('#slideshow-<%= @ad_banner.title.dehumanize %>').cycle({
|
|
||||||
delay: -1000,
|
|
||||||
fx: "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
|
|
||||||
timeoutFn: getTimeout,
|
|
||||||
pager: '.banner_nav-<%= @ad_banner.title.dehumanize %>',
|
|
||||||
pagerAnchorBuilder: function(idx, slide) {
|
|
||||||
return "<li><a href='#'></a></li>";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div style='position:relative'>
|
<div style='position:relative'>
|
||||||
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
|
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
|
||||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
|
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
|
||||||
|
@ -24,3 +8,15 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
var banner = {"banner_name":"#slideshow-<%= @ad_banner.title.dehumanize %>",
|
||||||
|
"banner_fx":"<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>",
|
||||||
|
"banner_pager":".banner_nav-<%= @ad_banner.title.dehumanize %>",
|
||||||
|
"image_count":"<%= @ad_banner.ad_images.length %>",
|
||||||
|
"image_loaded":0,
|
||||||
|
"time_to_next":<%= @ad_banner.transition_msec %>,
|
||||||
|
"current":0,
|
||||||
|
"best_size": "<%= @ad_banner.best_size %>"
|
||||||
|
};
|
||||||
|
banners.push(banner);
|
||||||
|
</script>
|
|
@ -11,7 +11,8 @@ backup_server:
|
||||||
description: BackupServer and remove old backups
|
description: BackupServer and remove old backups
|
||||||
|
|
||||||
update_tag_cloud:
|
update_tag_cloud:
|
||||||
cron: 0 0 [0,12] * * *
|
# cron: 0 0 [0,12] * * *
|
||||||
|
cron: 0 0 0 * * *
|
||||||
class: UpdateTagCloud
|
class: UpdateTagCloud
|
||||||
args:
|
args:
|
||||||
description: UpdateTagCloud
|
description: UpdateTagCloud
|
||||||
|
@ -23,7 +24,14 @@ generate_system_summary:
|
||||||
description: Generate the system status such as disk free space,package version list for showing at site tab
|
description: Generate the system status such as disk free space,package version list for showing at site tab
|
||||||
|
|
||||||
email_cron:
|
email_cron:
|
||||||
cron: 0 0 [10,16,22] * * *
|
# cron: 0 0 [10,16,22] * * *
|
||||||
|
cron: 0 0 10 * * *
|
||||||
class: EmailCron
|
class: EmailCron
|
||||||
args:
|
args:
|
||||||
description: EmailCron
|
description: EmailCron
|
||||||
|
|
||||||
|
get_remote_announcement:
|
||||||
|
cron: */5 * * * * *
|
||||||
|
class: GetRemoteAnnouncement
|
||||||
|
args:
|
||||||
|
description: GetRemoteAnnouncement
|
||||||
|
|
|
@ -3,6 +3,8 @@ Orbit::Application.routes.draw do
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
devise_for :users,:controllers => {:sessions => 'sessions'}
|
||||||
|
|
||||||
devise_for :users do
|
devise_for :users do
|
||||||
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,13 +32,7 @@ module ParserFrontEnd
|
||||||
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 ''
|
||||||
args.each do |index,arg|
|
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args
|
||||||
if index=="tag_id" || index=="category_id"
|
|
||||||
ret << (ret.include?("?") ? "&#{index}[]=#{arg}": "?#{index}[]=#{arg}" )
|
|
||||||
else
|
|
||||||
ret << (ret.include?("?") ? "&#{index}=#{arg}": "?#{index}=#{arg}" )
|
|
||||||
end
|
|
||||||
end if args
|
|
||||||
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)
|
||||||
|
|
|
@ -0,0 +1,150 @@
|
||||||
|
require 'mongo'
|
||||||
|
require 'open-uri'
|
||||||
|
require 'json'
|
||||||
|
require 'date'
|
||||||
|
|
||||||
|
@db = Mongo::Connection.new("localhost", 27017).db("fgu_orbit")
|
||||||
|
@coll_bulletin = @db["bulletins"]
|
||||||
|
@bulletin_links = @db["bulletin_links"]
|
||||||
|
@coll_cat = @db["bulletin_categories"]
|
||||||
|
@updated_bulletins = Array.new
|
||||||
|
|
||||||
|
@categories = @coll_cat.find().to_a.inject({}) do |categories, category|
|
||||||
|
categories[category['key']] = category['_id']
|
||||||
|
categories
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def save_bulletin_links bulletin_id, title, url, c_time
|
||||||
|
|
||||||
|
title = "Link" if title == ''
|
||||||
|
|
||||||
|
bulletin_link = {
|
||||||
|
title: {"zh_tw" => title, "en" => title },
|
||||||
|
url: url,
|
||||||
|
bulletin_id: bulletin_id,
|
||||||
|
created_at: c_time,
|
||||||
|
updated_at: c_time
|
||||||
|
}
|
||||||
|
@bulletin_links.save(bulletin_link)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_remote_bulletins_json(url)
|
||||||
|
data = ""
|
||||||
|
open(url){|f| f.each_line {|line| data << line} }
|
||||||
|
|
||||||
|
bulletins = JSON.parse data
|
||||||
|
|
||||||
|
bulletins.each do |b|
|
||||||
|
|
||||||
|
lang = b[1]=='zh-tw' ? "zh_tw".to_sym : "en".to_sym
|
||||||
|
|
||||||
|
next if b[2]==""
|
||||||
|
next if @categories["#{b[7]}"].nil?
|
||||||
|
|
||||||
|
if b[5]=="" and b[4]!=""
|
||||||
|
b[5]=b[4]
|
||||||
|
b[4]=""
|
||||||
|
end
|
||||||
|
|
||||||
|
bulletin = { _type: "Bulletin",
|
||||||
|
postdate: Time.parse(b[8]),
|
||||||
|
created_at: Time.parse(b[8]),
|
||||||
|
updated_at: Time.parse(b[8]),
|
||||||
|
is_checked: true,
|
||||||
|
is_pending: false,
|
||||||
|
is_rejected: false,
|
||||||
|
bulletin_category_id: @categories["#{b[7]}"],
|
||||||
|
title: {lang => b[2]},
|
||||||
|
subtitle: {lang => b[4]},
|
||||||
|
text: {lang => b[5]},
|
||||||
|
available_for_zh_tw: true,
|
||||||
|
available_for_en: true,
|
||||||
|
create_user_id: "",
|
||||||
|
public: true,
|
||||||
|
sn: b[0],
|
||||||
|
site: b[9],
|
||||||
|
site_id: b[10],
|
||||||
|
is_top: false,
|
||||||
|
is_hot: false,
|
||||||
|
is_hidden: false }
|
||||||
|
|
||||||
|
this_bulletin = @coll_bulletin.find_one(:$and => [{ :sn => bulletin[:sn]},{ :site => bulletin[:site]}])
|
||||||
|
@updated_bulletins.push({:sn => bulletin[:sn],:site => bulletin[:site] })
|
||||||
|
# p bulletin
|
||||||
|
|
||||||
|
unless this_bulletin
|
||||||
|
@coll_bulletin.save(bulletin)
|
||||||
|
|
||||||
|
|
||||||
|
#files
|
||||||
|
(10..14).each do |i|
|
||||||
|
ta = i + 5
|
||||||
|
save_bulletin_links( bulletin[:_id], b[ta], b[i], bulletin[:created_at] ) if b[i] != ''
|
||||||
|
end
|
||||||
|
|
||||||
|
#url
|
||||||
|
save_bulletin_links( bulletin[:_id], '', b[20], bulletin[:created_at] ) if b[20] != ''
|
||||||
|
|
||||||
|
# puts "Inserted "+lang.to_s+" "+bulletin[:title][lang]
|
||||||
|
# p bulletin
|
||||||
|
else
|
||||||
|
@coll_bulletin.update(
|
||||||
|
{"_id"=>this_bulletin["_id"]},
|
||||||
|
{
|
||||||
|
:_type => "Bulletin",
|
||||||
|
:postdate => bulletin[:postdate],
|
||||||
|
:created_at => bulletin[:created_at],
|
||||||
|
:updated_at => bulletin[:updated_at],
|
||||||
|
:is_checked => this_bulletin["is_checked"],
|
||||||
|
:is_pending => this_bulletin["is_pending"],
|
||||||
|
:is_rejected => this_bulletin["is_rejected"],
|
||||||
|
:bulletin_category_id => bulletin[:bulletin_category_id],
|
||||||
|
:title => bulletin[:title],
|
||||||
|
:subtitle => bulletin[:subtitle],
|
||||||
|
:text => bulletin[:text],
|
||||||
|
:available_for_zh_tw => this_bulletin["available_for_zh_tw"],
|
||||||
|
:available_for_en => this_bulletin["available_for_en"],
|
||||||
|
:create_user_id => "",
|
||||||
|
:public => this_bulletin["public"],
|
||||||
|
:sn => bulletin[:sn],
|
||||||
|
:site => bulletin[:site],
|
||||||
|
:site_id => bulletin[:site_id],
|
||||||
|
:is_top => this_bulletin["is_top"],
|
||||||
|
:is_hot => this_bulletin["is_hot"],
|
||||||
|
:is_hidden => this_bulletin["is_hidden"]
|
||||||
|
})
|
||||||
|
|
||||||
|
@bulletin_links.remove(bulletin_id: BSON::ObjectId(this_bulletin["_id"].to_s) )
|
||||||
|
|
||||||
|
#files
|
||||||
|
(10..14).each do |i|
|
||||||
|
ta = i + 5
|
||||||
|
save_bulletin_links( this_bulletin["_id"], b[ta], b[i], this_bulletin["created_at"] ) if b[i] != ''
|
||||||
|
end
|
||||||
|
|
||||||
|
#url
|
||||||
|
save_bulletin_links( this_bulletin["_id"], '', b[20], bulletin[:created_at] ) if b[20] != ''
|
||||||
|
|
||||||
|
# puts "Updated "+lang.to_s+" "+bulletin[:title][lang]
|
||||||
|
# p this_bulletin["_id"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
get_remote_bulletins_json("http://president.fgu.edu.tw/remote_annoucement/get_news2.php")
|
||||||
|
get_remote_bulletins_json("http://car.fgu.edu.tw/remote_annoucement/get_news2.php")
|
||||||
|
|
||||||
|
# Delete bulletins that had been removed form remote sites
|
||||||
|
# Find all remote bulletins on server
|
||||||
|
local_bulletins = @coll_bulletin.find({ site: { :$exists => true } })
|
||||||
|
|
||||||
|
# Check if each remote bulletins on server exist in the updated bulletins
|
||||||
|
local_bulletins.each do |local_bulletin|
|
||||||
|
result = @updated_bulletins.select {|remote_bulletin| remote_bulletin[:sn] == local_bulletin["sn"] and remote_bulletin[:site] == local_bulletin["site"]}
|
||||||
|
if result.length == 0
|
||||||
|
@coll_bulletin.remove(:$and => [{ :sn => local_bulletin["sn"]},{ :site => local_bulletin["site"]}])
|
||||||
|
p "Delete: "+local_bulletin["site"]+"-"+local_bulletin["sn"]
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,26 +1,95 @@
|
||||||
$(document).ready(function() {
|
var banners = [];
|
||||||
|
var banner_index = 0;
|
||||||
|
$q = jQuery;
|
||||||
|
$q.getScript('/static/jquery.cycle.all.latest.js');
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
$.each($(".dymanic_load"),function(){
|
$.each($(".dymanic_load"),function(){
|
||||||
if($(this).attr("path")==''){$(this).html("App setting Failed");}
|
if($(this).attr("path")==''){$(this).html("App setting Failed");}
|
||||||
|
|
||||||
if($(this).attr("path")!=''){
|
if($(this).attr("path")!=''){
|
||||||
ajax_load_proc($(this),$(this).attr("path"));
|
if($(this).attr("path").indexOf("show_banner")>0){
|
||||||
|
ajax_load_proc($(this),$(this).attr("path"),"true");
|
||||||
|
}else{
|
||||||
|
ajax_load_proc($(this),$(this).attr("path"),$(this).attr("path"));
|
||||||
}
|
}
|
||||||
}
|
}});
|
||||||
);
|
|
||||||
$("#main_content").addClass("module");
|
$("#main_content").addClass("module");
|
||||||
});
|
});
|
||||||
|
|
||||||
function ajax_load_proc(wapper,url){
|
function ajax_load_proc(wapper,url,isBanner){
|
||||||
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
||||||
if (textSta == 'success') {
|
if (textSta == 'success') {
|
||||||
|
if(isBanner=="true"){
|
||||||
wapper.html(respText);
|
wapper.html(respText);
|
||||||
|
var banner = banners[banner_index];
|
||||||
|
$(banner.banner_name+" > img").each(function(){
|
||||||
|
$(this).load(function(){ banner.image_loaded++; });
|
||||||
|
});
|
||||||
|
BannerCycle(banner_index);
|
||||||
|
banner_index++;
|
||||||
|
}else{
|
||||||
|
wapper.html(respText);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if(textSta == 'error')
|
if(textSta == 'error')
|
||||||
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function BannerCycle(banner_index){
|
||||||
|
var banner = banners[banner_index];
|
||||||
|
if (banner.image_loaded==$(banner.banner_name+" img").length){
|
||||||
|
if(banner.banner_name=="#slideshow-banner"){
|
||||||
|
$q(banner.banner_name).cycle({
|
||||||
|
delay: -1000,
|
||||||
|
fx: banner.banner_fx,
|
||||||
|
timeout: banner.time_to_next,
|
||||||
|
pager: banner.banner_pager,
|
||||||
|
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
var width = banner.best_size.split(" x ")[0];
|
||||||
|
var height = banner.best_size.split(" x ")[1];
|
||||||
|
$(banner.banner_name).css( "width", width);
|
||||||
|
$(banner.banner_name).css( "height", height);
|
||||||
|
$(banner.banner_name).css( "display", "block");
|
||||||
|
$(banner.banner_name).css( "overflow", "hidden");
|
||||||
|
$(banner.banner_name+" > img").each(function(){
|
||||||
|
$( this ).css( "position", "absolute" );
|
||||||
|
$( this ).css( "top", "0" );
|
||||||
|
$( this ).css( "left", "0" );
|
||||||
|
$( this ).css( "display", "block" );
|
||||||
|
});
|
||||||
|
if($(banner.banner_name+" > img").length>1) OrbitCycle(banner_index);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
setTimeout("BannerCycle("+banner_index+")",500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function OrbitCycle(banner_index){
|
||||||
|
var banner = banners[banner_index];
|
||||||
|
var index = 0;
|
||||||
|
|
||||||
|
$(banner.banner_name+" > img").each(function(){
|
||||||
|
if(index==banner.current){
|
||||||
|
$( this ).css( "z-index", $(banner.banner_name+" img").length+1);
|
||||||
|
$(this).fadeTo( "slow" , 1);
|
||||||
|
}else{
|
||||||
|
$( this ).css( "z-index", index);
|
||||||
|
$(this).fadeTo( "slow" , 0);
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
if((banner.current+1)<$(banner.banner_name+" img").length){
|
||||||
|
banner.current++;
|
||||||
|
}else{
|
||||||
|
banner.current=0;
|
||||||
|
}
|
||||||
|
// console.log("OrbitCycle: "+banner_index);
|
||||||
|
setTimeout("OrbitCycle("+banner_index+")",banner.time_to_next);
|
||||||
|
}
|
||||||
|
|
||||||
// Ad Banner FX code [start]
|
// Ad Banner FX code [start]
|
||||||
function getTimeout() {
|
function getTimeout() {
|
||||||
return $(this).attr('time_to_next');
|
return $(this).attr('time_to_next');
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Bulletin
|
||||||
end
|
end
|
||||||
|
|
||||||
def share_item
|
def share_item
|
||||||
Item.first(conditions:{name: 'announcement'})
|
Item.first(conditions:{name: 'news'})
|
||||||
end
|
end
|
||||||
|
|
||||||
def proc_check(check,not_pass_info = "")
|
def proc_check(check,not_pass_info = "")
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="info1">
|
<div class="info1">
|
||||||
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
<span class="pull-right"><%= dislpay_view_count(@bulletin) %></span>
|
||||||
|
<span class="pull-right"><%= share_links(@bulletin, 'announcement') %></span>
|
||||||
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
<span class="date"><%= display_date_time(@bulletin.postdate) %></span>
|
||||||
<% unit = @bulletin.cache_dept[I18n.locale.to_s] rescue nil %>
|
<% unit = @bulletin.cache_dept[I18n.locale.to_s] rescue nil %>
|
||||||
<span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span>
|
<span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span>
|
||||||
|
@ -38,4 +39,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= share_links(@bulletin, 'announcement') %>
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -9,17 +9,40 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||||
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
||||||
@album_images = @album.gallery_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
|
||||||
@class = "c" + @settings["horizontal"].to_s
|
@class = "c" + @settings["horizontal"].to_s
|
||||||
@total = @settings["vertical"] * @settings["horizontal"]
|
@total = @settings["vertical"] * @settings["horizontal"]
|
||||||
@rnd = Random.new
|
@rnd = Random.new
|
||||||
@images = []
|
@images = []
|
||||||
for i in 0..@total-1
|
|
||||||
image = @album_images[@rnd.rand(0...@album_images.count)]
|
if @album_images.count > @total
|
||||||
|
@randoms = []
|
||||||
|
until @randoms.count == @total do
|
||||||
|
r = @rnd.rand(0...@album_images.count)
|
||||||
|
if !@randoms.include?r
|
||||||
|
@randoms << 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(image),"thumb"=>image.file.thumb.url}
|
||||||
@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
|
||||||
|
@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
|
||||||
|
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def widget2
|
def widget2
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,13 @@
|
||||||
<div class="o-links-list">
|
<div class="o-links-list">
|
||||||
<ul>
|
<ul>
|
||||||
<% web_links.page(params[:page_main]).per(@page_num).each do |web_link| %>
|
<% web_links.page(params[:page_main]).per(@page_num).each do |web_link| %>
|
||||||
|
<% if !web_link.title.empty? %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to web_link.title, web_link.url, {:target => '_blank', :title => web_link.title, :class=>"o-links-title"} %>
|
<%= link_to web_link.title, web_link.url, {:target => '_blank', :title => web_link.title, :class=>"o-links-title"} %>
|
||||||
<div class="o-links-description"><%= web_link.context %></div>
|
<div class="o-links-description"><%= web_link.context %></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
<div class="o-links-list">
|
<div class="o-links-list">
|
||||||
<ul>
|
<ul>
|
||||||
<% web_links.page(params[:page_main]).per(@page_num).each do |web_link| %>
|
<% web_links.page(params[:page_main]).per(@page_num).each do |web_link| %>
|
||||||
|
<% if !web_link.title.empty? %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to web_link.title, web_link.url, {:target => '_blank', :title => web_link.title, :class=>"o-links-title"} %>
|
<%= link_to web_link.title, web_link.url, {:target => '_blank', :title => web_link.title, :class=>"o-links-title"} %>
|
||||||
<div class="o-links-description"><%= web_link.context %></div>
|
<div class="o-links-description"><%= web_link.context %></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue