Changes for nccu

This commit is contained in:
Christophe Vilayphiou 2012-02-29 16:01:50 +08:00
parent 5223a7a3e9
commit 6b2aeadde6
18 changed files with 999 additions and 956 deletions

View File

@ -20,7 +20,7 @@ gem 'rubyzip'
gem 'sinatra' gem 'sinatra'
gem 'sprockets' gem 'sprockets'
gem 'tinymce-rails' gem 'tinymce-rails'
# gem 'therubyracer' gem 'therubyracer'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.

View File

@ -84,6 +84,7 @@ GEM
railties (~> 3.0) railties (~> 3.0)
thor (~> 0.14) thor (~> 0.14)
json (1.6.5) json (1.6.5)
libv8 (3.3.10.4)
linecache19 (0.5.12) linecache19 (0.5.12)
ruby_core_source (>= 0.1.4) ruby_core_source (>= 0.1.4)
mail (2.3.0) mail (2.3.0)
@ -179,6 +180,8 @@ GEM
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
subexec (0.2.1) subexec (0.2.1)
therubyracer (0.9.9)
libv8 (~> 3.3.10)
thor (0.14.6) thor (0.14.6)
tilt (1.3.3) tilt (1.3.3)
tinymce-rails (3.4.8) tinymce-rails (3.4.8)
@ -234,6 +237,7 @@ DEPENDENCIES
sinatra sinatra
spork spork
sprockets sprockets
therubyracer
tinymce-rails tinymce-rails
uglifier uglifier
watchr watchr

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,104 +1,97 @@
var viewportwidth, var viewportwidth,
viewportheight; viewportheight;
function resize() { function resize() {
viewportheight=$(window).height(); viewportheight=$(window).height();
viewportwidth=$(window).width(); viewportwidth=$(window).width();
if(window.navigator.userAgent.indexOf("MSIE")>0){ if(window.navigator.userAgent.indexOf("MSIE")>0){
windH=document.clientHeight; windH=document.clientHeight;
windW=document.clientWidht; windW=document.clientWidht;
} }
} }
$(document).ready(function(){ $(document).ready(function(){
$(document).on('click', '.language-menu li', function(){ $(document).on('click', '.orbit-bar-member', function(){
$(this).each(function(i){ $(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
$(this).siblings().removeClass('active') $('.bar-login .dropdown-menu').toggle();
$(this).addClass('active') return false;
}) });
return false;
}); $(document).click(function() {
$(document).on('click', '.orbit-bar-member', function(){ $('.orbit-bar-member').removeClass("open");
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open'); $('.bar-login .dropdown-menu').hide();
$('.bar-login .dropdown-menu').toggle(); });
return false;
}); $(document).on('click', '.bar-login .dropdown-menu', function(e) {
e.stopPropagation();
$(document).click(function() { $('.bar-login .dropdown-menu').show();
$('.orbit-bar-member').removeClass("open"); });
$('.bar-login .dropdown-menu').hide();
}); $('.tip').tooltip({
placement: "left"
$(document).on('click', '.bar-login .dropdown-menu', function(e) { });
e.stopPropagation();
$('.bar-login .dropdown-menu').show(); $(document).on('click', '.privacy', function() {
}); switch ($(this).val()) {
case 'true':
$('.tip').tooltip({ $(this).parents('.controls').children('.select-role').slideUp(300);
placement: "left" break;
}); case 'false':
$(this).parents('.controls').children('.select-role').slideDown(300);
$(document).on('click', '.privacy', function() { break;
switch ($(this).val()) { }
case 'true': });
$(this).parents('.controls').children('.select-role').slideUp(300);
break; $(document).on('click', '.toggle-tr-edit', function() {
case 'false': $(this).parents('tr').next('.qe-block').removeClass('hide');
$(this).parents('.controls').children('.select-role').slideDown(300); $(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
break; $(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
} });
});
$(document).on('click', '.sort-header > .sort', function() {
$(document).on('click', '.toggle-tr-edit', function() { $.getScript($(this).attr('rel'));
$(this).parents('tr').next('.qe-block').removeClass('hide'); });
$(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide'); /*tinyscrollbar&windows-Size*/
}); resize();
$('#main-sidebar').css("height", viewportheight-40);
$(document).on('click', '.sort-header > .sort', function() { $('#main-sidebar .viewport').css("height", viewportheight-40);
$.getScript($(this).attr('rel')); $('.post-title').css("width", viewportwidth-495);
}); $('#main-sidebar').tinyscrollbar();
$('.detal-list').tinyscrollbar();
/*tinyscrollbar&windows-Size*/ $('#main-sidebar').tinyscrollbar({size:(viewportheight-44)});
resize();
$('#main-sidebar').css("height", viewportheight-40); /*isotope*/
$('#main-sidebar .viewport').css("height", viewportheight-40); var $container = $('#isotope');
$('.post-title').css("width", viewportwidth-495); $container.isotope({
$('#main-sidebar').tinyscrollbar(); itemSelector : '.item',
$('.detal-list').tinyscrollbar(); layoutMode : 'masonry',
$('#main-sidebar').tinyscrollbar({size:(viewportheight-44)}); });
/*isotope*/
var $container = $('#isotope'); });
$container.isotope({ $(window).resize(function(){
itemSelector : '.item', resize();
layoutMode : 'masonry', var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2;
}); $('#main-sidebar').css("height", viewportheight-30);
$('#main-sidebar .viewport').css("height", viewportheight-30);
$('.post-title').css("width", viewportwidth-495);
}); $('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft)
$(window).resize(function(){ $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
resize(); mainTablePosition()
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2; });
$('#main-sidebar').css("height", viewportheight-30); /*main-table position*/
$('#main-sidebar .viewport').css("height", viewportheight-30); function mainTablePosition() {
$('.post-title').css("width", viewportwidth-495); var $height = $('#main-wrap > .subnav').height()
$('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft) var $table = $('#main-wrap > .table')
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); //alert ($table.height())
mainTablePosition() $table.stop().animate({marginTop:$height},500)
}); //$table.css({marginTop : $height})
/*main-table position*/ }
function mainTablePosition() { $(window).scroll(function () {
var $height = $('#main-wrap > .subnav').height() //var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1;
var $table = $('#main-wrap > .table') //var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));
//alert ($table.height()) var $winLeft = $(window).scrollLeft()
$table.stop().animate({marginTop:$height},500) $(".table-label").css({left:$winLeft*-1} );
//$table.css({marginTop : $height}) //$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
} //$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
$(window).scroll(function () { //console.log($mainWrapMarginLeft+($winLeft*-1)+5);
//var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1; });
//var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));
var $winLeft = $(window).scrollLeft()
$(".table-label").css({left:$winLeft*-1} );
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
//console.log($mainWrapMarginLeft+($winLeft*-1)+5);
});

View File

@ -2642,8 +2642,8 @@ button.btn.small, input[type="submit"].btn.small {
color: #333333; color: #333333;
} }
.pagination { .pagination {
height: 36px; height: 36px;
margin: 18px 0; margin: 18px 0;
} }
.pagination ul { .pagination ul {
display: inline-block; display: inline-block;
@ -2663,7 +2663,8 @@ button.btn.small, input[type="submit"].btn.small {
.pagination li { .pagination li {
display: inline; display: inline;
} }
.pagination a {
.pagination .page{
float: left; float: left;
padding: 0 14px; padding: 0 14px;
line-height: 34px; line-height: 34px;
@ -2671,6 +2672,28 @@ button.btn.small, input[type="submit"].btn.small {
border: 1px solid #ddd; border: 1px solid #ddd;
border-left-width: 0; border-left-width: 0;
} }
.pagination a {
float: left;
}
.pagination .next{
float: left;
padding: 0 14px;
line-height: 34px;
text-decoration: none;
border: 1px solid #ddd;
border-left-width: 0;
}
.pagination .last{
float: left;
padding: 0 14px;
line-height: 34px;
text-decoration: none;
border: 1px solid #ddd;
border-left-width: 0;
}
.pagination .current{
border-left-width: 1px;
}
.pagination a:hover, .pagination .active a { .pagination a:hover, .pagination .active a {
background-color: #f5f5f5; background-color: #f5f5f5;
} }

File diff suppressed because it is too large Load Diff

View File

@ -26,10 +26,10 @@
</ul> </ul>
</li> </li>
<% if user_signed_in? %> <% if user_signed_in? %>
<li class="dropdown active clear"> <li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown"> <a class="orbit-bar-account" href="#" data-toggle="dropdown">
<!-- <img src="images/menber-pic.png" /> --> <img class="member-img" src="/assets/menber-pic.png" />
<%= image_tag current_user.avatar.thumb.url, :class => 'member-img' %> <%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span> <span class="member-name"><%= current_user.name %></span>
</a> </a>
<ul class="dropdown-menu account-menu"> <ul class="dropdown-menu account-menu">
@ -45,7 +45,7 @@
<%= t(:desktop) %> <%= t(:desktop) %>
</a> </a>
</li> </li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-out') + t(:logout), destroy_user_session_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-out') + ' ' + t(:logout), destroy_user_session_path %></li>
<li class="divider"></li> <li class="divider"></li>
<li> <li>
@ -95,7 +95,7 @@
<% end %> <% end %>
</ul> </ul>
<form class="navbar-search span6" action=""> <form class="navbar-search span6" action="">
<input class="search-query span4" type="text" placeholder="Search NCCU"> <input class="search-query span4" type="text" placeholder="<%= t(:search_nccu) %>">
</form> </form>
</div> </div>
</div> </div>

View File

@ -13,7 +13,7 @@
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers('users') do -%> <%= content_tag :li, :class => active_for_controllers('users') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), panel_web_resource_back_end_web_links_path %> <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%> <%= content_tag :li, :class => active_for_controllers(nil) do -%>
@ -25,7 +25,7 @@
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%> <%= content_tag :li, :class => active_for_controllers(nil) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), nil %> <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%> <%= content_tag :li, :class => active_for_controllers(nil) do -%>

View File

@ -47,7 +47,7 @@ module PrototypeR4
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de # config.i18n.default_locale = :de
config.i18n.default_locale = :en config.i18n.default_locale = :zh_tw
# JavaScript files you want as :defaults (application.js is always included). # JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails) # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

View File

@ -24,21 +24,21 @@ PrototypeR4::Application.configure do
config.action_dispatch.best_standards_support = :builtin config.action_dispatch.best_standards_support = :builtin
config.middleware.use ExceptionNotifier, # config.middleware.use ExceptionNotifier,
:email_prefix => "[R4_error]", # :email_prefix => "[R4_error]",
:sender_address => %{"notifier" <redmine@rulingcom.com>}, # :sender_address => %{"notifier" <redmine@rulingcom.com>},
:exception_recipients => %w{chris@rulingcom.com} # :exception_recipients => %w{chris@rulingcom.com}
config.action_mailer.delivery_method = :smtp # config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { # config.action_mailer.smtp_settings = {
:tls => true, # :tls => true,
:enable_starttls_auto => true, # :enable_starttls_auto => true,
:address => "smtp.gmail.com", # :address => "smtp.gmail.com",
:port => '587', # :port => '587',
:domain => "smtp.gmail.com", # :domain => "smtp.gmail.com",
:authentication => "plain", # :authentication => "plain",
:user_name => "redmine@rulingcom.com", # :user_name => "redmine@rulingcom.com",
:password => "rulingredmine" } # :password => "rulingredmine" }
end end

View File

@ -32,6 +32,7 @@ en:
password: Password password: Password
register: Register register: Register
remember_me: Remember me remember_me: Remember me
search_nccu: Search NCCU
show: Show show: Show
submit: Submit submit: Submit
sure?: Are you sure? sure?: Are you sure?

View File

@ -17,7 +17,7 @@ zh_tw:
edit: 編輯 edit: 編輯
email: 電子郵件 email: 電子郵件
enable: 啟用 enable: 啟用
forget_password: 忘記密碼? forgot_password: 忘記密碼?
help: 協助 help: 協助
hide: 隱藏 hide: 隱藏
homepage: 首頁 homepage: 首頁
@ -25,10 +25,11 @@ zh_tw:
logout: 登出 logout: 登出
no_: "No" no_: "No"
nothing: nothing:
or_lower: or_lower:
password: 密碼 password: 密碼
register: 註冊 register: 註冊
remember_me: 記住我 remember_me: 記住我
search_nccu: 搜尋政大
show: 顯示 show: 顯示
submit: 送出 submit: 送出
sure?: 您肯定嗎? sure?: 您肯定嗎?

View File

@ -81,7 +81,7 @@ module ParserFrontEnd
res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>" res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>"
res << "<script type='text/javascript' src='/assets/event.js'></script>" res << "<script type='text/javascript' src='/assets/event.js'></script>"
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
res << "<script type='text/javascript' src='#{js.file.url}'></script>" # res << "<script type='text/javascript' src='#{js.file.url}'></script>"
end end
res res
end end

View File

@ -17,7 +17,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) @bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
end end
get_categorys get_categorys
@current_category = BulletinCategory.from_id(params[:bulletin_category_id]) rescue nil
end end
def show def show

View File

@ -14,4 +14,8 @@ class BulletinCategory
has_many :bulletins has_many :bulletins
def self.from_id(id)
BulletinCategory.find(id) rescue nil
end
end end

View File

@ -2,7 +2,11 @@
<%= flash_messages %> <%= flash_messages %>
<h1 class="h1"><%= t('announcement.list_announcement') %></h1> <% if @current_category %>
<h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] + t('announcement.bulletin.list_lower') %></h1>
<% else %>
<h1 class="h1"><%= t('announcement.list_announcement') %></h1>
<% end %>
<table class="table table-bordered"> <table class="table table-bordered">

View File

@ -11,7 +11,7 @@
<li> <li>
<div class="news_img"><%= image_tag(post.image.url, :size => "290x130") if post.image.file %></div> <div class="news_img"><%= image_tag(post.image.url, :size => "290x130") if post.image.file %></div>
<h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %></h3> <h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %></h3>
<p class="news_wrap"><%= post.subtitle[I18n.locale] %></p> <p class="news_wrap"><%= post.subtitle[I18n.locale].html_safe %></p>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@ -14,7 +14,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
# @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first # @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first
@web_links = WebLink.widget_datas.page(params[:page]).per(9) @web_links = WebLink.widget_datas.page(params[:page]).per(5)
# get_categorys # get_categorys
@ -24,7 +24,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
end end
def reload_web_links def reload_web_links
@web_links = WebLink.widget_datas.page(params[:page]).per(9) @web_links = WebLink.widget_datas.page(params[:page]).per(5)
end end