Skip to content
Permalink
Browse files

Slight refactoring of checking of whether user is logged in to see if…

… they should get a lightbox. Adding the check to tag translate links.
  • Loading branch information...
Walter McGinnis
Walter McGinnis committed Jan 17, 2011
1 parent f931803 commit 60d3d9e16b381aafcc174cf28db2c1a1d376d66d
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/kete_translatable_content/extensions/helpers/application_helper.rb
@@ -1,4 +1,6 @@
ApplicationHelper.module_eval do
# lighboxes only used when user is logged in
alias lightbox? logged_in?

def tags_for(item)
html_string = String.new
@@ -7,7 +9,7 @@ def tags_for(item)

html_string = "<p>#{t('application_helper.tags_for.tags')} "
item_tags = item.tags
logger.debug("what are item_tags: " + item_tags.inspect)

item_tags.each_with_index do |tag,index|
html_string += link_to_tagged(tag, item.class.name)

@@ -16,7 +18,7 @@ def tags_for(item)
unless tag.locale == I18n.locale
html_string += '<sup class="badge">' +
translate_link(tag,
:lightbox => true,
:lightbox => lightbox?,
:action => 'new') +
'</sup>'
end
@@ -60,12 +62,10 @@ def combined_tranlation_links
html += '</li>'
end

lightbox = logged_in? ? true : false

if current_translatable_record.original_locale != I18n.locale &&
!available_locales.include?(I18n.locale.to_s)
html += '<li id="translate">' + translate_link(current_translatable_record,
:lightbox => lightbox,
:lightbox => lightbox?,
:action => 'new',
:params => {:version => version}) + '</li>'
elsif current_translatable_record.original_locale == I18n.locale && available_locales.size == 1

0 comments on commit 60d3d9e

Please sign in to comment.
You can’t perform that action at this time.