Add missing translations in announcement and change announcement behavior for passed and rejected

This commit is contained in:
Christophe Vilayphiou 2012-04-24 15:27:46 +08:00
parent c0abaa643c
commit d247f05d2e
6 changed files with 43 additions and 28 deletions

View File

@ -89,7 +89,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# GET /bulletins/1/edit # GET /bulletins/1/edit
def edit def edit
@bulletin = Bulletin.find(params[:id]) @bulletin = Bulletin.find(params[:id])
if @bulletin.is_rejected? if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?)
redirect_to :action => :index redirect_to :action => :index
else else
# @summary_variable = @bulletin.summary_variable # @summary_variable = @bulletin.summary_variable

View File

@ -14,7 +14,7 @@
<span class="label"><%= t(:pending) %></span> <span class="label"><%= t(:pending) %></span>
<% end %> <% end %>
<% if bulletin.is_checked? %> <% if bulletin.is_checked? %>
<span class="label"><%= t(:checked) %></span> <span class="label"><%= t(:passed) %></span>
<% end %> <% end %>
<% if bulletin.is_rejected? %> <% if bulletin.is_rejected? %>
<span class="label"><%= t(:rejected) %></span> <span class="label"><%= t(:rejected) %></span>
@ -25,23 +25,23 @@
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%> <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
<% unless bulletin.is_rejected?%> <% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li> <li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
<li class="dropdown"> <li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a> <a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
<ul class="dropdown-menu" id="menu1"> <ul class="dropdown-menu" id="menu1">
<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li> <li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li>
<li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li> <li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li>
<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li> <li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li>
<li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li> <li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li>
<li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li> <li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
</ul> </ul>
</li> </li>
<%#= debugger %> <%#= debugger %>
<%#= a=1 %> <%#= a=1 %>
<% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %> <% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %>
<li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %> <li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
<% end %> <% end %>
<% end %> <% end %>
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li> <li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
</ul> </ul>

View File

@ -98,7 +98,7 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
</div> </div>
<% if params[:action] != 'new' %> <% if params[:action] != 'new' %>
<div id="widget-audit" class="widget-box"> <div id="widget-audit" class="widget-box">
<div class="widget-action clear"> <div class="widget-action clear">
@ -208,7 +208,7 @@
<td style="text-align:center" colspan="4"> <td style="text-align:center" colspan="4">
<div id='add_bulletin_link' class="info_input bulletin_links_block"> <div id='add_bulletin_link' class="info_input bulletin_links_block">
<%= hidden_field_tag 'bulletin_link_field_count', @bulletin.bulletin_links.count %> <%= hidden_field_tag 'bulletin_link_field_count', @bulletin.bulletin_links.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a> <a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a>
</div> </div>
</td> </td>
</tr> </tr>
@ -253,7 +253,7 @@
<td style="text-align:center" colspan="4"> <td style="text-align:center" colspan="4">
<div id='add_bulletin_file' class="info_input bulletin_files_block"> <div id='add_bulletin_file' class="info_input bulletin_files_block">
<%= hidden_field_tag 'bulletin_file_field_count', @bulletin.bulletin_files.count %> <%= hidden_field_tag 'bulletin_file_field_count', @bulletin.bulletin_files.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a> <a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -4,6 +4,7 @@
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<%= f.file_field :file %> <%= f.file_field :file %>
<%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:target => '_blank', :title => t(:view)} ) : '' %>
</div> </div>
</div> </div>
</td> </td>

View File

@ -5,6 +5,12 @@ en:
_locale: English _locale: English
basic: Basic
picture: Piture
tags: Tag
link: Link
file: File
add: Add add: Add
back: Back back: Back
create: Create create: Create
@ -22,6 +28,14 @@ en:
sure?: Are you sure? sure?: Are you sure?
update: Update update: Update
yes_: "Yes" yes_: "Yes"
hot: Hot
top: Top
hidden: Hidden
passed: Passed
pending: Pending
rejected: Rejected
clear: Clear
announcement: announcement:
sure?: Sure? sure?: Sure?

View File

@ -24,12 +24,12 @@ zh_tw:
update: 更新 update: 更新
yes_: "Yes" yes_: "Yes"
is_hot: 熱門 hot: 熱門
is_top: 置頂 top: 置頂
is_hidden: 隱藏 hidden: 隱藏
is_checked: 通過 passed: 通過
is_pending: 待審核 pending: 待審核
is_rejected: 不通過 rejected: 不通過
clear: 清除 clear: 清除
quick_edit: 快速編輯 quick_edit: 快速編輯