Merge remote-tracking branch 'osmlab/welcome-2'

This commit is contained in:
Tom Hughes 2013-08-18 14:50:36 +01:00
commit 56fd5c4d90
33 changed files with 5400 additions and 461 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 63 KiB

View file

@ -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" />
<path
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 183,864.36218 0,-4 2,-2 2,0 -2,2 0,4 2,2 -2,0 z"
id="path4118"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
id="path4120"
d="m 196,864.36218 0,-4 -2,-2 -2,0 2,2 0,4 -1,2 1,0 z"
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 185,858.36218 5,0 0,2 -5,0 z"
id="rect4122"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 194,866.36218 -5,0 0,-2 5,0 z"
id="rect4126"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 190,858.36218 2,2 0,3 -2,0 z"
id="path4130"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path4132"
d="m 189,866.36218 -2,-2 0,-3 2,0 z"
style="color:#000000;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;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" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

View file

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1000"
height="500"
id="svg2"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="welcome-sprite.svg"
inkscape:export-filename="/Users/saman/work_repos/openstreetmap-website/app/assets/images/welcome-sprite.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="424.69193"
inkscape:cy="435.3413"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1369"
inkscape:window-height="1036"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-bbox="true"
inkscape:snap-nodes="true"
inkscape:object-paths="true"
inkscape:object-nodes="true">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
<sodipodi:guide
orientation="1,0"
position="100,530"
id="guide11961" />
<sodipodi:guide
orientation="1,0"
position="200,540"
id="guide11963" />
<sodipodi:guide
orientation="1,0"
position="300,550"
id="guide11977" />
<sodipodi:guide
orientation="1,0"
position="400,600"
id="guide11979" />
<sodipodi:guide
orientation="1,0"
position="500,580"
id="guide11981" />
<sodipodi:guide
orientation="1,0"
position="600,500"
id="guide11983" />
<sodipodi:guide
orientation="1,0"
position="700,500"
id="guide11985" />
<sodipodi:guide
orientation="-0.79335322,-0.60876159"
position="575.00001,439.99998"
id="guide12971" />
<sodipodi:guide
orientation="0,1"
position="420,400"
id="guide3038" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-552.36218)">
<g
id="g11955"
transform="translate(0,-3)" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/Users/saman/work_repos/osm-redesign/renders/share-1.png"
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
id="path6918-2"
d="m -153,412.86218 0,-2.00001 10,-3.99999 2,10e-6 0,1.99998 -4,10 -2,1e-5 0,-6 z"
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" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#70cd8f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2987"
sodipodi:cx="42.5"
sodipodi:cy="42.5"
sodipodi:rx="42.5"
sodipodi:ry="42.5"
d="m 85,42.5 a 42.5,42.5 0 1 1 -85,0 42.5,42.5 0 1 1 85,0 z"
transform="matrix(1.0588235,0,0,1.0588235,5,557.36218)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#cd7070;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2987-7"
sodipodi:cx="42.5"
sodipodi:cy="42.5"
sodipodi:rx="42.5"
sodipodi:ry="42.5"
d="m 85,42.5 a 42.5,42.5 0 1 1 -85,0 42.5,42.5 0 1 1 85,0 z"
transform="matrix(1.0588235,0,0,1.0588235,105,557.36218)" />
<path
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 135,582.36218 -2,0 -3,3 0,2 15,15 -15,15 0,2 3,3 2,0 15,-15 15,15 2,0 3,-3 0,-2 -15,-15 15,-15 0,-2 -3,-3 -2,0 -15,15 z"
id="rect3761-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2987-7-7-1"
sodipodi:cx="42.5"
sodipodi:cy="42.5"
sodipodi:rx="42.5"
sodipodi:ry="42.5"
d="m 85,42.5 a 42.5,42.5 0 1 1 -85,0 42.5,42.5 0 1 1 85,0 z"
transform="matrix(0.3529412,0,0,0.3529412,235,587.36218)" />
<path
style="opacity:0.5;color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.05882347;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 519.72811,582.91357 19.83383,-15.21904 40.43807,49.66766 -19.83383,15.21904 z"
id="rect4144"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 510.59669,571.01327 19.83383,-15.21904 6.08761,7.93353 -19.83383,15.21904 z"
id="rect4174"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 563.20997,636.54797 19.83384,-15.21903 1.19788,17.98791 -3.96676,3.04381 z"
id="path4182"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2987-7-7-2"
sodipodi:cx="42.5"
sodipodi:cy="42.5"
sodipodi:rx="42.5"
sodipodi:ry="42.5"
d="m 85,42.5 a 42.5,42.5 0 1 1 -85,0 42.5,42.5 0 1 1 85,0 z"
transform="matrix(1.0588235,0,0,1.0588235,605,557.36218)" />
<path
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 425.00002,639.36218 -20.00002,-20 0,-29 20.00003,-20.00001 67.99997,10e-6 2,2 0,65 -1.99998,2 z"
id="rect11998"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
inkscape:connector-curvature="0"
d="m 379.30233,557.36218 c -8.6696,0 -15.69768,7.02808 -15.69768,15.69767 0,1.58143 0.28446,3.07359 0.71948,4.51309 l -39.11337,39.11337 c -1.4395,-0.43502 -2.93166,-0.71948 -4.51309,-0.71948 -8.66959,0 -15.69767,7.02808 -15.69767,15.69768 0,8.66959 7.02808,15.69767 15.69767,15.69767 8.6696,0 15.69768,-7.02808 15.69768,-15.69767 0,-1.58143 -0.28446,-3.07359 -0.71948,-4.51309 l 39.11337,-39.11337 c 1.4395,0.43502 2.93166,0.71948 4.51309,0.71948 8.66959,0 15.69767,-7.02808 15.69767,-15.69768 0,-8.66959 -7.02808,-15.69767 -15.69767,-15.69767 z m 0,9.4186 c 3.46782,0 6.27907,2.81125 6.27907,6.27907 0,3.46783 -2.81125,6.27907 -6.27907,6.27907 -3.46783,0 -6.27907,-2.81124 -6.27907,-6.27907 0,-3.46782 2.81124,-6.27907 6.27907,-6.27907 z m -58.60466,58.60466 c 3.46783,0 6.27907,2.81124 6.27907,6.27907 0,3.46782 -2.81124,6.27907 -6.27907,6.27907 -3.46782,0 -6.27907,-2.81125 -6.27907,-6.27907 0,-3.46783 2.81125,-6.27907 6.27907,-6.27907 z"
id="path5387-6-5"
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
d="m 250,557.36218 c -20.7105,0 -37.5,16.78935 -37.5,37.5 0,20.71072 37.5,52.5 37.5,52.5 0,0 37.5,-31.78928 37.5,-52.5 0,-20.71065 -16.7895,-37.5 -37.5,-37.5 z m 1.1715,22.5 c 8.2845,0 15,6.71572 15,15 0,8.28427 -6.7155,15 -15,15 -8.28375,0 -15,-6.71573 -15,-15 0,-8.28428 6.71625,-15 15,-15 z"
id="path8139-4-6-3-5"
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccccccccccc"
inkscape:connector-curvature="0"
id="path12963"
d="m 31,598.36218 -2,0 -3,3 0,2 14,14 5,5 5,-5 25,-25 0,-2 -3,-3 -2,0 -25,25 z"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<g
id="g12979">
<path
transform="matrix(1.0666649,0,0,1.0666649,-20.332779,546.02902)"
d="m 335,80 a 15,15 0 1 1 -30,0 15,15 0 1 1 30,0 z"
sodipodi:ry="15"
sodipodi:rx="15"
sodipodi:cy="80"
sodipodi:cx="320"
id="path12975"
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:16;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:16;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path12977"
sodipodi:cx="320"
sodipodi:cy="80"
sodipodi:rx="15"
sodipodi:ry="15"
d="m 335,80 a 15,15 0 1 1 -30,0 15,15 0 1 1 30,0 z"
transform="matrix(0.46666693,0,0,0.46666693,171.66658,594.02886)" />
</g>
<path
transform="matrix(1.0588235,0,0,1.0588235,605,557.36218)"
d="m 85,42.5 a 42.5,42.5 0 1 1 -85,0 42.5,42.5 0 1 1 85,0 z"
sodipodi:ry="42.5"
sodipodi:rx="42.5"
sodipodi:cy="42.5"
sodipodi:cx="42.5"
id="path16825"
style="color:#000000;fill:#7092ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<text
xml:space="preserve"
style="font-size:60px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:0px;word-spacing:0px;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Helvetica Neue;-inkscape-font-specification:Helvetica Neue Bold"
x="633.32001"
y="624.29218"
id="text16827"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan16829"
x="633.32001"
y="624.29218">?</tspan></text>
<rect
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3053"
width="10"
height="15.000005"
x="415"
y="597.36218"
rx="3"
ry="2.2500007" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -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);

View file

@ -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'
}
});

View file

@ -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 */
* {
@ -998,8 +1029,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 +1043,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 +1161,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%;
@ -1425,7 +1520,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 +1533,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 +1555,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 +1716,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 +1793,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;
}
@ -1818,6 +1916,8 @@ ul.secondary-actions {
.inner11 { padding: $lineheight/2;}
.inner20 { padding: $lineheight 0;}
.inner02 { padding: 0 $lineheight;}
/* Utility for general button styles */
@ -2191,3 +2291,83 @@ a.button {
border: 0;
background: #fff;
}
/* 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;
}
}

View file

@ -172,32 +172,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 +255,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;
}
}

View file

@ -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

View file

@ -88,19 +88,27 @@ class UserController < ApplicationController
if @user.save
flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL)
referer = welcome_path
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"
flash[:notice] = t 'user.new.flash welcome', :email => @user.email
Notifier.signup_confirm(@user, nil).deliver
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'
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 = 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
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
session[:user] = user.id
cookies.permanent["_osm_username"] = user.display_name
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') + "<br /><br />" + 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
redirect_to referer || welcome_path
end
else
user = User.find_by_display_name(params[:display_name])
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]))
else
flash[:error] = t('user.confirm.unknown token')
end
redirect_to :action => 'login'
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)

View file

@ -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')

View file

@ -5,6 +5,10 @@ class UserToken < ActiveRecord::Base
after_initialize :set_defaults
def expired?
expiry < Time.now
end
private
def set_defaults

View file

@ -2,23 +2,8 @@
<p><%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %></p>
<% if @url -%>
<p><%= t("notifier.signup_confirm.confirm") %></p>
<p><%= link_to @url, @url %></p>
<% end -%>
<p><%= t("notifier.signup_confirm.welcome") %></p>
<p><%= 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"))) %></p>
<p><%= raw(t("notifier.signup_confirm_html.get_reading")) %></p>
<p><%= raw(t("notifier.signup_confirm_html.ask_questions")) %></p>
<p><%= raw(t("notifier.signup_confirm_html.wiki_signup")) %></p>
<p><%= raw(t("notifier.signup_confirm_html.user_wiki_page")) %></p>
<p><%= raw(t("notifier.signup_confirm_html.current_user")) %></p>

View file

@ -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

View file

@ -0,0 +1,67 @@
<% content_for :head do %>
<%= javascript_include_tag "welcome" %>
<% end %>
<% content_for :heading do %>
<h2><%= t "welcome_page.title" %></h2>
<% end %>
<p><%= t "welcome_page.introduction_html" %></p>
<h3><%= t "welcome_page.whats_on_the_map.title" %></h3>
<div class=' clearfix'>
<div class='col6 inner11'>
<div class='center clearfix inner11'>
<span class='sprite small check'></span>
</div>
<p><%= t "welcome_page.whats_on_the_map.on_html" %></p>
</div>
<div class='col6 inner11'>
<div class='center clearfix inner11'>
<span class='sprite small x'></span>
</div>
<p><%= t "welcome_page.whats_on_the_map.off_html" %></p>
</div>
</div>
<h3><%= t "welcome_page.basic_terms.title" %></h3>
<p><%= t "welcome_page.basic_terms.paragraph_1_html" %></p>
<div class='col12 clearfix icon-list'>
<div class='clearfix'>
<span class='sprite small term editor'></span>
<p><%= t "welcome_page.basic_terms.editor_html" %></p>
</div>
<div class='clearfix'>
<span class='sprite small term node'></span>
<p><%= t "welcome_page.basic_terms.node_html" %></p>
</div>
<div class='clearfix'>
<span class='sprite small term way'></span>
<p><%= t "welcome_page.basic_terms.way_html" %></p>
</div>
<div class='clearfix'>
<span class='sprite small term tag'></span>
<p><%= t "welcome_page.basic_terms.tag_html" %></p>
</div>
</div>
<div class='col12 clearfix icon-list'>
<h3><%= t "welcome_page.questions.title" %></h3>
<span class='sprite small term question'></span>
<p><%= t "welcome_page.questions.paragraph_1_html" %></p>
</div>
<div class='clearfix center'>
<a href="<%= edit_path %>" class="button start-mapping"><%= t "welcome_page.start_mapping" %></a>
</div>
<div class='note-box'>
<div class='inner22'>
<h3><%= t "welcome_page.add_a_note.title" %></h3>
<p><%= t "welcome_page.add_a_note.paragraph_1_html" %></p>
<p><%= t "welcome_page.add_a_note.paragraph_2_html", :map_url => root_path %></p>
</div>
</div>

View file

@ -1,19 +1,32 @@
<script>
$("#content").hide();
</script>
<% content_for :heading do %>
<h1><%= t 'user.confirm.heading' %></h1>
<h2><%= t 'user.confirm.heading' %></h2>
<div class='header-illustration confirm-main'></div>
<% end %>
<p><%= t 'user.confirm.press confirm button' %></p>
<% if params[:confirm_string] %>
<script>
$("#content").hide();
</script>
<%= form_tag({}, { :id => "confirm" }) do %>
<input type="display_name" name="confirm_string" value="<%= params[:display_name] %>">
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t 'user.confirm.button' %>">
<p><%= t 'user.confirm.press confirm button' %></p>
<%= form_tag({}, { :id => "confirm" }) do %>
<input type="display_name" name="confirm_string" value="<%= params[:display_name] %>">
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t 'user.confirm.button' %>">
<% end %>
<script>
$("#confirm").submit();
</script>
<% else %>
<h1>
<%= t "user.confirm.introduction_1" %>
<span class="deemphasize">
<%= t "user.confirm.introduction_2" %>
</span>
</h1>
<p class='deemphasize'><%= t "user.confirm.reconfirm_html",
:reconfirm => url_for(:action => 'confirm_resend')%></p>
<% end %>
<script>
$("#confirm").submit();
</script>

View file

@ -1,102 +1,100 @@
<% content_for :heading do %>
<h1><%= t 'user.new.heading' %></h1>
<h1><%= t 'user.new.title' %></h1>
<div class='header-illustration new-user-main'></div>
<div class='header-illustration new-user-arm'></div>
<% end %>
<p><%= t 'user.new.fill_form' %></p>
<%= 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? %>
<div id="signupForm" class="standard-form">
<fieldset>
<div class="form-row">
<label for="email" class="standard-label">
<%= t 'user.new.email address' %>
</label>
<%= email_field(:user, :email, { :tabindex => 1 }) %>
</div>
<div class="form-row">
<label for="email_confirmation" class="standard-label">
<%= t 'user.new.confirm email address' %>
</label>
<%= email_field(:user, :email_confirmation, { :tabindex => 2 }) %>
</div>
<span class="form-help deemphasize"><%= raw(t 'user.new.not displayed publicly') %></span>
</fieldset>
<fieldset>
<div class="form-row">
<label for="display_name" class="standard-label">
<%= t 'user.new.display name' %>
</label>
<%= text_field(:user, :display_name, { :tabindex => 3 }) %>
</div>
<span class="form-help deemphasize"><%= t 'user.new.display name description' %></span>
</fieldset>
<fieldset class="form-divider" id="openid_field">
<div class="form-row">
<label for="openid_url" class="standard-label">
<%= raw t 'user.new.openid', :logo => openid_logo %>
</label>
<%= url_field(:user, :openid_url, { :id => "openid_url", :tabindex => 4, :class => "openid_url" }) %>
</div>
<span id="openid_note" class="deemphasize">
<%= t 'user.new.openid no password' %>
</span>
</fieldset>
<fieldset>
<div class="form-row">
<label for='user[pass_crypt]' class="standard-label">
<%= t 'user.new.password' %>
</label>
<%= password_field(:user, :pass_crypt, {:tabindex => 5 }) %>
</div>
<div class="form-row">
<label class="standard-label">
<%= t 'user.new.confirm password' %>
</label>
<%= password_field(:user, :pass_crypt_confirmation, { :tabindex => 6 }) %>
</div>
</fieldset>
<div id="openid_prompt" class="form-row">
<%= link_to raw(t("user.new.use openid", :logo => openid_logo)), "#", :id => "openid_enable" %>
<fieldset>
<div class="form-row">
<label for="email" class="standard-label">
<%= t 'user.new.email address' %>
</label>
<%= email_field(:user, :email, { :tabindex => 1 }) %>
<%= error_message_on(:user, :email) %>
</div>
<div class="form-row">
<label for="email_confirmation" class="standard-label">
<%= t 'user.new.confirm email address' %>
</label>
<%= email_field(:user, :email_confirmation, { :tabindex => 2 }) %>
<%= error_message_on(:user, :email_confirmation) %>
</div>
<span class="form-help deemphasize"><%= raw(t 'user.new.not displayed publicly') %></span>
</fieldset>
<%= submit_tag t('user.new.continue'), :tabindex => 6 %>
<fieldset>
<div class="form-row">
<label for="display_name" class="standard-label">
<%= t 'user.new.display name' %>
</label>
<%= text_field(:user, :display_name, { :tabindex => 3 }) %>
<%= error_message_on(:user, :display_name) %>
</div>
<span class="form-help deemphasize"><%= t 'user.new.display name description' %></span>
</fieldset>
<fieldset class="form-divider" id="openid_field">
<div class="form-row">
<label for="openid_url" class="standard-label">
<%= raw t 'user.new.openid', :logo => openid_logo %>
</label>
<%= url_field(:user, :openid_url, { :id => "openid_url", :tabindex => 4, :class => "openid_url" }) %>
<%= error_message_on(:user, :openid_url) %>
</div>
<span class="form-help deemphasize"><%= t 'user.new.openid no password' %></span>
</fieldset>
<fieldset>
<div class="form-row">
<label for='user[pass_crypt]' class="standard-label">
<%= t 'user.new.password' %>
</label>
<%= password_field(:user, :pass_crypt, {:tabindex => 5 }) %>
<%= error_message_on(:user, :pass_crypt) %>
</div>
<div class="form-row">
<label class="standard-label">
<%= t 'user.new.confirm password' %>
</label>
<%= password_field(:user, :pass_crypt_confirmation, { :tabindex => 6 }) %>
<%= error_message_on(:user, :pass_crypt_confirmation) %>
</div>
</fieldset>
<div id="openid_prompt" class="form-row">
<%= link_to raw(t("user.new.use openid", :logo => openid_logo)), "#", :id => "openid_enable" %>
</div>
<%= submit_tag t('user.new.continue'), :tabindex => 6 %>
<% end %>
<div class='aside col6 deemphasize inner22'>
<h4><%= t 'user.new.about.header' %></h4>
<%= t 'user.new.about.html' %>
</div>
<script type="text/javascript">
function enableOpenID()
{
$("#openid_prompt").hide();
$("#openid_field").show();
$("#openid_note").show();
$("#openid_url").prop("disabled", false);
}
function disableOpenID()
{
$("#openid_prompt").show();
$("#openid_field").hide();
$("#openid_note").hide();
$("#openid_url").prop("disabled", true);
}
$(document).ready(function () {
$("#openid_enable").click(enableOpenID);
<% if params[:openid] or (@user and @user.openid_url and not @user.openid_url.empty?) -%>
<% if params[:openid] or (@user and @user.openid_url.present?) -%>
enableOpenID();
<% else -%>
disableOpenID();

View file

@ -1,45 +1,56 @@
<% content_for :heading do %>
<h1><%= t 'user.terms.heading' %></h1>
<div class='header-illustration new-user-terms'></div>
<% end %>
<div id="terms">
<div class="directions">
<p><%= t 'user.terms.read and accept' %></p>
<!-- legale is <%= @legale %> -->
<%= form_tag :action => 'terms' do %>
<p><%= t 'user.terms.legale_select' %></p>
<fieldset>
<% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name,legale| %>
<%= radio_button_tag 'legale', legale, @legale == legale %>
<%= label_tag "legale_#{legale}", t('user.terms.legale_names.' + name) %>
<script type="text/javascript">
<!--
<%= form_tag({:action => "save"}, { :class => " inner22 standard-form fillL" }) do %>
<!-- legale is <%= @legale %> -->
<div class='form-row horizontal-list'>
<label class="standard-label">
<%= t 'user.terms.legale_select' %>
</label>
<% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name, legale| %>
<div class="form-row">
<label for="legale_<%= legale %>">
<%= radio_button_tag 'legale', legale, @legale == legale %>
<%= t('user.terms.legale_names.' + name) %>
</label>
<script>
$("#legale_<%= legale %>").change(function () {
$("#contributorTerms").html("<%=j image_tag 'searching.gif' %>");
$("#contributorTerms").load("<%= url_for :legale => legale %>");
});
// -->
</script>
<% end %>
</fieldset>
</div>
<% end %>
</div>
<div id="contributorTerms" class="legale">
</div>
<div id="contributorTerms" class="col12 legale">
<%= render :partial => "terms" %>
</div>
<%= form_tag({:action => "save"}, { :class => "sign" }) do %>
<p>
<label for="confirm_pd_checkbox"><%= t 'user.terms.consider_pd' %></label>
<div class="form-row">
<label for="user_consider_pd">
<%= check_box('user', 'consider_pd') %>
<span class="minorNote">(<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>)</span>
</p>
<%= t 'user.terms.consider_pd' %>
</label>
<span class="minorNote">(<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>)</span>
<%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %>
<div class="signing-buttons buttons">
<div class="buttons form-row inner20 clearfix">
<p class="deemphasize"><%= t 'user.terms.read and accept' %></p>
<%= submit_tag(t('user.terms.agree'), :name => "agree", :id => "agree") %>
<%= submit_tag(t('user.terms.decline'), :name => "decline", :id => "decline") %>
</div>
<p id="contributorGuidance"><%= 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' %></p>
<% end %>
</terms>
<div class="deemphasize">
<p id="contributorGuidance">
<%= 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' %>
</p>
</div>
</div>
<% end %>

View file

@ -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 )

View file

@ -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 <em>konkret og aktuelt</em> 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 <em>ikke</em> 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 <strong>editor</strong> er et program eller en hjemmeside der kan bruges til at editere kortet.
node_html: |
En <strong>node</strong> er et punkt på kortet, f.eks. en enkelt restaurant eller et træ.
way_html: |
En <strong>way</strong> er en linje eller et areal, f.eks. en vej, en å eller en bygning.
tag_html: |
Et <strong>tag</strong> 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å
<a href='http://help.openstreetmap.org/'>OpenStreetMaps hjælpeside</a>.
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å <a href='%{map_url}'>kortet</a> og klik på note-ikonet:
<span class='icon note'></span>. 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

View file

@ -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 <em>derzeit real existiert.</em> -
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 <strong>Editor</strong> ist ein Programm oder eine Webseite mit der man die Karte editieren kann.
node_html: |
Ein <strong>Knoten</strong> ist ein Punkt auf der Karte, z.B. ein Restaurant oder ein Baum.
way_html: |
Ein OSM <strong>Weg</strong> ist eine Linie oder Flaeche wie z.B. eine Strasse, Weg, Fluss oder Gebaeude.
tag_html: |
Ein <strong>tag</strong> 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 <a href='http://help.openstreetmap.org/'>the Hilfe Seite</a>.
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 <a href='%{map_url}'>die Karte</a> und klicke das Sprechblasen Icon:
<span class='icon note'></span>. 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 <a href="mailto:webmaster@openstreetmap.org">Webmaster</a> um ein Benutzerkonto erstellt zu bekommen - wir werden die Anfrage so schnell wie möglich bearbeiten.
about:
header: Frei und editierbar
html: |
<p>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.</p>
<p>Melde Dich an und beginne mitzuwirken. Wir werden Dir eine email schicken um diese zu bestaetigen.</p>
continue: Weiter
display name: "Benutzername:"
display name description: Dein öffentlich angezeigter Benutzername. Er kann später in den Einstellungen geändert werden.

View file

@ -1170,6 +1170,50 @@ en:
to our <a href="http://www.osmfoundation.org/wiki/License/Takedown_procedure">takedown
procedure</a> or file directly at our
<a href="http://dmca.openstreetmap.org/">on-line filing page</a>.
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 <em>real and current</em> -
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 <em>doesn't</em> 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 <strong>editor</strong> is a program or website you can use to edit the map.
node_html: |
A <strong>node</strong> is a point on the map, like a single restauraunt or a tree.
way_html: |
A <strong>way</strong> is a line or area, like a road, stream, lake or building.
tag_html: |
A <strong>tag</strong> 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 <a href='http://help.openstreetmap.org/'>the help website</a>.
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 <a href='%{map_url}'>the map</a> and click the note icon:
<span class='icon note'></span>. 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 +1250,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 <a href="http://wiki.openstreetmap.org/wiki/Beginners%27_guide">on the wiki</a>, and catch up with the latest news via the <a href="http://blog.openstreetmap.org/">OpenStreetMap blog</a> or <a href="http://twitter.com/openstreetmap">Twitter</a>.
ask_questions: You can ask any questions you may have about OpenStreetMap at our <a href="http://help.openstreetmap.org/">question and answer site</a>.
wiki_signup: 'You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.'
user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/wiki/Category:Users_in_London">[[Category:Users_in_London]]</a>.'
current_user: 'A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.'
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:
@ -1697,11 +1720,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 <a href="mailto:webmaster@openstreetmap.org">webmaster</a> 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: |
<p>Unlike other maps, OpenStreetMap is completely created by people like you,
and it's free for anyone to fix, update, download and use.</p>
<p>Sign up to get started contributing. We'll send an email to confirm your account.</p>
license_agreement: 'When you confirm your account you will need to agree to the <a href="http://www.osmfoundation.org/wiki/License/Contributor_Terms">contributor terms</a>.'
email address: "Email Address:"
confirm email address: "Confirm Email Address:"
@ -1723,16 +1750,14 @@ en:
with your OpenID in your user settings.
</li>
</ul>
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.<br /><br />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 <a href=\"%{url}\">this wiki page</a>."
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 +1766,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"
@ -1869,14 +1894,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 <a href=\"%{reconfirm}\">send yourself a new confirmation email</a>."
unknown token: "That confirmation code has expired or does not exist."
reconfirm_html: "If you need us to resend the confirmation email, <a href=\"%{reconfirm}\">click here</a>."
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.<br /><br />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."
@ -2139,6 +2166,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"

View file

@ -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 <em>réelles et actuelles</em>
- 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 <em>exclu</em> 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 <strong>éditeur</strong> est un programme ou site web qui vous permet d'éditer la carte.
node_html: |
Un <strong>nœud</strong> est un point sur la carte, comme un restaurant ou un arbre individuel.
way_html: |
Un <strong>chemin</strong est une ligne ou une surface, comme par exemple une rue, un
ruisseau, un lac, ou un bâtiment.
tag_html: |
Un <strong>tag</strong> 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 <a href='http://help.openstreetmap.org/'>
le site d'aide</a>.
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 <a href='%{map_url}'>la carte</a> et cliquez sur l'icône note:
<span class='icon note'></span>. 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}

View file

@ -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

View file

@ -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'

View file

@ -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)
user = new_user
user.email = users(:public_user).email
post :save
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
def test_user_create_submit_duplicate_email_uppercase
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)
user = new_user
user.display_name = users(:public_user).display_name
post :save
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)
user = new_user
user.display_name = users(:public_user).display_name.upcase
post :save
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.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

View file

@ -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/<display_name>/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/<display_name>/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