Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
spen | 39990efd15 | |
Manson Wang | bf815b168a |
|
@ -65,6 +65,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
# GET /bulletins/1/edit
|
||||
def edit
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
@users = @bulletin.get_users
|
||||
@tags = get_tags
|
||||
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
|
||||
|
||||
|
|
|
@ -24,10 +24,13 @@ class Bulletin
|
|||
|
||||
field :create_user_id
|
||||
field :update_user_id, :class_name => "User"
|
||||
field :user_ids
|
||||
|
||||
field :view_count, :type => Integer, :default => 0
|
||||
|
||||
field :public, :type => Boolean, :default => true
|
||||
field :rss_link
|
||||
|
||||
|
||||
mount_uploader :image, ImageUploader
|
||||
|
||||
|
@ -149,6 +152,9 @@ class Bulletin
|
|||
preview_object
|
||||
end
|
||||
|
||||
def get_users
|
||||
User.find(self.user_ids) rescue []
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
|
|
@ -64,6 +64,14 @@
|
|||
<%= f.datetime_picker :deadline, :no_label => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Promoter -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:promoter) %></label>
|
||||
<div class="controls">
|
||||
<%= render partial: 'admin/member_selects/selection_box', locals: {field: 'bulletin[user_ids][]', users: @users} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -36,6 +36,21 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% unless @bulletin.rss_link.blank? %>
|
||||
<div>
|
||||
<%= link_to t('ntu.rss_origin'), @bulletin.rss_link %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @bulletin.user_ids.blank? %>
|
||||
<div class="promoter">
|
||||
<div>
|
||||
<%= render partial: 'admin/member_selects/promoter_front', locals: {users: @bulletin.get_users} %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= share_links(@bulletin, 'announcement') %>
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ en:
|
|||
create_bulletin_category_success: Create Category Successfully
|
||||
date: Announcement Date
|
||||
default_widget:
|
||||
bulletin_category_with_title: Bulletin Category with Title
|
||||
bulletin_category_with_title: Category
|
||||
postdate: Post Date
|
||||
subtitle: Subtitle
|
||||
title: Title
|
||||
|
|
|
@ -13,7 +13,7 @@ zh_tw:
|
|||
create_bulletin_category_success: 建立類別成功
|
||||
date: 起迄日期
|
||||
default_widget:
|
||||
bulletin_category_with_title: 公告類別及標題
|
||||
bulletin_category_with_title: 類別
|
||||
postdate: 張貼日期
|
||||
subtitle: 副標題
|
||||
title: 標題
|
||||
|
@ -38,4 +38,4 @@ zh_tw:
|
|||
bulletins_and_web_links: 分眾頁籤
|
||||
index: 索引
|
||||
search: 搜尋
|
||||
more: 更多+
|
||||
more: 更多+
|
||||
|
|
Loading…
Reference in New Issue