This commit is contained in:
Manson Wang 2014-02-11 14:18:10 +08:00
parent 112958ac18
commit bf815b168a
4 changed files with 30 additions and 0 deletions

View File

@ -65,6 +65,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# GET /bulletins/1/edit # GET /bulletins/1/edit
def edit def edit
@bulletin = Bulletin.find(params[:id]) @bulletin = Bulletin.find(params[:id])
@users = @bulletin.get_users
@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

View File

@ -24,10 +24,13 @@ class Bulletin
field :create_user_id field :create_user_id
field :update_user_id, :class_name => "User" field :update_user_id, :class_name => "User"
field :user_ids
field :view_count, :type => Integer, :default => 0 field :view_count, :type => Integer, :default => 0
field :public, :type => Boolean, :default => true field :public, :type => Boolean, :default => true
field :rss_link
mount_uploader :image, ImageUploader mount_uploader :image, ImageUploader
@ -149,6 +152,9 @@ class Bulletin
preview_object preview_object
end end
def get_users
User.find(self.user_ids) rescue []
end
protected protected

View File

@ -65,6 +65,14 @@
</div> </div>
</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> </div>
<!-- Status Module --> <!-- Status Module -->

View File

@ -36,6 +36,21 @@
</div> </div>
</div> </div>
<% end %> <% end %>
<% unless @bulletin.rss_link.blank? %>
<div>
<%= link_to t('ntu.rss_origin'), @bulletin.rss_link %>
</div>
<% end %>
</div> </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') %> <%= share_links(@bulletin, 'announcement') %>