From 4990cfebbe9cfbbcc8d73cf1446f50f5c921a95b Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Mon, 12 Aug 2013 08:42:49 +0800
Subject: [PATCH 01/12] finish rails verson update and devise version update
and migration update
---
.gitignore | 4 +-
Gemfile | 8 +-
Gemfile.lock | 247 +++++++++---------
app/models/user.rb | 8 +
config/database.yml.example | 13 +
config/initializers/devise.rb | 242 ++++++++++++-----
config/locales/devise.en.yml | 59 +++++
config/routes.rb | 31 ++-
.../20110506082222_devise_create_users.rb | 76 +++---
...702184056_bitcoin_addresses_refactoring.rb | 2 -
db/migrate/20110713191630_create_accounts.rb | 5 +-
db/migrate/20110821132029_drop_admin_flag.rb | 12 +-
db/schema.rb | 80 +++---
13 files changed, 492 insertions(+), 295 deletions(-)
create mode 100644 config/database.yml.example
create mode 100644 config/locales/devise.en.yml
diff --git a/.gitignore b/.gitignore
index 4ee8e3a9..cede2097 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,6 @@ Thumbs.db
public/**/active_scaffold
public/blank.html
.idea/
-/.sass-cache/
\ No newline at end of file
+/.sass-cache/
+
+config/database.yml
diff --git a/Gemfile b/Gemfile
index 3236d197..39d73b7c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'rails', '3.1.3'
+gem 'rails', '3.2.13'
gem 'rake'
gem 'mysql2'
gem 'addressable'
@@ -23,10 +23,10 @@ gem 'exception_notification',
gem 'transitions',
:require => ["transitions", "active_record/transitions"]
-gem 'will_paginate', '~> 3.0.pre2'
+gem 'will_paginate'
# OTP toolbox
-gem 'rotp', '~> 1.3.0'
+gem 'rotp'
# QR Code generation
gem 'qrencoder'
@@ -41,7 +41,7 @@ gem 'blueprint-rails'
gem 'bourbon'
# File attachment with database storage support
-gem 'paperclip',
+gem 'paperclip',
:git => 'https://github.com/patshaughnessy/paperclip.git'
# Apple push notifications
diff --git a/Gemfile.lock b/Gemfile.lock
index 44b93ed3..985c960a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -14,7 +14,7 @@ GIT
GIT
remote: https://github.com/patshaughnessy/paperclip.git
- revision: c295bc4e78b84044296f3a03157c097b50161bc5
+ revision: 89d53623028a7f1f74cdc2726110486ada0061f9
specs:
paperclip (2.4.5)
activerecord (>= 2.3.0)
@@ -25,165 +25,170 @@ GIT
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.3)
- actionpack (= 3.1.3)
- mail (~> 2.3.0)
- actionpack (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
+ actionmailer (3.2.13)
+ actionpack (= 3.2.13)
+ mail (~> 2.5.3)
+ actionpack (3.2.13)
+ activemodel (= 3.2.13)
+ activesupport (= 3.2.13)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.5)
- rack-cache (~> 1.1)
- rack-mount (~> 0.8.2)
+ journey (~> 1.0.4)
+ rack (~> 1.4.5)
+ rack-cache (~> 1.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.3)
- active_scaffold (3.1.13)
- rails (~> 3.1.0)
- activemodel (3.1.3)
- activesupport (= 3.1.3)
+ sprockets (~> 2.2.1)
+ active_scaffold (3.3.3)
+ rails (~> 3.2.0)
+ activemodel (3.2.13)
+ activesupport (= 3.2.13)
builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- arel (~> 2.2.1)
+ activerecord (3.2.13)
+ activemodel (= 3.2.13)
+ activesupport (= 3.2.13)
+ arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- activesupport (3.1.3)
+ activeresource (3.2.13)
+ activemodel (= 3.2.13)
+ activesupport (= 3.2.13)
+ activesupport (3.2.13)
+ i18n (= 0.6.1)
multi_json (~> 1.0)
- addressable (2.2.6)
- arel (2.2.1)
- bcrypt-ruby (3.0.1)
- blueprint-rails (0.1.2)
- railties (~> 3.0)
- thor (~> 0.14)
- bourbon (1.2.0)
- sass (>= 3.1)
- builder (3.0.0)
- capistrano (2.9.0)
+ addressable (2.3.5)
+ arel (3.0.2)
+ bcrypt-ruby (3.1.1)
+ blueprint-rails (0.2.0)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ bourbon (3.1.8)
+ sass (>= 3.2.0)
+ thor
+ builder (3.0.4)
+ capistrano (2.15.5)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
- chronic (0.6.6)
- chunky_png (1.2.5)
- cocaine (0.2.1)
- coffee-rails (3.1.1)
+ chronic (0.9.1)
+ chunky_png (1.2.8)
+ climate_control (0.0.3)
+ activesupport (>= 3.0)
+ cocaine (0.5.1)
+ climate_control (>= 0.0.3, < 1.0)
+ coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
- railties (~> 3.1.0)
+ railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.2.0)
- configatron (2.9.0)
+ coffee-script-source (1.6.3)
+ configatron (2.13.0)
yamler (>= 0.1.0)
- delayed_job (3.0.0)
- activesupport (~> 3.0)
- devise (1.5.3)
+ delayed_job (4.0.0)
+ activesupport (>= 3.0, < 4.1)
+ devise (3.0.2)
bcrypt-ruby (~> 3.0)
- orm_adapter (~> 0.0.3)
- warden (~> 1.1)
+ orm_adapter (~> 0.1)
+ railties (>= 3.2.6, < 5)
+ warden (~> 1.2.3)
erubis (2.7.0)
- execjs (1.2.13)
+ execjs (1.4.0)
multi_json (~> 1.0)
- factory_girl (2.3.2)
- activesupport
- factory_girl_rails (1.4.0)
- factory_girl (~> 2.3.0)
+ factory_girl (4.2.0)
+ activesupport (>= 3.0.0)
+ factory_girl_rails (4.2.1)
+ factory_girl (~> 4.2.0)
railties (>= 3.0.0)
- haml (3.1.4)
- highline (1.6.9)
- hike (1.2.1)
- i18n (0.6.0)
- iban-tools (0.0.6)
- jquery-rails (1.0.19)
- railties (~> 3.0)
- thor (~> 0.14)
- json (1.6.4)
- libv8 (3.3.10.4)
- mail (2.3.0)
- i18n (>= 0.4.0)
+ haml (4.0.3)
+ tilt
+ highline (1.6.19)
+ hike (1.2.3)
+ i18n (0.6.1)
+ iban-tools (0.0.9)
+ journey (1.0.4)
+ jquery-rails (3.0.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.8.0)
+ libv8 (3.11.8.17)
+ mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
- mime-types (1.17.2)
- mocha (0.10.0)
+ mime-types (1.23)
+ mocha (0.14.0)
metaclass (~> 0.0.1)
- multi_json (1.0.4)
- mysql2 (0.3.11)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-sftp (2.0.5)
- net-ssh (>= 2.0.9)
- net-ssh (2.2.1)
- net-ssh-gateway (1.1.0)
- net-ssh (>= 1.99.1)
- orm_adapter (0.0.5)
+ multi_json (1.7.9)
+ mysql2 (0.3.13)
+ net-scp (1.1.2)
+ net-ssh (>= 2.6.5)
+ net-sftp (2.1.2)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.8)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
+ orm_adapter (0.4.0)
polyglot (0.3.3)
- qrencoder (1.4.0)
+ qrencoder (1.4.1)
chunky_png (~> 1.1)
- rack (1.3.6)
- rack-cache (1.1)
+ rack (1.4.5)
+ rack-cache (1.2)
rack (>= 0.4)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
- rack-ssl (1.3.2)
+ rack-ssl (1.3.3)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rails (3.1.3)
- actionmailer (= 3.1.3)
- actionpack (= 3.1.3)
- activerecord (= 3.1.3)
- activeresource (= 3.1.3)
- activesupport (= 3.1.3)
+ rails (3.2.13)
+ actionmailer (= 3.2.13)
+ actionpack (= 3.2.13)
+ activerecord (= 3.2.13)
+ activeresource (= 3.2.13)
+ activesupport (= 3.2.13)
bundler (~> 1.0)
- railties (= 3.1.3)
- railties (3.1.3)
- actionpack (= 3.1.3)
- activesupport (= 3.1.3)
+ railties (= 3.2.13)
+ railties (3.2.13)
+ actionpack (= 3.2.13)
+ activesupport (= 3.2.13)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
- thor (~> 0.14.6)
- rake (0.9.2.2)
- rdoc (3.12)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.1.0)
+ rdoc (3.12.2)
json (~> 1.4)
- recaptcha (0.3.4)
- rotp (1.3.2)
- sass (3.1.12)
- sass-rails (3.1.5)
- actionpack (~> 3.1.0)
- railties (~> 3.1.0)
- sass (~> 3.1.10)
- tilt (~> 1.3.2)
- sprockets (2.0.3)
+ recaptcha (0.3.5)
+ ref (1.0.5)
+ rotp (1.4.1)
+ sass (3.2.10)
+ sass-rails (3.2.6)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.2.2)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- therubyracer (0.9.9)
- libv8 (~> 3.3.10)
- thor (0.14.6)
- tilt (1.3.3)
- transitions (0.0.13)
- treetop (1.4.10)
+ therubyracer (0.11.4)
+ libv8 (~> 3.11.8.12)
+ ref
+ thor (0.18.1)
+ tilt (1.4.1)
+ transitions (0.1.11)
+ treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.31)
- uglifier (1.2.1)
+ tzinfo (0.3.37)
+ uglifier (2.1.2)
execjs (>= 0.3.0)
- multi_json (>= 1.0.2)
- warden (1.1.0)
+ multi_json (~> 1.0, >= 1.0.2)
+ warden (1.2.3)
rack (>= 1.0)
- whenever (0.7.2)
+ whenever (0.8.4)
activesupport (>= 2.3.4)
- chronic (~> 0.6.3)
- will_paginate (3.0.2)
+ chronic (>= 0.6.3)
+ will_paginate (3.0.4)
yamler (0.1.0)
PLATFORMS
@@ -209,13 +214,13 @@ DEPENDENCIES
mysql2
paperclip!
qrencoder
- rails (= 3.1.3)
+ rails (= 3.2.13)
rake
recaptcha
- rotp (~> 1.3.0)
+ rotp
sass-rails
therubyracer
transitions
uglifier
whenever
- will_paginate (~> 3.0.pre2)
+ will_paginate
diff --git a/app/models/user.rb b/app/models/user.rb
index 54bf9f5c..81d5e1c9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,4 +1,12 @@
class User < Account
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :confirmable,
+ # :lockable, :timeoutable and :omniauthable
+ devise :database_authenticatable, :registerable,
+ :recoverable, :rememberable, :trackable, :validatable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable,
diff --git a/config/database.yml.example b/config/database.yml.example
new file mode 100644
index 00000000..5ed06c58
--- /dev/null
+++ b/config/database.yml.example
@@ -0,0 +1,13 @@
+development:
+ adapter: mysql2
+ encoding: utf8
+ database: bitcoin-bank_development
+ username: root
+ password:
+
+test:
+ adapter: mysql2
+ encoding: utf8
+ database: bitcoin-bank_test
+ username: root
+ password:
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 3290371c..21a683d9 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,9 +1,10 @@
-# Use this hook to configure devise mailer, warden hooks and so forth. The first
-# four configuration values can also be set straight in your models.
+# Use this hook to configure devise mailer, warden hooks and so forth.
+# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
- # Configure the e-mail address which will be shown in DeviseMailer.
- config.mailer_sender = "Bitcoin Central support "
+ # Configure the e-mail address which will be shown in Devise::Mailer,
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
@@ -15,138 +16,237 @@
require 'devise/orm/active_record'
# ==> Configuration for any authentication mechanism
- # Configure which keys are used when authenticating an user. By default is
+ # Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
- # authenticating an user, both parameters are required. Remember that those
+ # authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
- config.authentication_keys = [ :name ]
+ # You can also supply a hash where the value is a boolean determining whether
+ # or not authentication should be aborted when the value is not present.
+ # config.authentication_keys = [ :email ]
+
+ # Configure parameters from the request object used for authentication. Each entry
+ # given should be a request method and it will automatically be passed to the
+ # find_for_authentication method and considered in your model lookup. For instance,
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
+ # config.request_keys = []
+
+ # Configure which authentication keys should be case-insensitive.
+ # These keys will be downcased upon creating or modifying a user and when used
+ # to authenticate or find a user. Default is :email.
+ config.case_insensitive_keys = [ :email ]
+
+ # Configure which authentication keys should have whitespace stripped.
+ # These keys will have whitespace before and after removed upon creating or
+ # modifying a user and when used to authenticate or find a user. Default is :email.
+ config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by default.
+ # It can be set to an array that will enable params authentication only for the
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
+ # enable it only for database (email + password) authentication.
# config.params_authenticatable = true
- # Tell if authentication through HTTP Basic Auth is enabled. True by default.
- config.http_authenticatable = true
-
- # Set this to true to use Basic Auth for AJAX requests. True by default.
- config.http_authenticatable_on_xhr = true
-
- # The realm used in Http Basic Authentication
- config.http_authentication_realm = "Bitcoin Central"
+ # Tell if authentication through HTTP Auth is enabled. False by default.
+ # It can be set to an array that will enable http authentication only for the
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
+ # enable it only for token authentication. The supported strategies are:
+ # :database = Support basic authentication with authentication key + password
+ # :token = Support basic authentication with token authentication key
+ # :token_options = Support token authentication with options as defined in
+ # http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
+ # config.http_authenticatable = false
+
+ # If http headers should be returned for AJAX requests. True by default.
+ # config.http_authenticatable_on_xhr = true
+
+ # The realm used in Http Basic Authentication. "Application" by default.
+ # config.http_authentication_realm = "Application"
+
+ # It will change confirmation, password recovery and other workflows
+ # to behave the same regardless if the e-mail provided was right or wrong.
+ # Does not affect registerable.
+ # config.paranoid = true
+
+ # By default Devise will store the user in session. You can skip storage for
+ # :http_auth and :token_auth by adding those symbols to the array below.
+ # Notice that if you are skipping storage for all authentication paths, you
+ # may want to disable generating routes to Devise's sessions controller by
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
+ config.skip_session_storage = [:http_auth]
+
+ # By default, Devise cleans up the CSRF token on authentication to
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
+ # requests for sign in and sign up, you need to get a new CSRF token
+ # from the server. You can disable this option at your own risk.
+ # config.clean_up_csrf_token_on_authentication = true
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
- config.stretches = 10
-
- # Define which will be the encryption algorithm. Devise also supports encryptors
- # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
- # you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
- # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
- config.encryptor = :bcrypt
+ #
+ # Limiting the stretches to just one in testing will increase the performance of
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
+ # a value less than 10 in other environments.
+ config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
- config.pepper = "91ad1e1ce0cabde16074553f385b11635b09fb44495d546e75a025bb9671f2715f4642e21d4dcf5c10e9077d81fb14833f1a8d29a9aaaea831c348d7f9837aa5"
+ # config.pepper = "894151605e3d8be8e272c6524967a9b9ae063b8bf2fd19dd3f8886c9169e96b79665ce7dee1712b13df60adec0cb989aa50771a8ffb5ca1799f08c95725f4684"
# ==> Configuration for :confirmable
- # The time you want to give your user to confirm his account. During this time
- # he will be able to access your application without confirming. Default is nil.
- # When confirm_within is zero, the user won't be able to sign in without confirming.
- # You can use this to let your user access some features of your application
- # without confirming the account, but blocking it after a certain period
- # (ie 2 days).
- config.confirm_within = 0
+ # A period that the user is allowed to access the website even without
+ # confirming his account. For instance, if set to 2.days, the user will be
+ # able to access the website for two days without confirming his account,
+ # access will be blocked just in the third day. Default is 0.days, meaning
+ # the user cannot access the website without confirming his account.
+ # config.allow_unconfirmed_access_for = 2.days
+
+ # A period that the user is allowed to confirm their account before their
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
+ # their account within 3 days after the mail was sent, but on the fourth day
+ # their account can't be confirmed with the token any more.
+ # Default is nil, meaning there is no restriction on how long a user can take
+ # before confirming their account.
+ # config.confirm_within = 3.days
+
+ # If true, requires any email changes to be confirmed (exactly the same way as
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
+ # db field (see migrations). Until confirmed new email is stored in
+ # unconfirmed email column, and copied to email column on successful confirmation.
+ config.reconfirmable = true
+
+ # Defines which key will be used when confirming an account
+ # config.confirmation_keys = [ :email ]
# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
- # config.remember_for = 2.days
-
- # If true, a valid remember token can be re-used between multiple browsers.
- config.remember_across_browsers = true
+ # config.remember_for = 2.weeks
# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false
+ # Options to be passed to the created cookie. For instance, you can set
+ # :secure => true in order to force SSL only cookies.
+ # config.rememberable_options = {}
+
# ==> Configuration for :validatable
- # Range for password length
- config.password_length = 6..100
+ # Range for password length. Default is 8..128.
+ config.password_length = 8..128
- # Regex to use to validate the email address
- config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
+ # Email regex used to validate email formats. It simply asserts that
+ # one (and only one) @ exists in the given string. This is mainly
+ # to give user feedback and not to assert the e-mail validity.
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
- # time the user will be asked for credentials again.
- config.timeout_in = 30.minutes
+ # time the user will be asked for credentials again. Default is 30 minutes.
+ # config.timeout_in = 30.minutes
+
+ # If true, expires auth token on session timeout.
+ # config.expire_auth_token_on_timeout = false
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
# :none = No lock strategy. You should handle locking by yourself.
- config.lock_strategy = :failed_attempts
+ # config.lock_strategy = :failed_attempts
+
+ # Defines which key will be used when locking and unlocking an account
+ # config.unlock_keys = [ :email ]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
# :both = Enables both strategies
# :none = No unlock strategy. You should handle unlocking by yourself.
- config.unlock_strategy = :both
+ # config.unlock_strategy = :both
# Number of authentication tries before locking an account if lock_strategy
# is failed attempts.
- config.maximum_attempts = 3
+ # config.maximum_attempts = 20
# Time interval to unlock the account if :time is enabled as unlock_strategy.
- config.unlock_in = 24.hours
+ # config.unlock_in = 1.hour
+
+ # ==> Configuration for :recoverable
+ #
+ # Defines which key will be used when recovering the password for an account
+ # config.reset_password_keys = [ :email ]
+
+ # Time interval you can reset your password with a reset password key.
+ # Don't put a too small interval or your users won't have the time to
+ # change their passwords.
+ config.reset_password_within = 6.hours
+
+ # ==> Configuration for :encryptable
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
+ # REST_AUTH_SITE_KEY to pepper).
+ #
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
+ # config.encryptor = :sha512
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
- config.token_authentication_key = :auth_token
+ # config.token_authentication_key = :auth_token
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
- # config.scoped_views = true
+ # config.scoped_views = false
# Configure the default scope given to Warden. By default it's the first
- # devise role declared in your routes.
+ # devise role declared in your routes (usually :user).
# config.default_scope = :user
- # Configure sign_out behavior.
- # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
- # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
- # config.sign_out_all_scopes = false
+ # Set this configuration to false if you want /users/sign_out to sign out
+ # only the current scope. By default, Devise signs out all scopes.
+ # config.sign_out_all_scopes = true
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
# :html, should redirect to the sign in page when the user does not have
# access, but formats like :xml or :json, should return 401.
+ #
# If you have any extra navigational formats, like :iphone or :mobile, you
- # should add them to the navigational formats lists. Default is [:html]
- # config.navigational_formats = [:html, :iphone]
+ # should add them to the navigational formats lists.
+ #
+ # The "*/*" below is required to match Internet Explorer requests.
+ # config.navigational_formats = ["*/*", :html]
+
+ # The default HTTP method used to sign out a resource. Default is :delete.
+ config.sign_out_via = :delete
+
+ # ==> OmniAuth
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
+ # up on your models and hooks.
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
# ==> Warden configuration
- # If you want to use other strategies, that are not (yet) supported by Devise,
- # you can configure them inside the config.warden block. The example below
- # allows you to setup OAuth, using http://github.com/roman/warden_oauth
+ # If you want to use other strategies, that are not supported by Devise, or
+ # change the failure app, you can configure them inside the config.warden block.
#
# config.warden do |manager|
- # manager.oauth(:twitter) do |twitter|
- # twitter.consumer_secret =
- # twitter.consumer_key =
- # twitter.options :site => 'http://twitter.com'
- # end
- # manager.default_strategies(:scope => :user).unshift :twitter_oauth
+ # manager.intercept_401 = false
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
- config.paranoid = true
-
- require 'devise/strategies/ga_otp_authenticatable'
- require 'devise/strategies/yk_otp_authenticatable'
-
- config.warden do |manager|
- manager.default_strategies(:scope => :user).unshift :ga_otp_authenticatable
- manager.default_strategies(:scope => :user).unshift :yk_otp_authenticatable
- end
+ # ==> Mountable engine configurations
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
+ # is mountable, there are some extra configurations to be taken into account.
+ # The following options are available, assuming the engine is mounted as:
+ #
+ # mount MyEngine, at: "/my_engine"
+ #
+ # The router that invoked `devise_for`, in the example above, would be:
+ # config.router_name = :my_engine
+ #
+ # When using omniauth, Devise cannot automatically set Omniauth path,
+ # so you need to do it manually. For the users scope, it would be:
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
new file mode 100644
index 00000000..d01f375c
--- /dev/null
+++ b/config/locales/devise.en.yml
@@ -0,0 +1,59 @@
+# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
+
+en:
+ devise:
+ confirmations:
+ confirmed: "Your account was successfully confirmed. You are now signed in."
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
+ failure:
+ already_authenticated: "You are already signed in."
+ inactive: "Your account was not activated yet."
+ invalid: "Invalid email or password."
+ invalid_token: "Invalid authentication token."
+ locked: "Your account is locked."
+ not_found_in_database: "Invalid email or password."
+ timeout: "Your session expired, please sign in again to continue."
+ unauthenticated: "You need to sign in or sign up before continuing."
+ unconfirmed: "You have to confirm your account before continuing."
+ mailer:
+ confirmation_instructions:
+ subject: "Confirmation instructions"
+ reset_password_instructions:
+ subject: "Reset password instructions"
+ unlock_instructions:
+ subject: "Unlock Instructions"
+ omniauth_callbacks:
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
+ success: "Successfully authenticated from %{kind} account."
+ passwords:
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
+ updated: "Your password was changed successfully. You are now signed in."
+ updated_not_active: "Your password was changed successfully."
+ registrations:
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
+ signed_up: "Welcome! You have signed up successfully."
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
+ updated: "You updated your account successfully."
+ sessions:
+ signed_in: "Signed in successfully."
+ signed_out: "Signed out successfully."
+ unlocks:
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
+ errors:
+ messages:
+ already_confirmed: "was already confirmed, please try signing in"
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
+ expired: "has expired, please request a new one"
+ not_found: "not found"
+ not_locked: "was not locked"
+ not_saved:
+ one: "1 error prohibited this %{resource} from being saved:"
+ other: "%{count} errors prohibited this %{resource} from being saved:"
diff --git a/config/routes.rb b/config/routes.rb
index 22166a2d..d81cbbe0 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,7 @@
BitcoinBank::Application.routes.draw do
+
+ devise_for :users
+
resources :invoices, :only => [:index, :new, :create, :show, :destroy]
resource :user, :only => [:edit, :update] do
@@ -31,15 +34,15 @@
:action => 'balance',
:as => 'balance',
:only => :get
-
+
get :deposit
get :pecunix_deposit_form
-
- resources :transfers, :only => [:index, :new, :create, :show]
-
- resources :trades,
+
+ resources :transfers, :only => [:index, :new, :create, :show]
+
+ resources :trades,
:only => [:index]
-
+
resources :invoices
resources :trade_orders, :only => [:index, :new, :create, :destroy] do
@@ -48,7 +51,7 @@
end
match "/s/:name" => "static_pages#show", :as => :static
-
+
match '/third_party_callbacks/:action',
:controller => :third_party_callbacks
@@ -57,29 +60,29 @@
resources :pending_transfers do
as_routes
-
+
member do
post :process_tx
end
end
-
+
resources :users do
as_routes
-
+
member do
get :balances
end
-
+
resources :account_operations do
as_routes
end
end
-
+
match '/balances', :to => 'informations#balances', :as => :balances
end
-
+
match '/qrcode/:data.png' => 'qrcodes#show', :as => :qrcode
-
+
match '/order_book' => 'trade_orders#book'
match '/trades' => 'trades#all_trades'
diff --git a/db/migrate/20110506082222_devise_create_users.rb b/db/migrate/20110506082222_devise_create_users.rb
index 20975821..6b6472b9 100644
--- a/db/migrate/20110506082222_devise_create_users.rb
+++ b/db/migrate/20110506082222_devise_create_users.rb
@@ -1,42 +1,52 @@
class DeviseCreateUsers < ActiveRecord::Migration
def self.up
- change_table(:users) do |t|
- # t.database_authenticatable
- t.string :encrypted_password, :null => false, :default => ''
- t.string :password_salt, :null => false, :default => ''
-
- t.confirmable
- t.recoverable
- t.rememberable
- t.trackable
- t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
- t.token_authenticatable
- end
+ create_table(:users) do |t|
+ ## Database authenticatable
+ t.string :email, :null => false, :default => ""
+ t.string :encrypted_password, :null => false, :default => ""
+
+ ## Recoverable
+ t.string :reset_password_token
+ t.datetime :reset_password_sent_at
+
+ ## Rememberable
+ t.datetime :remember_created_at
+
+ ## Trackable
+ t.integer :sign_in_count, :default => 0
+ t.datetime :current_sign_in_at
+ t.datetime :last_sign_in_at
+ t.string :current_sign_in_ip
+ t.string :last_sign_in_ip
+
+ # Confirmable
+ t.string :confirmation_token
+ t.datetime :confirmed_at
+ t.datetime :confirmation_sent_at
+ t.string :unconfirmed_email # Only if using reconfirmable
- add_index :users, :email, :unique => true
+ # Lockable
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
+ t.string :unlock_token # Only if unlock strategy is :email or :both
+ t.datetime :locked_at
- execute "ALTER TABLE `users` MODIFY COLUMN `password` VARCHAR(255) NULL"
+ # Token authenticatable
+ t.string :authentication_token
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ add_index :users, :confirmation_token, :unique => true
+ add_index :users, :unlock_token, :unique => true
+ add_index :users, :authentication_token, :unique => true
end
def self.down
- change_table :users do |t|
- t.remove :encrypted_password
- t.remove :password_salt
- t.remove :authentication_token
- t.remove :confirmation_token
- t.remove :confirmed_at
- t.remove :confirmation_sent_at
- t.remove :reset_password_token
- t.remove :remember_token
- t.remove :remember_created_at
- t.remove :sign_in_count
- t.remove :current_sign_in_at
- t.remove :last_sign_in_at
- t.remove :current_sign_in_ip
- t.remove :last_sign_in_ip
- t.remove :failed_attempts
- t.remove :unlock_token
- t.remove :locked_at
- end
+ # By default, we don't want to make any assumption about how to roll back a migration when your
+ # model already existed. Please edit below which fields you would like to remove in this migration.
+ raise ActiveRecord::IrreversibleMigration
end
end
+
diff --git a/db/migrate/20110702184056_bitcoin_addresses_refactoring.rb b/db/migrate/20110702184056_bitcoin_addresses_refactoring.rb
index 6e522286..b97ff552 100644
--- a/db/migrate/20110702184056_bitcoin_addresses_refactoring.rb
+++ b/db/migrate/20110702184056_bitcoin_addresses_refactoring.rb
@@ -1,11 +1,9 @@
class BitcoinAddressesRefactoring < ActiveRecord::Migration
def self.up
- rename_column :users, :last_address, :bitcoin_address
add_column :users, :last_address_refresh, :datetime
end
def self.down
- rename_column :users, :bitcoin_address, :last_address
remove_column :users, :last_address_refresh
end
end
diff --git a/db/migrate/20110713191630_create_accounts.rb b/db/migrate/20110713191630_create_accounts.rb
index 454638b1..a29ce5a7 100644
--- a/db/migrate/20110713191630_create_accounts.rb
+++ b/db/migrate/20110713191630_create_accounts.rb
@@ -1,9 +1,8 @@
class CreateAccounts < ActiveRecord::Migration
def self.up
- rename_table :users, :accounts
add_column :accounts, :parent_id, :integer
add_column :accounts, :type, :string
- rename_column :accounts, :account, :name
+ add_column :accounts, :account, :string
rename_column :account_operations, :user_id, :account_id
execute "UPDATE `accounts` SET `type`='User'"
@@ -11,7 +10,7 @@ def self.up
def self.down
rename_column :account_operations, :account_id, :user_id
- rename_column :accounts, :name, :account
+ remove_column :accounts, :account
remove_column :accounts, :parent_id
remove_column :accounts, :type
rename_table :accounts, :users
diff --git a/db/migrate/20110821132029_drop_admin_flag.rb b/db/migrate/20110821132029_drop_admin_flag.rb
index 0b9590c4..44192db1 100644
--- a/db/migrate/20110821132029_drop_admin_flag.rb
+++ b/db/migrate/20110821132029_drop_admin_flag.rb
@@ -1,9 +1,9 @@
class DropAdminFlag < ActiveRecord::Migration
- def self.up
- remove_column :accounts, :admin
- end
+ # def self.up
+ # remove_column :accounts, :admin
+ # end
- def self.down
- add_column :accounts, :admin, :boolean, :default => false
- end
+ # def self.down
+ # add_column :accounts, :admin, :boolean, :default => false
+ # end
end
diff --git a/db/schema.rb b/db/schema.rb
index 25914bc2..0c917048 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -17,8 +18,8 @@
t.integer "account_id"
t.string "address"
t.decimal "amount", :precision => 16, :scale => 8, :default => 0.0
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "currency"
t.string "lr_transaction_id"
t.decimal "lr_transferred_amount", :precision => 16, :scale => 8, :default => 0.0
@@ -41,32 +42,26 @@
add_index "account_operations", ["lr_transaction_id"], :name => "index_transfers_on_lr_transaction_id", :unique => true
create_table "accounts", :force => true do |t|
- t.string "name", :null => false
- t.string "email"
- t.string "password"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "bitcoin_address"
- t.string "salt"
- t.string "time_zone"
- t.string "secret_token"
+ t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
- t.string "password_salt", :default => "", :null => false
- t.string "confirmation_token"
- t.datetime "confirmed_at"
- t.datetime "confirmation_sent_at"
t.string "reset_password_token"
- t.string "remember_token"
+ t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
+ t.string "confirmation_token"
+ t.datetime "confirmed_at"
+ t.datetime "confirmation_sent_at"
+ t.string "unconfirmed_email"
t.integer "failed_attempts", :default => 0
t.string "unlock_token"
t.datetime "locked_at"
t.string "authentication_token"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "merchant", :default => false
t.string "ga_otp_secret"
t.boolean "require_ga_otp", :default => false
@@ -74,6 +69,7 @@
t.boolean "require_yk_otp", :default => false
t.integer "parent_id"
t.string "type"
+ t.string "account"
t.string "full_name"
t.text "address"
t.boolean "notify_on_trade", :default => true
@@ -82,14 +78,18 @@
t.decimal "commission_rate", :precision => 16, :scale => 8
end
+ add_index "accounts", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
+ add_index "accounts", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
add_index "accounts", ["email"], :name => "index_users_on_email", :unique => true
+ add_index "accounts", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+ add_index "accounts", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
create_table "announcements", :force => true do |t|
t.string "title"
t.text "content"
t.boolean "active"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "bank_accounts", :force => true do |t|
@@ -98,22 +98,22 @@
t.string "iban", :null => false
t.text "account_holder"
t.string "state"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "comments", :force => true do |t|
t.integer "user_id"
t.integer "ticket_id"
t.text "contents"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "currencies", :force => true do |t|
t.string "code", :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "invoices", :force => true do |t|
@@ -123,8 +123,8 @@
t.string "payment_address", :null => false
t.string "callback_url", :null => false
t.datetime "paid_at"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "reference", :null => false
t.string "merchant_reference"
t.string "merchant_memo"
@@ -143,8 +143,8 @@
t.decimal "traded_currency", :precision => 16, :scale => 8, :default => 0.0
t.decimal "ppc", :precision => 16, :scale => 8, :default => 0.0
t.string "currency"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "seller_id"
t.integer "buyer_id"
t.string "type"
@@ -153,8 +153,8 @@
create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
@@ -165,8 +165,8 @@
t.string "title"
t.string "locale"
t.text "contents"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "tickets", :force => true do |t|
@@ -174,8 +174,8 @@
t.text "description"
t.integer "user_id"
t.string "state"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "trade_orders", :force => true do |t|
@@ -184,8 +184,8 @@
t.decimal "ppc", :precision => 16, :scale => 8
t.string "currency", :null => false
t.string "category", :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "active", :default => true
t.boolean "dark_pool", :default => false, :null => false
t.boolean "dark_pool_exclusive_match", :default => false, :null => false
@@ -199,16 +199,16 @@
t.decimal "daily_limit", :precision => 16, :scale => 8, :default => 0.0
t.decimal "monthly_limit", :precision => 16, :scale => 8, :default => 0.0
t.boolean "management", :default => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "yubikeys", :force => true do |t|
t.integer "user_id", :null => false
t.string "key_id", :null => false
t.boolean "active", :default => true
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
end
From 11c6545dd675bf449a1c265128a761a317264b3d Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Mon, 12 Aug 2013 08:52:13 +0800
Subject: [PATCH 02/12] =?UTF-8?q?=E4=BF=AE=E6=AD=A3case=20when=E7=9A=84?=
=?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/transfers_helper.rb | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/helpers/transfers_helper.rb b/app/helpers/transfers_helper.rb
index fc08933b..721fd4b9 100644
--- a/app/helpers/transfers_helper.rb
+++ b/app/helpers/transfers_helper.rb
@@ -8,22 +8,22 @@ def confirmation_tooltip_for(transfer)
t :confirmations_left, :count => (Transfer::MIN_BTC_CONFIRMATIONS - transfer.bt_tx_confirmations)
end
end
-
+
def transfer_details(transfer)
link_to(image_tag("details.png", :alt => t(".details"), :title => t(".details")), account_transfer_path(transfer))
end
-
- def transfer_state(state, options = {})
+
+ def transfer_state(state, options = {})
content_tag :span,
:class => ["transfer-state", color_for_transfer_state(state)] do
"#{options[:icon] ? image_tag("#{state}.png", :class => "state-icon") : ""} #{options[:message]}".strip.html_safe
end
end
-
+
def color_for_transfer_state(state)
- case state
- when "pending" : "orange"
- when "processed" : "green"
+ case state
+ when "pending" then "orange"
+ when "processed" then "green"
end
end
end
From 6817e4a394c6b4ff979baa2529e2e67cd9496d2e Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Mon, 12 Aug 2013 20:58:36 +0800
Subject: [PATCH 03/12] for i18n bug
---
app/controllers/informations_controller.rb | 14 +-
app/views/devise/sessions/new.html.haml | 10 +-
app/views/layouts/_locale_select.html.erb | 8 +-
app/views/layouts/application.html.haml | 2 +-
app/views/users/_form.html.haml | 6 +-
config/application.rb | 18 +-
config/locales/en/other.yml | 8 +-
config/locales/en/views.yml | 278 --------------------
config/locales/fr/currencies.yml | 28 --
config/locales/fr/defaults.yml | 193 --------------
config/locales/fr/devise.yml | 41 ---
config/locales/fr/emails.yml | 27 --
config/locales/fr/models.yml | 198 ---------------
config/locales/fr/other.yml | 199 ---------------
config/locales/fr/views.yml | 275 --------------------
config/locales/views.en.yml | 281 +++++++++++++++++++++
config/routes.rb | 2 -
17 files changed, 311 insertions(+), 1277 deletions(-)
delete mode 100644 config/locales/en/views.yml
delete mode 100644 config/locales/fr/currencies.yml
delete mode 100644 config/locales/fr/defaults.yml
delete mode 100644 config/locales/fr/devise.yml
delete mode 100644 config/locales/fr/emails.yml
delete mode 100644 config/locales/fr/models.yml
delete mode 100644 config/locales/fr/other.yml
delete mode 100644 config/locales/fr/views.yml
create mode 100644 config/locales/views.en.yml
diff --git a/app/controllers/informations_controller.rb b/app/controllers/informations_controller.rb
index 126baf2c..20e54e74 100644
--- a/app/controllers/informations_controller.rb
+++ b/app/controllers/informations_controller.rb
@@ -3,7 +3,7 @@ class InformationsController < ApplicationController
def welcome
currency = (params[:currency] || "eur").downcase.to_sym
-
+
@min_y = [0.3 * (Trade.last_week.with_currency(currency).minimum(:ppc) or 0) - (Trade.with_currency(currency).maximum(:ppc) or 0), 0].max
@max_y = 1.3 * (Trade.last_week.with_currency(currency).maximum(:ppc) or 0)
@@ -17,7 +17,7 @@ def welcome
:label => currency.to_s.upcase,
:color => color_for_currency(currency)
}
-
+
@options[:axes][:yaxis][:min] = @min_y
@options[:axes][:yaxis][:max] = @max_y
@@ -68,20 +68,20 @@ def support
@tickets = current_user.tickets
end
end
-
-
+
+
protected
def color_for_currency(currency)
colors = {
:lrusd => "#068300",
- :lreur => "#0E00C1",
+ :lreur => "#0E00C1",
:eur => "#AFAAF3",
:cad => "#6db7e1",
:inr => "#c40f75",
- :pgau => "#b58f24"
+ :pgau => "#b58f24"
}
-
+
colors[currency]
end
end
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index e8f70554..60f90c3e 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -2,8 +2,8 @@
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
.form-field
- = f.label :name
- = f.text_field :name
+ = f.label :account
+ = f.text_field :account
.explanation= t(:account_description)
.form-field
@@ -20,8 +20,8 @@
= f.label :yk_otp
= f.text_field :yk_otp, :class => "yk-otp"
.explanation= t(".yk_otp_explanation")
-
+
.form-field
- = f.submit t(".sign_in"), :class => "submit"
-
+ = f.submit "sign_in", :class => "submit"
+
= render :partial => "devise/shared/links"
diff --git a/app/views/layouts/_locale_select.html.erb b/app/views/layouts/_locale_select.html.erb
index 84aed979..faf3b0f1 100644
--- a/app/views/layouts/_locale_select.html.erb
+++ b/app/views/layouts/_locale_select.html.erb
@@ -1,12 +1,10 @@
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 50f2c500..2d23579d 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -1,5 +1,5 @@
!!! XML
-!!!
+!!!
%html{ :"xmlns:fb" => "http://www.facebook.com/2008/fbml", :"xmlns:og" => "http://ogp.me/ns#", :xmlns => "http://www.w3.org/1999/xhtml"}
%head
diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml
index adbe4326..099f3d59 100644
--- a/app/views/users/_form.html.haml
+++ b/app/views/users/_form.html.haml
@@ -3,8 +3,8 @@
- unless @user.new_record?
.form-field
- = f.label :name
- = f.text_field :name, :disabled => true
+ = f.label :account
+ = f.text_field :account, :disabled => true
.form-field
= f.label :email
@@ -48,7 +48,7 @@
.form-field
= f.label :notify_on_trade
= f.check_box :notify_on_trade, :class => "checkbox"
- .explanation= t(".notify_on_trade_explanation")
+ .explanation= t(".notify_on_trade_explanation")
%fieldset
%legend= t(".api_tools")
diff --git a/config/application.rb b/config/application.rb
index 307af3a8..1c96c7d8 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -10,17 +10,13 @@
module BitcoinBank
class Application < Rails::Application
- I18n.const_set :Locales, {
- :en => "English",
- :fr => "Français"
- }
-
- config.i18n.default_locale = :en
-
- config.i18n.available_locales = I18n::Locales.keys
-
- config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.yml')]
+ # I18n.const_set :Locales, {
+ # :en => "English"
+ # }
+ config.time_zone = 'Beijing'
+ config.i18n.default_locale = 'en'
+ config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
config.encoding = "utf-8"
config.filter_parameters += [:password]
@@ -32,7 +28,7 @@ class Application < Rails::Application
config.assets.enabled = true
config.assets.version = '1.0'
-
+
Haml::Template.options[:ugly] = true
end
end
diff --git a/config/locales/en/other.yml b/config/locales/en/other.yml
index cd979dd9..93c203ac 100644
--- a/config/locales/en/other.yml
+++ b/config/locales/en/other.yml
@@ -14,7 +14,7 @@ en:
no_data: No data has been found
# controllers/informations_controller.rb
- chart_date_format: %m/%d
+ chart_date_format: "%m/%d"
# controllers/sessions_controller.rb
sign_in_success: You logged-in successfully to your account.
@@ -50,7 +50,7 @@ en:
# helpers/transfers_helper.rb
confirmations_left:
one: 1 confirmation left
- other: %{count} confirmations left
+ other: "%{count} confirmations left"
# mailers/backup_mailer.rb
support_from: Bitcoin Central support <%{support_email}>
@@ -108,7 +108,7 @@ en:
sign_in_submit: Sign-in
# views/trade_orders/book.html
- order_book_title: Select a currency
+ order_book_title: Select a currency
amount: Amount
price: Price
no_buying_orders_found: No buying orders have been found.
@@ -116,7 +116,7 @@ en:
# views/trades/index.html
trade_history_title: Trade history
- no_trades_found: No trades were found
+ no_trades_found: No trades were found
# views/transfers/index.html
account_history_title: Account history
diff --git a/config/locales/en/views.yml b/config/locales/en/views.yml
deleted file mode 100644
index cc330e2e..00000000
--- a/config/locales/en/views.yml
+++ /dev/null
@@ -1,278 +0,0 @@
-en:
- layouts:
- application:
- title: "Bitcoin-Central : Trade Bitcoins easily and safely"
- description: Buy, sell and store Bitcoins easily and safely on the best open-source platform
- user_informations:
- signed_in_as: Signed-in as
- address_tip: A new address is generated each time you receive a payment, your previous addresses will still work though
- your_address: Your address
- logout: Logout
- sign_up: Sign-up
- sign_in: Sign-in
- navigation:
- account:
- main: Account
- balance: Balance
- history: History
- withdraw: Withdraw
- deposit: Deposit
- trading:
- main: Trading
- your_orders: Trade orders
- order_book: Order book
- trade_history: Trade history
- admin:
- main: Admin
- transfers: Transfers
- users: Users
- information: Informations
- pending_transfers: Pending transfers
- help:
- main: Help
- faq: FAQ
- economy: Economy
- support: Support
- fees: Our Fees
- api_docs: API
- terms_of_service: Terms of Service
- ecommerce:
- main: E-commerce
-
- invoices:
- new:
- create_invoice: Create an invoice
- error: Error posting invoice
- amount_explanation: The amount to be paid for this invoice
- payment_explanation: The address at which the funds should be sent
- callback_url_explanation: The URL that should be POST'ed to upon payment
- submit: Post invoice
- created: Invoice successfully posted
- item_url_explanation: Related order URL on the merchant website
- index:
- details: Show invoice details
- create: Create invoice
- deleted: Invoice deleted successfully
- confirm: Are you sure you want to delete this invoice ?
- delete: Delete this invoice
- show:
- details: Invoice details
- payee: Payee
- payment-explanations: >
- To pay this invoice, simply transfer the requested amount to
- the payment address, the page will automatically refresh to
- show you its progress.
- return_to_item: Return to merchant website
-
- trade_orders:
- index:
- create: Create an order
- active_orders: "Active orders (%{count})"
- inactive_orders: "Inactive orders (%{count})"
- detailed_list:
- na: N/A
- sell: Ask
- buy: Bid
- market: Market
- limit: Limit
- delete_order: Delete this trade order
- delete_order_confirm: Are you sure you want to delete this trade order ?
- activate_order: Activate this trade order and execute it
- activate_order_confirm: Are you sure you want to activate this trade order ?
- book:
- bids: Bids
- asks: Asks
- list:
- price: Price
- amount: Amount
- total: Total
- market_order: Market Order
- new:
- title: Create a trade order
- currency_explanation: Currency you want to trade
- type_explanation: Different matching types are explained in our help page
- category: Category
- buy: Buy
- sell: Sell
- sell_or_buy_explanation: Whether you want to buy or sell bitcoins
- your_balance: Your balance
- your_balance_explanation: Your available confirmed balance
- amount_explanation: BTC amount you're trading
- ppc_explanation: Price for 1 BTC
- total_explanation: The total for your order
- dark_pool_explanation: Should the order be hidden ?
- help: Visit our help page if you need assistance trading Bitcoins
- error:
- one: "1 error prevented your trade order from being created :"
- other: "%{count} errors prevented your trade order from being created :"
-
- trades:
- index:
- title: Trade history
-
- accounts:
- show:
- add_funds: Deposit funds
- deposit:
- not_available: SEPA wire deposits are currently unavailable
- deposit_bitcoins_title: Deposit Bitcoins
- deposit_bitcoins_body_html:
-
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
- You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
- deposit_eur_title: Deposit with bank wire
- deposit_eur_body_html: "
-
- Funding your EUR account with a SEPA wire is free.
-
-
You must include your account ID in the \"Comments\" field
-
You can wire most currencies, it will get converted to EUR before funding your account
-
Fees may apply for non-SEPA transfers, contact us for more details
- Use this form to specify the amount of gold grams to deposit, upon submission
- you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
- is completed, the gold will appear in your balance.
-
- pgau_amount: Amount (PGAU)
- deposit_pgau: Deposit Pecunix
- other_options: Other options
- add_bank_account: Add a bank account
- lr_sci_form:
- click_for_lr_html: Click here to pay with your Liberty Reserve account (LREUR and LRUSD).
-
- users:
- form:
- submit: Submit
- merchant_explanation: Activate merchant tools
- ga_otp_explanation: Require Google Auth. OTP
- ga_otp_config: Help and setup instructions
- additional_authentication_requirements: Additional authentication requirements
- api_tools: API & Tools
- yk_otp_config: Associate keys to your account
- time_zone_explanation: Used to display localized dates and times
- manage_bank_accounts: Manage your bank accounts
- registered_bank_accounts:
- zero: You haven't registered any bank account yet.
- one: You have registered a bank account
- other: You have registered %{count} bank accounts
- notifications: E-mail notifications
- notify_on_trade_explanation: Receive a notification when one of your trade orders gets matched
- ga_otp_configuration:
- reset: The Google Authenticator shared-secret has been correctly reset, you should update your mobile device settings
- password_change_form:
- change_password: Change your password
- submit: Submit
- password_updated: Your password has been updated successfully
-
-
- yubikeys:
- index:
- create: Associate a Yubikey to your account
- delete: Delete this Yubikey
- confirm: Are you sure ?
- associate: Associate a new Yubikey
- otp_explanation: Simply generate an OTP here to associate your key
- created: Yubikey associated, you'll need it for your next sign-in
- destroyed: Yubikey removed
- error: This key could not be associated to your account
-
- devise:
- sessions:
- new:
- ga_otp_explanation: Required only if you enabled Google Authenticator
- yk_otp_explanation: Required only if you enabled a Yubikey
- password_explanation: Password forgotten ?
- sign_in: Sign-in
-
- unlocks:
- new:
- resend: Send unlock instructions
-
- transfers:
- index:
- details: Transaction details
- successful:
- processed: Your successfully withdrew %{amount} %{currency}
- pending: Your withdrawal request was successful and will be processed shortly
- show:
- state:
- processed: Processed
- pending: Pending
- new:
- title: Withdraw funds
- body_html: "
-
You can currently withdraw using the following methods :
-
-
Bitcoins,
-
EUR bank wire,
-
Liberty Reserve automated transfer,
-
Pecunix manual transfer
-
-
- "
- error: "Some errors prevent your funds from being withdrawn :"
- max_amount: Maximum amount
- submit: Transfer
- manage_bank_accounts: Manage your bank accounts
-
- bank_accounts:
- index:
- title: Add a bank account
- submit: Submit
- created: Bank account successfully registered
- error: Your bank account could not be registered
- destroyed: Bank account deleted
- not_destroyed: You cannot delete a bank account that has been verified or wired to
- list:
- delete: Delete
- confirm: Are you sure you want to delete this bank account?
-
- static_pages:
- show:
- last_modification_at: "This page was last updated at %{updated_at}"
-
- tickets:
- new:
- title: Open a support request
- submit: Submit request
- description_explanation: Please be as accurate as possible when describing your request and provide all the relevant details.
- error: Unable to submit your support request
- index:
- successfully_created: Your request was saved successfully, it will be processed as soon as possible
- your_tickets: Your support requests
- no_tickets_found: You have no support requests to display
- ticket:
- add_comment: Add a comment
- someone_wrote: %{who} wrote, %{when} ago
- you: You
- reopen : Re-open ticket
- close: Close ticket
-
- informations:
- welcome:
- download: Download Bitcoin 0.5.0
- source: Source code
- trading_data_title: Last week's trading data
- welcome: Welcome to bitcoin-central.net!
-
- support:
- contact: Contact us
- contact_description_html: "You can reach us at %{email}"
- please_sign_in: Please sign-in to open a support request
- your_tickets:
- zero: You don't have any pending support tickets.
- one: You have a pending support ticket.
- other: You have %{count} pending support tickets.
- open_a_ticket: Open a new support ticket
- view_tickets: View all requests
diff --git a/config/locales/fr/currencies.yml b/config/locales/fr/currencies.yml
deleted file mode 100644
index 7c7fa4fb..00000000
--- a/config/locales/fr/currencies.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-fr:
- currencies:
- all:
- name: Toutes devises
- btc:
- name: Bitcoin
- link: http://www.bitcoin.org/
- eur:
- name: Euro
- link: http://www.ecb.int/
- lrusd:
- name: Dollar Liberty Reserve
- link: https://www.libertyreserve.com/?ref=U8651415
- lreur:
- name: Euro Liberty Reserve
- link: https://www.libertyreserve.com/?ref=U8651415
- pgau:
- name: Or Pecunix
- link: http://www.pecunix.com/
- cad:
- name: Dollar Canadien
- link: http://www.bankofcanada.ca/
- inr:
- name: Roupie Indienne
- link: http://www.rbi.org.in/
- usd:
- name: Dollar US
- link: http://www.federalreserve.gov/
diff --git a/config/locales/fr/defaults.yml b/config/locales/fr/defaults.yml
deleted file mode 100644
index 02ffbbc3..00000000
--- a/config/locales/fr/defaults.yml
+++ /dev/null
@@ -1,193 +0,0 @@
-# French translations for Ruby on Rails
-# by Christian Lescuyer (christian@flyingcoders.com)
-# contributors:
-# - Sebastien Grosjean - ZenCocoon.com
-# - Bruno Michel - http://github.com/nono
-# - Tsutomu Kuroda - http://github.com/kuroda (t-kuroda@oiax.jp)
-
-fr:
- date:
- formats:
- default: "%d/%m/%Y"
- short: "%e %b"
- long: "%e %B %Y"
- day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]
- abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam]
- month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre]
- abbr_month_names: [~, jan., fév., mar., avr., mai, juin, juil., août, sept., oct., nov., déc.]
- order:
- - :day
- - :month
- - :year
-
- time:
- formats:
- default: "%d/%m/%Y %H:%M"
- short: "%d %b %H:%M"
- long: "%A %d %B %Y %H:%M"
- am: 'am'
- pm: 'pm'
-
- datetime:
- distance_in_words:
- half_a_minute: "une demi-minute"
- less_than_x_seconds:
- zero: "moins d'une seconde"
- one: "moins d'une seconde"
- other: "moins de %{count} secondes"
- x_seconds:
- one: "1 seconde"
- other: "%{count} secondes"
- less_than_x_minutes:
- zero: "moins d'une minute"
- one: "moins d'une minute"
- other: "moins de %{count} minutes"
- x_minutes:
- one: "1 minute"
- other: "%{count} minutes"
- about_x_hours:
- one: "environ une heure"
- other: "environ %{count} heures"
- x_days:
- one: "1 jour"
- other: "%{count} jours"
- about_x_months:
- one: "environ un mois"
- other: "environ %{count} mois"
- x_months:
- one: "1 mois"
- other: "%{count} mois"
- about_x_years:
- one: "environ un an"
- other: "environ %{count} ans"
- over_x_years:
- one: "plus d'un an"
- other: "plus de %{count} ans"
- almost_x_years:
- one: "presqu'un an"
- other: "presque %{count} ans"
- prompts:
- year: "Année"
- month: "Mois"
- day: "Jour"
- hour: "Heure"
- minute: "Minute"
- second: "Seconde"
-
- number:
- format:
- separator: ","
- delimiter: " "
- precision: 3
- significant: false
- strip_insignificant_zeros: false
- currency:
- format:
- format: "%n %u"
- unit: "€"
- separator: ","
- delimiter: " "
- precision: 2
- significant: false
- strip_insignificant_zeros: false
- percentage:
- format:
- delimiter: ""
- precision:
- format:
- delimiter: ""
- human:
- format:
- delimiter: ""
- precision: 2
- significant: true
- strip_insignificant_zeros: true
- storage_units:
- format: "%n %u"
- units:
- byte:
- one: "octet"
- other: "octets"
- kb: "ko"
- mb: "Mo"
- gb: "Go"
- tb: "To"
- decimal_units:
- format: "%n %u"
- units:
- unit: ""
- thousand: "millier"
- million: "million"
- billion: "milliard"
- trillion: "billion"
- quadrillion: "million de milliards"
-
- support:
- array:
- words_connector: ", "
- two_words_connector: " et "
- last_word_connector: " et "
- select:
- prompt: "Veuillez sélectionner"
-
- helpers:
- select:
- prompt: "Veuillez sélectionner"
- submit:
- create: "Créer un %{model}"
- update: "Modifier ce %{model}"
- submit: "Enregistrer ce %{model}"
-
- attributes:
- created_at: "Créé le"
- updated_at: "Modifié le"
-
- errors:
- format: "%{attribute} : %{message}"
- messages: &errors_messages
- inclusion: "n'est pas inclus(e) dans la liste"
- exclusion: "n'est pas disponible"
- invalid: "n'est pas valide"
- confirmation: "ne concorde pas avec la confirmation"
- accepted: "doit être accepté(e)"
- empty: "doit être rempli(e)"
- blank: "doit être rempli(e)"
- too_long: "est trop long (pas plus de %{count} caractères)"
- too_short: "est trop court (au moins %{count} caractères)"
- wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
- not_a_number: "n'est pas un nombre"
- not_an_integer: "doit être un nombre entier"
- greater_than: "doit être supérieur à %{count}"
- greater_than_or_equal_to: "doit être supérieur ou égal à %{count}"
- equal_to: "doit être égal à %{count}"
- less_than: "doit être inférieur à %{count}"
- less_than_or_equal_to: "doit être inférieur ou égal à %{count}"
- odd: "doit être impair"
- even: "doit être pair"
- invalid_otp: Jeton d'authentification invalide
- debit_not_equal_to_credit: Le débit est différent du crédit pour la devise %{currency}
- should_be_negative: doit être négatif
- max_amount: ne peut pas être supérieur à votre limite (%{maximum} %{currency})
- unknown_country_code: a un code pays invalide
- bad_check_digits: a une clef de contrôle invalide
- bad_format: a un format incorrect
- bad_length: a une longueur incorrecte
- bad_chars: comprend des caractères invalides
- insufficient_privileges: Privilèges insuffisants
- should_be_blank: ne peut pas être renseigné
- template: &errors_template
- header:
- one: "Impossible d'enregistrer ce %{model} : 1 erreur"
- other: "Impossible d'enregistrer ce %{model} : %{count} erreurs"
- body: "Veuillez vérifier les champs suivants : "
-
- activerecord:
- errors:
- messages:
- taken: "n'est pas disponible"
- record_invalid: "La validation a échoué : %{errors}"
- <<: *errors_messages
- template:
- <<: *errors_template
- full_messages:
- format: "%{attribute} %{message}"
diff --git a/config/locales/fr/devise.yml b/config/locales/fr/devise.yml
deleted file mode 100644
index 9f4fb6c4..00000000
--- a/config/locales/fr/devise.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-fr:
- errors:
- messages:
- not_found: "not found"
- already_confirmed: "was already confirmed"
- not_locked: "was not locked"
-
- devise:
- failure:
- unauthenticated: 'Vous devez-être connecté pour accéder à cette page'
- unconfirmed: 'You have to confirm your account before continuing'
- locked: 'Your account is locked'
- invalid: 'Invalid email or password'
- invalid_token: 'Invalid authentication token'
- timeout: 'Your session expired, please sign in again to continue'
- inactive: 'Your account was not activated yet'
- invalid_ga_otp: Code Google Authenticator invalide ou expiré
- invalid_yk_otp: Code Yubikey invalide
- sessions:
- signed_in: 'Connexion réussie'
- signed_out: 'Déconnexion réussie'
- passwords:
- send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes'
- updated: 'Your password was changed successfully. You are now signed in'
- confirmations:
- send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes'
- confirmed: 'Your account was successfully confirmed. You are now signed in'
- registrations:
- signed_up: 'You have registered successfully. Confirmation instructions have been sent to you by e-mail'
- updated: 'You updated your account successfully'
- destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon'
- unlocks:
- send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes'
- unlocked: 'Your account was successfully unlocked. You are now signed in'
- mailer:
- confirmation_instructions:
- subject: 'Confirmation instructions'
- reset_password_instructions:
- subject: 'Reset password instructions'
- unlock_instructions:
- subject: 'Unlock Instructions'
diff --git a/config/locales/fr/emails.yml b/config/locales/fr/emails.yml
deleted file mode 100644
index 691e8da5..00000000
--- a/config/locales/fr/emails.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-fr:
- emails:
- invoice_payment_notification:
- subject: Vous avez reçu un paiement bitcoin!
- body: "Vous avez reçu un paiement de %{amount} BTC en paiement de la facture %{reference}"
-
- withdrawal_processed_notification:
- subject: Votre demande de paiement a été traitée
- body: "Votre demande de paiement a été traitée, vous devriez recevoir un virement sous peu."
-
- tickets:
- view_details_of: "Voir les détails du ticket \"%{title}\""
- reopen_notification:
- subject: Votre ticket a été ré-ouvert
- create_notification:
- subject: Un nouveau ticket a été ouvert
- close_notification:
- subject: Votre ticket a été clôturé
- comment_notification:
- subject: Un commentaire a été ajouté sur votre ticket
-
- trade_notification:
- subject: Vos ordres d'échange ont été exécutés
- traded: "%{traded_btc} BTC au prix de %{ppc} %{currency} par BTC pour un total de %{traded_currency} %{currency}"
- bought: Achats
- sold: Ventes
-
diff --git a/config/locales/fr/models.yml b/config/locales/fr/models.yml
deleted file mode 100644
index 4c8eb0ba..00000000
--- a/config/locales/fr/models.yml
+++ /dev/null
@@ -1,198 +0,0 @@
-fr:
- activerecord:
- attributes:
- invoice:
- reference: Référence
- user: Emetteur
- payment_address: Adresse de paiement
- amount: Montant
- callback_url: URL de notification
- state: Etat
- paid_at: Payé le
- merchant_reference: Réf. bénéficiaire
- merchant_memo: Commentaire
- authentication_token: Jeton d'authentification
- item_url: URL de la commande
- liberty_reserve_transfer:
- lr_account_id: Compte Liberty Reserve
- trade_order:
- amount: Montant
- dark_pool: Ordre masqué
- ppc: Prix
- category: Type
- type: Matching
- currency: Devise
- total: Total
- created_at: Création
- updated_at: Mise à jour
- transfer:
- id: ID
- created_at: Date
- user: Utilisateur
- amount: Montant
- address: Adresse
- currency: Devise
- bt_tx_confirmations: Confirmations
- bt_tx_from: Adresse Bitcoin d'origine
- bt_tx_id: Transaction Bitcoin
- email: Adresse e-mail
- lr_merchant_fee: Commission Liberty Reserve
- lr_transferred_amount: Montant Liberty Reserve transféré
- lr_transaction_id: Réf. Liberty Reserve
- lr_account_id: Compte Liberty Reserve
- px_tx_id: Réf. Pecunix
- px_fee: Commission Pecunix
- px_payer: Expéditeur Pecunix
- state: État
- user:
- id: ID
- email: Adresse e-mail
- password: Mot de passe
- password_confirmation: Confirmation du mot de passe
- recaptcha_response_field: Etes vous un humain?
- name: Compte
- admin: Administration
- authentication_token: Jeton d'authentification
- confirmation_sent_at: Envoi du mail de confirmation
- confirmation_token: Jeton de confirmation
- confirmed_at: Confirmation
- current_sign_in_at: Connexion courante
- current_sign_in_ip: IP de connexion courante
- encrypted_password: Mot de passe crypté
- failed_attempts: Echecs d'authentification
- last_address: Dernière adresse Bitcoin
- last_sign_in_at: Dernière connexion
- last_sign_in_ip: IP de dernière connexion
- locked_at: Verouillé le
- password_salt: Sel de mot de passe
- remember_created_at: Rappel
- remeber_token: Jeton de rappel
- reset_password_token: Jeton de changement de mot de passe
- salt: Sel
- secret_token: Jeton secret
- time_zone: Fuseau horaire
- unlock_token: Jeton de déverouillage
- purchase_trades: Transactions d'achat
- sale_trades: Transactions de vente
- trade_orders: Ordres
- transfers: Transactions
- current_password: Mot de passe actuel
- new_password: Nouveau mot de passe
- merchant: API E-commerce
- require_ga_otp: Google Authenticator
- require_yk_otp: Yubikey
- ga_otp: Code Google Auth.
- yk_otp: Code Yubikey
- bank_account_id: Compte bancaire
- full_name: Votre nom
- address: Votre addresse
- notify_on_trade: Exécution d'ordre
- trade:
- type: Type
- amount: Montant
- price: Taux
- total: Total
- created_at: Date
- announcement:
- content: Message
- active: Activé
- yubikey:
- otp: Code Yubikey
- key_id: Identifiant de clé
- active: Activée
- created_at: Création
- static_pages:
- title: Titre
- locale: Locale
- contents: Contenu
- created_at: Date de création
- updated_at: Date de dernière mise à jour
- bank_account:
- bic: BIC
- iban: IBAN
- account_holder: Nom et adresse
- created_at: Enregistré le
- state: État
- currency:
- code: Code
- created_at: Création
- updated_at: Mise à jour
- ticket:
- id: Réf.
- title: Titre
- state: Statut
- description: Description
- created_at: Ouvert le
- updated_at: Mis à jour
-
- models:
- invoice:
- one: Facture
- other: Factures
- user:
- one: Utilisateur
- other: Utilisateurs
- trade_order:
- one: Ordre
- other: Ordres
- account_operation:
- one: Opération
- other: Opérations
- transfer:
- one: Transaction
- other: Transactions
- trade:
- one: Echange
- other: Echanges
- announcement:
- one: Annonce
- other: Annonces
- yubikey:
- one: Yubikey
- other: Yubikeys
- static_page:
- one: Page statique
- other: Pages statiques
- bank_account:
- one: Compte bancaire
- other: Comptes bancaires
- ticket:
- one: Ticket
- other: Tickets
- currency:
- one: Devise
- other: Devises
-
- extra:
- invoice:
- state_translations:
- pending: En attente de paiement
- processing: Traitement en cours
- paid: Payé
- state_tooltips:
- pending: Aucun paiement n'a encore été reçu
- processing: Un paiement a été reçu, il est en attente de confirmation par le réseau Bitcoin
- paid: Paiement a été confirmé
- trade:
- types:
- buy: Achat
- sell: Vente
- bank_account:
- states:
- unverified: Non vérifié
- verified: Vérifié
- currency:
- codes:
- eur: Euro
- usd: Dollar US
- cad: Dollar Canadien
- inr: Roupie Indienne
- lrusd: Dollar Liberty Reserve
- lreur: Euro Liberty Reserve
- pgau: Or Pecunix
- btc: Bitcoin
- ticket:
- states:
- pending: En cours
- solved: Résolu
- closed: Fermé
diff --git a/config/locales/fr/other.yml b/config/locales/fr/other.yml
deleted file mode 100644
index 75d40b68..00000000
--- a/config/locales/fr/other.yml
+++ /dev/null
@@ -1,199 +0,0 @@
-fr:
- will_paginate:
- next: Suivant
- previous: Précédent
-
- password_forgotten: Mot de passe oublié ?
- didnt_receive_confirmation: "E-mail de confirmation non reçu ?"
- didnt_receive_unlock_instructions: "E-mail de déverrouillage non reçu ?"
- resend_confirmation: Renvoyer l'email de confirmation
- submit: Valider
-
- # Generic
- no_data: Aucune donnée
-
- # controllers/informations_controller.rb
- chart_date_format: %d.%m.
-
- # controllers/sessions_controller.rb
- sign_in_success: Connection réussie
- sign_in_failure: Connection échouée, vérifiez vos identifiants
- sign_out_success: Déconnexion réussie
-
- # controllers/third_party_callbacks_controller.rb
- lr_transfer_success: "Vous avez transféré %{amount} %{currency} vers votre compte avec succès (Commission LR : %{fee} %{currency})"
- lr_transfer_failure: Votre transfert de %{amount} %{currency} a échoué
- px_transfer_canceled: Votre transfert Pecunix a été annulé
- px_transfer_success: Vous avez transféré %{amount} PGAU vers votre compte avec succès (Commission Pecunix %{fee} PGAU).
-
- # controllers/trade_orders_controller.rb
- order_saved: Votre ordre a été enregistré, il n'a pu être exécuté faute d'ordres compatibles.
- order_filled: Votre ordre a été %{how} exécuté, vous avez %{action} %{traded_btc} BTC pour %{amount} %{currency} au prix de %{ppc} %{currency}/BTC
- bought: acheté
- sold: vendu
- partially: partiellement
- completely: complètement
- order_deleted: Votre ordre a été supprimé
- change_password: Changement de mot de passe
-
- # controllers/transfers_controller.rb
- successful_transfer: Vous avez transféré %{amount} %{currency} avec succès
-
- # controllers/user_controller.rb
- account_created: Votre compte a été créé avec succès
- account_updated: Votre compte a été mis à jour avec succès
-
- # helpers/trade_orders_helper.rb
- order_dark_pool_some: Certains de ces ordres ne sont pas visibles publiquement
- order_dark_pool: Cet ordre n'est pas visible publiquement
-
- # helpers/transfers_helper.rb
- confirmations_left:
- one: En attente d'une confirmation
- other: En attente de %{count} confirmations
-
- # mailers/backup_mailer.rb
- support_from: Bitcoin Central Support <%{support_email}>
- wallet_backup_subject: Sauvegarde du wallet.dat %{date}
-
- # mailers/user_mailer.rb
- sign_up_confirmation: "Confirmation d'enregistrement"
-
- # models/*.rb + lib/validators/*.rb
- errors:
- not_yourself: ne peut pas être vous-même
-
- blank: ne peut pas être vide
-
- must_be_greater: doit-être plus grand que %{min} BTC
- greater_than_balance: est plus élevé que votre solde (%{balance} %{currency})
- greater_than_capacity: est plus élevé que vos possibilités (%{capacity} BTC bei %{ppc} BTC/%{currency})
- minimum_dark_pool_order: "Cet ordre est trop petit pour être privé"
-
- invalid: est invalide
- no_match: ne correspond pas
- answer_incorrect: est incorrecte
-
- not_your_address: ne peut pas être votre adresse
- min_amount: ne peut-être inférieur à %{minimum} %{currency}
- ppc_minimum: Le prix doit-être supérieur à 0.0001 %{currency}
-
- # views/accounts/show.html
- account_balance_title: Soldes
- currency: Devise
- balance: Solde
- balance_unconfirmed: Ce transfert est en attente de confirmations du réseau Bitcoin
-
- # views/backup_mailer/wallet_backup.text
- encrypted_wallet: Copie cryptée du wallet.dat %{date}
-
- # views/informations/economy.html
- economy_title: Économie
- how_many_generated: "Combien de Bitcoins y-a-t'il en circulation ?"
- generated_coins_html: "Il y a à l'heure actuelle %{count} Bitcoins en circulation."
-
- # views/informations/faq.html
- faq_title: Foire aux questions
-
- # views/informations/welcome.html
-
- # views/layouts/_footer.html
- footer_html: "Vous pouvez supporter ce projet en donnant à l'adresse : %{adress}"
-
- # views/sessions/new.html
- account_label: N° de compte
- account_description: Adresse e-mail ou n° de compte
- password_label: Mot de passe
- password_description: Mot de passe oublié ?
- sign_in_submit: Connexion
-
- # views/trade_orders/book.html
- order_book_title: Choisissez une devise
- amount: Montant
- price: Prix
- no_buying_orders_found: "Aucun ordre d'achat n'a été trouvé"
- no_selling_orders_found: "Aucun ordre de vente n'a été trouvé"
- total: Total
-
- # views/trades/index.html
- trade_history_title: Historique
- no_trades_found: Aucune transaction trouvée
-
- # views/transfers/index.html
- account_history_title: Historique
- currency: Devise
-
- # views/transfers/new.html
- transfer_funds_title: Transfert de fonds
- transfer_funds_body_html: "
-
Vous pouvez transférer des fonds vers :
-
-
une adresse bitcoin (BTC uniquement),
-
une adresse e-mail (toutes devises),
-
une n° de compte Bitcoin Central (toutes devises), ou
- Les transferts en bitcoins peuvent-être effectués vers un compte Bitcoin Central ou vers une adresse e-mail.
- Le transfert reste interne à Bitcoin Central dans le cas dun envoi vers une adresse bitcoin si cette adresse
- appartient à un de ses utilisateurs, sinon ils sont effectués via le réseau bitcoin.
-
-
- Les transferts entre comptes Bitcoin Central sont entièrement gratuits.
-
-
- Les transferts vers une adresse e-mail déclenchent lenvoi dun message si son propriétaire
- ne possède pas de compte Bitcoin Central, dans ce cas, le message linforme que les fonds sont
- disponibles sur Bitcoin Central. Si les fonds ne sont pas récupérés par leur destinataire ils sont
- re-crédités sur le compte de lexpéditeur après un certain temps. Cette fonctionnalité nest pas encore disponible.
-
- payee: Destinataire
- payee_id_eur: N° de compte Bitcoin Central ou adresse e-mail
- payee_id_lrusd: N° de compte Bitcoin Central, Liberty Reserve, ou adresse e-mail
- payee_id_lreur: N° de compte Bitcoin Central, Liberty Reserve, ou adresse e-mail
- payee_id_btc: N° de compte Bitcoin Central, adresse bitcoin ou e-mail
- payee_id_none: Identification du destinataire
- confirmed_balance: Votre solde disponible
- transfer_amount: Montant
- transfer_button: Transférer
-
- # views/user_mailer/registration_confirmation.html
- # views/user_mailer/registration_confirmation.text
- thanks_for_registering: "Merci d'avoir créé votre compte Bitcoin Central."
- your_account_id_is: "Votre n° de compte : %{account_id}"
-
- # views/users/_form.html
- error_updating_account:
- one: "Une erreur a empêché vos informations d'être enregistrées :"
- other: "%{count} erreurs ont empêché vos informations d'être enregistrées :"
- error_updating_password:
- one: "Une erreur a empêché votre mot de passe d'être changé :"
- other: "%{count} erreurs ont empêché votre mot de passe d'être changé :"
- email: Adresse e-mail
- new_password_explanation: Remplissez ce champ pour changer votre mot de passe
- new_password_confirmation: Confirmation
- new_password_confirmation_explanation: Confirmation du nouveau mot de passe
- current_password_explanation: Nécessaire pour protéger votre compte
-
- # views/users/edit.html
- account_details_title: Détails de votre compte
-
- # views/users/index.html
- listing_users_title: Liste des utilisateurs
- account: Compte
- password: Mot de passe
- user_show: Montrer
- user_edit: Editer
- user_destroy: Supprimer
- user_destroy_confirm: Êtes-vous sûr(e) ?
- user_new: Nouvel utilisateur
-
- # views/users/new.html
- sign_up_for_account_title: Créer un compte
-
- # Admin
- insufficient_privileges: Droits insuffisants pour visiter cette page
diff --git a/config/locales/fr/views.yml b/config/locales/fr/views.yml
deleted file mode 100644
index b22b2813..00000000
--- a/config/locales/fr/views.yml
+++ /dev/null
@@ -1,275 +0,0 @@
-fr:
- layouts:
- application:
- title: "Bitcoin-Central : Achetez et vendez des Bitcoins"
- description: Achetez, vendez et stockez vos Bitcoins de manière simple et sûre avec la meilleure plateforme Bitcoin open-source
- user_informations:
- signed_in_as: Connecté sous
- address_tip: Une nouvelle adresse est générée à chaque paiement reçu, vos adresses précédentes restent valables
- your_address: Votre adresse
- logout: Déconnexion
- sign_up: Créer un compte
- sign_in: Connexion
- navigation:
- account:
- main: Compte
- balance: Soldes
- history: Historique
- withdraw: Retirer des fonds
- deposit: Déposer des fonds
- trading:
- main: Achat/Vente
- your_orders: Ordres d'échange
- order_book: Offres en cours
- trade_history: Historique d'échanges
- admin:
- main: Administration
- transfers: Transferts
- users: Utilisateurs
- information: Informations
- pending_transfers: Opérations en attente
- help:
- main: Aide
- faq: Foire aux questions
- economy: Économie
- support: Contact
- fees: Nos Tarifs
- api_docs: API
- terms_of_service: Conditions d'utilisation
- ecommerce:
- main: E-commerce
-
- invoices:
- new:
- create_invoice: Créer une facture
- error: Erreur de création de facture
- amount_explanation: Montant à payer
- payment_explanation: Adresse de réception des fonds
- callback_url_explanation: URL de notification vers laquelle POSTer
- submit: Créer facture
- created: Facture créée avec succès
- item_url_explanation: URL de la commande sur le site du vendeur
- index:
- details: Voir le détail de la facture
- create: Créer une facture
- deleted: Facture supprimée avec succès
- confirm: Êtes-vous sûr(e) de vouloir supprimer cette facture ?
- delete: Supprimer cette facture
- show:
- details: Détails de la facture
- payee: Bénéficiaire
- payment-explanations: >
- Pour payer, transférez simplement le montant indiqué
- à l'adresse de paiement, la page se rafraîchira automatiquement
- afin de vous indiquer l'avancement du processus.
- return_to_item: Revenir sur le site du vendeur
-
- trade_orders:
- index:
- create: Passer un ordre
- active_orders: "Ordres actifs (%{count})"
- inactive_orders: "Ordres inactifs (%{count})"
- detailed_list:
- na: N/A
- sell: Vente
- buy: Achat
- market: Marché
- limit: Limite
- delete_order: Supprimer cet ordre
- delete_order_confirm: Êtes-vous sûr(e) de vouloir supprimer cet ordre ?
- activate_order: Activer l'ordre et l'exécuter
- activate_order_confirm: Êtes-vous sûr(e) de vouloir activer cet ordre ?
- book:
- bids: Achat
- asks: Vente
- list:
- price: Prix
- amount: Montant
- total: Total
- market_order: Prix du marché
- new:
- title: Nouvel ordre d'échange
- currency_explanation: Devise à échanger
- type_explanation: Les différentes méthodes de matching sont décrites dans l'aide
- category: Category
- buy: Acheter
- sell: Vendre
- sell_or_buy_explanation: Voulez-vous acheter ou vendre des Bitcoins ?
- your_balance: Votre solde
- your_balance_explanation: Votre solde dans la devise sélectionnée
- amount_explanation: Montant en BTC à échanger
- ppc_explanation: Prix pour 1 BTC
- total_explanation: Total de votre ordre
- dark_pool_explanation: Ne pas afficher l'ordre publiquement
- help: Visitez notre page d'aide si vous avez besoin d'assistance
- error:
- one: "Une erreur empêche votre ordre d'être passé :"
- other: "%{count} erreurs empêchent votre ordre d'être passé :"
-
- trades:
- index:
- title: Historique
-
- accounts:
- show:
- add_funds: Déposer des fonds
- deposit:
- not_available: Le dépôt par virement SEPA n'est pas disponible actuellement
- deposit_bitcoins_title: Ajouter des Bitcoins
- deposit_bitcoins_body_html:
-
Envoyez simplement les Bitcoins à l'adresse affichée en haut à droite de l'écran, ils apparaîtront au crédit de votre compte après quelques minutes.
- Vous pourrez utiliser ces fonds une fois la transaction confirmée (environ %{estimation} minutes).
- deposit_eur_title: Ajouter des fonds par virement
- deposit_eur_body_html: "
-
- Nous ne facturons pas de frais pour l'approvisionnement par virement SEPA en euros.
-
-
Vous devez impérativement renseigner le champ \"Commentaire\" avec votre numéro de compte,
-
Nous pouvons recevoir des virements dans une grande variété de devises,
-
Des frais peuvent s'appliquer pour les virements non SEPA, n'hésitez-pas à nous contacter
-
-
- "
- bic: BIC
- account_holder: Titulaire du compte
- iban: IBAN
- bank: Banque
- comment: Commentaire
- account_holder_address: Addresse du titulaire
- deposit_lr_title: Ajouter du Liberty Reserve
- deposit_pgau_title: Ajouter de l'or Pecunix
- deposit_pgau_body_html:
-
- Précisez la quantité d'or à ajouter en grammes, vous serez redirigé vers l'interface Pecunix afin de valider la transaction.
-
- pgau_amount: Montant (PGAU)
- deposit_pgau: Ajouter de l'or Pecunix
- other_options: Autres options
- add_bank_account: Ajouter un compte bancaire
- lr_sci_form:
- click_for_lr_html: Cliquez ici pour payer avec directement avec votre compte Liberty Reserve (LREUR et LRUSD).
-
- users:
- form:
- submit: Enregistrer
- merchant_explanation: Activer votre boutique en ligne
- ga_otp_explanation: Utiliser Google Authenticator en complément du mot de passe
- ga_otp_config: Aide et instructions de configuration
- additional_authentication_requirements: Options d'authentification
- api_tools: Outils & API
- yk_otp_config: Associer des Yubikey à votre compte
- time_zone_explanation: Utilisé pour afficher les dates et heures locales
- manage_bank_accounts: Gérez vos comptes bancaires
- registered_bank_accounts:
- zero: Vous n'avez enregistré aucun compte bancaire pour l'instant.
- one: Vous avez enregistré un compte bancaire.
- other: Vous avez enregistré %{count} comptes bancaires.
- notifications: Notifications e-mail
- notify_on_trade_explanation: Recevoir une notification quand un échange est enregistré
- ga_otp_configuration:
- reset: Le secret partagé a été ré-initialisé, vous devez mettre à jour la configuration de votre téléphone
- password_change_form:
- change_password: Changement de mot de passe
- submit: Enregistrer
- password_updated: Votre mot de passe a été changé avec succès
-
- yubikeys:
- index:
- create: Associer une Yubikey à votre compte
- delete: Supprimer cette Yubikey
- confirm: Êtes-vous sûr(e) ?
- associate: Associer une nouvelle Yubikey
- otp_explanation: Générez simplement un mot de passe Yubikey ici
- created: Yubikey associée, elle sera nécessaire pour votre prochaine authentification
- destroyed: Yubikey supprimée
- error: Cette Yubikey n'a pu être associée à votre compte
-
- devise:
- sessions:
- new:
- ga_otp_explanation: Nécessaire uniquement si vous avez activé Google Authenticator
- yk_otp_explanation: Nécessaire uniquement si vous avez activé une Yubikey
- password_explanation: Mot de passe oublié ?
- sign_in: Connexion
-
- unlocks:
- new:
- resend: Envoyer les instructions de déverrouillage
-
- transfers:
- index:
- details: Détails de la transaction
- successful:
- processed: Vous avez transféré %{amount} %{currency} avec succès
- pending: Votre demande de transfert a été correctement enregistrée, elle sera traitée très prochainement
- show:
- state:
- processed: Traité
- pending: En attente
- new:
- title: Retirer des fonds
- body_html: "
-
Les méthodes suivantes sont actuellement disponibles :
-
-
Envoi de Bitcoins,
-
Virement SEPA,
-
Transfert automatique de Liberty Reserve,
-
Paiement Pecunix manuel
-
-
- "
- error: "Des erreurs empêchent l'envoi de vos fonds :"
- max_amount: Montant maximum
- submit: Valider
- manage_bank_accounts: Gérer vos comptes bancaires
-
- bank_accounts:
- index:
- title: Ajoutez un compte bancaire
- submit: Enregistrer
- created: Compte bancaire enregistré avec succès
- error: Votre compte bancaire n'a pas pu être enregistré
- destroyed: Compte bancaire supprimé
- not_destroyed: Vous ne pouvez pas supprimer un compte bancaire vérifié ou déjà utilisé
- list:
- delete: Supprimer
- confirm: Êtes-vous certain(e) de vouloir supprimer ce compte?
-
- static_pages:
- show:
- last_modification_at: "Date de dernière modification : %{updated_at}"
-
- tickets:
- new:
- title: Ouvrez un ticket de support
- submit: Enregistrer
- description_explanation: Décrivez précisément votre demande et n'hésitez-pas à inclure tous les détails nécessaires
- error: Impossible de soumettre la demande
- index:
- successfully_created: Votre demande a été enregistrée, elle sera traitée dès que possible
- your_tickets: Vos tickets de support
- no_tickets_found: Vous n'avez ouvert aucun ticket de support
- ticket:
- add_comment: Ajouter un commentaire
- someone_wrote: %{who} avez écrit, il y a %{when}
- you: Vous
- reopen : Rouvrir le ticket
- close: Fermer le ticket
-
- informations:
- welcome:
- download: Télécharger Bitcoin 0.5.0
- source: Code source
- trading_data_title: Échanges de la semaine passée
- welcome: Bienvenue sur bitcoin-central.net !
- support:
- contact: Contactez-nous
- contact_description_html: "Vous pouvez nous contacter à l'adresse %{email}"
- please_sign_in: Vous devez vous identifier pour ouvir un ticket de support
- your_tickets:
- zero: Vous n'avez aucun ticket en cours.
- one: Vous avez un ticket en cours.
- other: Vous avez %{count} tickets en cours.
- open_a_ticket: Ouvrir un nouveau ticket
- view_tickets: Voir tous les tickets
-
\ No newline at end of file
diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml
new file mode 100644
index 00000000..2b6a8efd
--- /dev/null
+++ b/config/locales/views.en.yml
@@ -0,0 +1,281 @@
+en:
+ layouts:
+ application:
+ title: "Bitcoin-Central : Trade Bitcoins easily and safely"
+ description: "Buy, sell and store Bitcoins easily and safely on the best open-source platform"
+ # user_informations:
+ # signed_in_as: "Signed-in as"
+ # address_tip: "A new address is generated each time you receive a payment, your previous addresses will still work though"
+ # your_address: "Your address"
+ # logout: "Logout"
+ # sign_up: "Sign-up"
+ # sign_in: "Sign-in"
+ # navigation:
+ # account:
+ # main: "Account"
+ # balance: "Balance"
+ # history: "History"
+ # withdraw: "Withdraw"
+ # deposit: "Deposit"
+ # trading:
+ # main: "Trading"
+ # your_orders: "Trade orders"
+ # order_book: "Order book"
+ # trade_history: "Trade history"
+ # admin:
+ # main: "Admin"
+ # transfers: "Transfers"
+ # users: "Users"
+ # information: "Informations"
+ # pending_transfers: "Pending transfers"
+ # help:
+ # main: "Help"
+ # faq: "FAQ"
+ # economy: "Economy"
+ # support: "Support"
+ # fees: "Our Fees"
+ # api_docs: "API"
+ # terms_of_service: "Terms of Service"
+ # ecommerce:
+ # main: "E-commerce"
+
+ # invoices:
+ # new:
+ # create_invoice: "Create an invoice"
+ # error: "Error posting invoice"
+ # amount_explanation: "The amount to be paid for this invoice"
+ # payment_explanation: "The address at which the funds should be sent"
+ # callback_url_explanation: "The URL that should be POST'ed to upon payment"
+ # submit: "Post invoice"
+ # created: "Invoice successfully posted"
+ # item_url_explanation: "Related order URL on the merchant website"
+ # index:
+ # details: "Show invoice details"
+ # create: "Create invoice"
+ # deleted: "Invoice deleted successfully"
+ # confirm: "Are you sure you want to delete this invoice ?"
+ # delete: "Delete this invoice"
+ # show:
+ # details: "Invoice details"
+ # payee: "Payee"
+ # payment-explanations: """>
+ # To pay this invoice, simply transfer the requested amount to
+ # the payment address, the page will automatically refresh to
+ # show you its progress.
+ # return_to_item: Return to merchant website
+ # """
+ # trade_orders:
+ # index:
+ # create: "Create an order"
+ # active_orders: "Active orders (%{count})"
+ # inactive_orders: "Inactive orders (%{count})"
+ # detailed_list:
+ # na: "N/A"
+ # sell: "Ask"
+ # buy: "Bid"
+ # market: "Market"
+ # limit: "Limit"
+ # delete_order: "Delete this trade order"
+ # delete_order_confirm: "Are you sure you want to delete this trade order ?"
+ # activate_order: "Activate this trade order and execute it"
+ # activate_order_confirm: "Are you sure you want to activate this trade order ?"
+ # book:
+ # bids: "Bids"
+ # asks: "Asks"
+ # list:
+ # price: "Price"
+ # amount: "Amount"
+ # total: "Total"
+ # market_order: "Market Order"
+ # new:
+ # title: "Create a trade order"
+ # currency_explanation: "Currency you want to trade"
+ # type_explanation: "Different matching types are explained in our help page"
+ # category: "Category"
+ # buy: "Buy"
+ # sell: "Sell"
+ # sell_or_buy_explanation: "Whether you want to buy or sell bitcoins"
+ # your_balance: "Your balance"
+ # your_balance_explanation: "Your available confirmed balance"
+ # amount_explanation: "BTC amount you're trading"
+ # ppc_explanation: "Price for 1 BTC"
+ # total_explanation: "The total for your order"
+ # dark_pool_explanation: "Should the order be hidden ?"
+ # help: "Visit our help page if you need assistance trading Bitcoins"
+ # error:
+ # one: "1 error prevented your trade order from being created :"
+ # other: "%{count} errors prevented your trade order from being created :"
+
+ # trades:
+ # index:
+ # title: "Trade history"
+
+ # accounts:
+ # show:
+ # add_funds: "Deposit funds"
+ # deposit:
+ # not_available: "SEPA wire deposits are currently unavailable"
+ # deposit_bitcoins_title: "Deposit Bitcoins"
+ # deposit_bitcoins_body_html: """
+ #
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
+ # You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
+ # """
+ # deposit_eur_title: Deposit with bank wire
+ # deposit_eur_body_html:
+ # """
+ #
+ # Funding your EUR account with a SEPA wire is free.
+ #
+ #
You must include your account ID in the \"Comments\" field
+ #
You can wire most currencies, it will get converted to EUR before funding your account
+ #
Fees may apply for non-SEPA transfers, contact us for more details
+ # Use this form to specify the amount of gold grams to deposit, upon submission
+ # you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
+ # is completed, the gold will appear in your balance.
+ #
+ # """
+ # pgau_amount: "Amount (PGAU)"
+ # deposit_pgau: "Deposit Pecunix"
+ # other_options: "Other options"
+ # add_bank_account: "Add a bank account"
+ # lr_sci_form:
+ # click_for_lr_html: 'Click here to pay with your Liberty Reserve account (LREUR and LRUSD).'
+
+ # users:
+ # form:
+ # submit: "Submit"
+ # merchant_explanation: "Activate merchant tools"
+ # ga_otp_explanation: "Require Google Auth. OTP"
+ # ga_otp_config: "Help and setup instructions"
+ # additional_authentication_requirements: "Additional authentication requirements"
+ # api_tools: "API & Tools"
+ # yk_otp_config: "Associate keys to your account"
+ # time_zone_explanation: "Used to display localized dates and times"
+ # manage_bank_accounts: "Manage your bank accounts"
+ # registered_bank_accounts:
+ # zero: "You haven't registered any bank account yet."
+ # one: "You have registered a bank account"
+ # other: "You have registered %{count} bank accounts"
+ # notifications: "E-mail notifications"
+ # notify_on_trade_explanation: "Receive a notification when one of your trade orders gets matched"
+ # ga_otp_configuration:
+ # reset: "The Google Authenticator shared-secret has been correctly reset, you should update your mobile device settings"
+ # password_change_form:
+ # change_password: "Change your password"
+ # submit: "Submit"
+ # password_updated: "Your password has been updated successfully"
+
+
+ # yubikeys:
+ # index:
+ # create: Associate a Yubikey to your account
+ # delete: Delete this Yubikey
+ # confirm: Are you sure ?
+ # associate: Associate a new Yubikey
+ # otp_explanation: Simply generate an OTP here to associate your key
+ # created: "Yubikey associated, you'll need it for your next sign-in"
+ # destroyed: Yubikey removed
+ # error: This key could not be associated to your account
+
+ # devise:
+ # sessions:
+ # new:
+ # ga_otp_explanation: Required only if you enabled Google Authenticator
+ # yk_otp_explanation: Required only if you enabled a Yubikey
+ # password_explanation: Password forgotten ?
+ # sign_in: Sign-in
+
+ # unlocks:
+ # new:
+ # resend: Send unlock instructions
+
+ # transfers:
+ # index:
+ # details: Transaction details
+ # successful:
+ # processed: Your successfully withdrew %{amount} %{currency}
+ # pending: Your withdrawal request was successful and will be processed shortly
+ # show:
+ # state:
+ # processed: Processed
+ # pending: Pending
+ # new:
+ # title: Withdraw funds
+ # body_html: """
+ #
You can currently withdraw using the following methods :
+ #
+ #
Bitcoins,
+ #
EUR bank wire,
+ #
Liberty Reserve automated transfer,
+ #
Pecunix manual transfer
+ #
+ #
+ # """
+ # error: "Some errors prevent your funds from being withdrawn :"
+ # max_amount: Maximum amount
+ # submit: Transfer
+ # manage_bank_accounts: Manage your bank accounts
+
+ # bank_accounts:
+ # index:
+ # title: Add a bank account
+ # submit: Submit
+ # created: Bank account successfully registered
+ # error: Your bank account could not be registered
+ # destroyed: Bank account deleted
+ # not_destroyed: You cannot delete a bank account that has been verified or wired to
+ # list:
+ # delete: Delete
+ # confirm: Are you sure you want to delete this bank account?
+
+ # static_pages:
+ # show:
+ # last_modification_at: "This page was last updated at %{updated_at}"
+
+ # tickets:
+ # new:
+ # title: Open a support request
+ # submit: Submit request
+ # description_explanation: Please be as accurate as possible when describing your request and provide all the relevant details.
+ # error: Unable to submit your support request
+ # index:
+ # successfully_created: Your request was saved successfully, it will be processed as soon as possible
+ # your_tickets: Your support requests
+ # no_tickets_found: You have no support requests to display
+ # ticket:
+ # add_comment: Add a comment
+ # someone_wrote: %{who} wrote, %{when} ago
+ # you: You
+ # reopen : Re-open ticket
+ # close: Close ticket
+
+ # informations:
+ # welcome:
+ # download: Download Bitcoin 0.5.0
+ # source: Source code
+ # trading_data_title: Last week's trading data
+ # welcome: Welcome to bitcoin-central.net!
+
+ # support:
+ # contact: Contact us
+ # contact_description_html: "You can reach us at %{email}"
+ # please_sign_in: Please sign-in to open a support request
+ # your_tickets:
+ # zero: You don't have any pending support tickets.
+ # one: You have a pending support ticket.
+ # other: You have %{count} pending support tickets.
+ open_a_ticket: Open a new support ticket
+ view_tickets: View all requests
diff --git a/config/routes.rb b/config/routes.rb
index d81cbbe0..6a2c5abd 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,5 @@
BitcoinBank::Application.routes.draw do
- devise_for :users
-
resources :invoices, :only => [:index, :new, :create, :show, :destroy]
resource :user, :only => [:edit, :update] do
From 3b5362d4c34329485a5984523c45329ad0eb7640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B9=E5=B8=B8=E9=91=AB?=
Date: Mon, 12 Aug 2013 21:27:13 +0800
Subject: [PATCH 04/12] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Gemfile | 3 ++-
Gemfile.lock | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Gemfile b/Gemfile
index 39d73b7c..9773fc7c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,5 @@
-source 'http://rubygems.org'
+#source 'http://rubygems.org'
+source 'http://ruby.taobao.org'
gem 'rails', '3.2.13'
gem 'rake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 985c960a..ec69ed21 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -23,7 +23,7 @@ GIT
mime-types
GEM
- remote: http://rubygems.org/
+ remote: http://ruby.taobao.org/
specs:
actionmailer (3.2.13)
actionpack (= 3.2.13)
From 385331fbe2f0ca03dd93a2995252f41108d669ce Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Mon, 12 Aug 2013 21:30:26 +0800
Subject: [PATCH 05/12] renew migrate
---
db/migrate/20101017194104_create_users.rb | 62 ++++++++++++++-----
.../20110506082222_devise_create_users.rb | 52 ----------------
db/migrate/20110713191630_create_accounts.rb | 1 +
db/schema.rb | 5 ++
4 files changed, 54 insertions(+), 66 deletions(-)
delete mode 100644 db/migrate/20110506082222_devise_create_users.rb
diff --git a/db/migrate/20101017194104_create_users.rb b/db/migrate/20101017194104_create_users.rb
index 0806cbde..7fa786b4 100644
--- a/db/migrate/20101017194104_create_users.rb
+++ b/db/migrate/20101017194104_create_users.rb
@@ -1,19 +1,53 @@
class CreateUsers < ActiveRecord::Migration
+
def self.up
- create_table :users do |t|
- t.string :account,
- :null => false
-
- t.string :email
-
- t.string :password,
- :null => false
-
- t.timestamps
+ create_table(:users) do |t|
+ ## Database authenticatable
+ t.string :email, :null => false, :default => ""
+ t.string :encrypted_password, :null => false, :default => ""
+
+ ## Recoverable
+ t.string :reset_password_token
+ t.datetime :reset_password_sent_at
+
+ ## Rememberable
+ t.datetime :remember_created_at
+
+ ## Trackable
+ t.integer :sign_in_count, :default => 0
+ t.datetime :current_sign_in_at
+ t.datetime :last_sign_in_at
+ t.string :current_sign_in_ip
+ t.string :last_sign_in_ip
+
+ # Confirmable
+ t.string :confirmation_token
+ t.datetime :confirmed_at
+ t.datetime :confirmation_sent_at
+ t.string :unconfirmed_email # Only if using reconfirmable
+
+ # Lockable
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
+ t.string :unlock_token # Only if unlock strategy is :email or :both
+ t.datetime :locked_at
+
+ # Token authenticatable
+ t.string :authentication_token
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ add_index :users, :confirmation_token, :unique => true
+ add_index :users, :unlock_token, :unique => true
+ add_index :users, :authentication_token, :unique => true
+ end
+
+ def self.down
+ # By default, we don't want to make any assumption about how to roll back a migration when your
+ # model already existed. Please edit below which fields you would like to remove in this migration.
+ drop_table :users
end
- end
- def self.down
- drop_table :users
- end
end
diff --git a/db/migrate/20110506082222_devise_create_users.rb b/db/migrate/20110506082222_devise_create_users.rb
deleted file mode 100644
index 6b6472b9..00000000
--- a/db/migrate/20110506082222_devise_create_users.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-class DeviseCreateUsers < ActiveRecord::Migration
- def self.up
- create_table(:users) do |t|
- ## Database authenticatable
- t.string :email, :null => false, :default => ""
- t.string :encrypted_password, :null => false, :default => ""
-
- ## Recoverable
- t.string :reset_password_token
- t.datetime :reset_password_sent_at
-
- ## Rememberable
- t.datetime :remember_created_at
-
- ## Trackable
- t.integer :sign_in_count, :default => 0
- t.datetime :current_sign_in_at
- t.datetime :last_sign_in_at
- t.string :current_sign_in_ip
- t.string :last_sign_in_ip
-
- # Confirmable
- t.string :confirmation_token
- t.datetime :confirmed_at
- t.datetime :confirmation_sent_at
- t.string :unconfirmed_email # Only if using reconfirmable
-
- # Lockable
- t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
- t.string :unlock_token # Only if unlock strategy is :email or :both
- t.datetime :locked_at
-
- # Token authenticatable
- t.string :authentication_token
-
- t.timestamps
- end
-
- add_index :users, :email, :unique => true
- add_index :users, :reset_password_token, :unique => true
- add_index :users, :confirmation_token, :unique => true
- add_index :users, :unlock_token, :unique => true
- add_index :users, :authentication_token, :unique => true
- end
-
- def self.down
- # By default, we don't want to make any assumption about how to roll back a migration when your
- # model already existed. Please edit below which fields you would like to remove in this migration.
- raise ActiveRecord::IrreversibleMigration
- end
-end
-
diff --git a/db/migrate/20110713191630_create_accounts.rb b/db/migrate/20110713191630_create_accounts.rb
index a29ce5a7..309d50ba 100644
--- a/db/migrate/20110713191630_create_accounts.rb
+++ b/db/migrate/20110713191630_create_accounts.rb
@@ -1,5 +1,6 @@
class CreateAccounts < ActiveRecord::Migration
def self.up
+ rename_table :users, :accounts
add_column :accounts, :parent_id, :integer
add_column :accounts, :type, :string
add_column :accounts, :account, :string
diff --git a/db/schema.rb b/db/schema.rb
index 0c917048..c8e95192 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -62,6 +62,11 @@
t.string "authentication_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
+ t.string "last_address"
+ t.string "salt"
+ t.string "time_zone"
+ t.boolean "admin", :default => false
+ t.string "secret_token"
t.boolean "merchant", :default => false
t.string "ga_otp_secret"
t.boolean "require_ga_otp", :default => false
From a6de4706dbeabd454e5103aabb5492f1524356cc Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Mon, 12 Aug 2013 22:02:15 +0800
Subject: [PATCH 06/12] fixed user name nil bug
---
app/controllers/registrations_controller.rb | 4 +--
app/models/account.rb | 12 +++------
app/models/user.rb | 29 +++++++++++----------
3 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index ceaffe07..839aa380 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -1,7 +1,7 @@
class RegistrationsController < Devise::RegistrationsController
def create
build_resource
-
+
resource.email = params[:user][:email]
verify_recaptcha and resource.captcha_checked!
@@ -11,7 +11,7 @@ def create
:notice => t("devise.registrations.signed_up")
else
clean_up_passwords(resource)
- render_with_scope :new
+ render :new
end
end
end
diff --git a/app/models/account.rb b/app/models/account.rb
index f8ba32fe..b07dbf7c 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -1,15 +1,9 @@
class Account < ActiveRecord::Base
has_many :account_operations
- has_many :used_currencies,
- :dependent => :destroy
-
- belongs_to :parent,
- :class_name => 'Account'
+ has_many :used_currencies, :dependent => :destroy
- validates :name,
- :presence => true,
- :uniqueness => true
+ belongs_to :parent, :class_name => 'Account'
# BigDecimal returned here
def balance(currency, options = {} )
@@ -37,7 +31,7 @@ def self.storage_account_for(currency)
account
else
Account.create! do |a|
- a.name = account_name
+ a.account = account_name
end
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 81d5e1c9..be2c2c6e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,14 +1,14 @@
class User < Account
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
- # :lockable, :timeoutable and :omniauthable
- devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :validatable
-
- # Setup accessible (or protected) attributes for your model
- attr_accessible :email, :password, :password_confirmation, :remember_me
- # Include default devise modules. Others available are:
- # :token_authenticatable, :confirmable, :lockable and :timeoutable
+ # # :lockable, :timeoutable and :omniauthable
+ # devise :database_authenticatable, :registerable,
+ # :recoverable, :rememberable, :trackable, :validatable
+
+ # # Setup accessible (or protected) attributes for your model
+ # attr_accessible :email, :password, :password_confirmation, :remember_me
+ # # Include default devise modules. Others available are:
+ # # :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable,
:ga_otp_authenticatable,
:yk_otp_authenticatable,
@@ -18,11 +18,12 @@ class User < Account
:trackable,
:validatable,
:lockable,
- :timeoutable
+ :timeoutable,
+ :rememberable
# Setup accessible (or protected) attributes for your model
- attr_accessible :password, :password_confirmation, :remember_me, :time_zone,
- :merchant, :require_ga_otp, :require_yk_otp, :full_name, :address
+ attr_accessible :password, :password_confirmation, :remember_me, :time_zone,
+ :merchant, :require_ga_otp, :require_yk_otp, :full_name, :address, :remember_me
attr_accessor :captcha,
:skip_captcha,
@@ -92,11 +93,11 @@ def confirm!
def self.find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
- name = conditions.delete(:name)
- where(conditions).where(["name = :value OR email = :value", { :value => name }]).first
+ account = conditions.delete(:account)
+ where(conditions).where(["account = :value OR email = :value", { :value => account }]).first
end
def generate_name
- self.name = "BC-U#{"%06d" % (rand * 10 ** 6).to_i}"
+ self.account = "BC-U#{"%06d" % (rand * 10 ** 6).to_i}"
end
end
From 4ba0d0ae5bab6664a2401102e6e4ad05195ada5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B9=E5=B8=B8=E9=91=AB?=
Date: Tue, 13 Aug 2013 22:01:29 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=20=E8=A7=A3=E5=86=B3=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/registrations_controller.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 839aa380..016504be 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -3,6 +3,8 @@ def create
build_resource
resource.email = params[:user][:email]
+ resource.password = params[:user][:password]
+ resource.password_confirmation = params[:user][:password_confirmation]
verify_recaptcha and resource.captcha_checked!
From b9bcaab04d7ad9b760aa3ec982f71ef1d7c6bd6c Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Wed, 14 Aug 2013 20:03:55 +0800
Subject: [PATCH 08/12] delete code validate in sign up
---
app/controllers/registrations_controller.rb | 1 -
app/models/user.rb | 12 ------------
app/views/devise/sessions/new.html.haml | 15 ++-------------
app/views/registrations/new.html.erb | 9 ---------
4 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 016504be..0f734771 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -6,7 +6,6 @@ def create
resource.password = params[:user][:password]
resource.password_confirmation = params[:user][:password_confirmation]
- verify_recaptcha and resource.captcha_checked!
if resource.save
redirect_to root_path,
diff --git a/app/models/user.rb b/app/models/user.rb
index be2c2c6e..029f2f11 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -61,18 +61,6 @@ class User < Account
:uniqueness => true,
:presence => true
- validate :captcha do
- if captcha.nil? and new_record?
- unless skip_captcha
- errors[:captcha] << I18n.t("errors.answer_incorrect")
- end
- end
- end
-
- def captcha_checked!
- self.captcha = true
- end
-
def bitcoin_address
super or (generate_new_address && super)
end
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index 60f90c3e..b7ca002b 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -2,25 +2,14 @@
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
.form-field
- = f.label :account
- = f.text_field :account
- .explanation= t(:account_description)
+ = f.label :email
+ = f.text_field :email
.form-field
= f.label :password
= f.password_field :password
.explanation= link_to t(".password_explanation"), new_password_path(resource_name)
- .form-field
- = f.label :ga_otp
- = f.text_field :ga_otp, :class => "ga-otp"
- .explanation= t(".ga_otp_explanation")
-
- .form-field
- = f.label :yk_otp
- = f.text_field :yk_otp, :class => "yk-otp"
- .explanation= t(".yk_otp_explanation")
-
.form-field
= f.submit "sign_in", :class => "submit"
diff --git a/app/views/registrations/new.html.erb b/app/views/registrations/new.html.erb
index 0a7b1ae3..69c0514b 100644
--- a/app/views/registrations/new.html.erb
+++ b/app/views/registrations/new.html.erb
@@ -43,15 +43,6 @@
- <% if resource.new_record? %>
-
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
- # You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
- # """
- # deposit_eur_title: Deposit with bank wire
- # deposit_eur_body_html:
- # """
- #
- # Funding your EUR account with a SEPA wire is free.
- #
- #
You must include your account ID in the \"Comments\" field
- #
You can wire most currencies, it will get converted to EUR before funding your account
- #
Fees may apply for non-SEPA transfers, contact us for more details
- # Use this form to specify the amount of gold grams to deposit, upon submission
- # you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
- # is completed, the gold will appear in your balance.
- #
- # """
- # pgau_amount: "Amount (PGAU)"
- # deposit_pgau: "Deposit Pecunix"
- # other_options: "Other options"
- # add_bank_account: "Add a bank account"
- # lr_sci_form:
- # click_for_lr_html: 'Click here to pay with your Liberty Reserve account (LREUR and LRUSD).'
+ accounts:
+ show:
+ add_funds: "Deposit funds"
+ deposit:
+ not_available: "SEPA wire deposits are currently unavailable"
+ deposit_bitcoins_title: "Deposit Bitcoins"
+ deposit_bitcoins_body_html:
+
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
+ You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
+
+ deposit_eur_title: Deposit with bank wire
+ deposit_eur_body_html:
+
+ Funding your EUR account with a SEPA wire is free.
+
+
You must include your account ID in the \"Comments\" field
+
You can wire most currencies, it will get converted to EUR before funding your account
+
Fees may apply for non-SEPA transfers, contact us for more details
+ Use this form to specify the amount of gold grams to deposit, upon submission
+ you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
+ is completed, the gold will appear in your balance.
+
+ pgau_amount: "Amount (PGAU)"
+ deposit_pgau: "Deposit Pecunix"
+ other_options: "Other options"
+ add_bank_account: "Add a bank account"
+ lr_sci_form:
+ click_for_lr_html: 'Click here to pay with your Liberty Reserve account (LREUR and LRUSD).'
# users:
# form:
From 43fc5cbd5621768afd071c0c1e81c571b53f7f3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B9=E5=B8=B8=E9=91=AB?=
Date: Wed, 14 Aug 2013 21:26:28 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E9=82=AE=E7=AE=B1?=
=?UTF-8?q?=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/registrations_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 0f734771..1ddfbbfc 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -5,7 +5,7 @@ def create
resource.email = params[:user][:email]
resource.password = params[:user][:password]
resource.password_confirmation = params[:user][:password_confirmation]
-
+ resource.confirmed_at = DateTime.now
if resource.save
redirect_to root_path,
From 7b878c4ae6baccc049ba66bdfe12ee0c2f014e76 Mon Sep 17 00:00:00 2001
From: songjiayang
Date: Wed, 14 Aug 2013 21:28:31 +0800
Subject: [PATCH 11/12] for i18n error
---
app/views/accounts/_balance_row.html.haml | 2 +-
app/views/accounts/show.html.haml | 4 +-
config/application.rb | 2 +-
config/locales/currencies.en.yml | 28 ---
config/locales/defaults.em.yml | 192 ---------------
config/locales/devise.en.yml | 59 -----
config/locales/en/views.yml | 277 +++++++++++++++++++++
config/locales/views.en.yml | 278 ----------------------
8 files changed, 281 insertions(+), 561 deletions(-)
delete mode 100644 config/locales/currencies.en.yml
delete mode 100644 config/locales/defaults.em.yml
delete mode 100644 config/locales/devise.en.yml
create mode 100644 config/locales/en/views.yml
delete mode 100644 config/locales/views.en.yml
diff --git a/app/views/accounts/_balance_row.html.haml b/app/views/accounts/_balance_row.html.haml
index 57d3f5e9..cef3fa76 100644
--- a/app/views/accounts/_balance_row.html.haml
+++ b/app/views/accounts/_balance_row.html.haml
@@ -1,6 +1,6 @@
- if (balance > 0) or %w{btc eur}.include?(code)
%tr
- %td= link_to image_tag("currencies/#{code}_logo.png", :alt => t("en.currencies.#{code}.name"), :title => t("en.currencies.#{code}.name")), t("en.currencies.#{code}.link"), :target => "_blank", :title => t("en.currencies.#{code}.name")
+ %td= link_to image_tag("currencies/#{code}_logo.png"), t("currencies.#{code}.link"), :target => "_blank", :title => t("currencies.#{code}.name")
%td= code.upcase
%td.account-balance{ :title => exact_balance(balance, code) }
%div{ :class => color_for_balance(balance) }
diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml
index d3d3f4a6..52e90b4b 100644
--- a/app/views/accounts/show.html.haml
+++ b/app/views/accounts/show.html.haml
@@ -7,8 +7,8 @@
%tr
%th
%th= t :currency
- %th= t :balance
+ %th= t :balance
- @balances.keys.sort.each do |code|
- - unless %w{UNCONFIRMED_BTC ADDRESS}.include?(code)
+ - unless %w{UNCONFIRMED_BTC ADDRESS}.include?(code)
= render :partial => 'accounts/balance_row', :locals => { :code => code.downcase, :balance => @balances[code], :unconfirmed_btc => @balances['UNCONFIRMED_BTC'] }
diff --git a/config/application.rb b/config/application.rb
index 1c96c7d8..58dd8d16 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -16,7 +16,7 @@ class Application < Rails::Application
config.time_zone = 'Beijing'
config.i18n.default_locale = 'en'
- config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
+ config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
config.encoding = "utf-8"
config.filter_parameters += [:password]
diff --git a/config/locales/currencies.en.yml b/config/locales/currencies.en.yml
deleted file mode 100644
index 72c1176f..00000000
--- a/config/locales/currencies.en.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-en:
- currencies:
- all:
- name: All currencies
- btc:
- name: Bitcoin
- link: http://www.bitcoin.org/
- eur:
- name: Euro
- link: http://www.ecb.int/
- lrusd:
- name: Liberty Reserve Dollar
- link: https://www.libertyreserve.com/?ref=U8651415
- lreur:
- name: Liberty Reserve Euro
- link: https://www.libertyreserve.com/?ref=U8651415
- pgau:
- name: Pecunix Gold
- link: http://www.pecunix.com/
- cad:
- name: Canadian Dollar
- link: http://www.bankofcanada.ca/
- inr:
- name: Indian Rupee
- link: http://www.rbi.org.in/
- usd:
- name: US Dollar
- link: http://www.federalreserve.gov/
diff --git a/config/locales/defaults.em.yml b/config/locales/defaults.em.yml
deleted file mode 100644
index 50dc37e6..00000000
--- a/config/locales/defaults.em.yml
+++ /dev/null
@@ -1,192 +0,0 @@
-# US English translations for Ruby on Rails
-#
-# Use this as the base for the locale file of your language.
-
-en:
- date:
- formats:
- default: "%Y-%m-%d"
- short: "%b %d"
- long: "%B %d, %Y"
-
- day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
- abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
-
- month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
- abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
- order:
- - :year
- - :month
- - :day
-
- time:
- formats:
- default: "%m/%d/%Y %H:%M"
- short: "%d %b %H:%M"
- long: "%B %d, %Y %H:%M"
- am: "am"
- pm: "pm"
-
- support:
- array:
- words_connector: ", "
- two_words_connector: " and "
- last_word_connector: ", and "
-
- select:
- prompt: "Please select"
-
- number:
- format:
- separator: "."
- delimiter: ","
- precision: 3
- significant: false
- strip_insignificant_zeros: false
-
- currency:
- format:
- format: "%n %u"
- unit: "$"
- separator: "."
- delimiter: ","
- precision: 2
- significant: false
- strip_insignificant_zeros: false
-
- percentage:
- format:
- delimiter: ""
-
- precision:
- format:
- delimiter: ""
-
- human:
- format:
- delimiter: ""
- precision: 3
- significant: true
- strip_insignificant_zeros: true
- storage_units:
- format: "%n %u"
- units:
- byte:
- one: "Byte"
- other: "Bytes"
- kb: "KB"
- mb: "MB"
- gb: "GB"
- tb: "TB"
- decimal_units:
- format: "%n %u"
- units:
- unit: ""
- thousand: Thousand
- million: Million
- billion: Billion
- trillion: Trillion
- quadrillion: Quadrillion
-
- datetime:
- distance_in_words:
- half_a_minute: "half a minute"
- less_than_x_seconds:
- one: "less than 1 second"
- other: "less than %{count} seconds"
- x_seconds:
- one: "1 second"
- other: "%{count} seconds"
- less_than_x_minutes:
- one: "less than a minute"
- other: "less than %{count} minutes"
- x_minutes:
- one: "1 minute"
- other: "%{count} minutes"
- about_x_hours:
- one: "about 1 hour"
- other: "about %{count} hours"
- x_days:
- one: "1 day"
- other: "%{count} days"
- about_x_months:
- one: "about 1 month"
- other: "about %{count} months"
- x_months:
- one: "1 month"
- other: "%{count} months"
- about_x_years:
- one: "about 1 year"
- other: "about %{count} years"
- over_x_years:
- one: "over 1 year"
- other: "over %{count} years"
- almost_x_years:
- one: "almost 1 year"
- other: "almost %{count} years"
- prompts:
- year: "Year"
- month: "Month"
- day: "Day"
- hour: "Hour"
- minute: "Minute"
- second: "Seconds"
-
- helpers:
- select:
- prompt: "Please select"
-
- submit:
- create: 'Create %{model}'
- update: 'Update %{model}'
- submit: 'Save %{model}'
-
- errors:
- format: "%{attribute} %{message}"
-
- messages: &errors_messages
- inclusion: "is not included in the list"
- exclusion: "is reserved"
- invalid: "is invalid"
- confirmation: "doesn't match confirmation"
- accepted: "must be accepted"
- empty: "can't be empty"
- blank: "can't be blank"
- too_long: "is too long (maximum is %{count} characters)"
- too_short: "is too short (minimum is %{count} characters)"
- wrong_length: "is the wrong length (should be %{count} characters)"
- not_a_number: "is not a number"
- not_an_integer: "must be an integer"
- greater_than: "must be greater than %{count}"
- greater_than_or_equal_to: "must be greater than or equal to %{count}"
- equal_to: "must be equal to %{count}"
- less_than: "must be less than %{count}"
- less_than_or_equal_to: "must be less than or equal to %{count}"
- odd: "must be odd"
- even: "must be even"
- invalid_otp: OTP is invalid
- debit_not_equal_to_credit: Credit and debit amounts are not equal for %{currency} account operations
- should_be_negative: must be negative
- max_amount: can't be greater than your limit (%{maximum} %{currency})
- unknown_country_code: has a wrong country code
- bad_check_digits: has wrong check digits
- bad_format: has wrong format
- bad_length: has wrong length
- bad_chars: has bad characters
- insufficient_privileges: Insufficient privileges
- should_be_blank: cannot have a value
- activerecord:
- errors:
- template:
- header:
- one: "1 error prohibited this %{model} from being saved"
- other: "%{count} errors prohibited this %{model} from being saved"
- body: "There were problems with the following fields:"
-
- messages:
- taken: "has already been taken"
- record_invalid: "Validation failed: %{errors}"
- <<: *errors_messages
-
- full_messages:
- format: "%{attribute} %{message}"
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
deleted file mode 100644
index d01f375c..00000000
--- a/config/locales/devise.en.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
-
-en:
- devise:
- confirmations:
- confirmed: "Your account was successfully confirmed. You are now signed in."
- send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
- send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
- failure:
- already_authenticated: "You are already signed in."
- inactive: "Your account was not activated yet."
- invalid: "Invalid email or password."
- invalid_token: "Invalid authentication token."
- locked: "Your account is locked."
- not_found_in_database: "Invalid email or password."
- timeout: "Your session expired, please sign in again to continue."
- unauthenticated: "You need to sign in or sign up before continuing."
- unconfirmed: "You have to confirm your account before continuing."
- mailer:
- confirmation_instructions:
- subject: "Confirmation instructions"
- reset_password_instructions:
- subject: "Reset password instructions"
- unlock_instructions:
- subject: "Unlock Instructions"
- omniauth_callbacks:
- failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
- success: "Successfully authenticated from %{kind} account."
- passwords:
- no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
- send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
- send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
- updated: "Your password was changed successfully. You are now signed in."
- updated_not_active: "Your password was changed successfully."
- registrations:
- destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
- signed_up: "Welcome! You have signed up successfully."
- signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
- signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
- signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
- update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
- updated: "You updated your account successfully."
- sessions:
- signed_in: "Signed in successfully."
- signed_out: "Signed out successfully."
- unlocks:
- send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
- send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
- unlocked: "Your account has been unlocked successfully. Please sign in to continue."
- errors:
- messages:
- already_confirmed: "was already confirmed, please try signing in"
- confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
- expired: "has expired, please request a new one"
- not_found: "not found"
- not_locked: "was not locked"
- not_saved:
- one: "1 error prohibited this %{resource} from being saved:"
- other: "%{count} errors prohibited this %{resource} from being saved:"
diff --git a/config/locales/en/views.yml b/config/locales/en/views.yml
new file mode 100644
index 00000000..9372ee13
--- /dev/null
+++ b/config/locales/en/views.yml
@@ -0,0 +1,277 @@
+en:
+ layouts:
+ application:
+ title: "Bitcoin-Central : Trade Bitcoins easily and safely"
+ description: "Buy, sell and store Bitcoins easily and safely on the best open-source platform"
+ user_informations:
+ signed_in_as: "Signed-in as"
+ address_tip: "A new address is generated each time you receive a payment, your previous addresses will still work though"
+ your_address: "Your address"
+ logout: "Logout"
+ sign_up: "Sign-up"
+ sign_in: "Sign-in"
+ navigation:
+ account:
+ main: "Account"
+ balance: "Balance"
+ history: "History"
+ withdraw: "Withdraw"
+ deposit: "Deposit"
+ trading:
+ main: "Trading"
+ your_orders: "Trade orders"
+ order_book: "Order book"
+ trade_history: "Trade history"
+ admin:
+ main: "Admin"
+ transfers: "Transfers"
+ users: "Users"
+ information: "Informations"
+ pending_transfers: "Pending transfers"
+ help:
+ main: "Help"
+ faq: "FAQ"
+ economy: "Economy"
+ support: "Support"
+ fees: "Our Fees"
+ api_docs: "API"
+ terms_of_service: "Terms of Service"
+ ecommerce:
+ main: "E-commerce"
+
+ invoices:
+ new:
+ create_invoice: "Create an invoice"
+ error: "Error posting invoice"
+ amount_explanation: "The amount to be paid for this invoice"
+ payment_explanation: "The address at which the funds should be sent"
+ callback_url_explanation: "The URL that should be POST'ed to upon payment"
+ submit: "Post invoice"
+ created: "Invoice successfully posted"
+ item_url_explanation: "Related order URL on the merchant website"
+ index:
+ details: "Show invoice details"
+ create: "Create invoice"
+ deleted: "Invoice deleted successfully"
+ confirm: "Are you sure you want to delete this invoice ?"
+ delete: "Delete this invoice"
+ show:
+ details: "Invoice details"
+ payee: "Payee"
+ payment-explanations: >
+ To pay this invoice, simply transfer the requested amount to
+ the payment address, the page will automatically refresh to
+ show you its progress.
+ return_to_item: Return to merchant website
+ trade_orders:
+ index:
+ create: "Create an order"
+ active_orders: "Active orders (%{count})"
+ inactive_orders: "Inactive orders (%{count})"
+ detailed_list:
+ na: "N/A"
+ sell: "Ask"
+ buy: "Bid"
+ market: "Market"
+ limit: "Limit"
+ delete_order: "Delete this trade order"
+ delete_order_confirm: "Are you sure you want to delete this trade order ?"
+ activate_order: "Activate this trade order and execute it"
+ activate_order_confirm: "Are you sure you want to activate this trade order ?"
+ book:
+ bids: "Bids"
+ asks: "Asks"
+ list:
+ price: "Price"
+ amount: "Amount"
+ total: "Total"
+ market_order: "Market Order"
+ new:
+ title: "Create a trade order"
+ currency_explanation: "Currency you want to trade"
+ type_explanation: "Different matching types are explained in our help page"
+ category: "Category"
+ buy: "Buy"
+ sell: "Sell"
+ sell_or_buy_explanation: "Whether you want to buy or sell bitcoins"
+ your_balance: "Your balance"
+ your_balance_explanation: "Your available confirmed balance"
+ amount_explanation: "BTC amount you're trading"
+ ppc_explanation: "Price for 1 BTC"
+ total_explanation: "The total for your order"
+ dark_pool_explanation: "Should the order be hidden ?"
+ help: "Visit our help page if you need assistance trading Bitcoins"
+ error:
+ one: "1 error prevented your trade order from being created :"
+ other: "%{count} errors prevented your trade order from being created :"
+
+ trades:
+ index:
+ title: "Trade history"
+
+ accounts:
+ show:
+ add_funds: "Deposit funds"
+ deposit:
+ not_available: "SEPA wire deposits are currently unavailable"
+ deposit_bitcoins_title: "Deposit Bitcoins"
+ deposit_bitcoins_body_html:
+
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
+ You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
+
+ deposit_eur_title: Deposit with bank wire
+ deposit_eur_body_html:
+
+ Funding your EUR account with a SEPA wire is free.
+
+
You must include your account ID in the \"Comments\" field
+
You can wire most currencies, it will get converted to EUR before funding your account
+
Fees may apply for non-SEPA transfers, contact us for more details
+ Use this form to specify the amount of gold grams to deposit, upon submission
+ you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
+ is completed, the gold will appear in your balance.
+
+ pgau_amount: "Amount (PGAU)"
+ deposit_pgau: "Deposit Pecunix"
+ other_options: "Other options"
+ add_bank_account: "Add a bank account"
+ lr_sci_form:
+ click_for_lr_html: 'Click here to pay with your Liberty Reserve account (LREUR and LRUSD).'
+
+ users:
+ form:
+ submit: "Submit"
+ merchant_explanation: "Activate merchant tools"
+ ga_otp_explanation: "Require Google Auth. OTP"
+ ga_otp_config: "Help and setup instructions"
+ additional_authentication_requirements: "Additional authentication requirements"
+ api_tools: "API & Tools"
+ yk_otp_config: "Associate keys to your account"
+ time_zone_explanation: "Used to display localized dates and times"
+ manage_bank_accounts: "Manage your bank accounts"
+ registered_bank_accounts:
+ zero: "You haven't registered any bank account yet."
+ one: "You have registered a bank account"
+ other: "You have registered %{count} bank accounts"
+ notifications: "E-mail notifications"
+ notify_on_trade_explanation: "Receive a notification when one of your trade orders gets matched"
+ ga_otp_configuration:
+ reset: "The Google Authenticator shared-secret has been correctly reset, you should update your mobile device settings"
+ password_change_form:
+ change_password: "Change your password"
+ submit: "Submit"
+ password_updated: "Your password has been updated successfully"
+
+
+ yubikeys:
+ index:
+ create: Associate a Yubikey to your account
+ delete: Delete this Yubikey
+ confirm: Are you sure ?
+ associate: Associate a new Yubikey
+ otp_explanation: Simply generate an OTP here to associate your key
+ created: "Yubikey associated, you'll need it for your next sign-in"
+ destroyed: Yubikey removed
+ error: This key could not be associated to your account
+
+ devise:
+ sessions:
+ new:
+ ga_otp_explanation: Required only if you enabled Google Authenticator
+ yk_otp_explanation: Required only if you enabled a Yubikey
+ password_explanation: Password forgotten ?
+ sign_in: Sign-in
+
+ unlocks:
+ new:
+ resend: Send unlock instructions
+
+ transfers:
+ index:
+ details: Transaction details
+ successful:
+ processed: Your successfully withdrew %{amount} %{currency}
+ pending: Your withdrawal request was successful and will be processed shortly
+ show:
+ state:
+ processed: Processed
+ pending: Pending
+ new:
+ title: Withdraw funds
+ body_html: >
+
You can currently withdraw using the following methods :
+
+
Bitcoins,
+
EUR bank wire,
+
Liberty Reserve automated transfer,
+
Pecunix manual transfer
+
+
+
+ error: "Some errors prevent your funds from being withdrawn :"
+ max_amount: Maximum amount
+ submit: Transfer
+ manage_bank_accounts: Manage your bank accounts
+
+ bank_accounts:
+ index:
+ title: Add a bank account
+ submit: Submit
+ created: Bank account successfully registered
+ error: Your bank account could not be registered
+ destroyed: Bank account deleted
+ not_destroyed: You cannot delete a bank account that has been verified or wired to
+ list:
+ delete: Delete
+ confirm: Are you sure you want to delete this bank account?
+
+ static_pages:
+ show:
+ last_modification_at: "This page was last updated at %{updated_at}"
+
+ tickets:
+ new:
+ title: Open a support request
+ submit: Submit request
+ description_explanation: Please be as accurate as possible when describing your request and provide all the relevant details.
+ error: Unable to submit your support request
+ index:
+ successfully_created: Your request was saved successfully, it will be processed as soon as possible
+ your_tickets: Your support requests
+ no_tickets_found: You have no support requests to display
+ ticket:
+ add_comment: Add a comment
+ someone_wrote: "%{who} wrote, %{when} ago"
+ you: You
+ reopen : Re-open ticket
+ close: Close ticket
+
+ informations:
+ welcome:
+ download: Download Bitcoin 0.5.0
+ source: Source code
+ trading_data_title: Last week's trading data
+ welcome: Welcome to bitcoin-central.net!
+
+ support:
+ contact: Contact us
+ contact_description_html: "You can reach us at %{email}"
+ please_sign_in: Please sign-in to open a support request
+ your_tickets:
+ zero: You don't have any pending support tickets.
+ one: You have a pending support ticket.
+ other: You have %{count} pending support tickets.
+ open_a_ticket: Open a new support ticket
+ view_tickets: View all requests
diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml
deleted file mode 100644
index 6b0d063f..00000000
--- a/config/locales/views.en.yml
+++ /dev/null
@@ -1,278 +0,0 @@
-en:
- layouts:
- application:
- title: "Bitcoin-Central : Trade Bitcoins easily and safely"
- description: "Buy, sell and store Bitcoins easily and safely on the best open-source platform"
- # user_informations:
- # signed_in_as: "Signed-in as"
- # address_tip: "A new address is generated each time you receive a payment, your previous addresses will still work though"
- # your_address: "Your address"
- # logout: "Logout"
- # sign_up: "Sign-up"
- # sign_in: "Sign-in"
- # navigation:
- # account:
- # main: "Account"
- # balance: "Balance"
- # history: "History"
- # withdraw: "Withdraw"
- # deposit: "Deposit"
- # trading:
- # main: "Trading"
- # your_orders: "Trade orders"
- # order_book: "Order book"
- # trade_history: "Trade history"
- # admin:
- # main: "Admin"
- # transfers: "Transfers"
- # users: "Users"
- # information: "Informations"
- # pending_transfers: "Pending transfers"
- # help:
- # main: "Help"
- # faq: "FAQ"
- # economy: "Economy"
- # support: "Support"
- # fees: "Our Fees"
- # api_docs: "API"
- # terms_of_service: "Terms of Service"
- # ecommerce:
- # main: "E-commerce"
-
- # invoices:
- # new:
- # create_invoice: "Create an invoice"
- # error: "Error posting invoice"
- # amount_explanation: "The amount to be paid for this invoice"
- # payment_explanation: "The address at which the funds should be sent"
- # callback_url_explanation: "The URL that should be POST'ed to upon payment"
- # submit: "Post invoice"
- # created: "Invoice successfully posted"
- # item_url_explanation: "Related order URL on the merchant website"
- # index:
- # details: "Show invoice details"
- # create: "Create invoice"
- # deleted: "Invoice deleted successfully"
- # confirm: "Are you sure you want to delete this invoice ?"
- # delete: "Delete this invoice"
- # show:
- # details: "Invoice details"
- # payee: "Payee"
- # payment-explanations: """>
- # To pay this invoice, simply transfer the requested amount to
- # the payment address, the page will automatically refresh to
- # show you its progress.
- # return_to_item: Return to merchant website
- # """
- # trade_orders:
- # index:
- # create: "Create an order"
- # active_orders: "Active orders (%{count})"
- # inactive_orders: "Inactive orders (%{count})"
- # detailed_list:
- # na: "N/A"
- # sell: "Ask"
- # buy: "Bid"
- # market: "Market"
- # limit: "Limit"
- # delete_order: "Delete this trade order"
- # delete_order_confirm: "Are you sure you want to delete this trade order ?"
- # activate_order: "Activate this trade order and execute it"
- # activate_order_confirm: "Are you sure you want to activate this trade order ?"
- # book:
- # bids: "Bids"
- # asks: "Asks"
- # list:
- # price: "Price"
- # amount: "Amount"
- # total: "Total"
- # market_order: "Market Order"
- # new:
- # title: "Create a trade order"
- # currency_explanation: "Currency you want to trade"
- # type_explanation: "Different matching types are explained in our help page"
- # category: "Category"
- # buy: "Buy"
- # sell: "Sell"
- # sell_or_buy_explanation: "Whether you want to buy or sell bitcoins"
- # your_balance: "Your balance"
- # your_balance_explanation: "Your available confirmed balance"
- # amount_explanation: "BTC amount you're trading"
- # ppc_explanation: "Price for 1 BTC"
- # total_explanation: "The total for your order"
- # dark_pool_explanation: "Should the order be hidden ?"
- # help: "Visit our help page if you need assistance trading Bitcoins"
- # error:
- # one: "1 error prevented your trade order from being created :"
- # other: "%{count} errors prevented your trade order from being created :"
-
- # trades:
- # index:
- # title: "Trade history"
-
- accounts:
- show:
- add_funds: "Deposit funds"
- deposit:
- not_available: "SEPA wire deposits are currently unavailable"
- deposit_bitcoins_title: "Deposit Bitcoins"
- deposit_bitcoins_body_html:
-
Simply transfer funds to your address and they'll show up in your account after a couple of minutes. Your address is located in the upper right corner of the screen.
- You will be able to use these funds after the transaction is confirmed (approximately %{estimation} minutes).
-
- deposit_eur_title: Deposit with bank wire
- deposit_eur_body_html:
-
- Funding your EUR account with a SEPA wire is free.
-
-
You must include your account ID in the \"Comments\" field
-
You can wire most currencies, it will get converted to EUR before funding your account
-
Fees may apply for non-SEPA transfers, contact us for more details
- Use this form to specify the amount of gold grams to deposit, upon submission
- you'll be taken to the Pecunix interface to confirm the transfer. Once the transfer
- is completed, the gold will appear in your balance.
-
- pgau_amount: "Amount (PGAU)"
- deposit_pgau: "Deposit Pecunix"
- other_options: "Other options"
- add_bank_account: "Add a bank account"
- lr_sci_form:
- click_for_lr_html: 'Click here to pay with your Liberty Reserve account (LREUR and LRUSD).'
-
- # users:
- # form:
- # submit: "Submit"
- # merchant_explanation: "Activate merchant tools"
- # ga_otp_explanation: "Require Google Auth. OTP"
- # ga_otp_config: "Help and setup instructions"
- # additional_authentication_requirements: "Additional authentication requirements"
- # api_tools: "API & Tools"
- # yk_otp_config: "Associate keys to your account"
- # time_zone_explanation: "Used to display localized dates and times"
- # manage_bank_accounts: "Manage your bank accounts"
- # registered_bank_accounts:
- # zero: "You haven't registered any bank account yet."
- # one: "You have registered a bank account"
- # other: "You have registered %{count} bank accounts"
- # notifications: "E-mail notifications"
- # notify_on_trade_explanation: "Receive a notification when one of your trade orders gets matched"
- # ga_otp_configuration:
- # reset: "The Google Authenticator shared-secret has been correctly reset, you should update your mobile device settings"
- # password_change_form:
- # change_password: "Change your password"
- # submit: "Submit"
- # password_updated: "Your password has been updated successfully"
-
-
- # yubikeys:
- # index:
- # create: Associate a Yubikey to your account
- # delete: Delete this Yubikey
- # confirm: Are you sure ?
- # associate: Associate a new Yubikey
- # otp_explanation: Simply generate an OTP here to associate your key
- # created: "Yubikey associated, you'll need it for your next sign-in"
- # destroyed: Yubikey removed
- # error: This key could not be associated to your account
-
- # devise:
- # sessions:
- # new:
- # ga_otp_explanation: Required only if you enabled Google Authenticator
- # yk_otp_explanation: Required only if you enabled a Yubikey
- # password_explanation: Password forgotten ?
- # sign_in: Sign-in
-
- # unlocks:
- # new:
- # resend: Send unlock instructions
-
- # transfers:
- # index:
- # details: Transaction details
- # successful:
- # processed: Your successfully withdrew %{amount} %{currency}
- # pending: Your withdrawal request was successful and will be processed shortly
- # show:
- # state:
- # processed: Processed
- # pending: Pending
- # new:
- # title: Withdraw funds
- # body_html: """
- #
You can currently withdraw using the following methods :
- #
- #
Bitcoins,
- #
EUR bank wire,
- #
Liberty Reserve automated transfer,
- #
Pecunix manual transfer
- #
- #
- # """
- # error: "Some errors prevent your funds from being withdrawn :"
- # max_amount: Maximum amount
- # submit: Transfer
- # manage_bank_accounts: Manage your bank accounts
-
- # bank_accounts:
- # index:
- # title: Add a bank account
- # submit: Submit
- # created: Bank account successfully registered
- # error: Your bank account could not be registered
- # destroyed: Bank account deleted
- # not_destroyed: You cannot delete a bank account that has been verified or wired to
- # list:
- # delete: Delete
- # confirm: Are you sure you want to delete this bank account?
-
- # static_pages:
- # show:
- # last_modification_at: "This page was last updated at %{updated_at}"
-
- # tickets:
- # new:
- # title: Open a support request
- # submit: Submit request
- # description_explanation: Please be as accurate as possible when describing your request and provide all the relevant details.
- # error: Unable to submit your support request
- # index:
- # successfully_created: Your request was saved successfully, it will be processed as soon as possible
- # your_tickets: Your support requests
- # no_tickets_found: You have no support requests to display
- # ticket:
- # add_comment: Add a comment
- # someone_wrote: %{who} wrote, %{when} ago
- # you: You
- # reopen : Re-open ticket
- # close: Close ticket
-
- # informations:
- # welcome:
- # download: Download Bitcoin 0.5.0
- # source: Source code
- # trading_data_title: Last week's trading data
- # welcome: Welcome to bitcoin-central.net!
-
- # support:
- # contact: Contact us
- # contact_description_html: "You can reach us at %{email}"
- # please_sign_in: Please sign-in to open a support request
- # your_tickets:
- # zero: You don't have any pending support tickets.
- # one: You have a pending support ticket.
- # other: You have %{count} pending support tickets.
- open_a_ticket: Open a new support ticket
- view_tickets: View all requests
From 52a6e44b8ad2702a60f9f7f567c01d8b75a53365 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B9=E5=B8=B8=E9=91=AB?=
Date: Thu, 15 Aug 2013 21:30:42 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E8=A7=A3=E5=86=B3name=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=8C=E5=B0=86=E4=BB=A5=E5=89=8D=E5=8E=BB=E6=8E=89=E7=9A=84?=
=?UTF-8?q?name=E5=8A=A0=E4=B8=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/admin/users_helper.rb | 12 ++++++------
app/models/account.rb | 2 +-
app/models/user.rb | 4 +++-
db/schema.rb | 1 +
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/app/helpers/admin/users_helper.rb b/app/helpers/admin/users_helper.rb
index 60d16b19..12007f04 100644
--- a/app/helpers/admin/users_helper.rb
+++ b/app/helpers/admin/users_helper.rb
@@ -1,9 +1,9 @@
module Admin::UsersHelper
- def id_column(record)
- record.id.to_s
- end
+ # def id_column(record)
+ # record.id.to_s if record.id
+ # end
- def name_column(record)
- link_to record.name, admin_user_account_operations_path(record)
- end
+ # def name_column(record)
+ # link_to record.name, admin_user_account_operations_path(record)
+ # end
end
diff --git a/app/models/account.rb b/app/models/account.rb
index b07dbf7c..7bfb19ca 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -31,7 +31,7 @@ def self.storage_account_for(currency)
account
else
Account.create! do |a|
- a.account = account_name
+ a.name = account_name
end
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 5f2d5de7..e36c258c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -81,6 +81,8 @@ def confirm!
def self.find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
+ name = conditions.delete(:name)
+ where(conditions).where(["name = :value OR email = :value", { :value => name }]).first
if login = conditions.delete(:email)
where(conditions).where(["lower(email) = :value", { :value => login.downcase }]).first
else
@@ -89,6 +91,6 @@ def self.find_for_database_authentication(warden_conditions)
end
def generate_name
- self.account = "BC-U#{"%06d" % (rand * 10 ** 6).to_i}"
+ self.name = "BC-U#{"%06d" % (rand * 10 ** 6).to_i}"
end
end
diff --git a/db/schema.rb b/db/schema.rb
index c8e95192..c49d42bb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -77,6 +77,7 @@
t.string "account"
t.string "full_name"
t.text "address"
+ t.string "name"
t.boolean "notify_on_trade", :default => true
t.integer "last_notified_trade_id", :default => 0, :null => false
t.integer "max_read_tx_id", :default => 0, :null => false