Compare commits

...
Author SHA1 Message Date
Spen 70673f19f0 fix ntue new member default non-administrator and announcement image size & file name cannot be null 2013-10-16 15:08:33 +08:00
Manson Wang 9849b5c7dd Ad_Banner fix for FGU
Conflicts:

	app/views/front/show_banner.html.erb
	public/static/kernel.js
2013-10-16 09:56:00 +08:00
rulingcom 3999308bb4 Changes in mobile 2013-10-11 15:15:09 +08:00
saurabhbhatia ee2adf2121 Updated Locations controller with id in json api 2013-10-09 09:19:05 +00:00
saurabhbhatia 363ea53861 Removed pagination from video api 2013-10-05 16:38:10 +08:00
saurabhbhatia b7ea756789 Updated channel videos liks to 3gp format 2013-10-04 20:04:44 +08:00
saurabhbhatia 839743779b Updated channel json with number of videos 2013-10-04 18:04:47 +08:00
Spen f8c7e8f17a fix ntue sub menu link target 2013-10-04 17:40:20 +08:00
saurabhbhatia 9f779f1f71 Updated visibility for get channels in api 2013-10-04 11:30:06 +08:00
saurabhbhatia 95310619c0 Fix the URL for video in channel video api 2013-10-04 11:28:28 +08:00
saurabhbhatia 55207da76a Updated to 2 steps for android app, channel id and channel related videos 2013-10-04 11:27:00 +08:00
saurabhbhatia 795d881626 Added video json api 2013-10-04 10:17:13 +08:00
saurabhbhatia 4cd455441f Updated location json visibility 2013-10-03 18:20:16 +08:00
saurabhbhatia fea0540ec3 updated json format for location and locaiton categories 2013-10-03 17:59:12 +08:00
saurabhbhatia 44f5a98a69 Updated Location and loction categories to pass ids 2013-10-03 17:30:05 +08:00
saurabhbhatia 746bcbed96 added get_categorywise_locations 2013-10-03 15:52:46 +08:00
saurabhbhatia ec6ef5a871 NTUE localtion categories as json for Android App 2013-10-03 15:06:59 +08:00
chris 8aa1e2dae0 Changes for mobile contact, one line 2013-10-01 15:44:44 +08:00
chris dd0d2368c8 Changes for mobile based on footer 2013-10-01 15:40:29 +08:00
Manson Wang 9c41282fdb Fix Ad_Banner Loading Problem (Not complete) 2013-09-30 21:10:49 +08:00
saurabhbhatia fac578f251 Merge branch '0913_ntue' of https://github.com/Rulingcom/orbit into 0913_ntue 2013-09-30 16:36:33 +08:00
Manson Wang 3b4e4e1098 Fix path of jquery.cycle.all.latest.js 2013-09-30 16:35:22 +08:00
harrybomrah 8c68c54a57 ad_banner banner load fixed for test site
Conflicts:

	app/views/front/show_banner.html.erb
2013-09-30 16:35:22 +08:00
Manson Wang 2d8754f0aa NTUE Logo 2013-09-30 16:35:22 +08:00
chris 19633a05d8 Fix parser_front_end.rb for page content 2013-09-30 16:35:21 +08:00
Spen 051adbf167 ntue email_ers fix and announcement widget filed fix 2013-09-30 16:35:21 +08:00
chris d386307745 Fix params name for rss 2013-09-30 16:35:21 +08:00
chris 5c0d16c22e Modification in rss feed for announcement:
- subtitle instead of text
	- add rss link in the json for categories
2013-09-30 16:35:21 +08:00
ruling 93424e1972 Fix link frontend and gallery json 2013-09-30 16:35:21 +08:00
chris 3c49a6eeae Do not show announcement in json and rss if no title in I18n.locale (fix 2) 2013-09-30 16:35:21 +08:00
chris f76ead6ea5 Revert "Do not show announcement in json and rss if no title in I18n.locale (fix)"
This reverts commit f72697ae76.
2013-09-30 16:35:21 +08:00
chris e8a8e92f5c Do not show announcement in json and rss if no title in I18n.locale (fix) 2013-09-30 16:35:21 +08:00
chris 5b60e389ec Revert "Do not show announcement in json and rss if no title in I18n.locale"
This reverts commit 03189092d3.
2013-09-30 16:35:20 +08:00
chris faabedad55 Do not show announcement in json and rss if no title in I18n.locale 2013-09-30 16:35:20 +08:00
chris d95b050e57 Changes to have both json and rss, add categories 2013-09-30 16:35:20 +08:00
harrybomrah afe6972dfa link widget for ntue updated 2013-09-30 16:35:20 +08:00
harrybomrah ce3842d3ad fixed external links opening in different window 2013-09-30 16:35:20 +08:00
chris 9fbf9e940e Fix scope error 2013-09-30 16:35:20 +08:00
chris 0f2c13e7ac First version of new feed for announcement 2013-09-30 16:35:20 +08:00
Spen f42d25c46b ntue emailer approval fix and announcement widget add unit field 2013-09-30 16:35:20 +08:00
chris dda603c27c Changes for ntue (mail app) 2013-09-30 16:35:19 +08:00
chris ecc3581106 Domain absolute url for tinymce files 2013-09-30 15:25:06 +08:00
Manson Wang e56e91cc93 Fix path of jquery.cycle.all.latest.js 2013-09-30 15:17:53 +08:00
harrybomrah 4b7703f4af ad_banner banner load fixed for test site
Conflicts:

	app/views/front/show_banner.html.erb
2013-09-30 14:16:29 +08:00
harrybomrah 2ec3d77600 widget code rewritten for gallery master branch 2013-09-30 14:15:53 +08:00
Manson Wang 5e1d6663a1 NTUE Logo 2013-09-30 14:15:31 +08:00
chris 19801eb10f Fix parser_front_end.rb for page content 2013-09-30 14:15:02 +08:00
Spen 4abe4f5c16 ntue email_ers fix and announcement widget filed fix 2013-09-27 18:58:58 +08:00
chris 52356d3316 Fix params name for rss 2013-09-27 16:52:50 +08:00
Matthew K. Fu JuYuan 6d4d3ccfd4 for some reason can_display has been remove from announcement init. add it back. 2013-09-23 16:29:22 +08:00
chris 663bb7776b Modification in rss feed for announcement:
- subtitle instead of text
	- add rss link in the json for categories
2013-09-17 23:11:23 +08:00
ruling dfcb383e0f Fix link frontend and gallery json 2013-09-17 20:55:03 +08:00
chris c4ca7f450a Do not show announcement in json and rss if no title in I18n.locale (fix 2) 2013-09-17 20:52:02 +08:00
chris e851395f79 Revert "Do not show announcement in json and rss if no title in I18n.locale (fix)"
This reverts commit f72697ae76.
2013-09-17 20:51:29 +08:00
chris f72697ae76 Do not show announcement in json and rss if no title in I18n.locale (fix) 2013-09-17 20:47:27 +08:00
chris 2040081679 Revert "Do not show announcement in json and rss if no title in I18n.locale"
This reverts commit 03189092d3.
2013-09-17 20:47:03 +08:00
chris 03189092d3 Do not show announcement in json and rss if no title in I18n.locale 2013-09-17 20:44:00 +08:00
harrybomrah 141b708392 widget code rewritten for gallery master branch 2013-09-16 11:22:56 +08:00
36 changed files with 281 additions and 128 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -15,6 +15,11 @@ function load_tinymce() {
theme_advanced_statusbar_location : "bottom",
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 : "o2k7",
skin_variant : "silver",
@@ -101,8 +101,8 @@ div[data-role="page"] {
border: none;
z-index: 50;
/*background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));*/
background-image: -webkit-linear-gradient(top, #5282A6, #133757);
-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;
background-image: -webkit-linear-gradient(top, #6D35AF, #391C69);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 #AE73F5, 0 -1px 0 rgba(31, 32, 36, 1) inset;
}
.header h1.ui-title {
margin: 8px 30%;
@@ -116,9 +116,9 @@ div[data-role="page"] {
margin-left: -15px;
font-size: 20px;
/*color: #727272;*/
color: #7CA6C5;
color: #C5A7D3;
/*background-color: #252525;*/
background-color: #144366;
background-color: #38177F;
border-radius: 0 0 5px 5px;
height: 15px;
line-height: 16px;
@@ -135,14 +135,14 @@ div[data-role="page"] {
background-image: none;
}
.header .ui-btn-up-a {
border: 1px solid #133547;
background-color: #0C4C64;
border: 1px solid #7220A0;
background-color: #9B2DCF;
background-image: -webkit-gradient(linear, left top, left bottom, from( #0D6691 ), to( #0E3A4B ));
background-image: -webkit-linear-gradient( #0D6691 , #0E3A4B );
background-image: -moz-linear-gradient( #0D6691 , #0E3A4B );
background-image: -ms-linear-gradient( #0D6691 , #0E3A4B );
background-image: -o-linear-gradient( #0D6691 , #0E3A4B );
background-image: linear-gradient( #0D6691 , #0E3A4B );
background-image: -webkit-linear-gradient(#9B1DF0, #5F2879);
background-image: -moz-linear-gradient(#9B1DF0, #5F2879);
background-image: -ms-linear-gradient(#9B1DF0, #5F2879);
background-image: -o-linear-gradient(#9B1DF0, #5F2879);
background-image: linear-gradient(#9B1DF0, #5F2879);
}
.header h1 img {
height: 30px;
+1 -1
View File
@@ -220,7 +220,7 @@ module ApplicationHelper
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
end
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='/assets/social-share-button.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ class User
mount_uploader :avatar, AvatarUploader
field :admin, :type => Boolean, :default => true
field :admin, :type => Boolean, :default => false
field :active_role
field :user_id
field :sid
+12 -17
View File
@@ -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'>
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
@@ -23,4 +7,15 @@
<% end %>
<% end %>
</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_loaded":0,
"time_to_next":<%= @ad_banner.transition_msec %>,
"current":0,
"best_size": "<%= @ad_banner.best_size %>"
};
banners.push(banner);
</script>
+1 -1
View File
@@ -4,7 +4,7 @@
<ul class='list'>
<% @menu_page.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>
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>" <%= "target=_blank" if child.class.to_s.eql?('Page').blank? %> ><%= child.title %></a>
</li>
<% end %>
</ul>
+1 -5
View File
@@ -3,9 +3,5 @@
<% end %>
<ul>
<li>總機電話:<a href="tel:+886229393091">02-29393091</a></li>
<li>傳真:02-29379611</li>
<li>緊急重大事件通聯窗口:校內分機 66119、66110</li>
<li>總值日室:<a href="tel:+88229387132">02-29387132</a></li>
<li>駐警衛室:<a href="tel:+88229387129">02-29387129</a></li>
<li>電話:<a href="tel:+886227321104">+886-2-2732-1104</a> <a href="tel:+886266396688">+886-2-6639-6688</a></li>
</ul>
+1 -1
View File
@@ -5,6 +5,6 @@
<div id='map_canvas'></div>
<script type='text/javascript'>
var $map_center = "24.987449, 121.576117"
var $map_center = "25.024562,121.544611"
var $map_zoom = 17
</script>
+1 -7
View File
@@ -32,13 +32,7 @@ module ParserFrontEnd
ret = ''
part = PagePart.find(front['part_id']) if front['part_id']
ret << eval("\"#{front['path']}\"") rescue ''
args.each do |index,arg|
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
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
end
front.swap(fragment)
+66 -39
View File
@@ -1,45 +1,72 @@
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){$(this).html("App setting Failed");}
if($(this).attr("path")!=''){
ajax_load_proc($(this),$(this).attr("path"));
}
}
);
$("#main_content").addClass("module");
});
var banners = [];
var banner_index = 0;
$q = jQuery;
$q.getScript('/static/jquery.cycle.all.latest.js');
function ajax_load_proc(wapper,url){
$.get(encodeURI(url), {}, function(respText,textSta,XML){
if (textSta == 'success') {
wapper.html(respText);
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
});
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){$(this).html("App setting Failed");}
if($(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");
});
function ajax_load_proc(wapper,url,isBanner){
$.get(encodeURI(url), {}, function(respText,textSta,XML){
if (textSta == 'success') {
if(isBanner=="true"){
wapper.html(respText);
var banner = banners[banner_index];
if($(banner.banner_name+" img").length>1){
$(banner.banner_name+" > img").each(function(){
$(this).load(function(){ banner.image_loaded++; });
});
BannerCycle(banner_index);
}
banner_index++;
}else{
wapper.html(respText);
}
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
});
}
// Ad Banner FX code [start]
function getTimeout() {
return $(this).attr('time_to_next');
}
function BannerCycle(banner_index){
var banner = banners[banner_index];
if (banner.image_loaded==$(banner.banner_name+" img").length){
$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{
setTimeout("BannerCycle("+banner_index+")",500);
}
}
$(document).ready(function() {
$(document).on('click', '.slideshow img', function()
{
if($(this).attr('link_url')!='')
{
if($(this).attr('link_open')=='new_window')
{
window.open($(this).attr('link_url'));
}
else
{
document.location.href=$(this).attr('link_url')
}
}
})
$(document).on('click', '.slideshow img', function()
{
if($(this).attr('link_url')!='')
{
if($(this).attr('link_open')=='new_window')
{
window.open($(this).attr('link_url'));
}
else
{
document.location.href=$(this).attr('link_url')
}
}
})
});
// Ad Banner FX code [end]
// Ad Banner FX code [end]
@@ -61,8 +61,9 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
custom_categories = @categories.inject([]) do |data, category|
data << {
title: category.title,
link: "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletins_path(bulletin_category_id: category.id, locale: I18n.locale)}",
link_json: "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(category_id: category.id, locale: I18n.locale)}"
link_html: "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletins_path(category_id: category.id, locale: I18n.locale)}",
link_json: "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(category_id: category.id, locale: I18n.locale, format: 'json')}",
link_rss: "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(category_id: category.id, locale: I18n.locale, format: 'rss')}"
}
end
render json: JSON.pretty_generate(custom_categories)
@@ -23,6 +23,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def index
email_group_data
# @bulletins = Bulletin.all
# @bulletins = Bulletin.desc("postdate desc")
get_categorys('BulletinCategory',params[:bulletin_category_id])
@@ -116,6 +119,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# POST /bulletins
# POST /bulletins.xml
def create
email_group_data
@tags = get_tags
if params[:bulletin_link]
@@ -221,6 +227,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def update
email_group_data
@bulletin = Bulletin.find(params[:id])
# @bulletin.image.clear if params[:bulletin][:image_del] == '1'
@@ -327,6 +335,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def get_bulletins
I18n.locale = params[:locale] || :zh_tw
bulletins = params[:category_id] ? Bulletin.where(bulletin_category_id: params[:category_id]).order_by(:created_at, :desc) : Bulletin.all.order_by(:created_at, :desc)
bulletins = bulletins.reject{|b| b.title_translations[I18n.locale.to_s].blank?}
@bulletins = Kaminari.paginate_array(bulletins).page(params[:page]).per(params[:per] || 10)
respond_to do |format|
@@ -339,7 +348,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
link: "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletin_path(bulletin, category_id: bulletin.bulletin_category.id, locale: I18n.locale)}",
image: "#{request.protocol}#{request.host_with_port}#{image_url}",
category: bulletin.bulletin_category.title,
content: bulletin.text,
description: bulletin.subtitle,
postdate: display_date_time(bulletin.postdate),
deadline: deadline,
tag: bulletin.sorted_tags.map{|tag| tag.name}
@@ -11,4 +11,14 @@ class BulletinFile
belongs_to :bulletin
validate :check_file_title
private
def check_file_title
if self.title.blank?
errors.add( :file, I18n.t("announcement.file_name_not_null"))
end
end
end
@@ -8,8 +8,8 @@ xml.rss :version => "2.0" do
xml.item do
xml.title category.title
xml.pubDate category.created_at.to_s(:rfc822)
xml.link "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(bulletin_category_id: category.id, locale: I18n.locale, format: 'rss')}"
xml.guid "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletins_path(bulletin_category_id: category.id)}"
xml.link "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(category_id: category.id, locale: I18n.locale, format: 'rss')}"
xml.guid "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletins_path(category_id: category.id)}"
end
end
end
@@ -22,7 +22,7 @@
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
</div>
<span class="alert widgetInfo"><%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px x 150px") %></span>
<span class="alert widgetInfo"><%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px x 230px") %></span>
<div class="controls file-upload input-prepend">
<%= t(:browse) %>
<%= f.file_field :image, :id => "input-upload", :class => '', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
@@ -278,32 +278,29 @@
<div id="content-box">
<hr />
<%#= f.datetime_picker :email_sentdate, :picker_type => 'separated', :label => t("announcement.email_sentdate") %>
<br />
<br />
<%= f.label :email_group ,t("announcement.email_group")%>
<div class="form-inline">
<ul class="nav nav-pills">
<% @email_group_data.collect do |k,v| %>
<li class="pull-left">
<%= check_box_tag 'bulletin[email_group][]', k, (@bulletin.email_group.nil? ? false : @bulletin.email_group.include?(k)), :id => "field-#{k}" %>
<label for="field-<%= k %>"><%= v["name"] %></label>
<%= hidden_field_tag 'bulletin[email_group][]', '' %>
</li>
<% end %>
</ul>
</div>
<%= f.label :email_group ,t("announcement.email_group")%>
<div class="form-inline">
<ul class="nav nav-pills">
<% @email_group_data.collect do |k,v| %>
<li class="pull-left">
<%= check_box_tag 'bulletin[email_group][]', k, (@bulletin.email_group.nil? ? false : @bulletin.email_group.include?(k)), :id => "field-#{k}" %>
<label for="field-<%= k %>"><%= v["name"] %></label>
<%= hidden_field_tag 'bulletin[email_group][]', '' %>
</li>
<% end if !@email_group_data.blank? %>
</ul>
</div>
<%= f.label :other_mailaddress ,"#{t("announcement.other_mailaddress")}(#{t("announcement.other_mailaddress_note")})"%>
<%= f.text_area :other_mailaddress, :class=>"span12", :cols=>"25", :rows=>"10" %>
<%= f.label :other_mailaddress ,"#{t("announcement.other_mailaddress")}(#{t("announcement.other_mailaddress_note")})"%>
<%= f.text_area :other_mailaddress, :class=>"span12", :cols=>"25", :rows=>"10" %>
</div>
</div>
</div>
</div>
@@ -1,5 +1,7 @@
<% # encoding: utf-8 %>
<%= f.error_messages %>
<tr id="<%= "bulletin_file_#{form_bulletin_file.id}" if !form_bulletin_file.new_record? %>" class='list_item'>
<td>
<div class="control-group">
@@ -6,13 +6,13 @@ xml.rss :version => "2.0" do
else
xml.title t('announcement.announcement')
end
xml.link "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(bulletin_category_id: @category.try(:id))}.rss"
xml.link "#{request.protocol}#{request.host_with_port}#{get_bulletins_panel_announcement_back_end_bulletins_path(bulletin_category_id: @category.try(:id), format: 'rss')}"
@bulletins.each do |bulletin|
xml.item do
xml.title bulletin.title
xml.pubDate bulletin.postdate.to_s(:rfc822)
xml.description bulletin.text
xml.description bulletin.subtitle
xml.link "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletin_path(bulletin, category_id: bulletin.bulletin_category.id, locale: I18n.locale)}"
xml.guid "#{request.protocol}#{request.host_with_port}#{panel_announcement_front_end_bulletin_path(bulletin)}"
end
@@ -25,6 +25,7 @@ en:
file: Attachment
file_description: File Description
file_name: File Name
file_name_not_null: Name cannot be null
frontend:
bulletins: Announcement front-end
search_result: Search result
@@ -25,6 +25,7 @@ zh_tw:
file: 附加檔案
file_description: 檔案描述
file_name: 檔案名稱
file_name_not_null: 名稱不得為空值
frontend:
bulletins: 公告前台
search_result: 搜尋結果頁
+2 -2
View File
@@ -30,13 +30,13 @@ module Announcement
widgets do
default_widget do
sorting 'desc(:postdate)'
query 'Bulletin.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
query 'Bulletin.can_display.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
enable ["typeA","typeB_style3","typeC"]
image :image
field :postdate
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
field :subtitle
link_field :subtitle,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
field :bulletin_create_dept
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
end
@@ -126,9 +126,9 @@ class Panel::ErEmail::BackEnd::EmailErsController < OrbitBackendController
respond_to do |format|
if @email_er.save
# if @email_er.is_checked == true and !@email_er.is_rejected
# send_email_data(@email_er)
# end
if @email_er.is_checked == true and !@email_er.is_rejected
send_email_data(@email_er)
end
format.html { redirect_to(panel_er_email_back_end_email_ers_url) }
format.xml { render :xml => @email_er, :status => :created, :location => @email_er }
+3 -2
View File
@@ -77,13 +77,14 @@ class EmailEr
if email_group_data.include?(egroup) and (egroup == '0' or egroup == '1' or egroup == '2' or egroup == '3')
group_mail << "#{email_group_data[egroup]["email"]}(#{email_group_data[egroup]["name"]})"
#group_mail << "#{email_group_data[egroup]["email"]}(#{email_group_data[egroup]["name"]})"
group_mail << "#{email_group_data[egroup]["name"]}"
elsif email_group_data.include?(egroup) and egroup == '4'
self.other_mailaddress.split(",").each do |otmail|
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
group_mail << "#{otmail}(#{email_group_data[egroup]["name"]})"
end
@@ -15,7 +15,7 @@ class EmailErFile
private
def file_size
if file.file.size > 1.megabytes
if file.file.size > 10.megabytes
errors.add( :file, I18n.t("er_email.email_file_limit"))
end
end
@@ -105,7 +105,7 @@
$(document).ready(function() {
$('#add_plugin_file a.add').live('click', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g");
var old_id = new RegExp("new_email_er_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :email_er_files) %>").replace(old_id, new_id));
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@@ -3,7 +3,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
# before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json]
before_filter :force_order_for_visitor,:only=>[:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs]
before_filter :force_order_for_visitor,:only=>[:index,:show,:get_albums,:imgs]
before_filter :force_order_for_user,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs]
before_filter :for_app_sub_manager,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs]
# before_filter lambda
@@ -5,6 +5,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
def show
@album = GalleryAlbum.find(params[:id])
@tags = Tag.find(@album.tagged_ids).map{|t| t.name}
respond_to do |format|
format.json { render json: @album }
end
end
def get_albums
@@ -9,15 +9,38 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
@album_images = @album.gallery_images if @album
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
@class = "c" + @settings["horizontal"].to_s
@total = @settings["vertical"] * @settings["horizontal"]
@rnd = Random.new
@images = []
for i in 0..@total-1
image = @album_images[@rnd.rand(0...@album_images.count)]
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
@images << values
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}
@images << values
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
@@ -33,4 +33,20 @@ class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendContr
render :json=>{"success"=>"true"}.to_json
end
def get_location_categories
location_categories = LocationCategory.all
@data = Array.new
location_categories.each do |category|
I18n.locale = :en
name_en = category.name
I18n.locale = :zh_tw
name_zh_tw = category.name
category_id = category.id.to_s
@data << { name_en: name_en, name_zh_tw: name_zh_tw, category_id: category_id, location_link: "http://ntue.tp.rulingcom.com/panel/location/back_end/locations/get_categorywise_locations?category_id=#{category_id}"}
end
render :json => JSON.pretty_generate(@data)
end
end
@@ -2,7 +2,7 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
include AdminHelper
before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :create, :update, :delete]
before_filter :force_order_for_user,:except => [:get_locations,:index]
before_filter :force_order_for_user,:except => [:get_locations,:index,:get_categorywise_locations]
def index
@location_infos = LocationInfo.all
@@ -73,4 +73,25 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
render :json => JSON.pretty_generate({location: @data})
end
def get_categorywise_locations
location_infos = LocationInfo.where(:location_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
+4 -1
View File
@@ -4,9 +4,12 @@ Rails.application.routes.draw do
namespace :back_end do
match "locations/get_locations" => "locations#get_locations"
match "locations/get_categorywise_locations" => "locations#get_categorywise_locations"
resources :locations
resources :location_categories
resources :location_categories, :except => [:show]
match "location_categories/get_location_categories" => "location_categories#get_location_categories"
end
end
end
@@ -1,6 +1,6 @@
class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController
before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :delete]
before_filter :force_order_for_user,:except => [:index]
before_filter :force_order_for_user,:except => [:index, :get_channel_videos, :get_channels]
def index
@channel_videos = ChannelVideo.all
@@ -17,7 +17,7 @@ class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController
respond_to do |format|
format.html
format.json { render json: @location }
format.json { render json: @channel_videos }
end
end
@@ -55,4 +55,47 @@ class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController
redirect_to panel_video_back_end_channel_videos_url
end
def get_channels
@channels = ChannelVideo.all
@data = Array.new
@channels.each do |channel|
client = YouTubeIt::Client.new(:dev_key => "AI39si5KGPg8rhKLBfmeukit2tCSP_B9lT8igiNICbrbgUXQoAdYGvsyCGCmO1wGnr1OW4bDRv-ESolwk-rdBNIAgVTL9VYaEA")
@client_videos = client.videos_by(:user => channel.channel_name)
number_of_videos = @client_videos.videos.length
name = channel.channel_name
channel_id = channel.id.to_s
@data << { channel_name: name, channel_link: "http://ntue.tp.rulingcom.com/panel/video/back_end/channel_videos/get_channel_videos?channel_id=#{channel_id}", number_of_videos: number_of_videos }
end
render :json => JSON.pretty_generate(@data)
end
def get_channel_videos
@channel_video = ChannelVideo.where(:_id => params[:channel_id])
@channel_video.each do |channel|
client = YouTubeIt::Client.new(:dev_key => "AI39si5KGPg8rhKLBfmeukit2tCSP_B9lT8igiNICbrbgUXQoAdYGvsyCGCmO1wGnr1OW4bDRv-ESolwk-rdBNIAgVTL9VYaEA")
@client_videos = client.videos_by(:user => channel.channel_name)
@data = Array.new
@client_videos.videos.each do |video|
# url = video.player_url
title = video.title
description = video.description
author = video.author.name
channel_name = channel.channel_name
video.media_content.each do |m|
if m.mime_type == "video/3gpp"
@url = m.url
end
end
# category_id = category.id.to_s
@data << { title: title, description: description, url: @url, author: author, channel_name: channel_name}
end
render :json => JSON.pretty_generate(@data)
end
end
end
+3
View File
@@ -4,6 +4,9 @@ Rails.application.routes.draw do
namespace :back_end do
match "videos/get_videos" => "videos#get_videos"
resources :videos
match "channel_videos/get_channels" => "channel_videos#get_channels"
match "channel_videos/get_channel_videos" => "channel_videos#get_channel_videos"
resources :channel_videos
end
@@ -10,11 +10,13 @@
<div class="o-links-list">
<ul>
<% web_links.page(params[:page_main]).per(@page_num).each do |web_link| %>
<% if !web_link.title.blank? %>
<li>
<%= 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>
</li>
<% end %>
<% end %>
</ul>
</div>
</li>