From: Tom Hughes Date: Thu, 22 Jul 2010 20:00:39 +0000 (+0100) Subject: Move the trace upload form from the list to a create trace page X-Git-Tag: live~6258^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/9f83acfb44d13fda8600ba8e730be722e08e7fb8 Move the trace upload form from the list to a create trace page --- diff --git a/app/views/trace/_trace_form.html.erb b/app/views/trace/_trace_form.html.erb deleted file mode 100644 index 194b8b2bc..000000000 --- a/app/views/trace/_trace_form.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% form_for :trace, @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %> - - - - - - -
<%= t'trace.trace_form.upload_gpx' %><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %>
<%= t'trace.trace_form.description' %><%= f.text_field :description, :size => 50, :maxlength => 255 %>
<%= t'trace.trace_form.tags' %><%= f.text_field :tagstring, :size => 50, :maxlength => 255 %> (<%= t'trace.trace_form.tags_help' %>)
<%= t'trace.trace_form.visibility' %><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> (<%= t'trace.trace_form.visibility_help' %>)
<%= submit_tag t('trace.trace_form.upload_button') %> | <%= t'trace.trace_form.help' %>
-<% end %> diff --git a/app/views/trace/_trace_header.html.erb b/app/views/trace/_trace_header.html.erb deleted file mode 100644 index 37b944fd4..000000000 --- a/app/views/trace/_trace_header.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -

<%= h(@title) %>

- -<% content_for :head do %> -<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %> -<% end %> - -

- <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %> - <% unless_user(@target_user, :span) do %> - | <%= link_to t('trace.trace_header.see_just_your_traces'), :action => 'mine' %> - <% end %> - <% if @tag %> - <% if @display_name %> - | <%= link_to t('trace.trace_header.see_all_traces'), :controller => 'trace', :action => 'list' %> - <% end %> - <% if_user(@target_user, :span) do %> - | <%= link_to t('trace.trace_header.see_your_traces'), :controller => 'trace', :action => 'mine' %> - <% end %> - <% end %> -

diff --git a/app/views/trace/_trace_list.html.erb b/app/views/trace/_trace_list.html.erb deleted file mode 100644 index 968fd85be..000000000 --- a/app/views/trace/_trace_list.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= render :partial => 'trace_paging_nav' %> - - - - - - - <%= render :partial => 'trace', :collection => @traces unless @traces.nil? %> -
- -<%= render :partial => 'trace_paging_nav' %> - -<%= render :partial => 'trace_optionals' %> diff --git a/app/views/trace/create.html.erb b/app/views/trace/create.html.erb index 140b74918..ba8b8e700 100644 --- a/app/views/trace/create.html.erb +++ b/app/views/trace/create.html.erb @@ -2,4 +2,12 @@ <%= error_messages_for 'trace' %> -<%= render :partial => 'trace_form' %> +<% form_for :trace, @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %> + + + + + + +
<%= t'trace.trace_form.upload_gpx' %><%= f.file_field :gpx_file, :size => 50, :maxlength => 255 %>
<%= t'trace.trace_form.description' %><%= f.text_field :description, :size => 50, :maxlength => 255 %>
<%= t'trace.trace_form.tags' %><%= f.text_field :tagstring, :size => 50, :maxlength => 255 %> (<%= t'trace.trace_form.tags_help' %>)
<%= t'trace.trace_form.visibility' %><%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> (<%= t'trace.trace_form.visibility_help' %>)
<%= submit_tag t('trace.trace_form.upload_button') %> | <%= t'trace.trace_form.help' %>
+<% end %> diff --git a/app/views/trace/list.html.erb b/app/views/trace/list.html.erb index a954dd766..78d203756 100644 --- a/app/views/trace/list.html.erb +++ b/app/views/trace/list.html.erb @@ -1,5 +1,35 @@ -<%= render :partial => 'trace_header' %> -<% if_user(@target_user) do %> - <%= render :partial => 'trace_form' %> +

<%= h(@title) %>

+ +<% content_for :head do %> +<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %> <% end %> -<%= render :partial => 'trace_list' %> + +

+ <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %> + <% unless_user(@target_user, :span) do %> + | <%= link_to t('trace.trace_header.your_traces'), :action => 'mine' %> + <% end %> + | <%= link_to t('trace.trace_header.upload_trace'), :action => 'create' %> + <% if @tag %> + <% if @display_name %> + | <%= link_to t('trace.trace_header.see_all_traces'), :controller => 'trace', :action => 'list' %> + <% end %> + <% if_user(@target_user, :span) do %> + | <%= link_to t('trace.trace_header.see_your_traces'), :controller => 'trace', :action => 'mine' %> + <% end %> + <% end %> +

+ +<%= render :partial => 'trace_paging_nav' %> + + + + + + + <%= render :partial => 'trace', :collection => @traces unless @traces.nil? %> +
+ +<%= render :partial => 'trace_paging_nav' %> + +<%= render :partial => 'trace_optionals' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ce80b6931..61616c562 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1351,7 +1351,8 @@ en: help: "Help" help_url: "http://wiki.openstreetmap.org/wiki/Upload" trace_header: - see_just_your_traces: "See just your traces, or upload a trace" + your_traces: "See just your traces" + upload_trace: "Upload a trace" see_all_traces: "See all traces" see_your_traces: "See all your traces" traces_waiting: "You have {{count}} traces waiting for upload. Please consider waiting for these to finish before uploading any more, so as not to block the queue for other users."