From: Matt Amos Date: Tue, 25 Aug 2009 16:49:52 +0000 (+0000) Subject: merge r17141:17256 from trunk X-Git-Tag: live~6643^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c6bf21a9d054f29d788272767b7a77d58fe56aec?hp=498832eb372d260cc12ac7037ef278a4652d34bc merge r17141:17256 from trunk --- diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 52e287b9a..690b4292b 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -103,7 +103,7 @@ class DiaryEntryController < ApplicationController if user @entries = DiaryEntry.find(:all, :conditions => ['user_id = ?', user.id], :order => 'created_at DESC', :limit => 20) - @title = I18n.t('diary_entry.feed.user.title', :user => user.display_name, :locale => I18n.locale) + @title = I18n.t('diary_entry.feed.user.title', :user => user.display_name) @description = I18n.t('diary_entry.feed.user.description', :user => user.display_name) @link = "http://#{SERVER_URL}/user/#{user.display_name}/diary" else @@ -113,8 +113,8 @@ class DiaryEntryController < ApplicationController @entries = DiaryEntry.find(:all, :include => :user, :conditions => ["users.visible = ? AND diary_entries.language_code = ?", true, params[:language]], :order => 'created_at DESC', :limit => 20) - @title = I18n.t('diary_entry.feed.language.title', Language.find(params[:language]).english_name) - @description = I18n.t('diary_entry.feed.language.description', Language.find(params[:language]).english_name) + @title = I18n.t('diary_entry.feed.language.title', :language_name => Language.find(params[:language]).english_name) + @description = I18n.t('diary_entry.feed.language.description', :language_name => Language.find(params[:language]).english_name) @link = "http://#{SERVER_URL}/diary/#{params[:language]}" else @entries = DiaryEntry.find(:all, :include => :user, diff --git a/app/controllers/oauth_clients_controller.rb b/app/controllers/oauth_clients_controller.rb index 00606c1ec..f90302894 100644 --- a/app/controllers/oauth_clients_controller.rb +++ b/app/controllers/oauth_clients_controller.rb @@ -2,8 +2,9 @@ class OauthClientsController < ApplicationController layout 'site' before_filter :authorize_web + before_filter :set_locale before_filter :require_user - + def index @client_applications = @user.client_applications @tokens = @user.oauth_tokens.find :all, :conditions => 'oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null' @@ -16,13 +17,13 @@ class OauthClientsController < ApplicationController def create @client_application = @user.client_applications.build(params[:client_application]) if @client_application.save - flash[:notice] = "Registered the information successfully" + flash[:notice] = t'oauth_clients.create.flash' redirect_to :action => "show", :id => @client_application.id else render :action => "new" end end - + def show @client_application = @user.client_applications.find(params[:id]) rescue ActiveRecord::RecordNotFound @@ -33,11 +34,11 @@ class OauthClientsController < ApplicationController def edit @client_application = @user.client_applications.find(params[:id]) end - + def update @client_application = @user.client_applications.find(params[:id]) if @client_application.update_attributes(params[:client_application]) - flash[:notice] = "Updated the client information successfully" + flash[:notice] = t'oauth_clients.update.flash' redirect_to :action => "show", :id => @client_application.id else render :action => "edit" @@ -47,7 +48,7 @@ class OauthClientsController < ApplicationController def destroy @client_application = @user.client_applications.find(params[:id]) @client_application.destroy - flash[:notice] = "Destroyed the client application registration" + flash[:notice] = t'oauth_clients.destroy.flash' redirect_to :action => "index" end end diff --git a/app/controllers/oauth_controller.rb b/app/controllers/oauth_controller.rb index f8959beae..98075b8f8 100644 --- a/app/controllers/oauth_controller.rb +++ b/app/controllers/oauth_controller.rb @@ -1,7 +1,8 @@ class OauthController < ApplicationController layout 'site' - before_filter :authorize_web, :except => [:request_token, :access_token] + before_filter :authorize_web, :only => [:oauthorize, :revoke] + before_filter :set_locale, :only => [:oauthorize, :revoke] before_filter :require_user, :only => [:oauthorize] before_filter :verify_oauth_consumer_signature, :only => [:request_token] before_filter :verify_oauth_request_token, :only => [:access_token] @@ -11,13 +12,11 @@ class OauthController < ApplicationController def request_token @token = current_client_application.create_request_token - logger.info "in REQUEST TOKEN" if @token logger.info "request token params: #{params.inspect}" # request tokens indicate what permissions the client *wants*, not # necessarily the same as those which the user allows. current_client_application.permissions.each do |pref| - logger.info "PARAMS found #{pref}" @token.write_attribute(pref, true) end @token.save! @@ -26,8 +25,8 @@ class OauthController < ApplicationController else render :nothing => true, :status => 401 end - end - + end + def access_token @token = current_token && current_token.exchange! if @token @@ -39,19 +38,18 @@ class OauthController < ApplicationController def oauthorize @token = RequestToken.find_by_token params[:oauth_token] - unless @token.invalidated? - if request.post? + unless @token.invalidated? + if request.post? any_auth = false @token.client_application.permissions.each do |pref| if params[pref] - logger.info "OAUTHORIZE PARAMS found #{pref}" @token.write_attribute(pref, true) any_auth ||= true else @token.write_attribute(pref, false) end end - + if any_auth @token.authorize!(@user) redirect_url = params[:oauth_callback] || @token.client_application.callback_url @@ -69,15 +67,13 @@ class OauthController < ApplicationController render :action => "authorize_failure" end end - + def revoke @token = @user.oauth_tokens.find_by_token params[:token] if @token @token.invalidate! - flash[:notice] = "You've revoked the token for #{@token.client_application.name}" + flash[:notice] = t('oauth.revoke.flash', :application => @token.client_application.name) end - logger.info "about to redirect" redirect_to :controller => 'oauth_clients', :action => 'index' end - end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 86b715154..bea700331 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -29,7 +29,7 @@ class UserController < ApplicationController if @user.save flash[:notice] = t 'user.new.flash create success message' - Notifier.deliver_signup_confirm(@user, @user.tokens.create) + Notifier.deliver_signup_confirm(@user, @user.tokens.create(:referer => params[:referer])) redirect_to :action => 'login' else render :action => 'new' @@ -198,10 +198,15 @@ class UserController < ApplicationController @user.active = true @user.email_valid = true @user.save! + referer = token.referer token.destroy flash[:notice] = t 'user.confirm.success' session[:user] = @user.id - redirect_to :action => 'account', :display_name => @user.display_name + unless referer.nil? + redirect_to referer + else + redirect_to :action => 'account', :display_name => @user.display_name + end else @notice = t 'user.confirm.failure' end diff --git a/app/views/oauth/oauthorize.html.erb b/app/views/oauth/oauthorize.html.erb index 0b9d321fe..844a86d52 100644 --- a/app/views/oauth/oauthorize.html.erb +++ b/app/views/oauth/oauthorize.html.erb @@ -1,17 +1,15 @@

Authorize access to your account

-

<%= t('oauth.client_application.request_access', :app_name => link_to(@token.client_application.name,@token.client_application.url)) %>

+

<%= t('oauth.oauthorize.request_access', :app_name => link_to(@token.client_application.name,@token.client_application.url)) %>

<% form_tag authorize_url do %> <%= hidden_field_tag "oauth_token", @token.token %> <%- if params[:oauth_callback] -%> - <%= hidden_field_tag "oauth_callback", params[:oauth_callback] %> -<%- end -%> -

<%= t 'oauth.client_application.allow_to' %>

- -

- <%= submit_tag %> -

+ <%= hidden_field_tag "oauth_callback", params[:oauth_callback] %> + <%- end -%> +

<%= t 'oauth.oauthorize.allow_to' %>

+ +

<%= submit_tag %>

<% end %> diff --git a/app/views/oauth_clients/_form.html.erb b/app/views/oauth_clients/_form.html.erb index f8fd4347e..dc8f8e3d9 100644 --- a/app/views/oauth_clients/_form.html.erb +++ b/app/views/oauth_clients/_form.html.erb @@ -1,23 +1,23 @@
-
- <%= f.text_field :name %> +
+ <%= f.text_field :name %>
-
- <%= f.text_field :url %> +
+ <%= f.text_field :url %>
-
- <%= f.text_field :callback_url %> +
+ <%= f.text_field :callback_url %>
-
- <%= f.text_field :support_url %> +
+ <%= f.text_field :support_url %>
-

<%= t'oauth.client_application.form.requests' %>

+

<%= t'oauth_clients.form.requests' %>

<% ClientApplication.all_permissions.each do |perm| %>
<%= f.check_box perm %> -
+
<% end %> diff --git a/app/views/oauth_clients/edit.html.erb b/app/views/oauth_clients/edit.html.erb index 855fc03d8..085ddef4e 100644 --- a/app/views/oauth_clients/edit.html.erb +++ b/app/views/oauth_clients/edit.html.erb @@ -1,6 +1,6 @@ -

<%= t'oauth.client_application.edit.title' %>

+

<%= t'oauth_clients.edit.title' %>

<% form_for :client_application, @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %> - <%= render :partial => "form", :locals => { :f => f } %> -
- <%= submit_tag t'oauth.client_application.edit.submit' %> + <%= render :partial => "form", :locals => { :f => f } %> +
+ <%= submit_tag t'oauth_clients.edit.submit' %> <% end %> diff --git a/app/views/oauth_clients/index.html.erb b/app/views/oauth_clients/index.html.erb index 9f11cddef..d95c68bcb 100644 --- a/app/views/oauth_clients/index.html.erb +++ b/app/views/oauth_clients/index.html.erb @@ -1,10 +1,10 @@ -

<%= t'oauth.client_application.index.title' %>

+

<%= t'oauth_clients.index.title' %>

<% unless @tokens.empty? %> -

<%= t'oauth.client_application.index.my_tokens' %>

-

<%= t'oauth.client_application.index.list_tokens' %>

+

<%= t'oauth_clients.index.my_tokens' %>

+

<%= t'oauth_clients.index.list_tokens' %>

- - + + <% @tokens.each do |token|%> <% content_tag_for :tr, token do %> @@ -12,22 +12,22 @@ <% end %> <% end %>
<%= t'oauth.client_application.index.application' %><%= t'oauth.client_application.index.issued_at' %> 
<%= t'oauth_clients.index.application' %><%= t'oauth_clients.index.issued_at' %> 
<%= link_to token.client_application.name, token.client_application.url %> <% form_tag :controller => 'oauth', :action => 'revoke' do %> <%= hidden_field_tag 'token', token.token %> - <%= submit_tag t('oauth.client_application.index.revoke') %> + <%= submit_tag t('oauth_clients.index.revoke') %> <% end %>
<% end %> -

<%= t'oauth.client_application.index.my_apps' %>

+

<%= t'oauth_clients.index.my_apps' %>

<% if @client_applications.empty? %> -

<%= t('oauth.client_application.index.no_apps', :oauth => "OAuth") %>

+

<%= t('oauth_clients.index.no_apps', :oauth => "OAuth") %>

<% else %> -

<%= t'oauth.client_application.index.registered_apps' %>

+

<%= t'oauth_clients.index.registered_apps' %>

<% @client_applications.each do |client|%> <% div_for client do %> <%= link_to client.name, :action => :show, :id => client.id %> <% end %> <% end %> <% end %> -

<%= link_to t('oauth.client_application.index.register_new'), :action => :new %>

+

<%= link_to t('oauth_clients.index.register_new'), :action => :new %>

diff --git a/app/views/oauth_clients/new.html.erb b/app/views/oauth_clients/new.html.erb index 75102f80c..292c53fc0 100644 --- a/app/views/oauth_clients/new.html.erb +++ b/app/views/oauth_clients/new.html.erb @@ -1,6 +1,6 @@ -

<%= t'oauth.client_application.new.title' %>

+

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

<% form_for :client_application, :url => { :action => :create } do |f| %> <%= render :partial => "form", :locals => { :f => f } %>
- <%= submit_tag t'oauth.client_application.new.submit' %> + <%= submit_tag t('oauth_clients.new.submit') %> <% end %> diff --git a/app/views/oauth_clients/not_found.erb b/app/views/oauth_clients/not_found.erb index 9a9865b73..d5c6ca755 100644 --- a/app/views/oauth_clients/not_found.erb +++ b/app/views/oauth_clients/not_found.erb @@ -1 +1 @@ -

<%= t('oauth.client_application.not_found', :type => @type) %>

+

<%= t('oauth_clients.not_found.sorry', :type => @type) %>

diff --git a/app/views/oauth_clients/show.html.erb b/app/views/oauth_clients/show.html.erb index df8fbc248..2769fcd28 100644 --- a/app/views/oauth_clients/show.html.erb +++ b/app/views/oauth_clients/show.html.erb @@ -1,28 +1,27 @@ -

<%= t('oauth.client_application.show.title', :app_name => @client_application.name) %>

+

<%= t('oauth_clients.show.title', :app_name => @client_application.name) %>

- <%= t'oauth.client_application.show.key' %> <%=@client_application.key %> + <%= t'oauth_clients.show.key' %> <%=@client_application.key %>

- <%= t'oauth.client_application.show.secret' %> <%=@client_application.secret %> + <%= t'oauth_clients.show.secret' %> <%=@client_application.secret %>

- <%= t'oauth.client_application.show.url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %> + <%= t'oauth_clients.show.url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>

- <%= t'oauth.client_application.show.access_url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %> + <%= t'oauth_clients.show.access_url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>

- <%= t'oauth.client_application.show.authorize_url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %> + <%= t'oauth_clients.show.authorize_url' %> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>

-

<%= t'oauth.client_application.show.requests' %>

+

<%= t'oauth_clients.show.requests' %>

-

<%= t'oauth.client_application.show.support_notice' %>

- -

<%= link_to t('oauth.client_application.show.edit'), edit_oauth_client_url(@client_application.user.display_name, @client_application) %>

+

<%= t'oauth_clients.show.support_notice' %>

+

<%= link_to t('oauth_clients.show.edit'), edit_oauth_client_url(@client_application.user.display_name, @client_application) %>

diff --git a/app/views/user/login.html.erb b/app/views/user/login.html.erb index 9b6d62f92..0ae8fc0d9 100644 --- a/app/views/user/login.html.erb +++ b/app/views/user/login.html.erb @@ -1,6 +1,6 @@

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

-

<%= t 'user.login.please login', :create_user_link => link_to(t('user.login.create_account'), :controller => 'user', :action => 'new') %>

+

<%= t 'user.login.please login', :create_user_link => link_to(t('user.login.create_account'), :controller => 'user', :action => 'new', :referer => params[:referer]) %>

<% form_tag :action => 'login' do %> <%= hidden_field_tag('referer', h(params[:referer])) %> diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index 6ac85560d..8b1dab5be 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -19,6 +19,7 @@ <%= error_messages_for 'user' %> <% form_tag :action => 'save' do %> +<%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 16f66dbbc..42fa072d1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -797,7 +797,7 @@ en: make_public: made_public: "Track made public" oauth: - client_application: + oauthorize: request_access: "The application {{app_name}} is requesting access to your account. Please check whether you would like the application to have the following capabilities. You may choose as many or as few as you like." allow_to: "Allow the client application to:" allow_read_prefs: "read your user preferences." @@ -806,53 +806,63 @@ en: allow_write_api: "modify the map." allow_read_gpx: "read your private GPS traces." allow_write_gpx: "upload GPS traces." - new: - title: "Register a new application" - submit: "Register" - edit: - title: "Edit your application" - submit: "Edit" - show: - title: "OAuth details for {{app_name}}" - key: "Consumer Key:" - secret: "Consumer Secret:" - url: "Request Token URL:" - access_url: "Access Token URL:" - authorize_url: "Authorise URL:" - support_notice: "We support hmac-sha1 (recommended) as well as plain text in ssl mode." - edit: "Edit Details" - requests: "Requesting the following permissions from the user:" - allow_read_prefs: "read their user preferences." - allow_write_prefs: "modify their user preferences." - allow_write_diary: "create diary entries, comments and make friends." - allow_write_api: "modify the map." - allow_read_gpx: "read their private GPS traces." - allow_write_gpx: "upload GPS traces." - index: - title: "My OAuth Details" - my_tokens: "My Authorised Applications" - list_tokens: "The following tokens have been issued to applications in your name:" - application: "Application Name" - issued_at: "Issued At" - revoke: "Revoke!" - my_apps: "My Client Applications" - no_apps: "Do you have an application you would like to register for use with us using the {{oauth}} standard? You must register your web application before it can make OAuth requests to this service." - registered_apps: "You have the following client applications registered:" - register_new: "Register your application" - form: - name: "Name" - required: "Required" - url: "Main Application URL" - callback_url: "Callback URL" - support_url: "Support URL" - requests: "Request the following permissions from the user:" - allow_read_prefs: "read their user preferences." - allow_write_prefs: "modify their user preferences." - allow_write_diary: "create diary entries, comments and make friends." - allow_write_api: "modify the map." - allow_read_gpx: "read their private GPS traces." - allow_write_gpx: "upload GPS traces." - not_found: "Sorry, that {{type}} could not be found." + revoke: + flash: "You've revoked the token for {{application}}" + oauth_clients: + new: + title: "Register a new application" + submit: "Register" + edit: + title: "Edit your application" + submit: "Edit" + show: + title: "OAuth details for {{app_name}}" + key: "Consumer Key:" + secret: "Consumer Secret:" + url: "Request Token URL:" + access_url: "Access Token URL:" + authorize_url: "Authorise URL:" + support_notice: "We support hmac-sha1 (recommended) as well as plain text in ssl mode." + edit: "Edit Details" + requests: "Requesting the following permissions from the user:" + allow_read_prefs: "read their user preferences." + allow_write_prefs: "modify their user preferences." + allow_write_diary: "create diary entries, comments and make friends." + allow_write_api: "modify the map." + allow_read_gpx: "read their private GPS traces." + allow_write_gpx: "upload GPS traces." + index: + title: "My OAuth Details" + my_tokens: "My Authorised Applications" + list_tokens: "The following tokens have been issued to applications in your name:" + application: "Application Name" + issued_at: "Issued At" + revoke: "Revoke!" + my_apps: "My Client Applications" + no_apps: "Do you have an application you would like to register for use with us using the {{oauth}} standard? You must register your web application before it can make OAuth requests to this service." + registered_apps: "You have the following client applications registered:" + register_new: "Register your application" + form: + name: "Name" + required: "Required" + url: "Main Application URL" + callback_url: "Callback URL" + support_url: "Support URL" + requests: "Request the following permissions from the user:" + allow_read_prefs: "read their user preferences." + allow_write_prefs: "modify their user preferences." + allow_write_diary: "create diary entries, comments and make friends." + allow_write_api: "modify the map." + allow_read_gpx: "read their private GPS traces." + allow_write_gpx: "upload GPS traces." + not_found: + sorry: "Sorry, that {{type}} could not be found." + create: + flash: "Registered the information successfully" + update: + flash: "Updated the client information successfully" + destroy: + flash: "Destroyed the client application registration" user: login: title: "Login" diff --git a/config/locales/hu.yml b/config/locales/hu.yml index d65033c46..3d943b787 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -87,6 +87,9 @@ hu: download: "{{changeset_xml_link}} vagy {{osmchange_xml_link}} letöltése" changesetxml: "Changeset XML" osmchangexml: "osmChange XML" + feed: + title: "Módosításcsomag: {{id}}" + title_comment: "Módosításcsomag: {{id}} - {{comment}}" changeset_navigation: user: name_tooltip: "{{user}} szerkesztéseinek megtekintése" @@ -317,6 +320,16 @@ hu: edit_link: Ezen bejegyzés szerkesztése diary_comment: comment_from: "{{link_user}} hozzászólása ekkor: {{comment_created_at}}" + feed: + user: + title: "{{user}} OpenStreetMap naplóbejegyzései" + description: "Legutóbbi OpenStreetMap naplóbejegyzések {{user}} felhasználótól" + language: + title: "OpenStreetMap naplóbejegyzések {{language_name}} nyelven" + description: "Legutóbbi naplóbejegyzések az OpenStreetMap felhasználóitól {{language_name}} nyelven" + all: + title: "OpenStreetMap naplóbejegyzések" + description: "Legutóbbi naplóbejegyzések az OpenStreetMap felhasználóitól" export: start: area_to_export: "Exportálandó terület" @@ -690,6 +703,11 @@ hu: destination: "Csak célforgalom" construction: "Utak építés alatt" trace: + visibility: + private: "Magán (megosztva csak névtelenül, rendezetlen pontok)" + public: "Nyilvános (megjelenik a nyomvonalak listáján névtelenül, rendezetlen pontok)" + trackable: "Követhető (megosztva csak névtelenül, rendezett pontok időbélyeggel)" + identifiable: "Azonosítható (megjelenik a nyomvonalak listáján, és azonodítható, rendezett pontok időbélyeggel)" create: upload_trace: "GPS nyomvonal feltöltése" trace_uploaded: "A GPX fájl feltöltése megtörtént, és várakozik az adatbázisba való beillesztésre. Ez általában fél órán belül megtörténik, és fogsz kapni egy e-mailt, amint elkészült." @@ -708,6 +726,9 @@ hu: tags: "Címkék:" tags_help: "vesszővel elválasztva" save_button: "Módosítások mentése" + visibility: "Láthatóság:" + visibility_help: "Mit jelent ez?" + visibility_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces" no_such_user: title: "Nincs ilyen felhasználó" heading: "{{user}} felhasználó nem létezik" @@ -717,9 +738,9 @@ hu: description: "Leírás" tags: "Címkék" tags_help: "vesszővel elválasztva" - public: "Nyilvános?" - public_help: "mit jelent ez?" - public_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces" + visibility: "Láthatóság" + visibility_help: "Mit jelent ez?" + visibility_help_url: "http://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces" upload_button: "Feltöltés" help: "Segítség" help_url: "http://wiki.openstreetmap.org/wiki/Upload" @@ -745,10 +766,10 @@ hu: description: "Leírás:" tags: "Címkék:" none: "nincsenek" - make_public: "Ezen nyomvonal nyilvánossá tétele véglegesen" edit_track: "Ezen nyomvonal szerkesztése" delete_track: "Ezen nyomvonal törlése" trace_not_found: "Nem található nyomvonal!" + visibility: "Láthatóság:" trace_paging_nav: showing: "Jelenlegi oldal:" of: "összesen:" @@ -775,6 +796,73 @@ hu: scheduled_for_deletion: "A nyomvonal törlésre kijelölve" make_public: made_public: "A nyomvonal nyilvános lett" + oauth: + oauthorize: + request_access: "A(z) {{app_name}} alkalmazás hozzáférést kér a felhasználói fiókodhoz. Kérlek, jelöld, ha azt szeretnéd, hogy az alkalmazás rendelkezzen a következő képességekkel. Választhatsz olyan sokat vagy keveset, amennyit szeretnél." + allow_to: "Az alábbiak engedélyezése a kliensalkalmazásnak:" + allow_read_prefs: "felhasználói beállítások olvasása." + allow_write_prefs: "felhasználói beállítások módosítása." + allow_write_diary: "naplóbejegyzések, hozzászólások készítése és barátok hozzáadása." + allow_write_api: "a térkép módosítása." + allow_read_gpx: "magán GPS nyomvonalak olvasása." + allow_write_gpx: "GPS nyomvonalak feltöltése." + revoke: + flash: "Visszavontad az utalványt a(z) {{application}} alkalmazáshoz" + oauth_clients: + new: + title: "Új alkalmazás regisztrálása" + submit: "Regisztrálás" + edit: + title: "Alkalmazás szerkesztése" + submit: "Szerkesztés" + show: + title: "{{app_name}} OAuth részletei" + key: "Consumer Key:" + secret: "Consumer Secret:" + url: "Request Token URL:" + access_url: "Access Token URL:" + authorize_url: "Authorise URL:" + support_notice: "Támogatjuk a hmac-sha1 hitelesítést (ajánlott), valamint a sima szöveget ssl módban." + edit: "Részletek szerkesztése" + requests: "A következő engedélyek kérése a felhasználótól:" + allow_read_prefs: "felhasználó beállításainak olvasása." + allow_write_prefs: "felhasználó beállításainak módosítása." + allow_write_diary: "naplóbejegyzések, hozzászólások készítése és barátok hozzáadása." + allow_write_api: "a térkép módosítása." + allow_read_gpx: "magán GPS nyomvonalainak olvasása." + allow_write_gpx: "GPS nyomvonalak feltöltése." + index: + title: "OAuth részletek" + my_tokens: "Engedélyezett alkalmazások" + list_tokens: "A következő utalványok kerültek kibocsátásra a nevedben:" + application: "Alkalmazás neve" + issued_at: "Kibocsátva ekkor" + revoke: Visszavonás!" + my_apps: "Kliensalkalmazások" + no_apps: "Van olyan alkalmazásod, amit szeretnél regisztrálni a velünk való használathoz a(z) {{oauth}} szabvány használatával? Regisztrálnod kell a webalkalmazásod, mielőtt OAuth kéréseket küld ehhez a szolgáltatáshoz." + registered_apps: "A következő kliensalkalmazások vannak regisztrálva:" + register_new: "Alkalmazás regisztrálása" + form: + name: "Név" + required: "Szükséges" + url: "Main Application URL" + callback_url: "Callback URL" + support_url: "Support URL" + requests: "A következő engedélyek kérése a felhasználótól:" + allow_read_prefs: "felhasználó beállításainak olvasása." + allow_write_prefs: "felhasználó beállításainak módosítása." + allow_write_diary: "naplóbejegyzések, hozzászólások készítése és barátok hozzáadása." + allow_write_api: "a térkép módosítása." + allow_read_gpx: "magán GPS nyomvonalainak olvasása." + allow_write_gpx: "GPS nyomvonalak feltöltése." + not_found: + sorry: "Sajnálom, a(z) {{type}} nem található." + create: + flash: "Az információ sikeresen regisztrálva" + update: + flash: "A kliens információi sikeresen frissítve" + destroy: + flash: "A kliensalkalmazás regisztrációja törölve" user: login: title: "Bejelentkezés" @@ -851,6 +939,7 @@ hu: nearby users: "Közeli felhasználók: " no nearby users: "Még nincsenek felhasználók, akik megadták, hogy a közelben szerkesztenek." change your settings: beállítások módosítása + my_oauth_details: "OAuth részletek megtekintése" friend_map: your location: Helyed nearby mapper: "Közeli térképszerkesztők: " diff --git a/config/potlatch/localised/hu/localised.yaml b/config/potlatch/localised/hu/localised.yaml index e7ee9f2d1..d06699347 100644 --- a/config/potlatch/localised/hu/localised.yaml +++ b/config/potlatch/localised/hu/localised.yaml @@ -3,6 +3,7 @@ "hint_pointselected": pont kijelölve\n(shift+kattintás a pontra\núj vonal kezdéséhez) "action_movepoint": pont mozgatása "hint_drawmode": kattintás pont hozzáadásához\ndupla kattintás/Enter\na vonal befejezéséhez +"action_insertnode": pont hozzáadása vonalhoz "hint_overendpoint": végpont fölött ($1)\nkattintás a csatlakoztatáshoz\nshift+kattintás az egyesítéshez "hint_overpoint": pont fölött ($1)\nkattintás a csatlakoztatáshoz "closechangeset": Módosításcsomag bezárása @@ -11,14 +12,15 @@ "cancel": Mégse "ok": OK "prompt_changesetcomment": "Adj leírást a módosításaidhoz:" +"newchangeset": "\nKérlek, próbáld újra: a Potlatch egy új módosításcsomagot fog kezdeni." "emailauthor": \n\nKérlek, jelentsd a hibát (angolul) a richard\@systemeD.net e-mail címre, és írd le, hogy mit csináltál akkor, amikor a hiba történt. "retry": Újra "error_connectionfailed": Sajnálom - az OpenStreetMap szerverhez való kapcsolódás sikertelen. A legutóbbi módosítások nem lettek elmentve.\n\nSzeretnéd megpróbálni újra? "error_readfailed": Sajnálom - az OpenStreetMap szerver az adatok lekérdezésekor nem válaszolt.\n\nSzeretnéd megpróbálni újra? "conflict_waychanged": Amióta elkezdtél szerkeszteni, valaki más módosította a(z) $1$2 vonalat. -"conflict_visitway": "A vonal megtekintéséhez kattints az 'OK'-ra." +"conflict_visitway": A vonal megtekintéséhez kattints az OK-ra. "conflict_poichanged": Amióta elkezdtél szerkeszteni, valaki más módosította a(z) $1$2 pontot. -"conflict_visitpoi": "A pont megtekintéséhez kattints az 'OK'-ra." +"conflict_visitpoi": A pont megtekintéséhez kattints az OK-ra. "conflict_relchanged": Amióta elkezdtél szerkeszteni, valaki más módosította a(z) $1$2 kapcsolatot. "conflict_download": Az ő változatának letöltése "conflict_overwrite": Az ő változatának felülírása @@ -57,13 +59,22 @@ "tip_repeattag": Az előzőleg kiválasztott vonal címkéinek megismétlése (R) "tip_alert": Hiba történt - kattints a részletekért "help": Súgó -"manual": Kézikönyv +"advanced_parallel": Párhuzamos vonal +"advanced_history": Vonal története +"advanced_inspector": Felügyelő +"advanced_undelete": Törlés visszavonása +"advanced_close": Módosításcsomag lezárása +"advanced_maximise": Ablak maximalizálása "way": Vonal "advice_toolong": Túl hosszú a feloldáshoz - vágd rövidebb szakaszokra "deleting": törlése "action_deletepoint": pont törlése +"advice_deletingway": Vonal törlése (Z a visszavonáshoz) +"advice_revertingway": Visszaállítás a legutóbb mentett vonalra (Z a viszavonáshoz) "action_cancelchanges": "módosítások elvetése:" -"custom": "Egyéni:" +"advice_revertingpoi": Visszaállítás a legutóbb mentett POI-ra (Z a viszavonáshoz) +"advice_deletingpoi": POI törlése (Z a visszavonáshoz) +"custom": "Egyéni: " "nobackground": Nincs háttérkép "option_fadebackground": Áttetsző háttér "option_thinlines": Vékony vonalak használata minden méretaránynál @@ -100,10 +111,10 @@ "error_noway": A(z) $1 nem található (talán már eltávolítottad?), így nem vonható vissza. "error_nosharedpoint": A(z) $1 és a(z) $2 vonalaknak már nincs közös pontja, így nem vonható vissza a kettévágás. "error_nopoi": A POI nem található (talán már eltávolítottad?), így nem vonható vissza. -"action_tidyway": vonal tisztítása "delete": Törlés "prompt_taggedpoints": Ezen a vonalon van néhány címkézett pont. Biztosan törlöd? "a_way": vonal $1 +"action_changeway": módosítások vonalhoz "advice_waydragged": Vonal áthelyezve (Z a visszavonáshoz) "action_moveway": vonal mozgatása "action_splitway": vonal kettévágása @@ -111,7 +122,6 @@ "advice_tagconflict": A címkék nem egyeznek - ellenőrizd (Z a visszavonáshoz) "advice_nocommonpoint": A vonalaknak nincs közös pontjuk "action_reverseway": vonal megfordítása -"action_insertnode": pont hozzáadása vonalhoz "prompt_createparallel": Párhuzamos vonal készítése "offset_dual": Osztott pályás út (D2) "offset_motorway": Autópálya (D3) @@ -120,3 +130,4 @@ "offset_choose": Válassz eltolást (m) "action_createparallel": párhuzamos vonalak készítése "action_addpoint": pont hozzáadása a vonal végéhez +"advanced_minimise": Ablak minimalizálása diff --git a/db/migrate/043_add_referer_to_user_token.rb b/db/migrate/043_add_referer_to_user_token.rb new file mode 100644 index 000000000..554cc937e --- /dev/null +++ b/db/migrate/043_add_referer_to_user_token.rb @@ -0,0 +1,9 @@ +class AddRefererToUserToken < ActiveRecord::Migration + def self.up + add_column :user_tokens, :referer, :text + end + + def self.down + remove_column :user_tokens, :referer + end +end diff --git a/test/fixtures/languages.yml b/test/fixtures/languages.yml index e992da23e..7f4a18af6 100644 --- a/test/fixtures/languages.yml +++ b/test/fixtures/languages.yml @@ -9,3 +9,8 @@ de: code: de english_name: German native_name: Deutsch + +sl: + code: sl + english_name: Slovenian + native_name: slovenščina diff --git a/test/functional/diary_entry_controller_test.rb b/test/functional/diary_entry_controller_test.rb index d060af416..1f3492ae9 100644 --- a/test/functional/diary_entry_controller_test.rb +++ b/test/functional/diary_entry_controller_test.rb @@ -176,9 +176,44 @@ class DiaryEntryControllerTest < ActionController::TestCase def test_rss get :rss - assert_response :success + assert_response :success, "Should be able to get a diary RSS" + assert_select "rss:root", :count => 1 do + assert_select "channel", :count => 1 do + assert_select "channel>title", :count => 1 + assert_select "image", :count => 1 + assert_select "channel>item", :count => 2 + end + end + end + + def test_rss_language + get :rss, {:language => diary_entries(:normal_user_entry_1).language_code} + assert_response :success, "Should be able to get a specific language diary RSS" + assert_select "rss>channel>item", :count => 1 #, "Diary entries should be filtered by language" + end + +# def test_rss_nonexisting_language +# get :rss, {:language => 'xx'} +# assert_response :not_found, "Should not be able to get a nonexisting language diary RSS" +# end + + def test_rss_language_with_no_entries + get :rss, {:language => 'sl'} + assert_response :success, "Should be able to get a specific language diary RSS" + assert_select "rss>channel>item", :count => 0 #, "Diary entries should be filtered by language" + end + + def test_rss_user + get :rss, {:display_name => users(:normal_user).display_name} + assert_response :success, "Should be able to get a specific users diary RSS" + assert_select "rss>channel>item", :count => 2 #, "Diary entries should be filtered by user" end + def test_rss_nonexisting_user + get :rss, {:display_name => 'fakeUsername76543'} + assert_response :not_found, "Should not be able to get a nonexisting users diary RSS" + end + def test_viewing_diary_entry get :view, {:display_name => users(:normal_user).display_name, :id => diary_entries(:normal_user_entry_1).id} assert_response :success diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index e6ac49e8d..e4ed23294 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -85,4 +85,44 @@ class UserCreationTest < ActionController::IntegrationTest # Submit the reset password token # Check that the password has changed, and the user can login end + + def test_user_create_redirect + new_email = "redirect_tester@osm.org" + display_name = "redirect_tester" + password = "testtest" + # nothing special about this page, just need a protected page to redirect back to. + referer = "/traces/mine" + assert_difference('User.count') do + assert_difference('ActionMailer::Base.deliveries.size', 1) do + post_via_redirect "/user/save", + {:user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => password, :pass_crypt_confirmation => password}, :referer => referer } + end + end + + # Check the e-mail + register_email = ActionMailer::Base.deliveries.first + + assert_equal register_email.to[0], new_email + # Check that the confirm account url is correct + confirm_regex = Regexp.new("/user/confirm\\?confirm_string=([a-zA-Z0-9]*)") + assert_match(confirm_regex, register_email.body) + confirm_string = confirm_regex.match(register_email.body)[1] + + # Check the page + assert_response :success + assert_template 'login' + + ActionMailer::Base.deliveries.clear + + # Go to the confirmation page + get 'user/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 + follow_redirect! + assert_response :success + assert_template "trace/mine" + end end diff --git a/test/unit/language_test.rb b/test/unit/language_test.rb index da3004459..a171c1e2e 100644 --- a/test/unit/language_test.rb +++ b/test/unit/language_test.rb @@ -2,6 +2,6 @@ require File.dirname(__FILE__) + '/../test_helper' class LanguageTest < ActiveSupport::TestCase test "language count" do - assert_equal 2, Language.count + assert_equal 3, Language.count end end
<%= t 'user.new.email address' %><%= text_field('user', 'email',{:size => 50, :maxlength => 255, :tabindex => 1}) %>
<%= t 'user.new.confirm email address' %><%= text_field('user', 'email_confirmation',{:size => 50, :maxlength => 255, :tabindex => 2}) %>