From be00cec4d71f18989e906e752bd2313f5ed8ab6f Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 7 Jan 2013 00:36:48 +0800 Subject: [PATCH] Fix link for ad_banner Add missing helper for web_link_category Show design's js in front-end --- app/helpers/application_helper.rb | 2 +- app/views/front/show_banner.html.erb | 2 +- public/static/kernel.js | 2 +- .../back_end/web_link_categorys_helper.rb | 13 +++++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 vendor/built_in_modules/web_resource/app/helpers/panel/web_resource/back_end/web_link_categorys_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index efa078ea..e20a0c29 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -209,7 +209,7 @@ module ApplicationHelper javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| - # javascripts << "" + javascripts << "" end javascripts end diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index 2d790279..921c360d 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -19,7 +19,7 @@
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %> <% if ad_image.display? %> - <%= 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? %>'/> + <%= 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 %>
diff --git a/public/static/kernel.js b/public/static/kernel.js index f8f95e61..cef6f066 100644 --- a/public/static/kernel.js +++ b/public/static/kernel.js @@ -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')!='') { diff --git a/vendor/built_in_modules/web_resource/app/helpers/panel/web_resource/back_end/web_link_categorys_helper.rb b/vendor/built_in_modules/web_resource/app/helpers/panel/web_resource/back_end/web_link_categorys_helper.rb new file mode 100644 index 00000000..78e553ce --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/helpers/panel/web_resource/back_end/web_link_categorys_helper.rb @@ -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 \ No newline at end of file