demo website widget

This commit is contained in:
unknown 2012-06-25 15:38:32 +08:00
parent c1c9cca952
commit db571d2c65
6 changed files with 20 additions and 25 deletions

View File

@ -28,10 +28,10 @@
</ul>
</li>
<li class="search clear" title="<%= t :search_nccu %>">
<li class="search clear" title="<%= t :search_google %>">
<a class="orbit-bar-search" href="#">search</a>
<form class="navbar-search" action="">
<input class="search-query span3" type="text" placeholder="<%= t(:search_nccu) %>">
<input class="search-query span3" type="text" placeholder="<%= t(:search_google) %>">
</form>
</li>
<% if user_signed_in? %>

View File

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

View File

@ -31,7 +31,7 @@ zh_tw:
password: 密碼
register: 註冊
remember_me: 記住我
search_nccu: 搜尋政大
search_google: 搜尋Google
show: 顯示
submit: 送出
sure?: 您肯定嗎?

View File

@ -8,7 +8,8 @@ defaults: &defaults
development:
<<: *defaults
database: prototype_r4_development
# database: prototype_r4_development
database: demo_site_development
test:
<<: *defaults

View File

@ -12,14 +12,14 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@title = params[:part_title]
date_now = Time.now
if !params[:category_id].blank?
@bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).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.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(4)
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
elsif !params[:tag_id].blank?
@tag = AnnouncementTag.find(params[:tag_id]) rescue nil
@tag = AnnouncementTag.where(key: params[:tag_id])[0] unless @tag
@bulletins = @tag.bulletins.can_display.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 = @tag.bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(4)
else
@bulletins = Bulletin.can_display.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.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(4)
end
get_categorys

View File

@ -2,24 +2,18 @@
<h1 class="h1"><%= @title %></h1>
<% end %>
<h2>News</h2>
<table class="table table-bordered">
<tr>
<th><%= t('announcement.bulletin.category') %></th>
<th><%= t('announcement.bulletin.title') %></th>
<th><%= t('announcement.bulletin.postdate') %></th>
</tr>
<ul>
<% @bulletins.each do |post| %>
<tr>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
</td>
<td><%= display_date_time(post.postdate) %></td>
</tr>
<% @bulletins.each do |post| %>
<% end %>
<li>
<div class="pic"><%= image_tag(post.image.url, :size => "120x90") if post.image.file %></div>
<%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<span class="date"><%= display_date(post.postdate) %></span>
</li>
</table>
<% end %>
<%= paginate @bulletins, :params => {:inner => 'true'}, :remote => true %>
</ul>