Compare commits

...

2 Commits

Author SHA1 Message Date
spen 39990efd15 update default_widget field i18n 2014-05-12 11:19:37 +08:00
Manson Wang bf815b168a ntu_ga 2014-02-11 14:18:10 +08:00
6 changed files with 33 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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') %>

View File

@ -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

View File

@ -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: 更多+