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
def edit
@bulletin = Bulletin.find(params[:id])
if @bulletin.is_rejected?
if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?)
redirect_to :action => :index
else
# @summary_variable = @bulletin.summary_variable

View File

@ -14,7 +14,7 @@
<span class="label"><%= t(:pending) %></span>
<% end %>
<% if bulletin.is_checked? %>
<span class="label"><%= t(:checked) %></span>
<span class="label"><%= t(:passed) %></span>
<% end %>
<% if bulletin.is_rejected? %>
<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 ''%>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<% unless bulletin.is_rejected?%>
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
<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(: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(: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>
</ul>
</li>
<%#= debugger %>
<%#= a=1 %>
<% 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 %>
<% end %>
<% 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 class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
<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(: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(: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>
</ul>
</li>
<%#= debugger %>
<%#= a=1 %>
<% 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 %>
<% 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>
</ul>

View File

@ -98,7 +98,7 @@
<% end %>
<% end %>
</div>
</div>
</div>
<% if params[:action] != 'new' %>
<div id="widget-audit" class="widget-box">
<div class="widget-action clear">
@ -208,7 +208,7 @@
<td style="text-align:center" colspan="4">
<div id='add_bulletin_link' class="info_input bulletin_links_block">
<%= 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>
</td>
</tr>
@ -253,7 +253,7 @@
<td style="text-align:center" colspan="4">
<div id='add_bulletin_file' class="info_input bulletin_files_block">
<%= 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>
</td>
</tr>

View File

@ -4,6 +4,7 @@
<div class="control-group">
<div class="controls">
<%= 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>
</td>

View File

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

View File

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