Merge branch 'master' into moderation

This commit is contained in:
Andy Allan 2018-02-28 15:46:25 +08:00
commit 424b6ef1cf
273 changed files with 45853 additions and 25111 deletions

View file

@ -40,9 +40,7 @@ module ApplicationHelper
end
def if_user(user, tag = :div, &block)
if user
content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}")
end
content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}") if user
end
def unless_user(user, tag = :div, &block)
@ -110,9 +108,7 @@ module ApplicationHelper
if current_user
data[:user] = current_user.id.to_json
unless current_user.home_lon.nil? || current_user.home_lat.nil?
data[:user_home] = { :lat => current_user.home_lat, :lon => current_user.home_lon }
end
data[:user_home] = { :lat => current_user.home_lat, :lon => current_user.home_lon } unless current_user.home_lon.nil? || current_user.home_lat.nil?
end
data[:location] = session[:location] if session[:location]

View file

@ -8,18 +8,14 @@ module BrowseHelper
object.id
end
name = t "printable_name.with_id", :id => id.to_s
if version
name = t "printable_name.with_version", :id => name, :version => object.version.to_s
end
name = t "printable_name.with_version", :id => name, :version => object.version.to_s if version
# don't look at object tags if redacted, so as to avoid giving
# away redacted version tag information.
unless object.redacted?
locale = I18n.locale.to_s
while locale =~ /-[^-]+/ && !object.tags.include?("name:#{I18n.locale}")
locale = locale.sub(/-[^-]+/, "")
end
locale = locale.sub(/-[^-]+/, "") while locale =~ /-[^-]+/ && !object.tags.include?("name:#{I18n.locale}")
if object.tags.include? "name:#{locale}"
name = t "printable_name.with_name_html", :name => content_tag(:bdi, object.tags["name:#{locale}"].to_s), :id => content_tag(:bdi, name)