preview button fixed

This commit is contained in:
nccu 2015-01-07 17:26:39 +08:00
parent 66b37d17ee
commit b854e25b30
3 changed files with 21 additions and 15 deletions

View File

@ -21,8 +21,14 @@ module Admin::AnnouncementsHelper
end
end
ann_page = pages.first if ann_page.nil?
request.protocol+(request.host_with_port+ann_page.url+'/'+bulletin.to_param).gsub('//','/') rescue "/"
if Page.where(:module=>'announcement',:url => "/announcement").count ==1
ann_page = '/announcement'
else
ann_page = pages.first.url if ann_page.nil?
end
request.protocol+(request.host_with_port+ann_page+'/'+bulletin.to_param).gsub('//','/') rescue "/"
end
def load_access_level

View File

@ -80,3 +80,14 @@
content_tag :div, paginate(@bulletins), class: "pagination pagination-centered"
end
%>
<script type="text/javascript">
$(".appoval_button").on("click",function(){
var url = $(this).data("approve-link"),
modal = $("#approvalModal");
modal.find("iframe").attr("src", url);
modal.find("#object_id").val($(this).data("id"));
modal.modal("show");
return false;
})
</script>

View File

@ -6,14 +6,3 @@
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<%= render :partial=> "approval_modal" %>
<script type="text/javascript">
$(".appoval_button").on("click",function(){
var url = $(this).data("approve-link"),
modal = $("#approvalModal");
modal.find("iframe").attr("src", url);
modal.find("#object_id").val($(this).data("id"));
modal.modal("show");
return false;
})
</script>