Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebdf124d06 | ||
|
|
9f779f1f71 | ||
|
|
95310619c0 | ||
|
|
55207da76a | ||
|
|
795d881626 | ||
|
|
4cd455441f | ||
|
|
fea0540ec3 | ||
|
|
44f5a98a69 | ||
|
|
746bcbed96 | ||
|
|
ec6ef5a871 | ||
|
|
8aa1e2dae0 | ||
|
|
dd0d2368c8 | ||
|
|
9c41282fdb | ||
|
|
fac578f251 | ||
|
|
3b4e4e1098 | ||
|
|
8c68c54a57 | ||
|
|
2d8754f0aa | ||
|
|
19633a05d8 | ||
|
|
051adbf167 | ||
|
|
d386307745 | ||
|
|
5c0d16c22e | ||
|
|
93424e1972 | ||
|
|
3c49a6eeae | ||
|
|
f76ead6ea5 | ||
|
|
e8a8e92f5c | ||
|
|
5b60e389ec | ||
|
|
faabedad55 | ||
|
|
d95b050e57 | ||
|
|
afe6972dfa | ||
|
|
ce3842d3ad | ||
|
|
9fbf9e940e | ||
|
|
0f2c13e7ac | ||
|
|
f42d25c46b | ||
|
|
dda603c27c | ||
|
|
ecc3581106 | ||
|
|
e56e91cc93 | ||
|
|
4b7703f4af | ||
|
|
2ec3d77600 | ||
|
|
5e1d6663a1 | ||
|
|
19801eb10f | ||
|
|
4abe4f5c16 | ||
|
|
52356d3316 | ||
|
|
6d4d3ccfd4 | ||
|
|
663bb7776b | ||
|
|
dfcb383e0f | ||
|
|
141b708392 |
No files matched your search
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",
|
||||
|
||||
@@ -1,19 +1,4 @@
|
||||
<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>
|
||||
|
||||
<%= 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'>
|
||||
@@ -23,4 +8,11 @@
|
||||
<% 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 %>"
|
||||
};
|
||||
banners.push(banner);
|
||||
</script>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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)
|
||||
|
||||
+34
-12
@@ -1,23 +1,45 @@
|
||||
var banners = [];
|
||||
var banner_index = 0;
|
||||
|
||||
$(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"));
|
||||
}
|
||||
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){
|
||||
function ajax_load_proc(wapper,url,isBanner){
|
||||
$.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>");
|
||||
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>");
|
||||
});
|
||||
}
|
||||
|
||||
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>"; }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -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)
|
||||
|
||||
+1
-1
@@ -340,7 +340,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}
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Vendored
+3
-3
@@ -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
@@ -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
|
||||
|
||||
Vendored
+1
-1
@@ -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));
|
||||
});
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Vendored
+1
-1
@@ -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
|
||||
|
||||
Vendored
+3
@@ -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
|
||||
|
||||
+27
-4
@@ -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
|
||||
|
||||
|
||||
+16
@@ -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
|
||||
Vendored
+21
-1
@@ -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,24 @@ 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 << { 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
@@ -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
|
||||
|
||||
Vendored
+37
-2
@@ -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,39 @@ 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|
|
||||
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}"}
|
||||
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, :per_page => 5)
|
||||
@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
|
||||
# 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
|
||||
@@ -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
|
||||
|
||||
|
||||
vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb
Vendored
+2
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user