Set the default trace visibility on the upload form
This commit is contained in:
parent
2ce394118d
commit
ba70c100f1
1 changed files with 4 additions and 1 deletions
|
@ -105,7 +105,6 @@ class TraceController < ApplicationController
|
||||||
@target_user = target_user
|
@target_user = target_user
|
||||||
@display_name = target_user.display_name if target_user
|
@display_name = target_user.display_name if target_user
|
||||||
@all_tags = tagset.values
|
@all_tags = tagset.values
|
||||||
@trace = Trace.new(:visibility => default_visibility) if @user
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def mine
|
def mine
|
||||||
|
@ -130,6 +129,7 @@ class TraceController < ApplicationController
|
||||||
def create
|
def create
|
||||||
if params[:trace]
|
if params[:trace]
|
||||||
logger.info(params[:trace][:gpx_file].class.name)
|
logger.info(params[:trace][:gpx_file].class.name)
|
||||||
|
|
||||||
if params[:trace][:gpx_file].respond_to?(:read)
|
if params[:trace][:gpx_file].respond_to?(:read)
|
||||||
begin
|
begin
|
||||||
do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
|
do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
|
||||||
|
@ -158,7 +158,10 @@ class TraceController < ApplicationController
|
||||||
@trace.valid?
|
@trace.valid?
|
||||||
@trace.errors.add(:gpx_file, "can't be blank")
|
@trace.errors.add(:gpx_file, "can't be blank")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
@trace = Trace.new(:visibility => default_visibility)
|
||||||
end
|
end
|
||||||
|
|
||||||
@title = t 'trace.create.upload_trace'
|
@title = t 'trace.create.upload_trace'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue