small fix for preview
This commit is contained in:
parent
17a0e4b4ce
commit
8cfc89abcc
|
@ -205,7 +205,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
||||||
|
|
||||||
bulletin.is_preview = true
|
bulletin.is_preview = true
|
||||||
bulletin.save
|
bulletin.save
|
||||||
render :text=>page_for_bulletin(bulletin)
|
render :text=>page_for_bulletin(bulletin) + "?preview=true"
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_preview
|
def destroy_preview
|
||||||
|
|
|
@ -146,8 +146,12 @@ class AnnouncementsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_local_announcement(uid)
|
def show_local_announcement(uid, is_preview)
|
||||||
announcement = Bulletin.can_display.find_by(:uid => uid)
|
if is_preview
|
||||||
|
announcement = Bulletin.find_by(:uid => uid)
|
||||||
|
else
|
||||||
|
announcement = Bulletin.can_display.find_by(:uid => uid)
|
||||||
|
end
|
||||||
url_to_edit = OrbitHelper.user_can_edit?(announcement) ? "/admin/announcements/#{announcement.id.to_s}/edit" : ""
|
url_to_edit = OrbitHelper.user_can_edit?(announcement) ? "/admin/announcements/#{announcement.id.to_s}/edit" : ""
|
||||||
|
|
||||||
access_level = OrbitHelper.user_access_level?
|
access_level = OrbitHelper.user_access_level?
|
||||||
|
@ -247,7 +251,7 @@ class AnnouncementsController < ApplicationController
|
||||||
if OrbitHelper.is_object_from_feed?(uid)
|
if OrbitHelper.is_object_from_feed?(uid)
|
||||||
show_feed_announcement(uid)
|
show_feed_announcement(uid)
|
||||||
else
|
else
|
||||||
show_local_announcement(uid)
|
show_local_announcement(uid, (params["preview"] == "true" ? true : false))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue