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
15 changed files with 131 additions and 95 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@@ -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
+5 -2
View File
@@ -1,4 +1,3 @@
<%= javascript_include_tag "lib/jquery.cycle.all.latest.js"%>
<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'>
@@ -12,7 +11,11 @@
<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 %>"
"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>
+59 -54
View File
@@ -1,67 +1,72 @@
var banners = [];
var banner_index = 0;
$q = jQuery;
$q.getScript('/static/jquery.cycle.all.latest.js');
$(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");
$.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);
setTimeout("BannerCycle()", 2500);
}else{
wapper.html(respText);
}
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
});
$.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>");
});
}
function BannerCycle(){
var banner = banners[banner_index];
banner_index++;
$(banner.banner_name).ready(function() {
$(banner.banner_name).cycle({
delay: -1000,
fx: banner.banner_fx,
timeoutFn: getTimeout,
pager: banner.banner_pager,
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
});
});
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);
}
}
// Ad Banner FX code [start]
function getTimeout() {
return $(this).attr('time_to_next');
}
$(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]
@@ -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'
@@ -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
@@ -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">
@@ -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: 搜尋結果頁
@@ -83,7 +83,8 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
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 << { name: location.name,
@data << { id: location.id.to_s,
name: location.name,
pic_url: picurl,
thumb_url: thumburl,
longitude: location.longitude,
@@ -61,9 +61,12 @@ class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController
@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}"}
@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)
@@ -73,18 +76,23 @@ class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController
@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, :per_page => 5)
@client_videos = client.videos_by(:user => channel.channel_name)
@data = Array.new
@client_videos.videos.each do |video|
url = video.player_url
# 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}
@data << { title: title, description: description, url: @url, author: author, channel_name: channel_name}
end
render :json => JSON.pretty_generate(@data)