Fix link for ad_banner

Add missing helper for web_link_category
Show design's js in front-end
This commit is contained in:
chris 2013-01-07 00:36:48 +08:00
parent 736bda0679
commit be00cec4d7
4 changed files with 16 additions and 3 deletions

View File

@ -209,7 +209,7 @@ module ApplicationHelper
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/event.js'></script>\n"
page.design.javascripts.each do |js|
# javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>"
javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>"
end
javascripts
end

View File

@ -19,7 +19,7 @@
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %>
<% if ad_image.display? %>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.direct_to_after_click? ? ad_image.out_link : ad_image.context) || ' ' %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<% end %>
<% end %>
</div>

View File

@ -27,7 +27,7 @@ function getTimeout() {
}
$(document).ready(function() {
$('.slideshow').children('img').click(function()
$(document).on('click', '.slideshow img', function()
{
if($(this).attr('link_url')!='')
{

View File

@ -0,0 +1,13 @@
module Panel::WebResource::BackEnd::WebLinkCategorysHelper
include ActionView::Helpers::UrlHelper
def show_web_link_permission_link(web_link)
type = 'edit'
oa = web_link.get_object_auth_by_title(type)
if oa.nil?
web_link.object_auths.new(title: type ).save
oa = web_link.get_object_auth_by_title(type)
end
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa)
end
end