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

@ -9,13 +9,6 @@ function resize() {
} }
} }
$(document).ready(function(){ $(document).ready(function(){
$(document).on('click', '.language-menu li', function(){
$(this).each(function(i){
$(this).siblings().removeClass('active')
$(this).addClass('active')
})
return false;
});
$(document).on('click', '.orbit-bar-member', function(){ $(document).on('click', '.orbit-bar-member', function(){
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open'); $(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
$('.bar-login .dropdown-menu').toggle(); $('.bar-login .dropdown-menu').toggle();

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;
} }

View File

@ -30,6 +30,15 @@
-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;
-moz-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; -moz-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;
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; 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: -moz-linear-gradient(top, #5282A6, #133757);
background-image: -ms-linear-gradient(top, #5282A6, #133757);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5282A6), to(#133757));
background-image: -webkit-linear-gradient(top, #5282A6, #133757);
background-image: -o-linear-gradient(top, #5282A6, #133757);
background-image: linear-gradient(top, #5282A6, #133757);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5282A6', endColorstr='#133757', GradientType=0);
/*
background-image: -moz-linear-gradient(top, #545b60, #191a1c); background-image: -moz-linear-gradient(top, #545b60, #191a1c);
background-image: -ms-linear-gradient(top, #545b60, #191a1c); background-image: -ms-linear-gradient(top, #545b60, #191a1c);
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));
@ -37,6 +46,7 @@
background-image: -o-linear-gradient(top, #545b60, #191a1c); background-image: -o-linear-gradient(top, #545b60, #191a1c);
background-image: linear-gradient(top, #545b60, #191a1c); background-image: linear-gradient(top, #545b60, #191a1c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545b60', endColorstr='#191a1c', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545b60', endColorstr='#191a1c', GradientType=0);
*/
} }
#orbit-bar .navbar-search { #orbit-bar .navbar-search {
float: none; float: none;
@ -65,7 +75,8 @@
width:100%; width:100%;
} }
#orbit-bar .orbit-logo .brand { #orbit-bar .orbit-logo .brand {
background: url(<%= asset_path 'orbit-bar.png' %>) no-repeat -162px -5px; /* background: url(<%= asset_path 'orbit-bar.png' %>) no-repeat -162px -5px; */
background: url(<%= asset_path 'nccu_logo.png' %>) no-repeat 6px 0px;
text-indent:-9999px; text-indent:-9999px;
padding: 5px 20px 4px; padding: 5px 20px 4px;
} }

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