From: Tom Hughes Date: Tue, 20 Nov 2012 19:08:30 +0000 (+0000) Subject: Merge branch 'master' into notes X-Git-Tag: live~6086^2~71 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7599f98957334d1924550205f7ba12a726de7eb0?ds=inline;hp=-c Merge branch 'master' into notes Conflicts: Gemfile Gemfile.lock app/assets/stylesheets/common.css.scss app/helpers/application_helper.rb --- 7599f98957334d1924550205f7ba12a726de7eb0 diff --combined Gemfile index ce13c6532,1b35b6074..4b2d2ba9e --- a/Gemfile +++ b/Gemfile @@@ -2,7 -2,7 +2,7 @@@ source 'http://rubygems.org' # Require rails - gem 'rails', '3.2.8' + gem 'rails', '3.2.9' # Require things which have moved to gems in ruby 1.9 gem 'bigdecimal', :platforms => :ruby_19 @@@ -13,6 -13,9 +13,9 @@@ gem 'pg # Load jquery support gem 'jquery-rails' + # Load R2 for RTL conversion + gem 'r2' + # Load rails plugins gem 'rails-i18n', ">= 0.6.3" gem 'dynamic_form' @@@ -25,7 -28,7 +28,8 @@@ gem 'http_accept_language', '>= 1.0.2 gem 'paperclip', '~> 2.0' gem 'deadlock_retry', '>= 1.2.0' gem 'i18n-js', '>= 3.0.0.rc2' + gem 'rack-cors' +gem 'jsonify-rails' # We need ruby-openid 2.2.0 or later for ruby 1.9 support gem 'ruby-openid', '>= 2.2.0' diff --combined Gemfile.lock index 23eeceb19,7292a7141..eafd5d341 --- a/Gemfile.lock +++ b/Gemfile.lock @@@ -2,44 -2,44 +2,44 @@@ GE remote: http://rubygems.org/ specs: SystemTimer (1.2.3) - actionmailer (3.2.8) - actionpack (= 3.2.8) + actionmailer (3.2.9) + actionpack (= 3.2.9) mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + actionpack (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) + sprockets (~> 2.2.1) + activemodel (3.2.9) + activesupport (= 3.2.9) builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + activerecord (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) + activeresource (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + activesupport (3.2.9) i18n (~> 0.6) multi_json (~> 1.0) arel (3.0.2) bigdecimal (1.1.0) - builder (3.0.3) - cocaine (0.4.0) + builder (3.0.4) + cocaine (0.4.2) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.3.3) + coffee-script-source (1.4.0) composite_primary_keys (5.0.9) activerecord (~> 3.2.0, >= 3.2.8) deadlock_retry (1.2.0) @@@ -56,7 -56,7 +56,7 @@@ httpauth (0.2.0) httpclient (2.3.0.1) i18n (0.6.1) - i18n-js (3.0.0.rc2) + i18n-js (3.0.0.rc3) i18n iconv (0.1) journey (1.0.4) @@@ -64,11 -64,6 +64,11 @@@ railties (>= 3.1.0, < 5.0) thor (~> 0.14) json (1.7.5) + jsonify (0.3.1) + multi_json (~> 1.0) + jsonify-rails (0.3.2) + actionpack + jsonify (< 0.4.0) jwt (0.1.5) multi_json (>= 1.0) libv8 (3.3.10.4) @@@ -79,8 -74,8 +79,8 @@@ treetop (~> 1.4.8) memcached (1.4.6) mime-types (1.19) - minitest (4.1.0) - multi_json (1.3.6) - minitest (4.2.0) ++ minitest (4.3.0) + multi_json (1.3.7) multipart-post (1.1.5) nokogiri (1.5.5) oauth (0.4.7) @@@ -104,9 -99,12 +104,12 @@@ mime-types pg (0.14.1) polyglot (0.3.3) + r2 (0.0.3) rack (1.4.1) rack-cache (1.2) rack (>= 0.4) + rack-cors (0.2.7) + rack rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) @@@ -114,49 -112,50 +117,50 @@@ rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) + rails (3.2.9) + actionmailer (= 3.2.9) + actionpack (= 3.2.9) + activerecord (= 3.2.9) + activeresource (= 3.2.9) + activesupport (= 3.2.9) bundler (~> 1.0) - railties (= 3.2.8) - rails-i18n (0.6.6) + railties (= 3.2.9) + rails-i18n (0.7.0) i18n (~> 0.5) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) + railties (3.2.9) + actionpack (= 3.2.9) + activesupport (= 3.2.9) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rake (10.0.0) ++ rake (10.0.2) rdoc (3.12) json (~> 1.4) - redcarpet (2.2.1) + redcarpet (2.2.2) rinku (1.7.2) - ruby-openid (2.2.1) + ruby-openid (2.2.2) sanitize (2.0.3) nokogiri (>= 1.4.4, < 1.6) - sass (3.2.1) + sass (3.2.3) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - sprockets (2.1.3) + sprockets (2.2.1) hike (~> 1.2) + multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) therubyracer (0.10.2) libv8 (~> 3.3.10) thor (0.16.0) tilt (1.3.3) - timecop (0.5.2) - treetop (1.4.11) + timecop (0.5.3) + treetop (1.4.12) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.33) + tzinfo (0.3.35) uglifier (1.3.0) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) @@@ -179,7 -178,6 +183,7 @@@ DEPENDENCIE i18n-js (>= 3.0.0.rc2) iconv jquery-rails + jsonify-rails libxml-ruby (>= 2.0.5) memcached (>= 1.4.1) minitest @@@ -187,7 -185,9 +191,9 @@@ open_id_authentication (>= 1.1.0) paperclip (~> 2.0) pg - rails (= 3.2.8) + r2 + rack-cors + rails (= 3.2.9) rails-i18n (>= 0.6.3) redcarpet rinku (>= 1.2.2) diff --combined app/assets/javascripts/osm.js.erb index 33f190412,39d995c46..e8428da3a --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@@ -23,7 -23,7 +23,7 @@@ OSM = mapParams: function (search) { var params = {}, mapParams = {}, loc; - search = (search || window.location.search).replace('?', '').split('&'); + search = (search || window.location.search).replace('?', '').split(/&|;/); for (var i = 0; i < search.length; ++i) { var pair = search[i], @@@ -109,8 -109,6 +109,8 @@@ mapParams.lat = (mapParams.minlat + mapParams.maxlat) / 2; } + mapParams.notes = params.notes == "yes"; + var scale = parseFloat(params.scale); if (scale > 0) { mapParams.zoom = Math.log(360.0 / (scale * 512.0)) / Math.log(2.0); diff --combined app/assets/stylesheets/common.css.scss index d41dd5481,2837270fd..ec06997f8 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@@ -10,6 -10,7 +10,7 @@@ body background-color: #fff; margin: 0px; padding: 0px; + text-align: left; } body.slim { @@@ -48,20 -49,23 +49,23 @@@ h2 #left { position: absolute; - top: 0px; + top: 30px; + bottom: 0; width: 185px; font-size: 11px; line-height: 12px; + border-right: 1px solid #ccc; } /* Rules for the OpenStreetMap logo in the top left corner */ #logo { + display: block; width: 170px; min-width: 170px; padding: 5px; text-align: center; - margin: 25px 0 5px 0; + margin: auto; } #logo img { @@@ -94,7 -98,7 +98,7 @@@ /* Rules for the introductory text displayed in the left sidebar to new users */ .sidebar-copy { - padding: 0px 10px; + padding: 5px 10px; } .sidebar-copy p { @@@ -150,38 -154,35 +154,35 @@@ /* Rules for the menu displayed in the left sidebar */ .left_menu { + left: 0px; + margin: 0; padding: 5px 10px; - margin: 4px 0; + line-height: 15px; + font-size: 12px; + list-style-type: none; + border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; - line-height: 20px; - font-size: 14px; - font-weight: bold; - } - - .left_menu h1 { - font-style: normal; - font-size: 15px; } .left_menu ul { - margin: 0px; - list-style-type: none; + padding: 0; + margin: 0; } .left_menu li { - margin: 0px; - padding: 0px; + list-style-type: none; + padding: 0; + margin: 0; } - /* submenus */ - .left_menu ul li ul { - font-weight: normal; - line-height: 15px; + .left_menu h4 { + padding: 5px 0 5px 0; font-size: 12px; + margin: 0; } - .left_menu a { - color: #000; + .left_menu li:last-child h4 { + padding-top: 0; } /* Rules for SOTM advert */ @@@ -205,8 -206,10 +206,10 @@@ */ .optionalbox { + left: 0px; padding: 5px 10px; - margin: 4px 0; + margin: 5px 0; + text-align: left; } .optionalbox h1 { @@@ -223,21 -226,21 +226,21 @@@ } #search_field form { - width: 100%; + width: 165px; margin: 0px; padding: 0px; } #search_field { - position:relative; + position: relative; } #search_field input[type="text"] { width: 165px; - padding: 5px; font-size: 14px; line-height: 15px; height: 25px; + padding: 2px 0px 2px 5px; box-shadow: inset #DDD 0px 1px 3px; box-sizing: border-box; -webkit-box-sizing: border-box; @@@ -253,19 -256,21 +256,21 @@@ #search_field input[type="submit"] { width: 15px; height: 15px; - border:0; - text-indent:-1000px; + border: 0px; + text-indent: -1000px; + overflow: hidden; + text-transform: capitalize; padding-left: 0px; padding-right: 0px; - background: url(sprite.png); - position:absolute; - right:2px; - top:5px; - cursor:pointer; + background: image-url("sprite.png"); + position: absolute; + top: 5px; + right: 4px; + cursor: pointer; } .search_help { - margin:0; + margin: 5px 0 0 0; } .deemphasize { @@@ -279,8 -284,10 +284,10 @@@ /* Rules for donation request box */ .donate { + display: block; + position: relative; width: 153px; - margin: 10px 10px; + margin: 10px 10px 0px 10px; padding: 5px; border: 1px solid #AED1A0; background: #cbeea7; @@@ -289,10 -296,29 +296,29 @@@ font-size: 14px; border-radius: 2px; -moz-border-radius: 2px; + color: #222; } - .donate a { - color:#222; + .donate:hover { + background: #9ed485; + text-decoration: none; + } + + .donate p { + text-indent: 20px; + margin: 0; + } + + .donate .donate-icon { + width: 15px; + height: 15px; + border: 0px; + padding-left: 0px; + padding-right: 0px; + background: image-url("sprite.png") 0 -30px no-repeat; + position: absolute; + top: 8px; + left: 17px; } /* Rules for Creative Commons logo button */ @@@ -305,8 -331,13 +331,13 @@@ /* Rules for tabbed navigation bar */ #top-bar { - border-bottom: 1px solid #ccc; + position: absolute; + top: 0; + left: 185px; + right: 0; height: 29px; + border-bottom: 1px solid #ccc; + background: white; } #tabnav { @@@ -323,11 -354,13 +354,13 @@@ } #tabnav a, #tabnav a:link, #tabnav a:visited { + float: left; background: #fff; font-size: 14px; line-height: 19px; font-weight: bold; padding: 5px 10px; + margin-right: 1px; text-decoration: none; color: #333; -webkit-transition: color 200ms ease-in; @@@ -376,8 -409,10 +409,10 @@@ body.site-export #tabnav a#exportancho /* Rules for greeting bar in the top right corner */ #greeting { + float: right; height: 28px; margin: 0px; + padding-right: 10px; font-size: 13px; line-height: 28px; } @@@ -392,6 -427,7 +427,7 @@@ z-index: 20000000; position: absolute; top: 15px; + left: 15px; } /* Rules for OpenLayers maps */ @@@ -424,12 -460,18 +460,24 @@@ padding: 5px; } +#permalink a.disabled { + color: #ccc; + cursor: default; + text-decoration: none; +} + + .site-index #map .SimpleLayerSwitcher, + .site-index #map .olControlSimplePanZoom, + .site-export #map .SimpleLayerSwitcher, + .site-export #map .olControlSimplePanZoom { + top: 40px !important; + } + + .site-index #map .olControlScaleLine, + .site-export #map .olControlScaleLine { + left: 10px !important; + } + /* Rules for edit menu */ .menuicon { @@@ -469,20 -511,30 +517,30 @@@ display: none; } + .attribution_license { + text-align: left; + } + .attribution_notice { text-align: center; } + .attribution_project { + text-align: right; + } + /* Rules for the popout map sidebar */ #sidebar { display: none; position: absolute; - margin: 0px; + margin: 30px 0px 0px 0px; padding: 0px; + border-right: 1px solid #ccc; width: 30%; top: 0px; bottom: 0px; + left: 0px; } #sidebar #sidebar_content { @@@ -502,7 -554,15 +560,15 @@@ height: 29px; font-size: 14px; line-height: 15px; - background: #bbb; + background: #ccc; + } + + #sidebar #sidebar_title { + text-align: left; + } + + #sidebar #sidebar_close { + text-align: right; } /* Rules for the map key which appears in the popout sidebar */ @@@ -614,19 -674,28 +680,28 @@@ /* Rules for the main content area */ #content { - padding: 10px; - margin: 0px; - position: absolute; - bottom: 0px; + padding: 20px; + margin: 30px 0px 0px 185px; + border-left: 1px solid #ccc; + text-align: left; } - .site-index #content, .site-edit #content, + .site-index #content, .site-export #content { - border: 0px; + position: fixed; + margin-top: 0px; + left: 0px; + right: 0px; + top: 0px; + bottom: 0px; padding: 0px; } + .site-edit #content { + top: 30px; + } + #slim_container { width: 100%; } @@@ -656,6 -725,7 +731,7 @@@ #slim_header img { vertical-align: middle; margin-bottom: 5px; + margin-right: 5px; } /* Rules for text content pages */ @@@ -706,6 -776,7 +782,7 @@@ border-width: 0px; margin-top: 1px; margin-bottom: 1px; + text-align: left; } #changeset_list td { @@@ -732,8 -803,10 +809,10 @@@ #changeset_list_map { position: absolute; + float: right; top: 0px; bottom: 0px; + right: 0px; width: 49%; min-height: 400px; border: solid 1px black; @@@ -742,7 -815,9 +821,9 @@@ /* Rules for the data browser */ #browse_navigation { + float: right; width: 250px; + margin-left: 10px; text-align: center; } @@@ -750,25 -825,11 +831,28 @@@ table.browse_details th white-space: nowrap; } +td.browse_comments { + padding: 0px; +} + +td.browse_comments table { + border-collapse: collapse; +} + +td.browse_comments table td { + padding-bottom: 10px; +} + +td.browse_comments table td span.by { + font-size: small; + color: #999999; +} + #browse_map { + float: right; width: 250px; + text-align: right; + margin-left: 10px; } #browse_map #small_map { @@@ -787,6 -848,7 +871,7 @@@ font-size: small; border-collapse: collapse; border-width: 0px; + text-align: right; } #trace_list .trace_summary { @@@ -831,9 -893,30 +916,30 @@@ } #user_list_actions { + float: right; margin-top: 10px; } + /* Rules for the diary list */ + + .diary_entry-list img.user_image { + float: right; + } + + .diary_entry-list img.user_thumbnail { + float: right; + } + + /* Rules for the diary entry view */ + + .diary_entry-view img.user_image { + float: right; + } + + .diary_entry-view img.user_thumbnail { + float: right; + } + /* Rules for the new diary entry page */ .diary_entry div#map { @@@ -922,6 -1005,14 +1028,14 @@@ form#termsForm margin-bottom: 3em; } + form#termsForm div#buttons { + float: right; + } + + form#termsForm input#agree { + margin-left: 50px; + } + div#slim_content form#termsForm { width: auto; } @@@ -947,12 -1038,23 +1061,23 @@@ p#contributorGuidance #accountForm .user_map { position: relative; width: 500px; - height: 400px; + height: 400px; border: 1px solid #ccc; } - #accountImage td { - padding-bottom: 0px; + #accountForm td.accountImage { + img { + vertical-align: top; + margin-top: 3px; + } + + table { + display: inline-block; + + td { + padding-bottom: 0px; + } + } } .nohome .location { @@@ -973,10 -1075,15 +1098,15 @@@ /* Rules for the user view */ + .user-view img.user_image { + float: right; + } + .user-view .user_map { + float: right; position: relative; width: 400px; - height: 400px; + height: 400px; border: 1px solid #ccc; } @@@ -1113,9 -1220,11 +1243,11 @@@ #errorExplanation h2 { font-weight: bold; font-size: 12px; + padding: 5px 5px 5px 15px; margin: -7px; background-color: #c00; color: #fff; + text-align: left; } #errorExplanation p { @@@ -1136,6 -1245,11 +1268,11 @@@ font-weight: bold; font-size: 12px; line-height: 20px; + text-align: right; + } + + .submitButton { + text-align: right; } .minorNote { @@@ -1150,6 -1264,11 +1287,11 @@@ textarea border: 1px solid #ccc; } + input.openid_url { + background: image-url('openid_input.png') repeat-y left white; + padding-left: 16px; + } + /* Rules for user images */ img.user_image { @@@ -1239,6 -1358,7 +1381,7 @@@ abbr.geo display: inline-block; vertical-align: top; background-color: #ddd; + margin-left: 15px; padding: 5px 10px 10px 10px; font-size: 12px; @@@ -1248,9 -1368,12 +1391,12 @@@ th { vertical-align: top; + text-align: left; + padding: 0px 15px 0px 0px !important; } td { + text-align: left; font-family: fixed; line-height: 16px; padding: 0px !important; @@@ -1258,21 -1381,12 +1404,23 @@@ input.richtext_doedit { margin-top: 5px !important; + margin-right: 10px !important; } input.richtext_dopreview { margin-top: 5px !important; + margin-left: 10px !important; } } } + +/* Rules for the notes interface */ + +.note { + width: 300px; + + .buttons { + margin-top: 5px; + text-align: right; + } +} diff --combined app/helpers/application_helper.rb index fb422cc17,000677646..18f233e50 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@@ -88,15 -88,11 +88,23 @@@ module ApplicationHelpe end end + def dir + if dir = params[:dir] + dir == "rtl" ? "rtl" : "ltr" + else + I18n.t("html.dir") + end + end ++ + def friendly_date(date) + content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) + end + + def note_author(object, link_options = {}) + if object.author.nil? + h(object.author_name) + else + link_to h(object.author_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author_name}) + end + end end diff --combined app/models/notifier.rb index 1107a0da6,2a5bb15bc..a4eb0d4c3 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@@ -6,11 -6,20 +6,20 @@@ class Notifier < ActionMailer::Bas def signup_confirm(user, token) @locale = user.preferred_language_from(I18n.available_locales) - @url = url_for(:host => SERVER_URL, - :controller => "user", :action => "confirm", - :display_name => user.display_name, - :confirm_string => token.token) - + + # 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 + mail :to => user.email, :subject => I18n.t('notifier.signup_confirm.subject', :locale => @locale) end @@@ -114,20 -123,6 +123,20 @@@ :subject => I18n.t('notifier.friend_notification.subject', :user => friend.befriender.display_name, :locale => @locale) end + def note_comment_notification(comment, recipient) + @locale = recipient.preferred_language_from(I18n.available_locales) + @noteurl = browse_note_url(comment.note, :host => SERVER_URL) + @place = comment.note.nearby_place + @comment =comment.body + @owner = recipient == comment.note.author + @commenter = comment.author_name + + subject = I18n.t('notifier.note_comment_notification.subject_own', :commenter => comment.author_name) if @owner + subject = I18n.t('notifier.note_comment_notification.subject_other', :commenter => comment.author_name) unless @owner + + mail :to => recipient.email, :subject => subject + end + private def from_address(name, type, id, digest) diff --combined app/models/user.rb index 889c40451,6ea4de9be..33f01c06b --- a/app/models/user.rb +++ b/app/models/user.rb @@@ -12,8 -12,6 +12,8 @@@ class User < ActiveRecord::Bas has_many :tokens, :class_name => "UserToken" has_many :preferences, :class_name => "UserPreference" has_many :changesets, :order => 'created_at DESC' + has_many :note_comments, :foreign_key => :author_id + has_many :notes, :through => :note_comments has_many :client_applications has_many :oauth_tokens, :class_name => "OauthToken", :order => "authorized_at desc", :include => [:client_application] @@@ -47,12 -45,13 +47,13 @@@ validates_inclusion_of :preferred_editor, :in => Editors::ALL_EDITORS, :allow_nil => true attr_accessible :display_name, :email, :email_confirmation, :openid_url, - :pass_crypt, :pass_crypt_confirmation, :consider_pd + :pass_crypt, :pass_crypt_confirmation, :consider_pd, + :image_use_gravatar after_initialize :set_defaults before_save :encrypt_password - has_attached_file :image, + has_attached_file :image, :default_url => "/assets/:class/:attachment/:style.png", :styles => { :large => "100x100>", :small => "50x50>" } @@@ -84,7 -83,7 +85,7 @@@ token.update_column(:expiry, 1.week.from_now) if token and user return user - end + end def to_xml doc = OSM::API.new.get_xml_doc @@@ -127,7 -126,7 +128,7 @@@ end def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS) - if self.home_lon and self.home_lat + if self.home_lon and self.home_lat gc = OSM::GreatCircle.new(self.home_lat, self.home_lon) bounds = gc.bounds(radius) sql_for_distance = gc.sql_for_distance("home_lat", "home_lon") @@@ -184,7 -183,7 +185,7 @@@ end ## - # returns the first active block which would require users to view + # returns the first active block which would require users to view # a message, or nil if there are none. def blocked_on_view blocks.active.detect { |b| b.needs_view? } @@@ -208,8 -207,8 +209,8 @@@ ## # return a spam score for a user def spam_score - changeset_score = self.changesets.limit(10).length * 50 - trace_score = self.traces.limit(10).length * 50 + changeset_score = self.changesets.size * 50 + trace_score = self.traces.size * 50 diary_entry_score = self.diary_entries.inject(0) { |s,e| s += e.body.spam_score } diary_comment_score = self.diary_comments.inject(0) { |s,c| s += c.body.spam_score } diff --combined app/views/site/index.html.erb index 248b5a0b6,43485b27f..d4c33fcfd --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@@ -4,13 -4,12 +4,13 @@@ <% unless STATUS == :api_offline or STATUS == :database_offline -%> <% content_for :editmenu do -%> +
  • <%= link_to t("browse.start_rjs.notes_layer_name"), notes_url(:format => :json), :id => "show_notes" %>
  • <%= link_to t("browse.start_rjs.data_layer_name"), { :controller => :browse, :action => :start }, :id => "show_data" %>
  • <% end -%> <% end -%> <% content_for :left_menu do %> -
  • <%= link_to t("site.key.map_key"), {:action => :key}, :id => "open_map_key", :title => t("site.key.map_key_tooltip") %>
  • +
  • <%= link_to t("site.key.map_key"), {:action => :key}, :id => "open_map_key", :title => t("site.key.map_key_tooltip") %>

  • <% end %> <%= render :partial => 'home_link' %> @@@ -28,12 -27,6 +28,12 @@@ diff --combined config/example.application.yml index c795fc0d9,249e44773..b99e4a103 --- a/config/example.application.yml +++ b/config/example.application.yml @@@ -11,7 -11,7 +11,7 @@@ defaults: &default email_return_path: "bounces@openstreetmap.org" # API version api_version: "0.6" - # Application status - posstible values are: + # Application status - possible values are: # :online - online and operating normally # :api_readonly - site online but API in read-only mode # :api_offline - site online but API offline @@@ -27,8 -27,6 +27,8 @@@ max_number_of_nodes: 50000 # Maximum number of nodes that can be in a way (checked on save) max_number_of_way_nodes: 2000 + # The maximum area you're allowed to request notes from, in square degrees + max_note_request_area: 25 # Zoom level to use for postcode results from the geocoder postcode_zoom: 15 # Zoom level to use for geonames results from the geocoder diff --combined config/locales/de.yml index 1b1cb9427,26c9bcccb..007850fd3 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@@ -20,6 -20,7 +20,7 @@@ # Author: McDutchie # Author: Metalhead64 # Author: Michi + # Author: Mormegil # Author: Pill # Author: Purodha # Author: Raymond @@@ -952,22 -953,6 +953,22 @@@ de history_disabled_tooltip: Reinzoomen um Änderungen für diesen Bereich anzuzeigen history_tooltip: Änderungen für diesen Bereich anzeigen history_zoom_alert: Du musst näher heranzoomen, um die Chronik zu sehen + osb: + Fixed Error: Behobener Fehler + Unresolved Error: Offener Fehler + Description: Beschreibung + Comment: Kommentar + Has been fixed: Der Fehler wurde bereits behoben. Es kann jedoch bis zu einigen Tagen dauern, bis die Kartenansicht aktualisiert wird. + Comment/Close: Kommentieren/Schließen + Nickname: Benutzername + Add comment: Kommentar hinzufügen + Mark as fixed: Als behoben markieren + Cancel: Abbrechen + Create OpenStreetBug: OpenStreetBug melden + Create bug: Bug anlegen + Bug description: Fehlerbeschreibung + Create: Anlegeeen + Permalink: Permalink layouts: community: Gemeinschaft community_blogs: Blogs @@@ -1022,7 -1007,6 +1023,6 @@@ partners_url: http://wiki.openstreetmap.org/wiki/Partners sign_up: Registrieren sign_up_tooltip: Ein Benutzerkonto zum Daten bearbeiten erstellen - sotm2012: Komm zur OpenStreetMap-Konferenz „The State of the Map US“ 2012 vom 13. bis 14. Oktober in Portland, Oregon! tag_line: Die freie Wiki-Weltkarte user_diaries: Benutzer-Blogs user_diaries_tooltip: Benutzer-Blogs lesen @@@ -1039,6 -1023,9 +1039,9 @@@ text: Für den Fall einer Abweichung zwischen der vorliegenden Übersetzung und %{english_original_link}, ist die englischsprachige Seite maßgebend. title: Über diese Übersetzung legal_babble: + attribution_example: + alt: Beispiel, wie man auf OpenStreetMap auf einer Webseite hinweist + title: Hinweisbeispiel contributors_at_html: "Österreich: Enthält Daten der Stadt Wien (lizenziert gemäß CC BY AT), des Landes Vorarlberg und des Landes Tirol (beides lizenziert gemäß CC BY AT mit Anpassungen zur Lizenz)." contributors_ca_html: "Kanada: Enthält Daten von GeoBase®, GeoGratis (© Department of Natural Resources Canada), CanVec (© Department of Natural Resources Canada) und StatCan (Geography Division, Statistics Canada)." contributors_footer_1_html: Für weitere diesbezügliche Einzelheiten sowie anderer Datenquellen, die zur Verbesserung von OpenStreetMap genutzt wurden, besuche bitte die Seite über die Mitwirkenden im Wiki von OpenStreetMap. @@@ -1052,6 -1039,7 +1055,7 @@@ contributors_za_html: "Südafrika: Enthält Daten von Chief Directorate: National Geo-Spatial Information, Staatliches Urheberrecht vorbehalten." credit_1_html: Wir verlangen die Verwendung des Hinweises „© OpenStreetMap-Mitwirkende“. credit_2_html: "Du musst auch klarstellen, dass die Daten unter der Open-Database-Lizenz\nverfügbar sind, und sofern du unsere Kartenkacheln verwendest, dass die\nKartografie gemäß CC BY-SA lizenziert ist. Du kannst dies tun, indem du auf\ndiese Seite verlinkst.\nErsatzweise, und als Erfordernis, falls du OSM in Datenform weitergibst,\nkannst du die Lizenz(en) direkt verlinken und benennen. In Medien, in denen\nkeine Links möglich sind (z. B. gedruckten Werken), empfehlen wir dir,\ndeine Leser direkt auf openstreetmap.org zu verweisen (möglicherweise mit\ndem Erweitern von „OpenStreetMap“ zur vollen Adresse), auf opendatacommons.org,\nund, sofern zutreffend, auf creativecommons.org." + credit_3_html: "Der Hinweis sollte für eine durchsuchbare elektronische Karte in der Ecke der Karte stehen.\nZum Beispiel:" credit_title_html: Wie auf die Urheberschaft von OpenStreetMap hinzuweisen ist infringement_1_html: Die Mitwirkenden von OpenStreetMap weisen wir darauf hin, dass keinesfalls Daten aus urheberrechtlich geschützten Quellen verwendet werden dürfen (z. B. Google Maps oder gedruckte Kartenwerke), ohne vorher die ausdrückliche Erlaubnis des Rechteinhabers erhalten zu haben. infringement_2_html: "Sofern du denkst, dass urheberrechtlich geschütztes Material unerlaubterweise zur\nOpenStreetMap-Datenbank oder auf dieser Website hinzugefügt wurde, informiere dich\nbitte über unser Verfahren\nzum Entfernen von Inhalten oder melde dies direkt mit unserem\nOnlineformular." @@@ -1191,14 -1179,15 +1195,15 @@@ header: "%{from_user} hat dir eine Nachricht über OpenStreetMap mit dem Betreff %{subject} gesendet:" hi: Hallo %{to_user}, signup_confirm: - subject: "[OpenStreetMap] Deine E-Mail-Adresse bestätigen" + confirm: "Bevor wir etwas unternehmen, benötigen wir eine Bestätigung, dass diese Anfrage von dir stammt. Falls ja, klicke bitte auf den unten stehenden Link, um dein Benutzerkonto zu bestätigen:" + created: Jemand (hoffentlich du) erstellte gerade bei %{site_url} ein Benutzerkonto. + greeting: Hallo! + subject: "[OpenStreetMap] Willkommen bei OpenStreetMap" + welcome: Wir möchten dich willkommen heißen und geben dir zusätzliche Informationen, um anzufangen. signup_confirm_html: ask_questions: Du kannst jegliche Fragen zu OpenStreetMap auf unserer Website mit Fragen und Antworten stellen. - click_the_link: Wenn du das bist, Herzlich Willkommen! Bitte klicke auf den folgenden Link unter dieser Zeile um dein Benutzerkonto zu bestätigen. Lies danach weiter, denn es folgen mehr Informationen über OSM. current_user: Ebenso ist eine Liste mit allen Benutzern in einer Kategorie, die anzeigt wo diese auf der Welt sind, verfügbar. get_reading: Auf dieser Seite findest du einige nützliche Links und Informationen, die dir den Einstieg erleichtern werden. - greeting: Hallo! - hopefully_you: Jemand (hoffentlich du) möchte ein Benutzerkonto erstellen für introductory_video: Du kannst dir das %{introductory_video_link} anschauen. more_videos: Darüber hinaus gibt es noch viele weitere %{more_videos_link}. more_videos_here: Videos über OpenStreetMap @@@ -1208,19 -1197,13 +1213,13 @@@ signup_confirm_plain: ask_questions: "Du kannst jegliche Fragen zu OpenStreetMap auf unserer Website mit Fragen und Antworten stellen:" blog_and_twitter: "Immer auf dem neuesten Stand dank dem OpenStreetMap-Blog oder Twitter:" - click_the_link_1: Wenn du das bist, Herzlich Willkommen! Bitte klicke auf den folgenden Link unter dieser Zeile, um dein - click_the_link_2: Benutzerkonto zu bestätigen. Lies danach weiter, denn es folgen mehr Informationen über OSM. - current_user_1: Eine Liste mit allen Benutzern in einer Kategorie, - current_user_2: "die anzeigt wo sie auf der Welt sind, ist hier verfügbar:" - greeting: Hallo! - hopefully_you: Jemand (hoffentlich du) möchte ein Benutzerkonto erstellen für + current_user: "Eine aktuelle Liste von Benutzern in Kategorien, basierend auf ihren Wohnorten, ist verfügbar unter:" introductory_video: "Ein Einführungsvideo zu OpenStreetMap kannst du dir hier anschauen:" more_videos: "Weitere Videos gibt es hier:" opengeodata: "OpenGeoData.org ist das Blog von OpenStreetMap-Gründer Steve Coast; dort gibt es auch einen Podcast:" the_wiki: "Weitere Informationen über OSM findest du in unserem Wiki:" the_wiki_url: http://wiki.openstreetmap.org/wiki/DE:Beginners_Guide - user_wiki_1: Es wird begrüßt wenn du dort eine Benutzerseite erstellst, welche - user_wiki_2: einen Kategorie-Tag enthält der auf deinen Standort hinweist, zum Beispiel [[Category:Users_in_München]]. + user_wiki_page: Es wird dir empfohlen, eine Benutzerseite mit Kategoriemarkierungen deiner Herkunft zu erstellen, z. B. [[Kategorie:Benutzer aus München]]. wiki_signup: "Im Wiki von OpenStreetMap kannst du dich ebenfalls registrieren:" wiki_signup_url: http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Hauptseite oauth: @@@ -1551,6 -1534,10 +1550,10 @@@ email never displayed publicly: (nicht öffentlich sichtbar) flash update success: Benutzerinformationen erfolgreich aktualisiert. flash update success confirm needed: Benutzerinformationen erfolgreich aktualisiert. Du erhältst eine E-Mail, um deine neue E-Mail-Adresse zu bestätigen. + gravatar: + gravatar: Gravatar verwenden + link: http://wiki.openstreetmap.org/wiki/Gravatar + link text: Was ist das? home location: "Standort:" image: "Bild:" image size hint: (quadratische Bilder mit zumindest 100x100 Pixel funktionieren am besten) @@@ -1686,6 -1673,7 +1689,7 @@@ email address: "E-Mail-Adresse:" fill_form: Fülle das Formular aus und dir wird eine kurze E-Mail zur Aktivierung deines Benutzerkontos geschickt. flash create success message: "\nVielen Dank für deine Registrierung. Wir haben eine Bestätigungsnachricht an %{email} gesendet. Sobald du dein Benutzerkonto bestätigt hast, kannst du mit dem Kartieren anfangen.

    Sofern du ein Antispamsystem nutzt, das selbst Bestätigungen anfordert, musst du auf dessen Positivliste setzten, da wir auf keine Bestätigungsanfragen reagieren können." + flash welcome: Vielen Dank fürs Anmelden. Wir haben dir eine Willkommensnachricht an %{email} mit einigen Hinweisen zum Anfangen gesandt. heading: Ein Benutzerkonto erstellen license_agreement: Wenn du dein Benutzerkonto bestätigst, musst du auch den Bedingungen für Mitwirkende zustimmen. no_auto_account_create: Im Moment ist das automatische Erstellen eines Benutzerkontos leider nicht möglich. diff --combined config/locales/en.yml index c3fc981ea,1f5a741b7..ffd180d36 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@@ -120,8 -120,6 +120,8 @@@ en next_relation_tooltip: "Next relation" prev_changeset_tooltip: "Previous changeset" next_changeset_tooltip: "Next changeset" + prev_note_tooltip: "Previous note" + next_note_tooltip: "Next note" changeset_details: created_at: "Created at:" closed_at: "Closed at:" @@@ -225,7 -223,6 +225,7 @@@ view_data: "View data for current map view" manually_select: "Manually select a different area" start_rjs: + notes_layer_name: "Browse Notes" data_layer_name: "Browse Map Data" data_frame_title: "Data" zoom_or_select: "Zoom in or select an area of the map to view" @@@ -285,15 -282,6 +285,15 @@@ download_xml: "Download XML" view_history: "View history" edit: "Edit way" + note: + open_title: "Unresolved issue: %{note_name}" + closed_title: "Resolved issue: %{note_name}" + opened: "Opened:" + last_modified: "Last modified:" + closed: "Closed:" + at_by_html: "%{when} ago by %{user}" + description: "Description:" + comments: "Comments:" changeset: changeset_paging_nav: showing_page: "Showing page %{page}" @@@ -379,7 -367,8 +379,8 @@@ comment_link: Comment on this entry reply_link: Reply to this entry comment_count: - one: 1 comment + zero: No comments + one: "%{count} comment" other: "%{count} comments" edit_link: Edit this entry hide_link: Hide this entry @@@ -1035,22 -1024,22 +1036,22 @@@ code explains your rights and responsibilities. intro_3_html: | The cartography in our map tiles, and our documentation, are - licensed under the Creative + licensed under the Creative Commons Attribution-ShareAlike 2.0 license (CC-BY-SA). credit_title_html: How to credit OpenStreetMap credit_1_html: | - We require that you use the credit “© OpenStreetMap + We require that you use the credit “© OpenStreetMap contributors”. credit_2_html: | - You must also make it clear that the data is available under the Open - Database License, and if using our map tiles, that the cartography is - licensed as CC-BY-SA. You may do this by linking to - this copyright page. - Alternatively, and as a requirement if you are distributing OSM in a - data form, you can name and link directly to the license(s). In media - where links are not possible (e.g. printed works), we suggest you - direct your readers to openstreetmap.org (perhaps by expanding - 'OpenStreetMap' to this full address), to opendatacommons.org, and + You must also make it clear that the data is available under the Open + Database License, and if using our map tiles, that the cartography is + licensed as CC-BY-SA. You may do this by linking to + this copyright page. + Alternatively, and as a requirement if you are distributing OSM in a + data form, you can name and link directly to the license(s). In media + where links are not possible (e.g. printed works), we suggest you + direct your readers to openstreetmap.org (perhaps by expanding + 'OpenStreetMap' to this full address), to opendatacommons.org, and if relevant, to creativecommons.org. credit_3_html: | For a browsable electronic map, the credit should appear in the corner of the map. @@@ -1118,10 -1107,10 +1119,10 @@@ copyrighted sources (e.g. Google Maps or printed maps) without explicit permission from the copyright holders. infringement_2_html: | - If you believe that copyrighted material has been inappropriately - added to the OpenStreetMap database or this site, please refer - to our takedown - procedure or file directly at our + If you believe that copyrighted material has been inappropriately + added to the OpenStreetMap database or this site, please refer + to our takedown + procedure or file directly at our on-line filing page. notifier: diary_comment_notification: @@@ -1156,13 -1145,12 +1157,12 @@@ subject: "[OpenStreetMap] GPX Import success" loaded_successfully: loaded successfully with %{trace_points} out of a possible %{possible_points} points. signup_confirm: - subject: "[OpenStreetMap] Confirm your email address" - signup_confirm_plain: + subject: "[OpenStreetMap] Welcome to OpenStreetMap" greeting: "Hi there!" - hopefully_you: "Someone (hopefully you) would like to create an account over at" - # next two translations run-on : please word wrap appropriately - click_the_link_1: "If this is you, welcome! Please click the link below to confirm your" - click_the_link_2: "account and read on for more information about OpenStreetMap." + 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:" @@@ -1172,15 -1160,9 +1172,9 @@@ 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" - # next four translations are in pairs : please word wrap appropriately - user_wiki_1: "It is recommended that you create a user wiki page, which includes" - user_wiki_2: "category tags noting where you are, such as [[Category:Users_in_London]]." - current_user_1: "A list of current users in categories, based on where in the world" - current_user_2: "they are, is available from:" + 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: - greeting: "Hi there!" - hopefully_you: "Someone (hopefully you) would like to create an account over at" - click_the_link: "If this is you, welcome! Please click the link below to confirm that account and read on for more information about OpenStreetMap" introductory_video: "You can watch an %{introductory_video_link}." video_to_openstreetmap: "introductory video to OpenStreetMap" more_videos: "There are %{more_videos_link}." @@@ -1212,13 -1194,6 +1206,13 @@@ greeting: "Hi," hopefully_you: "Someone (possibly you) has asked for the password to be reset on this email address's openstreetmap.org account." click_the_link: "If this is you, please click the link below to reset your password." + note_comment_notification: + subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes" + subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in" + greeting: "Hi," + your_note: "%{commenter} has left a comment on one of your map notes near %{place}." + commented_note: "%{commenter} has left a comment on a map note you have commented on. The note is near %{place}." + details: "More details about the note can be found at %{url}." message: inbox: title: "Inbox" @@@ -1295,7 -1270,6 +1289,7 @@@ js_2: "OpenStreetMap uses JavaScript for its slippy map." permalink: Permalink shortlink: Shortlink + createnote: Add a note license: copyright: "Copyright OpenStreetMap and contributors, under an open license" license_url: "http://openstreetmap.org/copyright" @@@ -1674,6 -1648,7 +1668,7 @@@ 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." 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." @@@ -1704,7 -1679,6 +1699,7 @@@ 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 oauth settings: oauth settings @@@ -1714,7 -1688,6 +1709,7 @@@ diary: diary edits: edits traces: traces + notes: map notes remove as friend: remove as friend add as friend: add as friend mapper since: "Mapper since:" @@@ -1798,6 -1771,10 +1793,10 @@@ preferred languages: "Preferred Languages:" preferred editor: "Preferred Editor:" image: "Image:" + gravatar: + gravatar: "Use Gravatar" + link: "http://wiki.openstreetmap.org/wiki/Gravatar" + link text: "what is this?" new image: "Add an image" keep image: "Keep the current image" delete image: "Remove the current image" @@@ -1981,25 -1958,6 +1980,25 @@@ back: "View all blocks" revoker: "Revoker:" needs_view: "The user needs to log in before this block will be cleared." + note: + description: + opened_at_by: "Created %{when} ago by %{user}" + commented_at_by: "Updated %{when} ago by %{user}" + closed_at_by: "Resolved %{when} ago by %{user}" + reopened_at_by: "Reactivated %{when} ago by %{user}" + rss: + title: "OpenStreetMap Notes" + description_area: "A list of notes, reported, commented on or closed in your area [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]" + description_item: "An rss feed for note %{id}" + closed: "closed note (near %{place})" + new: "new note (near %{place})" + comment: "new comment (near %{place})" + mine: + title: "Notes submitted or commented on by %{user}" + heading: "%{user}'s notes" + description: "Notes submitted or commented on by %{user}" + id: "Id" + last_changed: "Last changed" javascripts: map: base: @@@ -2016,20 -1974,6 +2015,20 @@@ 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_1: Move the marker to the correct position and + intro_2: "add your comment in the box below:" + add: Add Note + show: + title: Note %{id} + event: "%{action} by %{user} at %{time}" + close: Close + comment_and_close: Comment & Close + comment: Comment redaction: edit: description: "Description" diff --combined db/structure.sql index 102a95cf2,339533b92..84c38c86e --- a/db/structure.sql +++ b/db/structure.sql @@@ -61,30 -61,6 +61,30 @@@ CREATE TYPE gpx_visibility_enum AS ENU ); +-- +-- Name: note_event_enum; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE note_event_enum AS ENUM ( + 'opened', + 'closed', + 'reopened', + 'commented', + 'hidden' +); + + +-- +-- Name: note_status_enum; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE note_status_enum AS ENUM ( + 'open', + 'closed', + 'hidden' +); + + -- -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: - -- @@@ -125,7 -101,7 +125,7 @@@ CREATE TYPE user_status_enum AS ENUM CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer LANGUAGE c STRICT - AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'maptile_for_point'; + AS '/srv/www/notes.osm.compton.nu/db/functions/libpgosm.so', 'maptile_for_point'; -- @@@ -134,7 -110,7 +134,7 @@@ CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint LANGUAGE c STRICT - AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'tile_for_point'; + AS '/srv/www/notes.osm.compton.nu/db/functions/libpgosm.so', 'tile_for_point'; -- @@@ -143,7 -119,7 +143,7 @@@ CREATE FUNCTION xid_to_int4(xid) RETURNS integer LANGUAGE c IMMUTABLE STRICT - AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'xid_to_int4'; + AS '/srv/www/notes.osm.compton.nu/db/functions/libpgosm.so', 'xid_to_int4'; SET default_tablespace = ''; @@@ -242,8 -218,8 +242,8 @@@ CREATE TABLE client_applications key character varying(50), secret character varying(50), user_id integer, - created_at timestamp without time zone, - updated_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, allow_read_prefs boolean DEFAULT false NOT NULL, allow_write_prefs boolean DEFAULT false NOT NULL, allow_write_diary boolean DEFAULT false NOT NULL, @@@ -724,78 -700,6 +724,78 @@@ CREATE TABLE nodes ); +-- +-- Name: note_comments; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE note_comments ( + id integer NOT NULL, + note_id bigint NOT NULL, + visible boolean NOT NULL, + created_at timestamp without time zone NOT NULL, + author_name character varying(255), + author_ip character varying(255), + author_id bigint, + body text, + event note_event_enum +); + + +-- +-- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE note_comments_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE note_comments_id_seq OWNED BY note_comments.id; + + +-- +-- Name: notes; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE notes ( + id integer NOT NULL, + latitude integer NOT NULL, + longitude integer NOT NULL, + tile bigint NOT NULL, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL, + nearby_place character varying(255), + status note_status_enum NOT NULL, + closed_at timestamp without time zone +); + + +-- +-- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE notes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE notes_id_seq OWNED BY notes.id; + + -- -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace: -- @@@ -804,8 -708,8 +804,8 @@@ CREATE TABLE oauth_nonces id integer NOT NULL, nonce character varying(255), "timestamp" integer, - created_at timestamp without time zone, - updated_at timestamp without time zone + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL ); @@@ -841,8 -745,8 +841,8 @@@ CREATE TABLE oauth_tokens secret character varying(50), authorized_at timestamp without time zone, invalidated_at timestamp without time zone, - created_at timestamp without time zone, - updated_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, allow_read_prefs boolean DEFAULT false NOT NULL, allow_write_prefs boolean DEFAULT false NOT NULL, allow_write_diary boolean DEFAULT false NOT NULL, @@@ -970,8 -874,8 +970,8 @@@ CREATE TABLE user_blocks ends_at timestamp without time zone NOT NULL, needs_view boolean DEFAULT false NOT NULL, revoker_id bigint, - created_at timestamp without time zone, - updated_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, reason_format format_enum DEFAULT 'html'::format_enum NOT NULL ); @@@ -1013,8 -917,8 +1013,8 @@@ CREATE TABLE user_preferences CREATE TABLE user_roles ( id integer NOT NULL, user_id bigint NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, role user_role_enum NOT NULL, granter_id bigint NOT NULL ); @@@ -1096,14 -1000,15 +1096,15 @@@ CREATE TABLE users status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL, terms_agreed timestamp without time zone, consider_pd boolean DEFAULT false NOT NULL, + openid_url character varying(255), preferred_editor character varying(255), terms_seen boolean DEFAULT false NOT NULL, - openid_url character varying(255), description_format format_enum DEFAULT 'html'::format_enum NOT NULL, image_fingerprint character varying(255), changesets_count integer DEFAULT 0 NOT NULL, traces_count integer DEFAULT 0 NOT NULL, - diary_entries_count integer DEFAULT 0 NOT NULL + diary_entries_count integer DEFAULT 0 NOT NULL, + image_use_gravatar boolean DEFAULT true NOT NULL ); @@@ -1255,20 -1160,6 +1256,20 @@@ ALTER TABLE ONLY gpx_files ALTER COLUM ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass); +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); + + -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- @@@ -1486,22 -1377,6 +1487,22 @@@ ALTER TABLE ONLY node ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version); +-- +-- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- + +ALTER TABLE ONLY note_comments + ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id); + + +-- +-- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- + +ALTER TABLE ONLY notes + ADD CONSTRAINT notes_pkey PRIMARY KEY (id); + + -- -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- @@@ -1852,34 -1727,6 +1853,34 @@@ CREATE INDEX nodes_tile_idx ON nodes US CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp"); +-- +-- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX note_comments_note_id_idx ON note_comments USING btree (note_id); + + +-- +-- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX notes_created_at_idx ON notes USING btree (created_at); + + +-- +-- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX notes_tile_status_idx ON notes USING btree (tile, status); + + +-- +-- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX notes_updated_at_idx ON notes USING btree (updated_at); + + -- -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@@ -2214,22 -2061,6 +2215,22 @@@ ALTER TABLE ONLY node ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id); +-- +-- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY note_comments + ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id); + + +-- +-- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY note_comments + ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id); + + -- -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@@ -2414,10 -2245,6 +2415,10 @@@ INSERT INTO schema_migrations (version INSERT INTO schema_migrations (version) VALUES ('20110322001319'); +INSERT INTO schema_migrations (version) VALUES ('20110508145337'); + +INSERT INTO schema_migrations (version) VALUES ('20110521142405'); + INSERT INTO schema_migrations (version) VALUES ('20110925112722'); INSERT INTO schema_migrations (version) VALUES ('20111116184519'); @@@ -2444,6 -2271,8 +2445,8 @@@ INSERT INTO schema_migrations (version INSERT INTO schema_migrations (version) VALUES ('20121005195010'); + INSERT INTO schema_migrations (version) VALUES ('20121012044047'); + INSERT INTO schema_migrations (version) VALUES ('21'); INSERT INTO schema_migrations (version) VALUES ('22'); @@@ -2514,16 -2343,6 +2517,16 @@@ INSERT INTO schema_migrations (version INSERT INTO schema_migrations (version) VALUES ('52'); +INSERT INTO schema_migrations (version) VALUES ('53'); + +INSERT INTO schema_migrations (version) VALUES ('54'); + +INSERT INTO schema_migrations (version) VALUES ('55'); + +INSERT INTO schema_migrations (version) VALUES ('56'); + +INSERT INTO schema_migrations (version) VALUES ('57'); + INSERT INTO schema_migrations (version) VALUES ('6'); INSERT INTO schema_migrations (version) VALUES ('7');