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
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
else
# @summary_variable = @bulletin.summary_variable
@ -146,6 +146,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin = Bulletin.find(params[:id])
params[:bulletin][:update_user_id] = current_user.id
delete_out_invalid_date_from_params
respond_to do |format|
if @bulletin.update_attributes(params[:bulletin])

View File

@ -32,7 +32,7 @@
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
<li>
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></a>
<a href="#imageupload" data-toggle="tab"><%= t("announcement.image") %></a>
</li>
<li>
<a href="#mail-group" data-toggle="tab"><%= t('announcement.email_reminder')%></a>
@ -116,7 +116,7 @@
<!-- Images Upload -->
<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="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @bulletin.image.file %>" data-provides="fileupload">
<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)") %>
<br />
<%= t("announcement.image_upload_size_note", :image_upload_size =>'900kb') %>
<br />
<%= t("announcement.image_note")%>
</span>
</div>
</div>
@ -245,6 +247,10 @@
<% end %>
<div class="control-group">
<div class="controls add-input"><%= t('announcement.append_note')%></div>
</div>
<!-- Link -->
<div class="control-group">
<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>
</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">
<%= @bulletin.text.html_safe rescue '' %>
</div>

View File

@ -4,6 +4,7 @@ en:
add_new: Add New
all_articles: All Articles
announcement: Announcement
append_note: Suggest to input underside Link and File's annotation to show correct info in frontend
approval_setting: Approval Setting
approve_bulletin_fail: Approval Fail
approve_bulletin_success: Approve Successfully
@ -26,6 +27,8 @@ en:
frontend:
bulletins: Announcement front-end
search_result: Search result
image: Cover image
image_note: The image will not show in content
link_name: Link Name
new_bulletin_category: New Bulletin Category
picture: Cover Picture

View File

@ -4,6 +4,7 @@ zh_tw:
add_new: 新建
all_articles: 文章列表
announcement: 公告
append_note: 以下之附加連結與檔案,為使前台顯示名稱,建議您輸入註解。
approval_setting: 審核設定
approve_bulletin_fail: 審核失敗
approve_bulletin_success: 審核成功
@ -28,6 +29,8 @@ zh_tw:
frontend:
bulletins: 公告前台
search_result: 搜尋結果頁
image: 封面圖片
image_note: 此處上傳的圖片不會在公告內文出現
link_name: 連結名稱
new_bulletin_category: 新增公告類別
picture: 刊頭圖片