Merge remote-tracking branch 'upstream/pull/2667'

This commit is contained in:
Tom Hughes 2020-08-05 21:50:08 +01:00
commit c24c2e481c
36 changed files with 289 additions and 344 deletions

View file

@ -44,6 +44,7 @@ gem "actionpack-page_caching", ">= 1.2.0"
gem "active_record_union"
gem "activerecord-import"
gem "bootstrap", "~> 4.5.0"
gem "bootstrap_form", "~> 4.0"
gem "cancancan"
gem "composite_primary_keys", "~> 12.0.0"
gem "config"

View file

@ -110,6 +110,9 @@ GEM
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
bootstrap_form (4.5.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
brakeman (4.9.0)
browser (4.2.0)
builder (3.2.4)
@ -484,6 +487,7 @@ DEPENDENCIES
binding_of_caller
bootsnap (>= 1.4.2)
bootstrap (~> 4.5.0)
bootstrap_form (~> 4.0)
brakeman
browser
bzip2-ffi

View file

@ -16,6 +16,8 @@
//= require piwik
//= require richtext
//= require querystring
//= require bs-custom-file-input
//= require bs-custom-file-input-init
/*
* Called as the user scrolls/zooms around to manipulate hrefs of the

View file

@ -0,0 +1,5 @@
/* global bsCustomFileInput */
$(document).ready(function () {
bsCustomFileInput.init();
});

View file

@ -119,7 +119,7 @@ L.OSM.layers = function (options) {
.attr("class", "text-muted")
.appendTo(overlaySection);
var overlays = $("<ul class='list-unstyled'>")
var overlays = $("<ul class='list-unstyled standard-form'>")
.appendTo(overlaySection);
var addOverlay = function (layer, name, maxArea) {

View file

@ -1,5 +1,6 @@
@import "parameters";
@import "bootstrap";
@import "rails_bootstrap_forms";
/* Styles common to large and small screens */
@ -717,6 +718,14 @@ body.compact-nav {
}
}
/* Temporary label size override until we remove site-wide font customisation */
form {
label {
font-size: 16px;
}
}
/* Rules for the search and direction forms */
header .search_forms,
@ -724,118 +733,6 @@ header .search_forms,
display: none;
}
.search_form,
.directions_form {
position: relative;
padding: $lineheight/2;
background-color: $lightgrey;
.query_wrapper {
position: relative;
overflow: hidden;
border-radius: 2px 0 0 2px;
}
input[type=text] {
width: 100%;
height: 30px;
transition: 300ms linear;
}
input[type=text].overflow {
border-right: none;
border-radius: 3px 0px 0px 3px;
}
input:focus {
outline: none;
box-shadow: 0px 0px 7px $vibrant-green;
}
input[type=submit].float {
float: right;
width: auto;
min-width: 0;
border-radius: 0 2px 2px 0;
}
input.error {
background-color: rgba($red, 0.4);
}
select {
/* this next line is to polyfill the vertical alignment of text within a select element,
* which is different between firefox and chrome. */
padding: 0.3em 0;
}
.query_options {
text-align: right;
font-size: 10px;
color: $blue;
}
.describe_location {
position: absolute;
top: 6px;
right: 6px;
font-size: 10px;
color: $blue;
}
.switch_link {
float: right;
width: auto;
min-width: 0;
margin-left: 6px;
}
img.button {
display: block;
width: 20px;
height: 20px;
}
span.force_width {
width: 100%;
padding-right: 25px;
display: block;
}
select.routing_engines {
min-height: 30px;
margin: 0px 0px 5px 25px;
}
input.routing_go {
min-width: 100px;
float: right;
}
div.header {
width: 100%;
height: 30px;
}
div.line {
width: 100%;
margin: 0px 0px 5px 0px;
}
div.loader_copy {
display: none;
img {
vertical-align: middle;
}
}
a.reverse_directions {
cursor: pointer;
margin: 0px 0px 5px 25px;
}
}
/* Rules for the map key which appears in the popout sidebar */
#mapkey {
@ -1257,30 +1154,6 @@ tr.turn:hover {
}
}
/* Rules for the new trace form */
#new_trace {
input[type=text] {
width: 50%;
width: calc(100% - 150px);
max-width: 500px;
}
}
/* Rules for the edit trace form */
.edit_trace {
.standard-form-row p {
margin-bottom: 0px;
}
input[type=text] {
width: 50%;
width: calc(100% - 150px);
max-width: 500px;
}
}
/* Rules for the user profile page */
#userinformation {
@ -1712,44 +1585,205 @@ tr.turn:hover {
float: left;
margin-top: 5px;
}
}
#remember_me_openid {
display: block;
}
select {
padding: 2px;
}
input[type="checkbox"],
input[type="radio"] {
margin-right: 5px;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
color: #222;
background-color: #fff;
border: 1px solid $grey;
border-radius: 3px;
padding: 2px 5px;
margin: 0;
width: 200px;
&.field_with_errors {
border: 2px solid #ff7070;
#remember_me_openid {
display: block;
}
}
textarea {
padding: 5px;
width: 100%;
min-height: 50px;
resize: vertical;
select {
padding: 2px;
}
input[type="checkbox"],
input[type="radio"] {
margin-right: 5px;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
color: #222;
background-color: #fff;
border: 1px solid $grey;
border-radius: 3px;
padding: 2px 5px;
margin: 0;
width: 200px;
&.field_with_errors {
border: 2px solid #ff7070;
}
}
textarea {
padding: 5px;
width: 100%;
min-height: 50px;
resize: vertical;
}
/* Utility for general button styles */
input[type="button"],
input[type="submit"],
input[type="reset"],
a.button {
cursor: pointer;
border: 0;
display: inline-block;
padding: $lineheight/4 $lineheight/2;
min-height: 20px + $lineheight/2;
min-width: 120px;
margin: 0 0 $lineheight/2 0;
color: white;
background: $blue;
text-align: center;
border-radius: 2px;
&:hover {
background: darken($blue, $hovercolor);
text-decoration: none;
}
&.deemphasize {
background: $lightblue;
&:hover {
background: darken($lightblue, $hovercolor);
}
}
&:disabled {
background: $lightgrey;
&:hover {
background: $lightgrey;
}
}
&:last-child {
margin-bottom: 0;
}
}
input[type="button"],
input[type="submit"],
input[type="reset"] {
line-height: normal;
}
a.button {
line-height: 20px;
}
.search_form,
.directions_form {
position: relative;
padding: $lineheight/2;
background-color: $lightgrey;
.query_wrapper {
position: relative;
overflow: hidden;
border-radius: 2px 0 0 2px;
}
input[type=text] {
width: 100%;
height: 30px;
transition: 300ms linear;
}
input[type=text].overflow {
border-right: none;
border-radius: 3px 0px 0px 3px;
}
input:focus {
outline: none;
box-shadow: 0px 0px 7px $vibrant-green;
}
input[type=submit].float {
float: right;
width: auto;
min-width: 0;
border-radius: 0 2px 2px 0;
}
input.error {
background-color: rgba($red, 0.4);
}
select {
/* this next line is to polyfill the vertical alignment of text within a select element,
* which is different between firefox and chrome. */
padding: 0.3em 0;
}
.query_options {
text-align: right;
font-size: 10px;
color: $blue;
}
.describe_location {
position: absolute;
top: 6px;
right: 6px;
font-size: 10px;
color: $blue;
}
.switch_link {
float: right;
width: auto;
min-width: 0;
margin-left: 6px;
}
img.button {
display: block;
width: 20px;
height: 20px;
}
span.force_width {
width: 100%;
padding-right: 25px;
display: block;
}
select.routing_engines {
min-height: 30px;
margin: 0px 0px 5px 25px;
}
input.routing_go {
min-width: 100px;
float: right;
}
div.header {
width: 100%;
height: 30px;
}
div.line {
width: 100%;
margin: 0px 0px 5px 0px;
}
div.loader_copy {
display: none;
img {
vertical-align: middle;
}
}
a.reverse_directions {
cursor: pointer;
margin: 0px 0px 5px 25px;
}
}
}
/* Rules for user images */
@ -1829,54 +1863,6 @@ div.secondary-actions {
.inner02 { padding: 0 $lineheight;}
/* Utility for general button styles */
input[type="button"],
input[type="submit"],
input[type="reset"],
a.button {
cursor: pointer;
border: 0;
display: inline-block;
padding: $lineheight/4 $lineheight/2;
min-height: 20px + $lineheight/2;
min-width: 120px;
margin: 0 0 $lineheight/2 0;
color: white;
background: $blue;
text-align: center;
border-radius: 2px;
&:hover {
background: darken($blue, $hovercolor);
text-decoration: none;
}
&.deemphasize {
background: $lightblue;
&:hover {
background: darken($lightblue, $hovercolor);
}
}
&:disabled {
background: $lightgrey;
&:hover {
background: $lightgrey;
}
}
&:last-child {
margin-bottom: 0;
}
}
input[type="button"],
input[type="submit"],
input[type="reset"] {
line-height: normal;
}
a.button {
line-height: 20px;
}
.buttons {
min-width: 200px;
input[type="submit"],

View file

@ -8,7 +8,6 @@ $lightblue: #B8C5F0;
$green: #7ebc6f;
$vibrant-green: #76c551;
$grey: #CCC;
$red: red;
$lightgrey: #EEE;
$darkgrey: #888;
$hovercolor: 20%;

View file

@ -15,7 +15,7 @@
<% if current_user %>
<div class="buttons clearfix subscribe-buttons">
<form action="#">
<form action="#" class="standard-form">
<% if @changeset.subscribers.exists?(current_user.id) %>
<input class="action-button" type="submit" name="unsubscribe" value="<%= t("javascripts.changesets.show.unsubscribe") %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
<% else %>
@ -29,7 +29,7 @@
<% if @comments.length > 0 %>
<div class='changeset-comments'>
<form action="#">
<form action="#" class="standard-form">
<ul class="list-unstyled">
<% @comments.each do |comment| %>
<% if comment.visible %>
@ -71,7 +71,7 @@
<% if current_user %>
<% unless @changeset.is_open? %>
<form action="#">
<form action="#" class="standard-form">
<textarea class="comment" name="text" cols="40" rows="5"></textarea>
<div class="buttons clearfix">
<input type="submit" name="comment" value="<%= t("javascripts.changesets.show.comment") %>" data-changeset-id="<%= @changeset.id %>" data-method="POST" data-url="<%= changeset_comment_url(@changeset) %>" disabled="1" />

View file

@ -7,7 +7,7 @@
<div class="note browse-section">
<p class="alert alert-info"><%= t("javascripts.notes.new.intro") %></p>
<form action="#">
<form action="#" class="standard-form">
<input type="hidden" name="lon">
<input type="hidden" name="lat">
<textarea class="comment" name="text" cols="40" rows="10" maxlength="2000" placeholder="<%= t("javascripts.notes.new.advice") %>"></textarea>

View file

@ -47,7 +47,7 @@
<% if @note.status == "open" %>
<% if current_user -%>
<form action="#">
<form action="#" class="standard-form">
<textarea class="comment" name="text" cols="40" rows="5" maxlength="2000"></textarea>
<div class="buttons clearfix">
<% if current_user.moderator? -%>
@ -59,7 +59,7 @@
</form>
<% end -%>
<% else %>
<form action="#">
<form action="#" class="standard-form">
<input type="hidden" name="text" value="">
<div class="buttons clearfix">
<% if current_user and current_user.moderator? -%>

View file

@ -13,7 +13,7 @@
<%= render :partial => "diary_comment", :collection => @comments %>
</div>
<div>
<div class="standard-form">
<% if current_user %>
<h3 id="newcomment"><%= t ".leave_a_comment" %></h3>

View file

@ -2,7 +2,7 @@
<h1><%= t ".heading", :user => @new_friend.display_name %></h1>
<% end %>
<%= form_tag do %>
<%= form_tag(nil, :class => "standard-form") do %>
<% if params[:referer] -%>
<%= hidden_field_tag("referer", params[:referer]) %>
<% end -%>

View file

@ -2,7 +2,7 @@
<h1><%= t ".heading", :user => @friend.display_name %></h1>
<% end %>
<%= form_tag do %>
<%= form_tag(nil, :class => "standard-form") do %>
<% if params[:referer] -%>
<%= hidden_field_tag("referer", params[:referer]) %>
<% end -%>

View file

@ -14,7 +14,7 @@
<% end %>
</div>
<br />
<div class="comment">
<div class="comment standard-form">
<%= form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
<%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
<%= label_tag :reassign, t(".reassign_param") %> <%= check_box_tag :reassign, true %>

View file

@ -2,7 +2,7 @@
<h1><%= t ".title" %></h1>
<% end %>
<%= form_tag(issues_path, :method => :get) do %>
<%= form_tag(issues_path, :method => :get, :class => "standard-form") do %>
<p><%= t ".search_guidance" %></p>
<%= select_tag :status, options_for_select(Issue.aasm.states.map(&:name).map { |state| [t(".states.#{state}"), state] }, params[:status]), :include_blank => t(".select_status"), :data => { :behavior => "category_dropdown" } %>
<%= select_tag :issue_type, options_for_select(@issue_types, params[:issue_type]), :include_blank => t(".select_type"), :data => { :behavior => "category_dropdown" } %>

View file

@ -1,4 +1,4 @@
<div class="search_forms">
<div class="search_forms standard-form">
<form method="GET" action="<%= search_path %>" class="search_form">
<%= link_to image_tag("directions.png", :class => "button"), directions_path, :class => "button switch_link", :title => t("site.search.get_directions_title") %>
<%= submit_tag t("site.search.submit_text"), :class => "float", :data => { :disable_with => false } %>

View file

@ -1,4 +1,4 @@
<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" unless message_summary.message_read? %>">
<tr id="inbox-<%= message_summary.id %>" class="standard-form inbox-row<%= "-unread" unless message_summary.message_read? %>">
<td class="inbox-sender"><%= link_to message_summary.sender.display_name, user_path(message_summary.sender) %></td>
<td class="inbox-subject"><%= link_to message_summary.title, message_path(message_summary) %></td>
<td class="inbox-sent"><%= l message_summary.sent_on, :format => :friendly %></td>

View file

@ -2,7 +2,7 @@
<h1><%= t ".title" %></h1>
<% end %>
<%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %>
<%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put, :class => "standard-form" } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<%= f.submit %>
<% end %>

View file

@ -18,7 +18,7 @@
<td><%= link_to token.client_application.name, token.client_application.url %></td>
<td><%= token.authorized_at %></td>
<td>
<%= form_tag :controller => "oauth", :action => "revoke" do %>
<%= form_tag({ :controller => "oauth", :action => "revoke" }, { :class => "standard-form" }) do %>
<%= hidden_field_tag "token", token.token %>
<%= submit_tag t(".revoke") %>
<% end %>

View file

@ -27,7 +27,7 @@
<p><%= t ".support_notice" %></p>
</div>
<div class="buttons">
<div class="buttons standard-form">
<%= button_to t(".edit"), edit_oauth_client_path(@client_application.user.display_name, @client_application), :method => :get, :class => "oauth-edit" %>
<%= button_to t(".delete"), oauth_client_path(@client_application.user.display_name, @client_application), :method => :delete, :data => { :confirm => t(".confirm") }, :class => "oauth-delete deemphasize" %>
</div>

View file

@ -4,7 +4,7 @@
<h1><%= t ".heading" %></h1>
<% end %>
<%= form_for(@redaction) do |f| %>
<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>

View file

@ -3,7 +3,7 @@
<h1><%= t ".heading" %></h1>
<% end %>
<%= form_for(@redaction) do |f| %>
<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>

View file

@ -5,7 +5,7 @@
<%= t ".title" %>
</h2>
<%= form_tag({ :controller => "export", :action => "finish" }, { :class => "export_form" }) do %>
<%= form_tag({ :controller => "export", :action => "finish" }, { :class => "export_form standard-form" }) do %>
<%= hidden_field_tag "format", "osm" %>
<div class='export_area_inputs'>

View file

@ -4,52 +4,16 @@
<img src="<%= url_for :controller => "traces", :action => "picture", :id => @trace.id, :display_name => @trace.user.display_name %>">
<%= form_for @trace do |f| %>
<div id='edit-trace-form' class='standard-form'>
<fieldset>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".filename" %></label>
<p class='deemphasize'><%= @trace.name %> (<%= link_to t(".download"), trace_data_path(@trace) %>)</p>
</div>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".uploaded_at" %></label>
<p class='deemphasize'><%= l @trace.timestamp, :format => :friendly %></p>
</div>
<% if @trace.inserted? %>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".points" %></label>
<p class='deemphasize'><%= @trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/, '\1,') %></p>
</div>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".start_coord" %></label>
</div>
<div class="geo">
<span class="latitude"><%= @trace.latitude %></span>;
<span class="longitude"><%= @trace.longitude %></span>
</div>
(<%= link_to t(".map"), :controller => "site", :action => "index", :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>)
<% end %>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".owner" %></label>
<p class='deemphasize'><%= link_to @trace.user.display_name, user_path(@trace.user) %></p>
</div>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".description" %></label>
<%= f.text_field :description %>
</div>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".tags" %></label>
<%= f.text_field :tagstring %> (<%= t ".tags_help" %>)
</div>
<div class='standard-form-row'>
<label class='standard-label'><%= t ".visibility" %></label>
<%= f.select :visibility, [[t("traces.visibility.private"), "private"], [t("traces.visibility.public"), "public"], [t("traces.visibility.trackable"), "trackable"], [t("traces.visibility.identifiable"), "identifiable"]] %> (<a href="<%= t ".visibility_help_url" %>"><%= t ".visibility_help" %></a>)
</div>
</fieldset>
</div>
<%= f.submit %>
<%= bootstrap_form_for @trace do |f| %>
<%= f.text_field :name, :disabled => true %>
<%= f.text_field :description %>
<%= f.text_field :tagstring %>
<%= f.select :visibility,
[[t("traces.visibility.private"), "private"],
[t("traces.visibility.public"), "public"],
[t("traces.visibility.trackable"), "trackable"],
[t("traces.visibility.identifiable"), "identifiable"]],
:help => link_to(t(".visibility_help"), t(".visibility_help_url")) %>
<%= f.primary %>
<%= link_to t(".cancel"), show_trace_path(@trace.user, @trace), :class => "btn btn-link" %>
<% end %>

View file

@ -2,32 +2,16 @@
<h1><%= t ".upload_trace" %></h1>
<% end %>
<%= error_messages_for "trace" %>
<%= form_for @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %>
<div class="standard-form">
<fieldset>
<div class='standard-form-row'>
<label for="trace_gpx_file" class="standard-label"><%= t ".upload_gpx" %></label>
<%= f.file_field :gpx_file %>
</div>
<div class='standard-form-row'>
<label class="standard-label"><%= t ".description" %></label>
<%= f.text_field :description %>
</div>
<div class='standard-form-row'>
<label class="standard-label"><%= t ".tags" %></label>
<%= f.text_field :tagstring %>
<span class="form-help deemphasize">(<%= t ".tags_help" %>)</span>
</div>
<div class='standard-form-row'>
<label class="standard-label"><%= t ".visibility" %></label>
<%= f.select :visibility, [[t("traces.visibility.private"), "private"], [t("traces.visibility.public"), "public"], [t("traces.visibility.trackable"), "trackable"], [t("traces.visibility.identifiable"), "identifiable"]] %>
<span class="form-help deemphasize">(<a href="<%= t ".visibility_help_url" %>"><%= t ".visibility_help" %></a>)</span>
</div>
</fieldset>
<%= f.submit %>
<span class="form-help deemphasize"><a href="<%= t ".help_url" %>"><%= t ".help" %></a></span>
</div>
<%= bootstrap_form_for @trace, :url => { :action => "create" }, :html => { :multipart => true } do |f| %>
<%= f.file_field :gpx_file, :placeholder => t("helpers.file.prompt") %>
<%= f.text_field :description %>
<%= f.text_field :tagstring %>
<%= f.select :visibility,
[[t("traces.visibility.private"), "private"],
[t("traces.visibility.public"), "public"],
[t("traces.visibility.trackable"), "trackable"],
[t("traces.visibility.identifiable"), "identifiable"]],
:help => link_to(t(".visibility_help"), t(".visibility_help_url")) %>
<%= f.primary %>
<%= link_to t(".help"), t(".help_url"), :class => "btn btn-link" %>
<% end %>

View file

@ -55,10 +55,10 @@
<br /><br />
<% if current_user && (current_user==@trace.user || current_user.administrator? || current_user.moderator?) %>
<div class="buttons">
<div>
<% if current_user == @trace.user %>
<%= link_to t(".edit_trace"), edit_trace_path(@trace), :class => "button" %>
<%= link_to t(".edit_trace"), edit_trace_path(@trace), :class => "btn btn-outline-primary" %>
<% end %>
<%= button_to t(".delete_trace"), { :controller => "traces", :action => "destroy", :id => @trace.id }, { :method => :delete, :data => { :confirm => t(".confirm_delete") } } %>
<%= link_to t(".delete_trace"), { :controller => "traces", :action => "destroy", :id => @trace.id }, { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
</div>
<% end %>

View file

@ -9,7 +9,7 @@
</ul>
<% end %>
<%= form_for(@user_block) do |f| %>
<%= form_for(@user_block, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>

View file

@ -4,7 +4,7 @@
:name => link_to(@user.display_name,
user_path(@user))) %></h1>
<% end %>
<%= form_for(@user_block) do |f| %>
<%= form_for(@user_block, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>

View file

@ -15,7 +15,7 @@
<%= t(".time_future", :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
</b></p>
<%= form_for :revoke, :url => { :action => "revoke" } do |f| %>
<%= form_for :revoke, :url => { :action => "revoke" }, :html => { :class => "standard-form" } do |f| %>
<%= f.error_messages %>
<p>
<%= check_box_tag "confirm", "yes" %>

View file

@ -12,7 +12,7 @@
<p><%= t ".press confirm button" %></p>
<%= form_tag({}, { :id => "confirm" }) do %>
<%= form_tag({}, { :id => "confirm", :class => "standard-form" }) do %>
<input type="display_name" name="confirm_string" value="<%= params[:display_name] %>">
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t ".button" %>">

View file

@ -10,7 +10,7 @@
<p><%= t ".press confirm button" %></p>
<%= form_tag({}, { :id => "confirm" }) do %>
<%= form_tag({}, { :id => "confirm", :class => "standard-form" }) do %>
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t ".button" %>">
<% end %>

View file

@ -2,7 +2,7 @@
<h1><%= t ".heading" %></h1>
<% end %>
<%= form_tag :action => "logout" do %>
<%= form_tag({ :action => "logout" }, { :class => "standard-form" }) do %>
<%= hidden_field_tag("referer", h(params[:referer])) %>
<%= submit_tag t(".logout_button") %>
<% end %>

View file

@ -6,6 +6,8 @@ en:
friendly: "%e %B %Y at %H:%M"
blog: "%e %B %Y"
helpers:
file:
prompt: Choose file
submit:
diary_comment:
create: Save
@ -93,6 +95,10 @@ en:
longitude: "Longitude"
public: "Public"
description: "Description"
name: Filename
gpx_file: Upload GPX File
visibility: Visibility
tagstring: Tags
message:
sender: "Sender"
title: "Subject"
@ -105,6 +111,9 @@ en:
description: "Description"
languages: "Languages"
pass_crypt: "Password"
help:
trace:
tagstring: comma delimited
datetime:
distance_in_words_ago:
about_x_hours:
@ -1823,11 +1832,6 @@ en:
identifiable: "Identifiable (shown in trace list and as identifiable, ordered points with timestamps)"
new:
upload_trace: "Upload GPS Trace"
upload_gpx: "Upload GPX File:"
description: "Description:"
tags: "Tags:"
tags_help: "comma delimited"
visibility: "Visibility:"
visibility_help: "what does this mean?"
visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
help: "Help"
@ -1840,20 +1844,9 @@ en:
one: "You have %{count} trace waiting for upload. Please consider waiting for these to finish before uploading any more, so as not to block the queue for other users."
other: "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."
edit:
cancel: Cancel
title: "Editing trace %{name}"
heading: "Editing trace %{name}"
filename: "Filename:"
download: "download"
uploaded_at: "Uploaded:"
points: "Points:"
start_coord: "Start coordinate:"
map: "map"
edit: "edit"
owner: "Owner:"
description: "Description:"
tags: "Tags:"
tags_help: "comma delimited"
visibility: "Visibility:"
visibility_help: "what does this mean?"
visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
update:

View file

@ -1,7 +1,9 @@
{
"name": "openstreetmap",
"private": true,
"dependencies": {},
"dependencies": {
"bs-custom-file-input": "^1.3.4"
},
"devDependencies": {
"eslint": "^7.3.1"
}

View file

@ -616,7 +616,7 @@ class TracesControllerTest < ActionDispatch::IntegrationTest
session_for(user)
post traces_path, :params => { :trace => { :gpx_file => file, :description => "", :tagstring => "new,trace", :visibility => "trackable" } }
assert_template :new
assert_match "Description is too short (minimum is 1 character)", response.body
assert_match "is too short (minimum is 1 character)", response.body
end
# Test fetching the edit page for a trace using GET

View file

@ -98,6 +98,11 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
bs-custom-file-input@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/bs-custom-file-input/-/bs-custom-file-input-1.3.4.tgz#c275cb8d4f1c02ba026324292509fa9a747dbda8"
integrity sha512-NBsQzTnef3OW1MvdKBbMHAYHssCd613MSeJV7z2McXznWtVMnJCy7Ckyc+PwxV6Pk16cu6YBcYWh/ZE0XWNKCA==
callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"