add backend form append note and fix show image

This commit is contained in:
spen 2014-05-02 13:52:02 +08:00
parent 8f7df1cc35
commit 543ec3a420
5 changed files with 19 additions and 9 deletions

View File

@ -78,7 +78,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@tags = get_tags @tags = get_tags
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
if !(is_manager? || is_admin? || is_authorized_sub_manager.include?(current_user.id)) if !(is_manager? || is_admin? || (is_authorized_sub_manager.include?(current_user.id) and @bulletin.create_user_id == current_user.id))
redirect_to :action => :index redirect_to :action => :index
else else
# @summary_variable = @bulletin.summary_variable # @summary_variable = @bulletin.summary_variable
@ -146,6 +146,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin = Bulletin.find(params[:id]) @bulletin = Bulletin.find(params[:id])
params[:bulletin][:update_user_id] = current_user.id
delete_out_invalid_date_from_params delete_out_invalid_date_from_params
respond_to do |format| respond_to do |format|
if @bulletin.update_attributes(params[:bulletin]) if @bulletin.update_attributes(params[:bulletin])

View File

@ -32,7 +32,7 @@
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a> <a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li> </li>
<li> <li>
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></a> <a href="#imageupload" data-toggle="tab"><%= t("announcement.image") %></a>
</li> </li>
<li> <li>
<a href="#mail-group" data-toggle="tab"><%= t('announcement.email_reminder')%></a> <a href="#mail-group" data-toggle="tab"><%= t('announcement.email_reminder')%></a>
@ -116,7 +116,7 @@
<!-- Images Upload --> <!-- Images Upload -->
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t(:image) %></label> <label class="control-label muted"><%= t("announcement.image") %></label>
<div class="controls"> <div class="controls">
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @bulletin.image.file %>" data-provides="fileupload"> <div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @bulletin.image.file %>" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left"> <div class="fileupload-new thumbnail pull-left">
@ -143,6 +143,8 @@
<%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px(w) x 230px(h)") %> <%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px(w) x 230px(h)") %>
<br /> <br />
<%= t("announcement.image_upload_size_note", :image_upload_size =>'900kb') %> <%= t("announcement.image_upload_size_note", :image_upload_size =>'900kb') %>
<br />
<%= t("announcement.image_note")%>
</span> </span>
</div> </div>
</div> </div>
@ -245,6 +247,10 @@
<% end %> <% end %>
<div class="control-group">
<div class="controls add-input"><%= t('announcement.append_note')%></div>
</div>
<!-- Link --> <!-- Link -->
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t(:link) %></label> <label class="control-label muted"><%= t(:link) %></label>

View File

@ -11,10 +11,6 @@
<span><%= t('announcement.default_widget.bulletin_create_dept') + ": " + unit unless unit.blank? %></span> <span><%= t('announcement.default_widget.bulletin_create_dept') + ": " + unit unless unit.blank? %></span>
</div> </div>
</div> </div>
<div class="news_image">
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
<%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
</div>
<div class="news_paragraph"> <div class="news_paragraph">
<%= @bulletin.text.html_safe rescue '' %> <%= @bulletin.text.html_safe rescue '' %>
</div> </div>

View File

@ -4,6 +4,7 @@ en:
add_new: Add New add_new: Add New
all_articles: All Articles all_articles: All Articles
announcement: Announcement announcement: Announcement
append_note: Suggest to input underside Link and File's annotation to show correct info in frontend
approval_setting: Approval Setting approval_setting: Approval Setting
approve_bulletin_fail: Approval Fail approve_bulletin_fail: Approval Fail
approve_bulletin_success: Approve Successfully approve_bulletin_success: Approve Successfully
@ -26,6 +27,8 @@ en:
frontend: frontend:
bulletins: Announcement front-end bulletins: Announcement front-end
search_result: Search result search_result: Search result
image: Cover image
image_note: The image will not show in content
link_name: Link Name link_name: Link Name
new_bulletin_category: New Bulletin Category new_bulletin_category: New Bulletin Category
picture: Cover Picture picture: Cover Picture
@ -54,4 +57,4 @@ en:
mail_url_view: This email is the reminder of an announcement, please click the link for the details mail_url_view: This email is the reminder of an announcement, please click the link for the details
mail_source: Source mail_source: Source
mail_time: Time mail_time: Time
image_upload_size_note: The following recommendations %{image_upload_size} upload size image_upload_size_note: The following recommendations %{image_upload_size} upload size

View File

@ -4,6 +4,7 @@ zh_tw:
add_new: 新建 add_new: 新建
all_articles: 文章列表 all_articles: 文章列表
announcement: 公告 announcement: 公告
append_note: 以下之附加連結與檔案,為使前台顯示名稱,建議您輸入註解。
approval_setting: 審核設定 approval_setting: 審核設定
approve_bulletin_fail: 審核失敗 approve_bulletin_fail: 審核失敗
approve_bulletin_success: 審核成功 approve_bulletin_success: 審核成功
@ -28,6 +29,8 @@ zh_tw:
frontend: frontend:
bulletins: 公告前台 bulletins: 公告前台
search_result: 搜尋結果頁 search_result: 搜尋結果頁
image: 封面圖片
image_note: 此處上傳的圖片不會在公告內文出現
link_name: 連結名稱 link_name: 連結名稱
new_bulletin_category: 新增公告類別 new_bulletin_category: 新增公告類別
picture: 刊頭圖片 picture: 刊頭圖片
@ -57,4 +60,4 @@ zh_tw:
mail_url_view: 此封信件為公告事件提醒,請點選以下連結詳細觀看 mail_url_view: 此封信件為公告事件提醒,請點選以下連結詳細觀看
mail_source: 來源 mail_source: 來源
mail_time: 時間 mail_time: 時間
image_upload_size_note: 建議檔案小於%{image_upload_size} image_upload_size_note: 建議檔案小於%{image_upload_size}