if (interestingFeature(element)) {
var $li = $("<li>")
- .addClass("query-result")
+ .addClass("query-result list-group-item")
.data("geometry", featureGeometry(element))
- .appendTo($ul);
- var $p = $("<p>")
.text(featurePrefix(element) + " ")
- .appendTo($li);
+ .appendTo($ul);
$("<a>")
.attr("href", "/" + element.type + "/" + element.id)
.text(featureName(element))
- .appendTo($p);
+ .appendTo($li);
}
}
@import "bootstrap/type";
// @import "bootstrap/images";
// @import "bootstrap/code";
-// @import "bootstrap/grid";
+@import "bootstrap/grid";
// @import "bootstrap/tables";
// @import "bootstrap/forms";
// @import "bootstrap/buttons";
@import "bootstrap/alert";
// @import "bootstrap/progress";
// @import "bootstrap/media";
-// @import "bootstrap/list-group";
+@import "bootstrap/list-group";
// @import "bootstrap/close";
// @import "bootstrap/toasts";
// @import "bootstrap/modal";
clear: both;
}
-/* Basic grid */
-
-.col0 { float:left; width:04.1666%; }
-.col1 { float:left; width:08.3333%; }
-.col2 { float:left; width:16.6666%; }
-.col3 { float:left; width:25.0000%; }
-.col4 { float:left; width:33.3333%; }
-.col5 { float:left; width:41.6666%; }
-.col6 { float:left; width:50.0000%; }
-.col7 { float:left; width:58.3333%; }
-.col8 { float:left; width:66.6666%; }
-.col9 { float:left; width:75.0000%; }
-.col10 { float:left; width:83.3333%; }
-.col11 { float:left; width:91.6666%; }
-.col12 { width:100%; }
-
-.margin0 { margin-left:04.1666%; }
-.margin1 { margin-left:08.3333%; }
-.margin2 { margin-left:16.6666%; }
-.margin3 { margin-left:25.0000%; }
-.margin4 { margin-left:33.3333%; }
-.margin5 { margin-left:41.6666%; }
-.margin6 { margin-left:50.0000%; }
-.margin7 { margin-left:58.3333%; }
-.margin8 { margin-left:66.6666%; }
-.margin9 { margin-left:75.0000%; }
-.margin10 { margin-left:83.3333%; }
-.margin11 { margin-left:91.6666%; }
-.margin12 { margin-left:100.0000%; }
-
.fillL { background-color: white; }
/* Default rules for the body of every page */
#sidebar .changesets {
li {
- padding: 15px 20px;
- border-bottom: 1px solid $grey;
cursor: pointer;
&.selected { background: $list-highlight; }
/* color is derived from changeset bbox fillColor in history.js */
}
- h4 {
- margin: 0;
- a {
- color: #000;
- }
- }
-
.comments {
float: right;
color: $darkgrey;
background-color: #F6F6F6;
border: 1px solid $grey;
border-radius: 3px;
- font-size: 12px;
table-layout: fixed;
border-collapse: separate;
.colour-preview-box {
float: right;
- width: 12px;
- height: 12px;
+ width: 14px;
+ height: 14px;
margin: 4px 0px;
border: 1px solid rgba(0, 0, 0, .1);
// add color via inline css on element: background-color: <tag value>;
.query-results {
display: none;
+ padding-bottom: $lineheight/2;
h3 {
- padding: $lineheight $lineheight $lineheight/2;
- margin: 0;
+ padding: 0 $lineheight;
}
ul {
li {
- padding: 15px 20px;
- border-bottom: 1px solid $grey;
-
&.query-result {
cursor: pointer;
}
/* Overrides for pages that use new layout conventions */
-.users-new,
-.users-create,
-.users-terms {
- .content-body .content-inner {
- padding: 0;
-
- .message {
- margin-top: 80px;
- padding: 20px;
- }
- }
-}
-
.users-new,
.users-create,
.users-terms,
border-bottom: none;
}
-/* Rules for RSS buttons */
-
-.rsssmall {
- position: relative;
- top: 3px;
-}
-
/* General styles for action lists / subnavs / pager navs */
ul.secondary-actions {
text-decoration: none;
}
- .note-box {
- margin-top: 20px;
- background-color: $offwhite;
- }
-
.icon.note {
background-color: #333;
border-radius: 4px;
background-size: cover;
background-attachment: fixed;
- .caption {
- max-width: 200px;
- font: 13px/20px Helvetica, Arial, sans-serif;
- position: fixed;
- text-align: right;
- right: 20px;
- bottom: 60px;
- text-shadow: #000 0px 1px 5px;
- color: $lightgrey;
- opacity: 0.8;
- display: none;
- }
-
- .caption a {
- color: white;
- white-space: nowrap;
- text-decoration: none;
- }
-
- a.next {
- display: block;
- position: fixed;
- right: 10px;
- bottom: 10px;
- width: 40px;
- height: 40px;
- border-radius: 5px;
- text-indent: -9999px;
- overflow: hidden;
- background: image-url('about/sprite.png') -120px 0px no-repeat;
- background-color: #000;
- background-color: rgba(0, 0, 0, 0.5);
- }
.content-inner {
position: relative;
color: #333;
min-width: 320px;
max-width: 640px;
-
- .section {
- margin-bottom: 30px;
- }
-
- .section:last-child {
- margin-bottom: 0;
- }
}
.text {
}
}
- h2 {
- margin-bottom: 10px;
- }
-
.icon {
width: 30px;
height: 30px;
top: auto;
}
- /* Rules for the sign-up page */
-
- &.user-new,
- &.user-create {
- .col6 {
- width: 100%;
- }
-
- .aside {
- display: none;
- }
- }
-
&.site-about #content .attr h1 {
font-size: 28px;
}
def logout
@title = t "users.logout.title"
- if params[:session] == session.id
+ if request.post?
if session[:token]
token = UserToken.find_by(:token => session[:token])
token&.destroy
# block. this should be caught and dealt with in the controller,
# but i've also included it here just in case.
def moderator_permissions
- errors.add(:base, I18n.t("user_block.model.non_moderator_update")) if creator_id_changed? && !creator.moderator?
- errors.add(:base, I18n.t("user_block.model.non_moderator_revoke")) unless revoker_id.nil? || revoker.moderator?
+ errors.add(:base, I18n.t("user_blocks.model.non_moderator_update")) if creator_id_changed? && !creator.moderator?
+ errors.add(:base, I18n.t("user_blocks.model.non_moderator_revoke")) if revoker_id_changed? && !revoker_id.nil? && !revoker.moderator?
end
end
</h2>
<div class="browse-section">
- <h4><%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %></h4>
+ <h6><%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %></h6>
<div class="details"><%= changeset_details(@changeset) %></div>
<%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %>
<div id="query-nearby" class="query-results">
<h3><%= t(".nearby") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
- <ul class="query-results-list"></ul>
+ <div>
+ <ul class="query-results-list list-group list-group-flush"></ul>
+ </div>
</div>
<div id="query-isin" class="query-results">
<h3><%= t(".enclosing") %></h3>
<%= image_tag "searching.gif", :class => "loader" %>
- <ul class="query-results-list"></ul>
+ <div>
+ <ul class="query-results-list list-group list-group-flush"></ul>
+ </div>
</div>
}
end %>
-<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data } do %>
- <h4>
- <a class="changeset_id" href="<%= changeset_path(changeset) %>">
+<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data }, :class => "list-group-item" do %>
+ <h6>
+ <a class="changeset_id text-dark" href="<%= changeset_path(changeset) %>">
<%= changeset.tags["comment"].to_s.presence || t("browse.no_comment") %>
</a>
- </h4>
+ </h6>
<div class="comments comments-<%= changeset.comments.length %>">
<%= changeset.comments.length %>
<span class="icon note grey"></span>
<% if @changesets.present? %>
- <ol class="changesets">
+ <ol class="changesets list-group list-group-flush">
<%= render @changesets %>
</ol>
<% if @changesets.size == 20 -%>
<%= yield :greeting %>
</li>
<li>
- <%= link_to t("layouts.logout"), logout_path(:session => session.id, :referer => request.fullpath), :class => "geolink" %>
+ <%= link_to t("layouts.logout"), logout_path(:referer => request.fullpath), :method => "post", :class => "geolink" %>
</li>
</ul>
</div>
<div class='section' id='legal'>
<h2><div class='icon legal'></div><%= t ".legal_title", :locale => @locale %></h2>
- <p><%= t ".legal_html", :locale => @locale %></p>
+ <p><%= t ".legal_1_html", :locale => @locale %></p>
+ <p><%= t ".legal_2_html", :locale => @locale %></p>
</div>
<div class='section' id='partners'>
<% end %>
<h3><%= t "layouts.intro_header" %></h3>
-
<p><%= t "layouts.intro_text" %></p>
<h3><%= t ".how_to_help.title" %></h3>
-<div class='clearfix'>
- <div class='col6 inner11'>
- <h3><%= t ".how_to_help.join_the_community.title" %></h3>
- <%= t ".how_to_help.join_the_community.explanation_html" %>
- <div class='clearfix center'>
- <a class="button sign-up" href="<%= user_new_path %>"><%= t("layouts.start_mapping") %></a>
+<div class='container'>
+ <div class='row'>
+ <div class='col-sm'>
+ <h5><%= t ".how_to_help.join_the_community.title" %></h5>
+ <p><%= t ".how_to_help.join_the_community.explanation_html" %></p>
+ <p class='text-center'>
+ <a class="button sign-up" href="<%= user_new_path %>"><%= t("layouts.start_mapping") %></a>
+ </p>
+ </div>
+ <div class='col-sm'>
+ <h5><%= t "site.welcome.add_a_note.title" %></h5>
+ <p><%= t "site.welcome.add_a_note.paragraph_1_html" %></p>
+ <p><%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %></p>
</div>
- </div>
- <div class='col6 inner11'>
- <h3><%= t "site.welcome.add_a_note.title" %></h3>
- <p><%= t "site.welcome.add_a_note.paragraph_1_html" %></p>
- <p><%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %></p>
</div>
</div>
<h3><%= t ".other_concerns.title" %></h3>
<p><%= t ".other_concerns.explanation_html" %></p>
-<div class='col12 clearfix icon-list'>
- <h3><%= t "site.welcome.questions.title" %></h3>
- <span class='sprite small term question'></span>
- <p><%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %></p>
-</div>
+<h3><%= t "site.welcome.questions.title" %></h3>
+<span class='sprite small term question'></span>
+<p><%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %></p>
<h3><%= t ".whats_on_the_map.title" %></h3>
-<div class=' clearfix'>
- <div class='col6 inner11'>
- <div class='center clearfix inner11'>
+<div class='row'>
+ <div class='col'>
+ <div class='center'>
<span class='sprite small check'></span>
</div>
<p><%= t ".whats_on_the_map.on_html" %></p>
</div>
- <div class='col6 inner11'>
- <div class='center clearfix inner11'>
+ <div class='col'>
+ <div class='center'>
<span class='sprite small x'></span>
</div>
<p><%= t ".whats_on_the_map.off_html" %></p>
<p><%= t ".basic_terms.paragraph_1_html" %></p>
-<div class='col12 clearfix icon-list'>
+<div class='clearfix icon-list'>
<div class='clearfix'>
<span class='sprite small term editor'></span>
<p><%= t ".basic_terms.editor_html" %></p>
</div>
</div>
-<div class='col12 clearfix icon-list'>
+<div class='clearfix icon-list'>
<h3><%= t ".rules.title" %></h3>
<span class='sprite small term rules'></span>
<p><%= t ".rules.paragraph_1_html" %></p>
</div>
-<div class='col12 clearfix icon-list'>
+<div class='clearfix icon-list'>
<h3><%= t ".questions.title" %></h3>
<span class='sprite small term question'></span>
<p><%= t ".questions.paragraph_1_html", :help_url => help_path %></p>
</div>
<div class='clearfix center'>
- <a href="<%= edit_path %>" class="button start-mapping"><%= t ".start_mapping" %></a>
+ <p><a href="<%= edit_path %>" class="button start-mapping"><%= t ".start_mapping" %></a></p>
</div>
-<div class='note-box'>
- <div class='inner22'>
- <h3><%= t ".add_a_note.title" %></h3>
- <p><%= t ".add_a_note.paragraph_1_html" %></p>
- <p><%= t ".add_a_note.paragraph_2_html", :map_url => root_path %></p>
- </div>
+<div class='alert alert-primary'>
+ <h3><%= t ".add_a_note.title" %></h3>
+ <p><%= t ".add_a_note.paragraph_1_html" %></p>
+ <p><%= t ".add_a_note.paragraph_2_html", :map_url => root_path %></p>
</div>
<%= form_tag :action => "logout" do %>
<%= hidden_field_tag("referer", h(params[:referer])) %>
- <%= hidden_field_tag("session", session.id) %>
<%= submit_tag t(".logout_button") %>
<% end %>
<div class='header-illustration new-user-arm'></div>
<% end %>
-<%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form fillL col6 inner22" } do |f| %>
- <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %>
+<div class="row">
+ <div class='text-muted col-sm order-sm-2'>
+ <h4><%= t ".about.header" %></h4>
+ <%= t ".about.html" %>
+ </div>
- <fieldset>
- <div class="form-row">
- <label for="email" class="standard-label">
- <%= t ".email address" %>
- </label>
- <%= f.email_field(:email, :tabindex => 1) %>
- <%= f.error_message_on(:email) %>
- </div>
- <div class="form-row">
- <label for="email_confirmation" class="standard-label">
- <%= t ".confirm email address" %>
- </label>
- <%= f.email_field(:email_confirmation, :tabindex => 2) %>
- <%= f.error_message_on(:email_confirmation) %>
- </div>
- <span class="form-help deemphasize"><%= t(".not_displayed_publicly_html") %></span>
- </fieldset>
+ <div class="col-sm">
+ <%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form" } do |f| %>
+ <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %>
- <fieldset>
- <div class="form-row">
- <label for="display_name" class="standard-label">
- <%= t ".display name" %>
- </label>
- <%= f.text_field(:display_name, :tabindex => 3) %>
- <%= f.error_message_on(:display_name) %>
- </div>
- <span class="form-help deemphasize"><%= t ".display name description" %></span>
- </fieldset>
+ <fieldset>
+ <div class="form-row">
+ <label for="email" class="standard-label">
+ <%= t ".email address" %>
+ </label>
+ <%= f.email_field(:email, :tabindex => 1) %>
+ <%= f.error_message_on(:email) %>
+ </div>
+ <div class="form-row">
+ <label for="email_confirmation" class="standard-label">
+ <%= t ".confirm email address" %>
+ </label>
+ <%= f.email_field(:email_confirmation, :tabindex => 2) %>
+ <%= f.error_message_on(:email_confirmation) %>
+ </div>
+ <span class="form-help deemphasize"><%= t(".not_displayed_publicly_html") %></span>
+ </fieldset>
- <fieldset class="form-divider" id="auth_field">
- <div class="form-row">
- <label for="openid_url" class="standard-label">
- <%= t ".external auth" %>
- </label>
- <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %>
- <%= f.text_field(:auth_uid, :tabindex => 5) %>
- <%= f.error_message_on(:auth_uid) %>
- </div>
- <span class="form-help deemphasize"><%= t ".auth no password" %></span>
- </fieldset>
+ <fieldset>
+ <div class="form-row">
+ <label for="display_name" class="standard-label">
+ <%= t ".display name" %>
+ </label>
+ <%= f.text_field(:display_name, :tabindex => 3) %>
+ <%= f.error_message_on(:display_name) %>
+ </div>
+ <span class="form-help deemphasize"><%= t ".display name description" %></span>
+ </fieldset>
- <fieldset>
- <div class="form-row">
- <label for='user[pass_crypt]' class="standard-label">
- <%= t ".password" %>
- </label>
- <%= f.password_field(:pass_crypt, :tabindex => 6) %>
- <%= f.error_message_on(:pass_crypt) %>
- </div>
- <div class="form-row">
- <label class="standard-label">
- <%= t ".confirm password" %>
- </label>
- <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %>
- <%= f.error_message_on(:pass_crypt_confirmation) %>
- </div>
- </fieldset>
+ <fieldset class="form-divider" id="auth_field">
+ <div class="form-row">
+ <label for="openid_url" class="standard-label">
+ <%= t ".external auth" %>
+ </label>
+ <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %>
+ <%= f.text_field(:auth_uid, :tabindex => 5) %>
+ <%= f.error_message_on(:auth_uid) %>
+ </div>
+ <span class="form-help deemphasize"><%= t ".auth no password" %></span>
+ </fieldset>
- <div id="auth_prompt" class="form-row">
- <%= link_to t(".use external auth"), "#", :id => "auth_enable" %>
- </div>
+ <fieldset>
+ <div class="form-row">
+ <label for='user[pass_crypt]' class="standard-label">
+ <%= t ".password" %>
+ </label>
+ <%= f.password_field(:pass_crypt, :tabindex => 6) %>
+ <%= f.error_message_on(:pass_crypt) %>
+ </div>
+ <div class="form-row">
+ <label class="standard-label">
+ <%= t ".confirm password" %>
+ </label>
+ <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %>
+ <%= f.error_message_on(:pass_crypt_confirmation) %>
+ </div>
+ </fieldset>
- <%= submit_tag t(".continue"), :tabindex => 8 %>
-<% end %>
+ <div id="auth_prompt" class="form-row">
+ <%= link_to t(".use external auth"), "#", :id => "auth_enable" %>
+ </div>
-<div class='aside col6 deemphasize inner22'>
- <h4><%= t ".about.header" %></h4>
- <%= t ".about.html" %>
+ <%= submit_tag t(".continue"), :tabindex => 8 %>
+ <% end %>
+ </div>
</div>
<div class='header-illustration new-user-terms'></div>
<% end %>
-<%= form_tag({ :action => "save" }, { :class => " inner22 standard-form fillL" }) do %>
+<%= form_tag({ :action => "save" }, { :class => "standard-form fillL" }) do %>
<!-- legale is <%= @legale %> -->
<p class="deemphasize"><%= t ".read and accept with tou" %></p>
- <label class="standard-label">
+ <h4>
<%= t ".heading_ct" %>
- </label>
- <div class='form-row horizontal-list'>
+ </h4>
+ <div class='form-row horizontal-list clearfix'>
<p class="deemphasize"><%= t ".contributor_terms_explain" %></p>
<label class="standard-label">
<%= t ".legale_select" %>
<% end %>
</div>
- <div id="contributorTerms" class="col12 legale">
+ <div id="contributorTerms" class="legale">
<%= render :partial => "terms" %>
</div>
</label>
</div>
- <label class="standard-label">
+ <h4>
<%= t "layouts.tou" %>
- </label>
+ </h4>
<p class="deemphasize"><%= t ".tou_explain_html", :tou_link => link_to(t("layouts.tou"), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %></p>
<div class="form-row">
<label for="read_tou">
<%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
- <div class="buttons form-row inner20 clearfix">
+ <div class="buttons form-row py-3 clearfix">
<%= submit_tag("Continue", :name => "continue", :id => "continue", :disabled => true) %>
<%= submit_tag("Cancel", :name => "decline", :id => "decline") %>
</div>
under the same licence. See the <a href='%{copyright_path}'>Copyright and
License page</a> for details.
legal_title: Legal
- legal_html: |
+ legal_1_html: |
This site and many other related services are formally operated by the
<a href='https://osmfoundation.org/'>OpenStreetMap Foundation</a> (OSMF)
on behalf of the community. Use of all OSMF operated services is subject
to our <a href="https://wiki.osmfoundation.org/wiki/Terms_of_Use">Terms of Use</a>, <a href="https://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy">
- Acceptable Use Policies</a> and our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a>
- <br>
+ Acceptable Use Policies</a> and our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a>.
+ legal_2_html: |
Please <a href='https://osmfoundation.org/Contact'>contact the OSMF</a>
if you have licensing, copyright or other legal questions.
<br>
end
def test_logout_without_referer
+ post :logout
+ assert_response :redirect
+ assert_redirected_to root_path
+ end
+
+ def test_logout_with_referer
+ post :logout, :params => { :referer => "/test" }
+ assert_response :redirect
+ assert_redirected_to "/test"
+ end
+
+ def test_logout_fallback_without_referer
get :logout
assert_response :success
assert_template :logout
assert_select "input[name=referer][value=?]", ""
-
- session_id = assert_select("input[name=session]").first["value"]
-
- get :logout, :params => { :session => session_id }
- assert_response :redirect
- assert_redirected_to root_path
end
- def test_logout_with_referer
+ def test_logout_fallback_with_referer
get :logout, :params => { :referer => "/test" }
assert_response :success
assert_template :logout
assert_select "input[name=referer][value=?]", "/test"
-
- session_id = assert_select("input[name=session]").first["value"]
-
- get :logout, :params => { :session => session_id, :referer => "/test" }
- assert_response :redirect
- assert_redirected_to "/test"
end
def test_logout_with_token
session[:token] = token.token
- get :logout
- assert_response :success
- assert_template :logout
- assert_select "input[name=referer][value=?]", ""
- assert_equal token.token, session[:token]
- assert_not_nil UserToken.where(:id => token.id).first
-
- session_id = assert_select("input[name=session]").first["value"]
-
- get :logout, :params => { :session => session_id }
+ post :logout
assert_response :redirect
assert_redirected_to root_path
assert_nil session[:token]
--- /dev/null
+require "application_system_test_case"
+
+class UserLogoutTest < ApplicationSystemTestCase
+ test "Sign out via link" do
+ user = create(:user)
+ sign_in_as(user)
+ assert_not page.has_content? "Log In"
+
+ click_on user.display_name
+ click_on "Log Out"
+ assert page.has_content? "Log In"
+ end
+
+ test "Sign out via link with referer" do
+ user = create(:user)
+ sign_in_as(user)
+ visit traces_path
+ assert_not page.has_content? "Log In"
+
+ click_on user.display_name
+ click_on "Log Out"
+ assert page.has_content? "Log In"
+ assert page.has_content? "Public GPS traces"
+ end
+
+ test "Sign out via fallback page" do
+ sign_in_as(create(:user))
+ assert_not page.has_content? "Log In"
+
+ visit logout_path
+ assert page.has_content? "Logout from OpenStreetMap"
+
+ click_button "Logout"
+ assert page.has_content? "Log In"
+ end
+
+ test "Sign out via fallback page with referer" do
+ sign_in_as(create(:user))
+ assert_not page.has_content? "Log In"
+
+ visit logout_path(:referer => "/traces")
+ assert page.has_content? "Logout from OpenStreetMap"
+
+ click_button "Logout"
+ assert page.has_content? "Log In"
+ assert page.has_content? "Public GPS traces"
+ end
+end