Display tags,update_user,time in the frontend
This commit is contained in:
parent
327c300941
commit
678327686f
|
@ -36,14 +36,18 @@ class AnnouncementsController < ApplicationController
|
|||
params = OrbitHelper.params
|
||||
announcement = Bulletin.can_display.find_by(:uid=>params[:uid])
|
||||
|
||||
tags = announcement.tags.map{|tag| { "tag" => tag.name } }
|
||||
files = announcement.bulletin_files.map{|file| { "file_url" => file.file.url, "file_title" => file.title } }
|
||||
links = announcement.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => link.title } }
|
||||
|
||||
{
|
||||
"tags" => tags,
|
||||
"bulletin_files" => files,
|
||||
"bulletin_links" => links,
|
||||
"data" => {
|
||||
"title" => announcement.title,
|
||||
"update_user" => announcement.update_user.member_profile.name,
|
||||
"updated_at" => announcement.updated_at.strftime('%Y-%m-%d %H:%M'),
|
||||
"body" =>announcement.text,
|
||||
"image" => announcement.image.url
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ module Announcement
|
|||
context_link 'announcement.all_articles',
|
||||
:link_path=>"admin_announcements_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{:bulletins=>:index},
|
||||
:active_for_action=>{'admin/announcement'=>'index'},
|
||||
:available_for => [:all]
|
||||
context_link 'announcement.add_new',
|
||||
:link_path=>"new_admin_announcement_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{:bulletins=>:new},
|
||||
:active_for_action=>{'admin/announcement'=>'new'},
|
||||
:available_for => [:sub_manager]
|
||||
# context_link 'announcement.categories',
|
||||
# :link_path=>"admin_announcement_path(get_module_app)" ,
|
||||
|
|
Loading…
Reference in New Issue