Make iD the default editor for all users that have not specified
a preferred editor, except fall back to P2 on IE.
+ def preferred_editor
+ editor = if params[:editor]
+ params[:editor]
+ elsif @user and @user.preferred_editor
+ @user.preferred_editor
+ else
+ DEFAULT_EDITOR
+ end
+
+ if request.env['HTTP_USER_AGENT'] =~ /MSIE/ and editor == 'id'
+ editor = 'potlatch2'
+ end
+
+ editor
+ end
+
+ helper_method :preferred_editor
+
private
# extract authorisation credentials from headers, returns user = nil if none
private
# extract authorisation credentials from headers, returns user = nil if none
- editor = params[:editor] || @user.preferred_editor || DEFAULT_EDITOR
+ editor = preferred_editor
if editor == "remote"
render :action => :index
if editor == "remote"
render :action => :index
content_tag(tag, capture(&block), :class => "hide_unless_administrator")
end
content_tag(tag, capture(&block), :class => "hide_unless_administrator")
end
- def preferred_editor
- if params[:editor]
- params[:editor]
- elsif @user and @user.preferred_editor
- @user.preferred_editor
- else
- DEFAULT_EDITOR
- end
- end
-
def scale_to_zoom(scale)
Math.log(360.0 / (scale.to_f * 512.0)) / Math.log(2.0)
end
def scale_to_zoom(scale)
Math.log(360.0 / (scale.to_f * 512.0)) / Math.log(2.0)
end
# URL of Nominatim instance to use for geocoding
nominatim_url: "http://nominatim.openstreetmap.org/"
# Default editor
# URL of Nominatim instance to use for geocoding
nominatim_url: "http://nominatim.openstreetmap.org/"
# Default editor
- default_editor: "potlatch2"
# OAuth consumer key for Potlatch 2
#potlatch2_key: ""
# OAuth consumer key for the web site
# OAuth consumer key for Potlatch 2
#potlatch2_key: ""
# OAuth consumer key for the web site