From: Tom Hughes Date: Fri, 23 Aug 2013 16:41:09 +0000 (+0100) Subject: Merge remote-tracking branch 'osmlab/id-default' X-Git-Tag: live~4792 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ae0177fbe61d7d02e3c6b441bd395fff6fd96a18?hp=8dc16bd8dbd362a0e823f8abd989d871ce5de32f Merge remote-tracking branch 'osmlab/id-default' --- diff --git a/Vendorfile b/Vendorfile index 88f999a40..c1242beb7 100644 --- a/Vendorfile +++ b/Vendorfile @@ -5,6 +5,7 @@ folder 'vendor/assets' do folder 'bootstrap' do file 'bootstrap.tooltip.js', 'https://raw.github.com/twbs/bootstrap/v2.3.2/js/bootstrap-tooltip.js' + file 'bootstrap.dropdown.js', 'https://raw.github.com/twbs/bootstrap/v2.3.2/js/bootstrap-dropdown.js' end folder 'leaflet' do diff --git a/app/assets/images/confirm-illustration.png b/app/assets/images/confirm-illustration.png new file mode 100644 index 000000000..ad673d547 Binary files /dev/null and b/app/assets/images/confirm-illustration.png differ diff --git a/app/assets/images/confirm-illustration.svg b/app/assets/images/confirm-illustration.svg new file mode 100644 index 000000000..9bb5715b8 --- /dev/null +++ b/app/assets/images/confirm-illustration.svg @@ -0,0 +1,1255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + diff --git a/app/assets/images/donate-ad.png b/app/assets/images/donate-ad.png deleted file mode 100644 index 6effbfe11..000000000 Binary files a/app/assets/images/donate-ad.png and /dev/null differ diff --git a/app/assets/images/sign-up-illustration-arm.png b/app/assets/images/sign-up-illustration-arm.png new file mode 100644 index 000000000..5f780299e Binary files /dev/null and b/app/assets/images/sign-up-illustration-arm.png differ diff --git a/app/assets/images/sign-up-illustration.png b/app/assets/images/sign-up-illustration.png new file mode 100644 index 000000000..0a92b9c5b Binary files /dev/null and b/app/assets/images/sign-up-illustration.png differ diff --git a/app/assets/images/sign-up-illustration.svg b/app/assets/images/sign-up-illustration.svg new file mode 100644 index 000000000..7f3a3338f --- /dev/null +++ b/app/assets/images/sign-up-illustration.svg @@ -0,0 +1,1359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + diff --git a/app/assets/images/sprite.svg b/app/assets/images/sprite.svg index dea2cccc1..3641c68ab 100644 --- a/app/assets/images/sprite.svg +++ b/app/assets/images/sprite.svg @@ -27,9 +27,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4142136" - inkscape:cx="82.865988" - inkscape:cy="195.08379" + inkscape:zoom="2" + inkscape:cx="141.24705" + inkscape:cy="185.81774" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -254,39 +254,8 @@ style="color:#000000;fill:#70cd8f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter6591-2);enable-background:accumulate" /> - - - - - + d="M 185 6 L 183 8 L 183 12 L 185 14 L 187 14 L 185 12 L 185 8 L 190 8 L 190 11 L 192 11 L 192 8 L 190 6 L 187 6 L 185 6 z M 192 6 L 194 8 L 194 12 L 189 12 L 189 9 L 187 9 L 187 12 L 189 14 L 194 14 L 196 12 L 196 8 L 194 6 L 192 6 z " + transform="translate(0,852.36218)" + id="path4118" /> diff --git a/app/assets/images/terms-illustration.png b/app/assets/images/terms-illustration.png new file mode 100644 index 000000000..475da0e87 Binary files /dev/null and b/app/assets/images/terms-illustration.png differ diff --git a/app/assets/images/terms-illustration.svg b/app/assets/images/terms-illustration.svg new file mode 100644 index 000000000..2bb1aaf99 --- /dev/null +++ b/app/assets/images/terms-illustration.svg @@ -0,0 +1,1620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/welcome-sprite.png b/app/assets/images/welcome-sprite.png new file mode 100644 index 000000000..969c53f96 Binary files /dev/null and b/app/assets/images/welcome-sprite.png differ diff --git a/app/assets/images/welcome-sprite.svg b/app/assets/images/welcome-sprite.svg new file mode 100644 index 000000000..0151c5ced --- /dev/null +++ b/app/assets/images/welcome-sprite.svg @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + ? + + + diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index a33e281ce..2b8bc5d26 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -4,6 +4,7 @@ //= require jquery.cookie //= require jquery.throttle-debounce //= require bootstrap.tooltip +//= require bootstrap.dropdown //= require augment //= require osm //= require leaflet @@ -16,7 +17,6 @@ //= require oauth //= require piwik //= require map -//= require menu //= require sidebar //= require richtext //= require geocoder @@ -95,26 +95,25 @@ function updatelinks(loc, zoom, layers, bounds, object) { } link.href = href; - - var minzoom = $(link).data("minzoom"); - if (minzoom) { - var name = link.id.replace(/anchor$/, ""); - $(link).off("click.minzoom"); - if (zoom >= minzoom) { - $(link) - .attr("title", I18n.t("javascripts.site." + name + "_tooltip")) - .removeClass("disabled"); - } else { - $(link) - .attr("title", I18n.t("javascripts.site." + name + "_disabled_tooltip")) - .addClass("disabled") - .on("click.minzoom", function () { - alert(I18n.t("javascripts.site." + name + "_zoom_alert")); - return false; - }); - } - } }); + + var editDisabled = zoom < 13; + $('#edit_tab') + .tooltip({placement: 'bottom'}) + .off('click.minzoom') + .on('click.minzoom', function() { return !editDisabled; }) + .toggleClass('disabled', editDisabled) + .attr('data-original-title', editDisabled ? + I18n.t('javascripts.site.edit_disabled_tooltip') : ''); + + var historyDisabled = zoom < 11; + $('#history_tab') + .tooltip({placement: 'bottom'}) + .off('click.minzoom') + .on('click.minzoom', function() { return !historyDisabled; }) + .toggleClass('disabled', historyDisabled) + .attr('data-original-title', historyDisabled ? + I18n.t('javascripts.site.history_disabled_tooltip') : ''); } // generate a cookie-safe string of map state diff --git a/app/assets/javascripts/browse.js b/app/assets/javascripts/browse.js index 5d2412183..11818a171 100644 --- a/app/assets/javascripts/browse.js +++ b/app/assets/javascripts/browse.js @@ -23,7 +23,7 @@ $(document).ready(function () { }).addTo(map); $("#loading").hide(); - $("#browse_map .geolink").show(); + $("#browse_map .secondary-actions").show(); $("a[data-editor=remote]").click(function () { return remoteEditHandler(bbox); @@ -41,7 +41,7 @@ $(document).ready(function () { bbox = map.getBounds(); $("#loading").hide(); - $("#browse_map .geolink").show(); + $("#browse_map .secondary-actions").show(); $("a[data-editor=remote]").click(function () { return remoteEditHandler(bbox); @@ -61,7 +61,7 @@ $(document).ready(function () { zoom: true, callback: function(extent) { $("#loading").hide(); - $("#browse_map .geolink").show(); + $("#browse_map .secondary-actions").show(); if (extent) { $("a.bbox[data-editor=remote]").click(function () { @@ -82,7 +82,4 @@ $(document).ready(function () { } }); } - - createMenu("area_edit", "area_edit_menu", "right"); - createMenu("object_edit", "object_edit_menu", "right"); }); diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index e46ca6d9d..2a704f724 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -158,6 +158,20 @@ $(document).ready(function () { remoteEditHandler(map.getBounds()); } + if (OSM.params().edit_help) { + $('#editanchor') + .removeAttr('title') + .tooltip({ + placement: 'bottom', + title: I18n.t('javascripts.edit_help') + }) + .tooltip('show'); + + $('body').one('click', function() { + $('#editanchor').tooltip('hide'); + }); + } + initializeSearch(map); initializeExport(map); initializeBrowse(map, params); diff --git a/app/assets/javascripts/menu.js b/app/assets/javascripts/menu.js deleted file mode 100644 index a01fc39cc..000000000 --- a/app/assets/javascripts/menu.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Open a menu. - */ -function openMenu(anchor, menu, align) { - var anchorPosition = anchor.offset(); - var offset; - - if (align == "left") { - offset = 0; - } else if (align == "right") { - offset = menu.outerWidth() - anchor.outerWidth(); - } - - menu.show(); - - menu.offset({ - top: anchorPosition.top + anchor.outerHeight(), - left: anchorPosition.left - offset - }); -} - -/* - * Setup a menu, triggered by hovering over an anchor for a given time. - */ -function createMenu(anchorid, menuid, align) { - var $anchor = $("#" + anchorid); - var $arrow = $("#" + anchorid + " .menuicon"); - var $menu = $("#" + menuid); - var $page = $(":not(#" + menuid + ", #" + anchorid + ")"); - - function hide() { - $menu.hide(); - $page.off("click", hide); - } - - $arrow.click(function(e) { - if ($anchor.is(":not(.disabled)")) { - e.stopPropagation(); - e.preventDefault(); - if ($menu.is(":visible")) { - $menu.hide(); - $page.off("click", hide); - } else { - openMenu($anchor, $menu.show(), align); - $page.on("click", hide); - } - } - }); -} diff --git a/app/assets/javascripts/welcome.js b/app/assets/javascripts/welcome.js new file mode 100644 index 000000000..56c454ac4 --- /dev/null +++ b/app/assets/javascripts/welcome.js @@ -0,0 +1,47 @@ +$(document).ready(function() { + var params = OSM.params(); + + if (params.lat && params.lon) { + params.lat = parseFloat(params.lat); + params.lon = parseFloat(params.lon); + params.zoom = params.zoom || 17; + + var url = '/edit'; + + if (params.editor) { + url += '?editor=' + params.editor; + } + + url += OSM.formatHash(params); + + $('.start-mapping').attr('href', url); + + } else if (navigator.geolocation) { + function geoSuccess(position) { + window.location = '/edit' + OSM.formatHash({ + zoom: 17, + lat: position.coords.latitude, + lon: position.coords.longitude + }); + } + + $('.start-mapping').on('click', function(e) { + e.preventDefault(); + + $('.start-mapping') + .addClass('loading'); + + // handle firefox's weird implementation + // https://bugzilla.mozilla.org/show_bug.cgi?id=675533 + window.setTimeout(manualEdit, 4000); + + navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit); + }); + } else { + manualEdit(); + } + + function manualEdit() { + window.location = '/?edit_help=1' + } +}); diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index a73c8e86d..c2f642edc 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -57,6 +57,37 @@ abbr, acronym { 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 */ * { @@ -171,6 +202,7 @@ h6:first-child { .icon.close { background-position: -200px 0; } .icon.check { background-position: -220px 0; } .icon.note { background-position: -240px 0; } +.icon.gear { background-position: -260px 0; } /* Rules for links */ @@ -441,7 +473,11 @@ a.donate { height: 30px; border-bottom: 1px solid #ccc; background: white; - z-index: 100; + z-index: 1001; + + .caret { + margin-top: 10px; + } } .site-edit #top-bar, @@ -455,49 +491,57 @@ a.donate { #tabnav { height: 29px; - margin-bottom:0; - overflow: hidden; - li { - display: inline; - } - a, a:link, a:visited { + margin-bottom: 0; + + > li { float: left; + + > * { + padding: 3px $lineheight/2; + } + } + + a.tab { + display: inline-block; font-weight: bold; - padding: 3px $lineheight/2; text-decoration: none; color: #333; - float: left; - margin-right: 1px; + -webkit-transition: color 200ms ease-in; -moz-transition: color 200ms ease-in; -o-transition: color 200ms ease-in; transition: color 200ms ease-in; + + &:hover { + text-decoration: underline; + } } -} -.site-index #tabnav a#viewanchor, -.site-edit #tabnav a#editanchor, -.changeset-list #tabnav a#historyanchor { - border-bottom: 1px solid #aaa; - background: #9ed485; - color: #000; -} + .disabled a { + color: #ccc; + cursor: default; -#tabnav a:link:hover, #tabnav a:visited:hover { - text-decoration: underline; -} + &:hover { + text-decoration: none; + } -#tabnav a:link.disabled, -#tabnav a:visited.disabled, -#tabnav a:link:hover.disabled, -#tabnav a:visited:hover.disabled { - color: #ccc; - cursor: default; - &:hover { - text-decoration: none; + .caret { + border-top-color: #ccc; + } + } + + .dropdown { + height: 29px; } } +.site-index #view_tab, +.site-edit #edit_tab, +.changeset-list #history_tab { + background: #9ed485; + color: #000; +} + /* Utility for styling notification numbers */ .count-number { @@ -513,12 +557,52 @@ a.donate { #greeting { float: right; - padding-top: 3px; - margin-right: $lineheight/4; -} + height: 100%; -.greeting-bar-unread { - font-weight: bold; + &.secondary-actions { + padding: 3px $lineheight/2; + } + + &.dropdown { + background-color: #EEE; + &:hover { + background-color: #CCC; + } + } + + img { + vertical-align: top; + border-radius: 2px 0 0 2px; + margin-right: 5px; + } + + #inboxanchor { + display: inline-block; + position: relative; + height: 20px; + top: -2px; + margin: 0 2px 0 0; + padding: 0 5px 0 0; + border-radius: 2px; + } + + .dropdown-toggle { + display: block; + padding: 3px 7px; + color: #000; + text-decoration: none; + } + + .dropdown-menu { + left: auto; + right: 0; + + .count-number { + float: right; + padding: 0 5px; + margin: 0; + } + } } /* Rules for the message shown in place of the map when javascript is disabled */ @@ -998,8 +1082,8 @@ ul.results-list li { border-bottom: 1px solid #ccc; } /* Rules for the main content area */ #content { - padding: $lineheight; position: relative; + padding: $lineheight; } .site-edit #content, @@ -1012,6 +1096,69 @@ ul.results-list li { border-bottom: 1px solid #ccc; } border-left: 1px solid #ccc; } +/* Overrides for pages that use new layout conventions */ +.user-new, +.user-create, +.user-terms, +.user-confirm, +.site-copyright, +.site-welcome { + #content { + max-width: 740px; + } +} + +.user-new, +.user-create, +.user-terms, +.user-confirm { + .content-heading { + height: 200px; + } +} + +.user-new, +.user-create, +.user-terms { + #content { + padding: 0; + } +} + +.header-illustration { + background-position: 0 0; + background-repeat: no-repeat; + position: absolute; + height: 200px; + width: 100%; + left: 0; + bottom: 0; + + &.new-user-main { + background-image: image-url("sign-up-illustration.png"); + } + + &.confirm-main { + background-image: image-url("confirm-illustration.png"); + } + + &.new-user-terms { + background-image: image-url("terms-illustration.png"); + } + + &.new-user-arm { + height: 110px; + width: 130px; + left: 260px; + top: 160px; + background-image: image-url("sign-up-illustration-arm.png"); + } +} + +@media only screen and (max-width:900px) { + .header-illustration.new-user-arm { display: none;} +} + .wrapper { margin-left: 184px; border-left: 1px solid #ccc; @@ -1067,6 +1214,7 @@ ul.results-list li { border-bottom: 1px solid #ccc; } position: relative; padding: $lineheight; background: $offwhite; + z-index: 2; h1, h2 { margin-bottom: $lineheight/2; line-height: 100%; @@ -1197,11 +1345,8 @@ ul.results-list li { border-bottom: 1px solid #ccc; } } } -#browse_map .geolink { - display: none; -} - #browse_map .secondary-actions { + display: none; margin-bottom: $lineheight/2; } @@ -1425,7 +1570,7 @@ ul.results-list li { border-bottom: 1px solid #ccc; } float: left; } -/* Rules for the login page */ +/* Rules for the log in page */ #login_openid_buttons { margin-bottom: 0; @@ -1438,7 +1583,7 @@ ul.results-list li { border-bottom: 1px solid #ccc; } /* Rules for the account confirmation page */ -#terms { +.user-terms { .legale { border: 1px solid #ccc; padding: $lineheight; @@ -1460,27 +1605,16 @@ ul.results-list li { border-bottom: 1px solid #ccc; } } } - form.sign { - input[type=submit] { - float: left; - } - #decline { - background: $grey; - &:hover { - background: darken($grey, $hovercolor); - } + #decline { + background: $lightblue; + &:hover { + background: darken($lightblue, $hovercolor); } } - fieldset { - margin-bottom: $lineheight; - } - #contributorGuidance { - background-color: $offwhite; - border-radius: 4px; - -moz-border-radius: 4px; - } - .signing-buttons { - height: 50px; + + .form-row { + margin: auto; + max-width: 370px; } } @@ -1632,7 +1766,17 @@ ul.results-list li { border-bottom: 1px solid #ccc; } .field_with_errors { padding: 2px; background-color: #ff7070; - display: table; + display: inline-block; +} + +.formError { + display: inline-block; + padding: 5px 10px; + margin-top: 5px; + border-radius: 4px; + font-size: 12px; + color: #fff; + background-color: #ff7070; } /* Rules for rails validation error boxes */ @@ -1699,6 +1843,10 @@ ul.results-list li { border-bottom: 1px solid #ccc; } padding-top: $lineheight; border-top: 1px solid $lightgrey; } + .horizontal-list .form-row { + float: left; + padding-right: 10px; + } .form-row { margin-bottom: $lineheight/2; } @@ -1793,7 +1941,7 @@ ul.secondary-actions { display: inline-block; margin-right: 60px; } - li { + > li { display: block; float: left; list-style: none; @@ -1808,6 +1956,10 @@ ul.secondary-actions { margin-right: 0px; } } + .dropdown-menu { + left: auto; + right: 0; + } } /* Utility for managing inner content areas */ @@ -1818,6 +1970,8 @@ ul.secondary-actions { .inner11 { padding: $lineheight/2;} +.inner20 { padding: $lineheight 0;} + .inner02 { padding: 0 $lineheight;} /* Utility for general button styles */ @@ -2191,3 +2345,211 @@ a.button { border: 0; background: #fff; } + +/* Rules for dropdown menus */ + +.dropdown { + position: relative; +} + +.dropdown-toggle { + *margin-bottom: -3px; +} + +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} + +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; +} + +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.dropdown-menu .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.dropdown-menu > li > a { + display: block; + padding: 3px 10px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} + +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus, +.dropdown-submenu:hover > a, +.dropdown-submenu:focus > a { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; +} + +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + outline: 0; +} + +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999999; +} + +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; +} + +.open { + *z-index: 1000; +} + +.open > .dropdown-menu { + display: block; +} + +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} + +/* Rules for the "Welcome" page */ +.site-welcome { + .center { + text-align: center; + .sprite { + float: none; + margin: auto; + } + } + + .sprite { + background-image: image-url("welcome-sprite.png"); + background-size: 500px 250px; + display: block; + float: left; + } + + .icon-list { + padding-bottom: 20px; + div { + margin-bottom: 10px; + p { + padding-top: 10px; + } + } + } + .sprite.small { + width: 50px; + height: 50px; + } + + .sprite.x { + background-position: -50px 0; + } + + .sprite.term { + margin-right: 10px; + vertical-align: middle; + } + + .sprite.node { + background-position: -100px 0; + } + + .sprite.way { + background-position: -150px 0; + } + + .sprite.tag { + background-position: -200px 0; + } + + .sprite.editor { + background-position: -250px 0; + } + + .sprite.question { + background-position: -300px 0; + } + + .start-mapping { + margin: auto; + cursor: pointer; + border: none; + padding: 20px 40px; + font-size: 30px; + text-decoration: none; + } + + .note-box { + margin-top: 20px; + background-color: $offwhite; + } + + .icon.note { + background-color: #333; + border-radius: 4px; + } +} diff --git a/app/assets/stylesheets/print.css b/app/assets/stylesheets/print.css index a74bc27fd..84efa0e2e 100644 --- a/app/assets/stylesheets/print.css +++ b/app/assets/stylesheets/print.css @@ -4,7 +4,6 @@ #tabnav, #sidebar, #permalink, -#editmenu, .leaflet-control { display: none; } diff --git a/app/assets/stylesheets/small.css.scss b/app/assets/stylesheets/small.css.scss index 5e21ce186..419abeac4 100644 --- a/app/assets/stylesheets/small.css.scss +++ b/app/assets/stylesheets/small.css.scss @@ -84,13 +84,6 @@ h2, h3, h4 { /* Rules for greeting bar in the top right corner */ -#greeting { - position: absolute; - right: 0; - top: 0; - background: none; -} - #browse_map ul.secondary-actions { float: right; font-size: 10px; @@ -172,32 +165,6 @@ p.search_results_entry { } } -/* Rules for the signup form */ - -#signupForm input[type="text"], #signupForm input[type="password"] { - width: 100%; -} - -#signupForm input#user_email { - max-width: 30em; -} - -#signupForm input#user_email_confirmation { - max-width: 30em; -} - -#signupForm input#user_display_name { - max-width: 20em; -} - -#signupForm input#user_pass_crypt { - max-width: 20em; -} - -#signupForm input#user_pass_crypt_confirmation { - max-width: 20em; -} - /* Rules for the login form */ #login_login input#user_email { @@ -281,3 +248,16 @@ p.search_results_entry { #message_title, #message_body { width: 100% !important; } + +/* Rules for the sign-up page */ + +.user-new, +.user-create { + .col6 { + width: 100%; + } + + .aside { + display: none; + } +} diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 69ce8f8b1..94cc64754 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -4,27 +4,11 @@ class SiteController < ApplicationController before_filter :authorize_web before_filter :set_locale - before_filter :require_user, :only => [:edit] + before_filter :redirect_map_params, :only => [:index, :edit, :export] + before_filter :require_user, :only => [:edit, :welcome] before_filter :require_oauth, :only => [:index] def index - anchor = [] - - if params[:lat] && params[:lon] - anchor << "map=#{params.delete(:zoom) || 5}/#{params.delete(:lat)}/#{params.delete(:lon)}" - end - - if params[:layers] - anchor << "layers=#{params.delete(:layers)}" - elsif params.delete(:notes) == 'yes' - anchor << "layers=N" - end - - if anchor.present? - redirect_to params.merge(:anchor => anchor.join('&')) - return - end - unless STATUS == :database_readonly or STATUS == :database_offline session[:location] ||= OSM::IPLocation(request.env['REMOTE_ADDR']) end @@ -80,6 +64,9 @@ class SiteController < ApplicationController @locale = params[:copyright_locale] || I18n.locale end + def welcome + end + def preview render :text => RichText.new(params[:format], params[:text]).to_html end @@ -87,4 +74,24 @@ class SiteController < ApplicationController def id render "id", :layout => false end + + private + + def redirect_map_params + anchor = [] + + if params[:lat] && params[:lon] + anchor << "map=#{params.delete(:zoom) || 5}/#{params.delete(:lat)}/#{params.delete(:lon)}" + end + + if params[:layers] + anchor << "layers=#{params.delete(:layers)}" + elsif params.delete(:notes) == 'yes' + anchor << "layers=N" + end + + if anchor.present? + redirect_to params.merge(:anchor => anchor.join('&')) + end + end end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 57d2f7d13..c3cd9fcf2 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -88,19 +88,27 @@ class UserController < ApplicationController if @user.save flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL) - if @user.status == "active" - flash[:notice] = t 'user.new.flash welcome', :email => @user.email + referer = welcome_path - Notifier.signup_confirm(@user, nil).deliver + begin + uri = URI(session[:referer]) + /map=(.*)\/(.*)\/(.*)/.match(uri.fragment) do |m| + editor = Rack::Utils.parse_query(uri.query).slice('editor') + referer = welcome_path({'zoom' => m[1], + 'lat' => m[2], + 'lon' => m[3]}.merge(editor)) + end + rescue + # Use default + end + if @user.status == "active" + session[:referer] = referer successful_login(@user) else - flash[:notice] = t 'user.new.flash create success message', :email => @user.email session[:token] = @user.tokens.create.token - - Notifier.signup_confirm(@user, @user.tokens.create(:referer => session.delete(:referer))).deliver - - redirect_to :action => 'login', :referer => params[:referer] + Notifier.signup_confirm(@user, @user.tokens.create(:referer => referer)).deliver + redirect_to :action => 'confirm', :display_name => @user.display_name end else render :action => 'new', :referer => params[:referer] @@ -304,55 +312,44 @@ class UserController < ApplicationController def confirm if request.post? - if token = UserToken.find_by_token(params[:confirm_string]) - if token.user.active? - flash[:error] = t('user.confirm.already active') - redirect_to :action => 'login' - else - user = token.user - user.status = "active" - user.email_valid = true - user.save! - referer = token.referer - token.destroy - - if session[:token] - token = UserToken.find_by_token(session[:token]) - session.delete(:token) - else - token = nil - end - - if token.nil? or token.user != user - flash[:notice] = t('user.confirm.success') - redirect_to :action => :login, :referer => referer - else - token.destroy - - session[:user] = user.id - cookies.permanent["_osm_username"] = user.display_name - - if referer.nil? - flash[:notice] = t('user.confirm.success') + "

" + t('user.confirm.before you start') - redirect_to :action => :account, :display_name => user.display_name - else - flash[:notice] = t('user.confirm.success') - redirect_to referer - end - end - end + token = UserToken.find_by_token(params[:confirm_string]) + if token && token.user.active? + flash[:error] = t('user.confirm.already active') + redirect_to :action => 'login' + elsif !token || token.expired? + flash[:error] = t('user.confirm.unknown token') + redirect_to :action => 'confirm' else - user = User.find_by_display_name(params[:display_name]) + user = token.user + user.status = "active" + user.email_valid = true + user.save! + referer = token.referer + token.destroy - if user and user.active? - flash[:error] = t('user.confirm.already active') - elsif user - flash[:error] = t('user.confirm.unknown token') + t('user.confirm.reconfirm', :reconfirm => url_for(:action => 'confirm_resend', :display_name => params[:display_name])) + if session[:token] + token = UserToken.find_by_token(session[:token]) + session.delete(:token) else - flash[:error] = t('user.confirm.unknown token') + token = nil end - redirect_to :action => 'login' + if token.nil? or token.user != user + flash[:notice] = t('user.confirm.success') + redirect_to :action => :login, :referer => referer + else + token.destroy + + session[:user] = user.id + cookies.permanent["_osm_username"] = user.display_name + + redirect_to referer || welcome_path + end + end + else + user = User.find_by_display_name(params[:display_name]) + if !user || user.active? + redirect_to root_path end end end @@ -518,7 +515,7 @@ private if user = User.authenticate(:username => username, :password => password) successful_login(user) elsif user = User.authenticate(:username => username, :password => password, :pending => true) - failed_login t('user.login.account not active', :reconfirm => url_for(:action => 'confirm_resend', :display_name => user.display_name)) + unconfirmed_login(user) elsif User.authenticate(:username => username, :password => password, :suspended => true) failed_login t('user.login.account is suspended', :webmaster => "mailto:webmaster@openstreetmap.org") else @@ -549,7 +546,7 @@ private if user = User.find_by_openid_url(identity_url) case user.status when "pending" then - failed_login t('user.login.account not active', :reconfirm => url_for(:action => 'confirm_resend', :display_name => user.display_name)) + unconfirmed_login(user) when "active", "confirmed" then successful_login(user) when "suspended" then @@ -680,6 +677,15 @@ private session.delete(:referer) end + ## + # + def unconfirmed_login(user) + redirect_to :action => 'confirm', :display_name => user.display_name + + session.delete(:remember_me) + session.delete(:referer) + end + ## # update a user's details def update_user(user, params) diff --git a/app/models/notifier.rb b/app/models/notifier.rb index a50922214..be6679c41 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -6,18 +6,10 @@ class Notifier < ActionMailer::Base def signup_confirm(user, token) with_recipient_locale user do - # If we are passed an email address verification token, create - # the confirumation URL for account activation. - # - # Otherwise the email has already been verified e.g. through - # a trusted openID provider and the account is active and a - # confirmation URL is not needed. - if token - @url = url_for(:host => SERVER_URL, - :controller => "user", :action => "confirm", - :display_name => user.display_name, - :confirm_string => token.token) - end + @url = url_for(:host => SERVER_URL, + :controller => "user", :action => "confirm", + :display_name => user.display_name, + :confirm_string => token.token) mail :to => user.email, :subject => I18n.t('notifier.signup_confirm.subject') diff --git a/app/models/user_token.rb b/app/models/user_token.rb index 9a754d344..3060b33ea 100644 --- a/app/models/user_token.rb +++ b/app/models/user_token.rb @@ -5,6 +5,10 @@ class UserToken < ActiveRecord::Base after_initialize :set_defaults + def expired? + expiry < Time.now + end + private def set_defaults diff --git a/app/views/browse/_map.html.erb b/app/views/browse/_map.html.erb index 9b82753fb..ed703665d 100644 --- a/app/views/browse/_map.html.erb +++ b/app/views/browse/_map.html.erb @@ -35,28 +35,26 @@ <%= content_tag "div", "", :id => "small_map", :data => data %> <%= t 'browse.map.loading' %> -
    -
  • - <% if map.instance_of? Note -%> - <%= link_to t("browse.map.larger.area"), - root_path(:notes => "yes"), - :id => "area_larger_map", - :class => "geolink bbox" %> - <% else -%> - <%= link_to t("browse.map.larger.area"), - root_path(:box => "yes"), - :id => "area_larger_map", - :class => "geolink bbox" %> - <% end -%> -
  • -
  • - <%= link_to h(t("browse.map.edit.area")) + content_tag(:span, "▼", :class => "menuicon"), - edit_path, - :id => "area_edit", - :data => { :editor => preferred_editor }, - :class => "geolink bbox" %> -
  • -
+
    +
  • + <% if map.instance_of? Note -%> + <%= link_to t("browse.map.larger.area"), + root_path(:notes => "yes"), + :id => "area_larger_map", + :class => "geolink bbox" %> + <% else -%> + <%= link_to t("browse.map.larger.area"), + root_path(:box => "yes"), + :id => "area_larger_map", + :class => "geolink bbox" %> + <% end -%> +
  • +
  • + <%= render :partial => 'layouts/edit_menu', + :locals => { :link_text => t("browse.map.edit.area"), + :link_class => 'bbox' } %> +
  • +
<% unless map.instance_of? Changeset %>
    @@ -67,11 +65,9 @@ :class => "geolink object" %>
  • - <%= link_to h(t("browse.map.edit." + map.class.to_s.downcase)) + content_tag(:span, "▼", :class => "menuicon"), - edit_path, - :id => "object_edit", - :data => { :editor => preferred_editor }, - :class => "geolink object" %> + <%= render :partial => 'layouts/edit_menu', + :locals => { :link_text => t("browse.map.edit." + map.class.to_s.downcase), + :link_class => 'object' } %>
<% end %> @@ -80,25 +76,3 @@ <%= t 'browse.map.deleted' %> <% end %> - - - - diff --git a/app/views/layouts/_edit_menu.html.erb b/app/views/layouts/_edit_menu.html.erb new file mode 100644 index 000000000..78c5dbb65 --- /dev/null +++ b/app/views/layouts/_edit_menu.html.erb @@ -0,0 +1,18 @@ + diff --git a/app/views/layouts/_inbox.html.erb b/app/views/layouts/_inbox.html.erb index fcaa5ae64..d4054dfaf 100644 --- a/app/views/layouts/_inbox.html.erb +++ b/app/views/layouts/_inbox.html.erb @@ -1,13 +1,3 @@ -<%= - link_to( - t("layouts.inbox_html", - :count => @user.new_messages.size > 0 ? - content_tag( - :span, @user.new_messages.size, :class => "count-number" - ) : - "" - ), - inbox_path(:display_name => @user.display_name), - :id => "inboxanchor" - ) -%> + + <%= user_thumbnail_tiny(@user, :size => 20, :width => 20, :height => 20) %><%= @user.new_messages.size %> + \ No newline at end of file diff --git a/app/views/layouts/_user_menu.html.erb b/app/views/layouts/_user_menu.html.erb new file mode 100644 index 000000000..ab7d955da --- /dev/null +++ b/app/views/layouts/_user_menu.html.erb @@ -0,0 +1,28 @@ + diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index a0e894e46..12b5b82c5 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -74,10 +74,7 @@
<%= ad = [{:image => 'sotm-birmingham-ad.png', :title => 'State of the Map Birmingham', - :href =>'http://stateofthemap.org/'}, - {:image => 'donate-ad.png', - :title => 'Server Donation Drive', - :href =>'http://donate.openstreetmap.org/'}].sample + :href =>'http://stateofthemap.org/'}].sample link_to ad[:href], :title => ad[:title] do image_tag ad[:image], :class => :ad @@ -99,53 +96,25 @@
-
    - <% if @user and @user.id %> -
  • <%=link_to h(@user.display_name), user_path(:display_name => @user.display_name), :title => t('layouts.welcome_user_link_tooltip') %>
  • -
  • <%= yield :greeting %>
  • -
  • <%= render :partial => "layouts/inbox" %>
  • -
  • <%= link_to t('layouts.logout'), logout_path(:session => request.session_options[:id], :referer => request.fullpath), {:id => 'logoutanchor', :title => t('layouts.logout_tooltip')}%>
  • - <% else %> -
  • <%= link_to t('layouts.log_in'), login_path(:referer => request.fullpath), {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %>
  • -
  • <%= link_to t('layouts.sign_up'), user_new_path, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %>
  • - <% end %> -
+ <% if @user and @user.id %> + <%= render :partial => "layouts/user_menu" %> + <% else %> +
    +
  • <%= link_to t('layouts.log_in'), login_path(:referer => request.fullpath), {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %>
  • +
  • <%= link_to t('layouts.sign_up'), user_new_path, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %>
  • +
+ <% end %>
    -
  • <%= link_to t('layouts.view'), root_path, { - :id => 'viewanchor', - :title => t('layouts.view_tooltip'), - :class => 'geolink llz layers' - } %>
  • -
  • <%= link_to h(t('layouts.edit')) + content_tag(:span, "▼", :class => "menuicon"), edit_path, { - :id => 'editanchor', - :title => t('javascripts.site.edit_tooltip'), - :data => { :minzoom => 13, :editor => preferred_editor }, - :class => 'geolink llz object disabled' - } %>
  • -
  • <%= link_to t('layouts.history'), browse_changesets_path, { - :id => 'historyanchor', - :data => { :minzoom => 11 }, - :title => t('javascripts.site.history_tooltip'), - :class => 'geolink bbox' - } %>
  • -
-
- -
<%= render :partial => "layouts/flash", :locals => { :flash => flash } %> <% if content_for? :heading %> diff --git a/app/views/notifier/signup_confirm.html.erb b/app/views/notifier/signup_confirm.html.erb index 0c154c968..814deee91 100644 --- a/app/views/notifier/signup_confirm.html.erb +++ b/app/views/notifier/signup_confirm.html.erb @@ -2,23 +2,8 @@

<%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %>

-<% if @url -%>

<%= t("notifier.signup_confirm.confirm") %>

<%= link_to @url, @url %>

-<% end -%>

<%= t("notifier.signup_confirm.welcome") %>

- -

<%= raw(t("notifier.signup_confirm_html.introductory_video", :introductory_video_link => link_to(t('notifier.signup_confirm_html.video_to_openstreetmap'), "http://showmedo.com/videos/video?name=1800000&fromSeriesID=180"))) %> - <%= raw(t("notifier.signup_confirm_html.more_videos", :more_videos_link => link_to(t('notifier.signup_confirm_html.more_videos_here'), "http://showmedo.com/videos/series?name=mS2P1ZqS6"))) %>

- -

<%= raw(t("notifier.signup_confirm_html.get_reading")) %>

- -

<%= raw(t("notifier.signup_confirm_html.ask_questions")) %>

- -

<%= raw(t("notifier.signup_confirm_html.wiki_signup")) %>

- -

<%= raw(t("notifier.signup_confirm_html.user_wiki_page")) %>

- -

<%= raw(t("notifier.signup_confirm_html.current_user")) %>

diff --git a/app/views/notifier/signup_confirm.text.erb b/app/views/notifier/signup_confirm.text.erb index e52396462..aee44782d 100644 --- a/app/views/notifier/signup_confirm.text.erb +++ b/app/views/notifier/signup_confirm.text.erb @@ -2,41 +2,8 @@ <%= fp(t("notifier.signup_confirm.created", :site_url => SERVER_URL)) %> -<% if @url -%> <%= fp(t("notifier.signup_confirm.confirm")) %> <%= @url %> -<% end -%> <%= fp(t("notifier.signup_confirm.welcome")) %> - -<%= fp(t("notifier.signup_confirm_plain.introductory_video")) %> - - http://showmedo.com/videos/video?name=1800000&fromSeriesID=180 - -<%= fp(t("notifier.signup_confirm_plain.more_videos")) %> - - http://showmedo.com/videos/series?name=mS2P1ZqS6 - -<%= fp(t("notifier.signup_confirm_plain.the_wiki")) %> - - <%= t("notifier.signup_confirm_plain.the_wiki_url") %> - -<%= fp(t("notifier.signup_confirm_plain.blog_and_twitter")) %> - - http://blog.openstreetmap.org/ - http://twitter.com/openstreetmap - -<%= fp(t("notifier.signup_confirm_plain.ask_questions")) %> - - http://help.openstreetmap.org/ - -<%= fp(t("notifier.signup_confirm_plain.wiki_signup")) %> - - <%= t("notifier.signup_confirm_plain.wiki_signup_url") %> - -<%= fp(t("notifier.signup_confirm_plain.user_wiki_page")) %> - -<%= fp(t("notifier.signup_confirm_plain.current_user")) %> - - http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region diff --git a/app/views/site/_home_link.html.erb b/app/views/site/_home_link.html.erb index 979ae7681..e907b3fb1 100644 --- a/app/views/site/_home_link.html.erb +++ b/app/views/site/_home_link.html.erb @@ -6,7 +6,6 @@ :class => "set_position", :data => { :lat => @user.home_lat, :lon => @user.home_lon, - :zoom => 15 }, - :title => t("layouts.home_tooltip") %> + :zoom => 15 } %> <% end %> <% end %> diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb new file mode 100644 index 000000000..da775e339 --- /dev/null +++ b/app/views/site/welcome.html.erb @@ -0,0 +1,67 @@ +<% content_for :head do %> + <%= javascript_include_tag "welcome" %> +<% end %> + +<% content_for :heading do %> +

<%= t "welcome_page.title" %>

+<% end %> + +

<%= t "welcome_page.introduction_html" %>

+ +

<%= t "welcome_page.whats_on_the_map.title" %>

+ +
+
+
+ +
+

<%= t "welcome_page.whats_on_the_map.on_html" %>

+
+
+
+ +
+

<%= t "welcome_page.whats_on_the_map.off_html" %>

+
+
+ +

<%= t "welcome_page.basic_terms.title" %>

+ +

<%= t "welcome_page.basic_terms.paragraph_1_html" %>

+ +
+
+ +

<%= t "welcome_page.basic_terms.editor_html" %>

+
+
+ +

<%= t "welcome_page.basic_terms.node_html" %>

+
+
+ +

<%= t "welcome_page.basic_terms.way_html" %>

+
+
+ +

<%= t "welcome_page.basic_terms.tag_html" %>

+
+
+ +
+

<%= t "welcome_page.questions.title" %>

+ +

<%= t "welcome_page.questions.paragraph_1_html" %>

+
+ + + +
+
+

<%= t "welcome_page.add_a_note.title" %>

+

<%= t "welcome_page.add_a_note.paragraph_1_html" %>

+

<%= t "welcome_page.add_a_note.paragraph_2_html", :map_url => root_path %>

+
+
\ No newline at end of file diff --git a/app/views/user/account.html.erb b/app/views/user/account.html.erb index a0979d5ae..0a2f056c2 100644 --- a/app/views/user/account.html.erb +++ b/app/views/user/account.html.erb @@ -7,7 +7,7 @@ <% end %> <%= error_messages_for 'user' %> -<%= form_for :user, :html => { :multipart => true, :id => 'accountForm',:class => 'standard-form' } do |f| %> +<%= form_for :user, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
@@ -24,7 +24,7 @@
- <%= f.email_field :new_email %> + <%= f.email_field :new_email, :autocomplete => :off %> <%= t 'user.account.email never displayed publicly' %>
diff --git a/app/views/user/api_read.builder b/app/views/user/api_read.builder index 71bf29208..e97695420 100644 --- a/app/views/user/api_read.builder +++ b/app/views/user/api_read.builder @@ -41,6 +41,11 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do @this_user.languages.split(",") { |lang| xml.tag! "lang", lang } end end + xml.tag! "messages" do + xml.tag! "received", :count => @this_user.messages.size, + :unread => @this_user.new_messages.size + xml.tag! "sent", :count => @this_user.sent_messages.size + end end end end diff --git a/app/views/user/confirm.html.erb b/app/views/user/confirm.html.erb index 3b68ddd5b..31f29eb64 100644 --- a/app/views/user/confirm.html.erb +++ b/app/views/user/confirm.html.erb @@ -1,19 +1,32 @@ - - <% content_for :heading do %> -

<%= t 'user.confirm.heading' %>

+

<%= t 'user.confirm.heading' %>

+
<% end %> -

<%= t 'user.confirm.press confirm button' %>

+<% if params[:confirm_string] %> + -<%= form_tag({}, { :id => "confirm" }) do %> - - - -<% end %> +

<%= t 'user.confirm.press confirm button' %>

+ + <%= form_tag({}, { :id => "confirm" }) do %> + + + + <% end %> - + +<% else %> +

+ <%= t "user.confirm.introduction_1" %> + + <%= t "user.confirm.introduction_2" %> + +

+ +

<%= t "user.confirm.reconfirm_html", + :reconfirm => url_for(:action => 'confirm_resend')%>

+<% end %> diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index 7324ddd29..d1772f996 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -1,102 +1,100 @@ <% content_for :heading do %> -

<%= t 'user.new.heading' %>

+

<%= t 'user.new.title' %>

+
+
<% end %> -

<%= t 'user.new.fill_form' %>

- -<%= error_messages_for 'user' %> - -<%= form_for :user, :url => { :action => 'create' } do %> +<%= form_for :user, :url => { :action => 'create' }, :html => { :class => 'standard-form fillL col6 inner22' } do %> <%= hidden_field_tag('referer', h(@referer)) unless @referer.nil? %> -
- -
-
- - <%= email_field(:user, :email, { :tabindex => 1 }) %> -
-
- - <%= email_field(:user, :email_confirmation, { :tabindex => 2 }) %> -
+
+
+ + <%= email_field(:user, :email, { :tabindex => 1 }) %> + <%= error_message_on(:user, :email) %> +
+
+ + <%= email_field(:user, :email_confirmation, { :tabindex => 2 }) %> + <%= error_message_on(:user, :email_confirmation) %> +
<%= raw(t 'user.new.not displayed publicly') %> -
- -
-
- - <%= text_field(:user, :display_name, { :tabindex => 3 }) %> -
- <%= t 'user.new.display name description' %> -
- -
-
- - <%= url_field(:user, :openid_url, { :id => "openid_url", :tabindex => 4, :class => "openid_url" }) %> -
- - <%= t 'user.new.openid no password' %> - -
- -
-
- - <%= password_field(:user, :pass_crypt, {:tabindex => 5 }) %> -
-
- - <%= password_field(:user, :pass_crypt_confirmation, { :tabindex => 6 }) %> -
-
- -
- <%= link_to raw(t("user.new.use openid", :logo => openid_logo)), "#", :id => "openid_enable" %> +
+ +
+
+ + <%= text_field(:user, :display_name, { :tabindex => 3 }) %> + <%= error_message_on(:user, :display_name) %>
+ <%= t 'user.new.display name description' %> +
+ +
+
+ + <%= url_field(:user, :openid_url, { :id => "openid_url", :tabindex => 4, :class => "openid_url" }) %> + <%= error_message_on(:user, :openid_url) %> +
+ <%= t 'user.new.openid no password' %> +
+ +
+
+ + <%= password_field(:user, :pass_crypt, {:tabindex => 5 }) %> + <%= error_message_on(:user, :pass_crypt) %> +
+
+ + <%= password_field(:user, :pass_crypt_confirmation, { :tabindex => 6 }) %> + <%= error_message_on(:user, :pass_crypt_confirmation) %> +
+
- <%= submit_tag t('user.new.continue'), :tabindex => 6 %> +
+ <%= link_to raw(t("user.new.use openid", :logo => openid_logo)), "#", :id => "openid_enable" %>
+ + <%= submit_tag t('user.new.continue'), :tabindex => 6 %> <% end %> +
+

<%= t 'user.new.about.header' %>

+ <%= t 'user.new.about.html' %> +
+ - <% end %> - +
<% end %> -
-
+
+ +
<%= render :partial => "terms" %>
- - <%= form_tag({:action => "save"}, { :class => "sign" }) do %> -

- + +

+ + (<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>) + <%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> -
+ +
+

<%= t 'user.terms.read and accept' %>

<%= submit_tag(t('user.terms.agree'), :name => "agree", :id => "agree") %> <%= submit_tag(t('user.terms.decline'), :name => "decline", :id => "decline") %>
-

<%= raw t 'user.terms.guidance', :summary => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary', :translations => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %>

- <% end %> - + +
+

+ <%= raw t 'user.terms.guidance', + :summary => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary', + :translations => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %> +

+
+
+<% end %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 6486be003..824c11573 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -56,7 +56,7 @@ OpenStreetMap::Application.configure do # config.action_controller.asset_host = "http://assets.example.com" # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - config.assets.precompile += %w( index.js edit.js browse.js changeset.js ) + config.assets.precompile += %w( index.js edit.js browse.js changeset.js welcome.js ) config.assets.precompile += %w( user.js diary_entry.js pngfix.js swfobject.js ) config.assets.precompile += %w( large-ltr.css small-ltr.css print-ltr.css ) config.assets.precompile += %w( large-rtl.css small-rtl.css print-rtl.css ) diff --git a/config/locales/da.yml b/config/locales/da.yml index 760acd0f0..89d49473e 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1090,6 +1090,50 @@ da: native_link: den danske udgave text: Du kigger på den engelske udgave af ophavsretsiden. Du kan gå tilbage til %{native_link} af denne side eller du kan holde op med at læse om ophavsret og %{mapping_link}. title: Om denne side + welcome_page: + title: Welcome! + introduction_html: | + Velkommen til OpenStreetMap, det frie brugerredigerede verdenskort. Nu hvor du er oprettet som + bruger er du klar til tilføje og ændre kortinformationer. Her er en guide med de vigtigste + informationer til at komme hurtigt i gang. + whats_on_the_map: + title: Hvad kortet indholder + on_html: | + OpenStreetMap indeholder elementer, der konkret og aktuelt findes - + f.eks. millioner af bygninger, veje og andre detaljer om steder. Du kan kortlægge + enhver detalje fra den virkelige verden som du interesserer dig for. + off_html: | + Kortet indeholder ikke subjektive informationer (f.eks. anmeldelser), ting + der ikke længere eksisterer, fiktive ting og ophavsretsligt beskyttede data fra andre + kort. Kopier aldrig nogen som helst information fra andre online- eller papirkort + med mindre der forelægger en særlig tilladelse. + basic_terms: + title: Grundlæggende begreber + paragraph_1_html: | + Her er nogen få begreber som er nyttige at forstå for at bidrage til OpenStreetMap. + editor_html: | + En editor er et program eller en hjemmeside der kan bruges til at editere kortet. + node_html: | + En node er et punkt på kortet, f.eks. en enkelt restaurant eller et træ. + way_html: | + En way er en linje eller et areal, f.eks. en vej, en å eller en bygning. + tag_html: | + Et tag er en lille bid information om en node eller en way, f.eks. navnet på en restaurant eller + hastighedsbegrænsningen på en vej. + questions: + title: Spørgsmål? + paragraph_1_html: | + Behøver du hjælp til at kortlægge eller er du usikker på hvordan OpenStreetMap bruges? Få svar på dine spørgsmål på + OpenStreetMaps hjælpeside. + start_mapping: Editér kortet + add_a_note: + title: Har du ikke tid til at kortlægge selv? Tilføj en note! + paragraph_1_html: | + Hvis du bare vil have en lille detalje rettet, men ikke har tid til at gøre det selv, så kan du tilføje en note. + paragraph_2_html: | + Bare gå ind på kortet og klik på note-ikonet: + . Dette vil tilføje et symbol som du kan trække rundt på kortet. Tilføj din besked, + klik på gem og lad andre brugere undersøge sagen. message: delete: deleted: Besked slettet diff --git a/config/locales/de.yml b/config/locales/de.yml index 896cacedd..58293fe61 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1206,6 +1206,49 @@ de: opened: neuer Fehler (in der Nähe von %{place}) reopened: reaktivierter Fehler (in der Nähe von %{place}) title: OpenStreetMap-Fehler + welcome_page: + title: Willkommen! + introduction_html: | + Willkommen zu OpenStreetMap, der weltweiten frei und editierbaren Karte. Jetzt wo Du registriert bist, ist alles so weit das Du anfangen kannst zu editieren. + Hier sind noch eine paar zusaetzliche Informationen zu den wichtigsten Dingen um erfolgreich zu editieren. + whats_on_the_map: + title: Was gehoert in die Karte? + on_html: | + OpenStreetMap ist eine Datenbank in der man alles erfassen kann was derzeit real existiert. - + Dies beinhalten sowohl Strassen, Gebaeude und Plaetze mit ihren Informationen als auch z.B. Geschaefte, Briefkaesten oder Hydranten. + Eigentlich eben alles was man so dauerhaft in der Umgebung finden kann und einem interessiert. + off_html: | + Was nicht in die Datenbank gehoert sind subjektive Daten wie Bewertungen, nicht mehr aktuelle + historische Fakten oder nicht real existierende Dinge. Ausserdem ist es wichtig nichts von + anderen Quellen zu kopieren, da OpenStreetMap Copyright sehr ernst nimmt. + basic_terms: + title: Grundbegriffe fuers Mapping + paragraph_1_html: | + OpenStreetMap hat ein paar eigene Begrifflichkeiten. Hier sind ein paar davon die nuetzlich sein duerften. + editor_html: | + Ein Editor ist ein Programm oder eine Webseite mit der man die Karte editieren kann. + node_html: | + Ein Knoten ist ein Punkt auf der Karte, z.B. ein Restaurant oder ein Baum. + way_html: | + Ein OSM Weg ist eine Linie oder Flaeche wie z.B. eine Strasse, Weg, Fluss oder Gebaeude. + tag_html: | + Ein tag ist eine Eigenschaft die man einem Objekt zuweist. Z.B. der Name eines Restaurant + oder die maximale Geschwindigkeit einer Strasse. + questions: + title: Fragen? + paragraph_1_html: | + Falls Du zusaetzliche Hilfe beim Mapping brauchst oder etwas nicht klar ist, gibt es zusaetzliche + Hilfe auf the Hilfe Seite. + start_mapping: Beginne mit dem Mapping + add_a_note: + title: Keine Zeit zum editieren? Dann melde einfach einen Fehler! + paragraph_1_html: | + Es ist sehr einfach eine Notiz fuer andere Mapper zu schreiben die diese dann mit der Zeit abarbeiten koennen, + falls man selbst nicht die Zeit hat sich einzuarbeiten und dies zu erledigen. + paragraph_2_html: | + Gehe einfach auf die Karte und klicke das Sprechblasen Icon: + . Dies fuegt einen Marker auf der Karte hinzu welchen man zu der Problemstelle ziehen kann. + Die Notiz sollte so genau wie moeglich sein, damit ein anderer Mapper die Erklaerung dann verwenden kann um den Fehler zu beheben. notifier: diary_comment_notification: footer: Hier gehts zum Eintrag %{readurl}, du kannst ihn kommentieren %{commenturl} oder direkt beantworten %{replyurl}. @@ -1769,6 +1812,12 @@ de: confirm email address: "Bestätige deine E-Mail-Adresse:" confirm password: "Passwort bestätigen:" contact_webmaster: Bitte kontaktiere den Webmaster um ein Benutzerkonto erstellt zu bekommen - wir werden die Anfrage so schnell wie möglich bearbeiten. + about: + header: Frei und editierbar + html: | +

Im Gegensatz zu anderen Karten, OpenStreetMap is vollstaendig von Leuten wie Dir erstellt. + Jeder kann sie verbessern, aktualisieren und erweitern, sowie fuer jeden Zweck verwenden.

+

Melde Dich an und beginne mitzuwirken. Wir werden Dir eine email schicken um diese zu bestaetigen.

continue: Weiter display name: "Benutzername:" display name description: Dein öffentlich angezeigter Benutzername. Er kann später in den Einstellungen geändert werden. diff --git a/config/locales/en.yml b/config/locales/en.yml index 3722498d0..a1e26baeb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -659,6 +659,7 @@ en: monument: "Monument" museum: "Museum" ruins: "Ruins" + tomb: "Tomb" tower: "Tower" wayside_cross: "Wayside Cross" wayside_shrine: "Wayside Shrine" @@ -995,16 +996,8 @@ en: h1: OpenStreetMap logo: alt_text: OpenStreetMap logo - welcome_user_link_tooltip: Your user page - home: home - home_tooltip: Go to home location - inbox_html: "inbox %{count}" - inbox_tooltip: - zero: Your inbox contains no unread messages - one: Your inbox contains 1 unread message - other: Your inbox contains %{count} unread messages - logout: logout - logout_tooltip: "Log out" + home: Go to Home Location + logout: Logout log_in: log in log_in_tooltip: Log in with an existing account sign_up: sign up @@ -1170,6 +1163,50 @@ en: to our takedown procedure or file directly at our on-line filing page. + welcome_page: + title: Welcome! + introduction_html: | + Welcome to OpenStreetMap, the free and editable map of the world. Now that you're signed + up, you're all set to get started mapping. Here's a quick guide with the most important + things you need to know. + whats_on_the_map: + title: What's on the Map + on_html: | + OpenStreetMap is a place for mapping things that are both real and current - + it includes millions of buildings, roads, and other details about places. You can map + whatever real-world features are interesting to you. + off_html: | + What it doesn't include is opinionated data like ratings, historical or + hypothetical features, and data from copyrighted sources. Unless you have special + permission, don't copy from online or paper maps. + basic_terms: + title: Basic Terms For Mapping + paragraph_1_html: | + OpenStreetMap has some of its own lingo. Here are a few key words that'll come in handy. + editor_html: | + An editor is a program or website you can use to edit the map. + node_html: | + A node is a point on the map, like a single restauraunt or a tree. + way_html: | + A way is a line or area, like a road, stream, lake or building. + tag_html: | + A tag is a bit of data about a node or way, like a + restaurant's name or a road's speed limit. + questions: + title: Any questions? + paragraph_1_html: | + Need help mapping, or not clear on how to use OpenStreetMap? Get your questions answered + on the help website. + start_mapping: Start Mapping + add_a_note: + title: No Time To Edit? Add a Note! + paragraph_1_html: | + If you just want something small fixed and don't have the time to sign up and learn how to edit, it's + easy to add a note. + paragraph_2_html: | + Just go to the map and click the note icon: + . This will add a marker to the map, which you can move + by dragging. Add your message, then click save, and other mappers will investigate. notifier: diary_comment_notification: subject: "[OpenStreetMap] %{user} commented on your diary entry" @@ -1206,28 +1243,7 @@ en: greeting: "Hi there!" created: "Someone (hopefully you) just created an account at %{site_url}." confirm: "Before we do anything else, we need to confirm that this request came from you, so if it did then please click the link below to confirm your account:" - welcome: "We would like to welcome you and provide you with some additional information to get you started." - signup_confirm_plain: - introductory_video: "You can watch an introductory video to OpenStreetMap here:" - more_videos: "There are more videos here:" - the_wiki: "Get reading about OpenStreetMap on the wiki:" - the_wiki_url: "http://wiki.openstreetmap.org/wiki/Beginners%27_guide" - blog_and_twitter: "Catch up with the latest news via the OpenStreetMap blog or Twitter:" - ask_questions: "You can ask any questions you may have about OpenStreetMap at our question and answer site:" - wiki_signup: "You may also want to sign up to the OpenStreetMap wiki at:" - wiki_signup_url: "http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page" - user_wiki_page: "It is recommended that you create a user wiki page, which includes category tags noting where you are, such as [[Category:Users_in_London]]." - current_user: "A list of current users in categories, based on where in the world they are, is available from:" - signup_confirm_html: - introductory_video: "You can watch an %{introductory_video_link}." - video_to_openstreetmap: "introductory video to OpenStreetMap" - more_videos: "There are %{more_videos_link}." - more_videos_here: "more videos here" - get_reading: Get reading about OpenStreetMap on the wiki, and catch up with the latest news via the OpenStreetMap blog or Twitter. - ask_questions: You can ask any questions you may have about OpenStreetMap at our question and answer site. - wiki_signup: 'You may also want to sign up to the OpenStreetMap wiki.' - user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as [[Category:Users_in_London]].' - current_user: 'A list of current users in categories, based on where in the world they are, is available from Category:Users_by_geographical_region.' + welcome: "After you confirm your account, we'll provide you with some additional information to get you started." email_confirm: subject: "[OpenStreetMap] Confirm your email address" email_confirm_plain: @@ -1270,7 +1286,7 @@ en: message: inbox: title: "Inbox" - my_inbox: "My inbox" + my_inbox: "My Inbox" outbox: "outbox" messages: "You have %{new_messages} and %{old_messages}" new_messages: @@ -1697,11 +1713,15 @@ en: flash changed: "Your password has been changed." flash token bad: "Did not find that token, check the URL maybe?" new: - title: "Create account" - heading: "Create a User Account" + title: "Sign Up" no_auto_account_create: "Unfortunately we are not currently able to create an account for you automatically." contact_webmaster: 'Please contact the webmaster to arrange for an account to be created - we will try and deal with the request as quickly as possible.' - fill_form: "Fill in the form and we will send you a quick email to activate your account." + about: + header: Free and editable + html: | +

Unlike other maps, OpenStreetMap is completely created by people like you, + and it's free for anyone to fix, update, download and use.

+

Sign up to get started contributing. We'll send an email to confirm your account.

license_agreement: 'When you confirm your account you will need to agree to the contributor terms.' email address: "Email Address:" confirm email address: "Confirm Email Address:" @@ -1723,16 +1743,14 @@ en: with your OpenID in your user settings. - continue: Continue - flash welcome: "Thanks for signing up. We've sent a welcome message to %{email} with some hints on getting started." - flash create success message: "Thanks for signing up. We've sent a confirmation note to %{email} and as soon as you confirm your account you'll be able to get mapping.

If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests." + continue: Sign Up terms accepted: "Thanks for accepting the new contributor terms!" terms declined: "We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see this wiki page." terms declined url: http://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined terms: title: "Contributor terms" heading: "Contributor terms" - read and accept: "Please read the agreement below and press the agree button to confirm that you accept the terms of this agreement for your existing and future contributions." + read and accept: "Please read the agreement and press the agree button to confirm that you accept the terms of this agreement for your existing and future contributions." consider_pd: "In addition to the above agreement, I consider my contributions to be in the Public Domain" consider_pd_why: "what's this?" consider_pd_why_url: http://www.osmfoundation.org/wiki/License/Why_would_I_want_my_contributions_to_be_public_domain @@ -1741,7 +1759,7 @@ en: declined: "http://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined" decline: "Decline" you need to accept or decline: "Please read and then either accept or decline the new Contributor Terms to continue." - legale_select: "Please select your country of residence:" + legale_select: "Country of residence:" legale_names: france: "France" italy: "Italy" @@ -1751,23 +1769,24 @@ en: heading: "The user %{user} does not exist" body: "Sorry, there is no user with the name %{user}. Please check your spelling, or maybe the link you clicked is wrong." view: - my diary: my diary + my diary: My Diary new diary entry: new diary entry - my edits: my edits - my traces: my traces - my notes: my map notes - my settings: my settings - my comments: my comments + my edits: My Edits + my traces: My Traces + my notes: My Notes + my profile: My Profile + my settings: My Settings + my comments: My Comments oauth settings: oauth settings - blocks on me: blocks on me - blocks by me: blocks by me - send message: send message - diary: diary - edits: edits - traces: traces - notes: map notes - remove as friend: unfriend - add as friend: add friend + blocks on me: Blocks on Me + blocks by me: Blocks by Me + send message: Send Message + diary: Diary + edits: Edits + traces: Traces + notes: Map Notes + remove as friend: Unfriend + add as friend: Add Friend mapper since: "Mapper since:" ago: "(%{time_in_words_ago} ago)" ct status: "Contributor terms:" @@ -1800,7 +1819,7 @@ en: moderator: "Revoke moderator access" block_history: "blocks received" moderator_history: "blocks given" - comments: "comments" + comments: "Comments" create_block: "block this user" activate_user: "activate this user" deactivate_user: "deactivate this user" @@ -1869,14 +1888,16 @@ en: flash update success confirm needed: "User information updated successfully. Check your email for a note to confirm your new email address." flash update success: "User information updated successfully." confirm: - heading: Confirm a user account + heading: Check your email! + introduction_1: | + We sent you a confirmation email. + introduction_2: | + Confirm your account by clicking on the link in the email and you'll be able to start mapping. press confirm button: "Press the confirm button below to activate your account." button: Confirm - success: "Confirmed your account, thanks for signing up!" - before you start: "We know you're probably in a hurry to start mapping, but before you do you might like to fill in some more information about yourself in the form below." already active: "This account has already been confirmed." - unknown token: "That token doesn't seem to exist." - reconfirm: "If it's been a while since you signed up you might need to send yourself a new confirmation email." + unknown token: "That confirmation code has expired or does not exist." + reconfirm_html: "If you need us to resend the confirmation email, click here." confirm_resend: success: "We've sent a new confirmation note to %{email} and as soon as you confirm your account you'll be able to get mapping.

If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests." failure: "User %{name} not found." @@ -2112,13 +2133,10 @@ en: site: edit_tooltip: Edit the map edit_disabled_tooltip: Zoom in to edit the map - edit_zoom_alert: You must zoom in to edit the map history_tooltip: View edits for this area history_disabled_tooltip: Zoom in to view edits for this area - history_zoom_alert: You must zoom in to view edits for this area createnote_tooltip: Add a note to the map createnote_disabled_tooltip: Zoom in to add a note to the map - createnote_zoom_alert: You must zoom in to add a note to the map notes: new: intro: "In order to improve the map the information you enter is shown to other mappers, so please be as descriptive and precise as possible when moving the marker to the correct position and entering your note below." @@ -2139,6 +2157,7 @@ en: reactivate: Reactivate comment_and_resolve: Comment & Resolve comment: Comment + edit_help: Move the map and zoom in on a location you want to edit, then click here. redaction: edit: description: "Description" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5484dc1c3..99c4d795f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1207,6 +1207,54 @@ fr: opened: nouvelle note (près de %{place}) reopened: note réactivée (près de %{place}) title: Notes OpenStreetMap + welcome_page: + title: Bienvenue ! + introduction_html: | + Bienvenue à OpenStreetMap, la carte du monde libre et éditable. Maintenant que vous + êtes enregistré, vous avez tout ce qu'il faut pour commencer à cartographier. Ce qui + suit est un petit guide des choses les plus importantes à savoir. + whats_on_the_map: + title: Ce qu'il y a sur la carte + on_html: | + OpenStreetMap sert à cartographier des choses à la fois réelles et actuelles + - il inclut des millions de bâtiments, de routes, et d'autres détails de lieux. Vous + pouvez cartographier n'importe quel élément du monde réel qui vous intéresse. + off_html: | + Ce qui est par contre exclu sont les données subjectives comme les cotes de + popularité, les éléments historiques ou hypothétiques, et les données venant de source + copyrightée. À moins d'avoir une permission spéciale, ne copiez pas à partir d'une + carte papier ou en ligne. + basic_terms: + title: Vocabulaire de base de cartographie + paragraph_1_html: | + OpenStreetMap a son propre jargon. Voici quelques mots clefs qui vous seront utiles. + editor_html: | + Un éditeur est un programme ou site web qui vous permet d'éditer la carte. + node_html: | + Un nœud est un point sur la carte, comme un restaurant ou un arbre individuel. + way_html: | + Un chemintag est une information à propos d'un nœud ou d'un chemin, comme + le nom d'un restaurant ou la vitesse limite d'une rue. + questions: + title: Des questions ? + paragraph_1_html: | + Besoin d'aide pour cartographier, ou pas sûr de comment utilise OpenStreetMap ? + Obtenez les réponses à vos questions sur + le site d'aide. + start_mapping: Commencer à cartographier + add_a_note: + title: Pas le temps d'éditer ? Ajoutez une note ! + paragraph_1_html: | + Si vous voulez juste faire une petite correction et n'avez pas le temps de vous + enregistrer et d'apprendre à éditer, il est facile d'ajouter une note. + paragraph_2_html: | + Allez simplement sur la carte et cliquez sur l'icône note: + . Cela ajoutera un marqueur sur la carte, que vous + pouvez déplacer en faisant glisser la carte. Ajoutez votre message puis cliquez sur + "ajouter une note", et d'autres contributeurs iront regarder. notifier: diary_comment_notification: footer: Vous pouvez également lire le commentaire sur %{readurl}, commenter sur %{commenturl} ou répondre sur %{replyurl} diff --git a/config/routes.rb b/config/routes.rb index bc473a4b0..0168b6190 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -122,9 +122,10 @@ OpenStreetMap::Application.routes.draw do # web site root :to => 'site#index', :via => [:get, :post] - match '/edit' => 'site#edit', :via => :get + match '/edit' => 'site#edit', :via => :get, :as => :edit match '/copyright/:copyright_locale' => 'site#copyright', :via => :get match '/copyright' => 'site#copyright', :via => :get + match '/welcome' => 'site#welcome', :via => :get, :as => :welcome match '/history' => 'changeset#list', :via => :get match '/history/feed' => 'changeset#feed', :via => :get, :format => :atom match '/export' => 'site#index', :export => true, :via => :get diff --git a/test/functional/site_controller_test.rb b/test/functional/site_controller_test.rb index 770f3e2b5..8885fae28 100644 --- a/test/functional/site_controller_test.rb +++ b/test/functional/site_controller_test.rb @@ -34,6 +34,10 @@ class SiteControllerTest < ActionController::TestCase { :path => "/copyright/locale", :method => :get }, { :controller => "site", :action => "copyright", :copyright_locale => "locale" } ) + assert_routing( + { :path => "/welcome", :method => :get }, + { :controller => "site", :action => "welcome" } + ) assert_routing( { :path => "/export", :method => :get }, { :controller => "site", :action => "index", :export => true } @@ -90,6 +94,17 @@ class SiteControllerTest < ActionController::TestCase assert_redirected_to :controller => :site, :action => 'index', :anchor => 'map=3/4/5&layers=T' end + def test_edit_redirect + get :edit, :lat => 4, :lon => 5 + assert_redirected_to :controller => :site, :action => 'edit', :anchor => 'map=5/4/5' + + get :edit, :lat => 4, :lon => 5, :zoom => 3 + assert_redirected_to :controller => :site, :action => 'edit', :anchor => 'map=3/4/5' + + get :edit, :lat => 4, :lon => 5, :zoom => 3, :editor => 'id' + assert_redirected_to :controller => :site, :action => 'edit', :editor => 'id', :anchor => 'map=3/4/5' + end + def test_permalink get :permalink, :code => 'wBz3--' assert_redirected_to :controller => :site, :action => 'index', :anchor => 'map=3/4.8779296875/3.955078125' diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb index 61286b284..6a64fd8d8 100644 --- a/test/functional/user_controller_test.rb +++ b/test/functional/user_controller_test.rb @@ -199,7 +199,7 @@ class UserControllerTest < ActionController::TestCase assert_select "html", :count => 1 do assert_select "head", :count => 1 do - assert_select "title", :text => /Create account/, :count => 1 + assert_select "title", :text => /Sign Up/, :count => 1 end assert_select "body", :count => 1 do assert_select "div#content", :count => 1 do @@ -209,118 +209,137 @@ class UserControllerTest < ActionController::TestCase assert_select "input[id=user_display_name]", :count => 1 assert_select "input[id=user_pass_crypt][type=password]", :count => 1 assert_select "input[id=user_pass_crypt_confirmation][type=password]", :count => 1 - assert_select "input[type=submit][value=Continue]", :count => 1 + assert_select "input[type=submit][value=Sign Up]", :count => 1 end end end end end - + + def new_user + user = User.new + user.status = "pending" + user.display_name = "new_tester" + user.email = "newtester@osm.org" + user.email_confirmation = "newtester@osm.org" + user.pass_crypt = "testtest" + user.pass_crypt_confirmation = "testtest" + user + end + def test_user_create_success - new_email = "newtester@osm.org" - display_name = "new_tester" + user = new_user + assert_difference('User.count') do assert_difference('ActionMailer::Base.deliveries.size') do - session[:new_user] = User.new({ - :status => "pending", :display_name => display_name, - :email => new_email, :email_confirmation => new_email, - :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" - }, :without_protection => true) - - post :save + post :save, {}, {:new_user => user} end end - + # Check the e-mail register_email = ActionMailer::Base.deliveries.first - - assert_equal register_email.to[0], new_email + + assert_equal register_email.to[0], user.email assert_match /#{@url}/, register_email.body.to_s # Check the page - assert_redirected_to :action => 'login', :referer => nil - + assert_redirected_to :action => 'confirm', :display_name => user.display_name + ActionMailer::Base.deliveries.clear end - + def test_user_create_submit_duplicate_email - email = users(:public_user).email - display_name = "new_tester" - assert_difference('User.count', 0) do - assert_difference('ActionMailer::Base.deliveries.size', 0) do - session[:new_user] = User.new({ - :status => "pending", :display_name => display_name, - :email => email, :email_confirmation => email, - :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" - }, :without_protection => true) - - post :save + user = new_user + user.email = users(:public_user).email + + assert_no_difference('User.count') do + assert_no_difference('ActionMailer::Base.deliveries.size') do + post :save, {}, {:new_user => user} end end - assert_response :success + + assert_response :success assert_template 'new' - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_email" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_email" end - + def test_user_create_submit_duplicate_email_uppercase - email = users(:public_user).email.upcase - display_name = "new_tester" - assert_difference('User.count', 0) do - assert_difference('ActionMailer::Base.deliveries.size', 0) do - session[:new_user] = User.new({ - :status => "pending", :display_name => display_name, - :email => email, :email_confirmation => email, - :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" - }, :without_protection => true) - - post :save + user = new_user + user.email = users(:public_user).email.upcase + + assert_no_difference('User.count') do + assert_no_difference('ActionMailer::Base.deliveries.size') do + post :save, {}, {:new_user => user} end end - assert_response :success + + assert_response :success assert_template 'new' - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_email" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_email" end def test_user_create_submit_duplicate_name - email = "new_tester@example.com" - display_name = users(:public_user).display_name - assert_difference('User.count', 0) do - assert_difference('ActionMailer::Base.deliveries.size', 0) do - session[:new_user] = User.new({ - :status => "pending", :display_name => display_name, - :email => email, :email_confirmation => email, - :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" - }, :without_protection => true) - - post :save + user = new_user + user.display_name = users(:public_user).display_name + + assert_no_difference('User.count') do + assert_no_difference('ActionMailer::Base.deliveries.size') do + post :save, {}, {:new_user => user} end end - assert_response :success + + assert_response :success assert_template 'new' - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_display_name" end def test_user_create_submit_duplicate_name_uppercase - email = "new_tester@example.com" - display_name = users(:public_user).display_name.upcase - assert_difference('User.count', 0) do - assert_difference('ActionMailer::Base.deliveries.size', 0) do - session[:new_user] = User.new({ - :status => "pending", :display_name => display_name, - :email => email, :email_confirmation => email, - :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" - }, :without_protection => true) - - post :save + user = new_user + user.display_name = users(:public_user).display_name.upcase + + assert_no_difference('User.count') do + assert_no_difference('ActionMailer::Base.deliveries.size') do + post :save, {}, {:new_user => user} end end - assert_response :success + + assert_response :success assert_template 'new' - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_display_name" + end + + def test_user_save_referer_params + user = new_user + + post :save, {}, {:new_user => user, + :referer => '/edit?editor=id#map=1/2/3'} + + assert_equal welcome_path(:editor => 'id', :zoom => 1, :lat => 2, :lon => 3), + user.tokens.order("id DESC").first.referer + end + + def test_user_confirm_expired_token + user = users(:inactive_user) + token = user.tokens.new + token.expiry = 1.day.ago + token.save! + + @request.cookies["_osm_session"] = user.display_name + post :confirm, :confirm_string => token.token + + assert_redirected_to :action => 'confirm' + assert_match /expired/, flash[:error] + end + + def test_user_already_confirmed + user = users(:normal_user) + token = user.tokens.create + + @request.cookies["_osm_session"] = user.display_name + post :confirm, :confirm_string => token.token + + assert_redirected_to :action => 'login' + assert_match /confirmed/, flash[:error] end def test_user_terms_new_user @@ -582,10 +601,33 @@ class UserControllerTest < ActionController::TestCase get :api_read, :id => users(:normal_user).id assert_response :success + # check the data that is returned + assert_select "description", :count => 1, :text => "test" + assert_select "contributor-terms", :count => 1 do + assert_select "[agreed=true]" + end + assert_select "img", :count => 1 + assert_select "roles", :count => 1 do + assert_select "role", :count => 0 + end + assert_select "changesets", :count => 1 do + assert_select "[count=0]" + end + assert_select "traces", :count => 1 do + assert_select "[count=0]" + end + assert_select "blocks", :count => 1 do + assert_select "received", :count => 1 do + assert_select "[count=0][active=0]" + end + assert_select "issued", :count => 0 + end + # check that we aren't revealing private information assert_select "contributor-terms[pd]", false assert_select "home", false assert_select "languages", false + assert_select "messages", false # check that a suspended user is not returned get :api_read, :id => users(:suspended_user).id @@ -601,12 +643,50 @@ class UserControllerTest < ActionController::TestCase end def test_user_api_details + # check that nothing is returned when not logged in get :api_details assert_response :unauthorized + # check that we get a response when logged in basic_authorization(users(:normal_user).email, "test") get :api_details assert_response :success + + # check the data that is returned + assert_select "description", :count => 1, :text => "test" + assert_select "contributor-terms", :count => 1 do + assert_select "[agreed=true][pd=false]" + end + assert_select "img", :count => 1 + assert_select "roles", :count => 1 do + assert_select "role", :count => 0 + end + assert_select "changesets", :count => 1 do + assert_select "[count=0]", :count => 1 + end + assert_select "traces", :count => 1 do + assert_select "[count=0]", :count => 1 + end + assert_select "blocks", :count => 1 do + assert_select "received", :count => 1 do + assert_select "[count=0][active=0]" + end + assert_select "issued", :count => 0 + end + assert_select "home", :count => 1 do + assert_select "[lat=12.1][lon=12.1][zoom=3]" + end + assert_select "languages", :count => 1 do + assert_select "lang", :count => 1, :text => "en" + end + assert_select "messages", :count => 1 do + assert_select "received", :count => 1 do + assert_select "[count=1][unread=0]" + end + assert_select "sent", :count => 1 do + assert_select "[count=1]" + end + end end def test_user_make_friend diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index c565afd1e..76397ae28 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -29,8 +29,7 @@ class UserCreationTest < ActionController::IntegrationTest assert_response :success assert_template 'user/new' assert_equal response.headers['Content-Language'][0..1], localer.to_s[0..1] unless localer == :root - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_email" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_email" assert_no_missing_translations end end @@ -48,8 +47,7 @@ class UserCreationTest < ActionController::IntegrationTest end assert_response :success assert_template 'user/new' - assert_select "div#errorExplanation" - assert_select "div#signupForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name" + assert_select "form > fieldset > div.form-row > div.field_with_errors > input#user_display_name" assert_no_missing_translations end end @@ -84,7 +82,7 @@ class UserCreationTest < ActionController::IntegrationTest # Check the page assert_response :success - assert_template 'login' + assert_template 'user/confirm' ActionMailer::Base.deliveries.clear end @@ -128,22 +126,20 @@ class UserCreationTest < ActionController::IntegrationTest # Check the page assert_response :success - assert_template 'login' + assert_template 'user/confirm' ActionMailer::Base.deliveries.clear # Go to the confirmation page - get 'user/confirm', { :confirm_string => confirm_string } + get "/user/#{display_name}/confirm", { :confirm_string => confirm_string } assert_response :success assert_template 'user/confirm' - post 'user/confirm', { :confirm_string => confirm_string, :confirm_action => 'submit' } - assert_response :redirect # to trace/mine in original referrer - follow_redirect! - assert_response :redirect # but it not redirects to /user//traces + post "user/#{display_name}/confirm", { :confirm_string => confirm_string } + assert_response :redirect follow_redirect! assert_response :success - assert_template 'trace/list' + assert_template 'site/welcome' end def test_user_create_openid_success @@ -167,7 +163,7 @@ class UserCreationTest < ActionController::IntegrationTest # Check the page assert_response :success - assert_template 'login' + assert_template 'user/confirm' ActionMailer::Base.deliveries.clear end @@ -223,21 +219,19 @@ class UserCreationTest < ActionController::IntegrationTest # Check the page assert_response :success - assert_template 'login' + assert_template 'user/confirm' ActionMailer::Base.deliveries.clear # Go to the confirmation page - get 'user/confirm', { :confirm_string => confirm_string } + get "/user/#{display_name}/confirm", { :confirm_string => confirm_string } assert_response :success assert_template 'user/confirm' - post 'user/confirm', { :confirm_string => confirm_string, :confirm_action => 'submit' } - assert_response :redirect # to trace/mine in original referrer - follow_redirect! - assert_response :redirect # but it not redirects to /user//traces + post "/user/#{display_name}/confirm", { :confirm_string => confirm_string } + assert_response :redirect follow_redirect! assert_response :success - assert_template "trace/list" + assert_template 'site/welcome' end end diff --git a/vendor/assets/bootstrap/bootstrap.dropdown.js b/vendor/assets/bootstrap/bootstrap.dropdown.js new file mode 100644 index 000000000..d04da5d7b --- /dev/null +++ b/vendor/assets/bootstrap/bootstrap.dropdown.js @@ -0,0 +1,169 @@ +/* ============================================================ + * bootstrap-dropdown.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#dropdowns + * ============================================================ + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement) { + // if mobile we we use a backdrop because click events don't delegate + $('