From f53d0e9c7f26838edab4f8b018edd811102bfae0 Mon Sep 17 00:00:00 2001 From: Spen Date: Fri, 7 Feb 2014 14:00:45 +0800 Subject: [PATCH] Fix orbit backend helper get_quick_link issue --- app/helpers/orbit_backend_helper.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index e5ef0c9..ba2a87e 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -321,7 +321,17 @@ module OrbitBackendHelper content_tag :li, link_to(t(quick[:translation] || :rejected_reason) + ' ' + truncate(object.not_checked_reason, :length => 10), '#', rel: "tooltip", 'data-original-title' => (wrap_string_with(object.not_checked_reason, :line_width => 24)), class: "reject_info #{quick[:class]}") end else - content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class]) + if quick[:define_link] + if quick[:condition_option] + if eval("#{quick[:condition_option]}") + content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class]) + end + else + content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class]) + end + else + content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class]) + end end end