iugusdk 1.0.0.alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +39 -0
- data/app/assets/images/application_logo.png +0 -0
- data/app/assets/javascripts/settings.js +10 -0
- data/app/assets/javascripts/settings_code.js.coffee.erb +0 -0
- data/app/assets/stylesheets/settings.sass +120 -0
- data/app/controllers/iugu/account_controller.rb +63 -0
- data/app/controllers/iugu/account_domains_controller.rb +64 -0
- data/app/controllers/iugu/account_roles_controller.rb +20 -0
- data/app/controllers/iugu/account_settings_controller.rb +17 -0
- data/app/controllers/iugu/account_users_controller.rb +43 -0
- data/app/controllers/iugu/application_domain_controller.rb +11 -0
- data/app/controllers/iugu/confirmations_controller.rb +2 -0
- data/app/controllers/iugu/invitations_controller.rb +49 -0
- data/app/controllers/iugu/omniauth_callbacks_controller.rb +23 -0
- data/app/controllers/iugu/passwords_controller.rb +2 -0
- data/app/controllers/iugu/profile_controller.rb +44 -0
- data/app/controllers/iugu/registrations_controller.rb +3 -0
- data/app/controllers/iugu/sessions_controller.rb +2 -0
- data/app/controllers/iugu/settings_controller.rb +11 -0
- data/app/controllers/iugu/unlocks_controller.rb +2 -0
- data/app/mailers/iugu_mailer.rb +16 -0
- data/app/models/account.rb +53 -0
- data/app/models/account_domain.rb +69 -0
- data/app/models/account_role.rb +24 -0
- data/app/models/account_user.rb +55 -0
- data/app/models/available_language.rb +10 -0
- data/app/models/social_account.rb +14 -0
- data/app/models/user.rb +107 -0
- data/app/models/user_invitation.rb +39 -0
- data/app/validators/email_validator.rb +17 -0
- data/app/views/iugu-old/account_settings.html.haml +17 -0
- data/app/views/iugu-old/login.html.haml +28 -0
- data/app/views/iugu-old/mails/confirmation_instructions.html.erb +5 -0
- data/app/views/iugu-old/mails/reset_password_instructions.html.erb +8 -0
- data/app/views/iugu-old/mails/unlock_instructions.html.erb +7 -0
- data/app/views/iugu-old/profile_settings.html.haml +76 -0
- data/app/views/iugu-old/signup.html.haml +36 -0
- data/app/views/iugu/account_domains/index.html.haml +33 -0
- data/app/views/iugu/account_domains/instructions.html.haml +0 -0
- data/app/views/iugu/account_roles/edit.html.haml +17 -0
- data/app/views/iugu/account_roles/update.html.haml +0 -0
- data/app/views/iugu/account_users/index.html.haml +23 -0
- data/app/views/iugu/account_users/view.html.haml +0 -0
- data/app/views/iugu/confirmations/new.html.haml +8 -0
- data/app/views/iugu/invitations/edit.html.haml +8 -0
- data/app/views/iugu/invitations/new.html.haml +13 -0
- data/app/views/iugu/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/iugu/mailer/invitation.html.haml +1 -0
- data/app/views/iugu/mailer/reset_password_instructions.html.haml +4 -0
- data/app/views/iugu/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/iugu/passwords/edit.html.haml +11 -0
- data/app/views/iugu/passwords/new.html.haml +8 -0
- data/app/views/iugu/registrations/edit.html.haml +15 -0
- data/app/views/iugu/registrations/new.html.haml +11 -0
- data/app/views/iugu/sessions/new.html.haml +9 -0
- data/app/views/iugu/settings/account.html.haml +48 -0
- data/app/views/iugu/settings/accounts.html.haml +33 -0
- data/app/views/iugu/settings/profile.html.haml +96 -0
- data/app/views/iugu/shared/_links.haml +19 -0
- data/app/views/iugu/unlocks/new.html.haml +8 -0
- data/app/views/layouts/settings.html.haml +46 -0
- data/config/initializers/account_roles.rb +5 -0
- data/config/initializers/devise.rb +242 -0
- data/config/initializers/social_accounts.rb +16 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/locales/devise.pt-BR.yml +55 -0
- data/config/locales/iugu.en.yml +73 -0
- data/config/locales/iugu.pt-BR.yml +73 -0
- data/config/routes.rb +77 -0
- data/db/migrate/20120528164634_create_account.rb +11 -0
- data/db/migrate/20120529134109_add_devise_to_users.rb +53 -0
- data/db/migrate/20120529162901_add_birthdate_and_name_to_user.rb +12 -0
- data/db/migrate/20120529174755_add_name_and_subscription_id_and_user_id_to_account.rb +13 -0
- data/db/migrate/20120529180814_create_account_users.rb +12 -0
- data/db/migrate/20120530114709_remove_user_id_from_accounts.rb +9 -0
- data/db/migrate/20120531171438_create_account_roles.rb +12 -0
- data/db/migrate/20120604131034_add_locale_to_user.rb +9 -0
- data/db/migrate/20120605142527_create_social_account.rb +15 -0
- data/db/migrate/20120612141130_set_locale.rb +6 -0
- data/db/migrate/20120613173114_remove_unique_from_user_email.rb +11 -0
- data/db/migrate/20120615180728_create_delayed_jobs.rb +22 -0
- data/db/migrate/20120629154429_create_user_invitations.rb +14 -0
- data/db/migrate/20120629195345_add_token_to_user_invitations.rb +8 -0
- data/db/migrate/20120705202827_add_roles_to_user_invitations.rb +8 -0
- data/db/migrate/20120716145846_create_account_domain.rb +14 -0
- data/db/migrate/20120719162426_add_subdomain_to_account.rb +9 -0
- data/lib/iugusdk.rb +73 -0
- data/lib/iugusdk/controllers/helpers.rb +45 -0
- data/lib/iugusdk/engine.rb +13 -0
- data/lib/iugusdk/locale_filter.rb +12 -0
- data/lib/iugusdk/root_tenancy_url.rb +22 -0
- data/lib/iugusdk/valid_tenancy_urls.rb +27 -0
- data/lib/iugusdk/version.rb +3 -0
- data/lib/tasks/iugusdk_tasks.rake +4 -0
- data/spec/controller_macros.rb +41 -0
- data/spec/controllers/account_controller_spec.rb +155 -0
- data/spec/controllers/account_domains_controller_spec.rb +173 -0
- data/spec/controllers/account_roles_controller_spec.rb +48 -0
- data/spec/controllers/account_settings_controller_spec.rb +42 -0
- data/spec/controllers/account_users_controller_spec.rb +145 -0
- data/spec/controllers/application_domain_controller_spec.rb +29 -0
- data/spec/controllers/invitations_controller_spec.rb +102 -0
- data/spec/controllers/profile_controller_spec.rb +125 -0
- data/spec/controllers/settings_controller_spec.rb +14 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/default.sass +111 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/dashboard_controller.rb +8 -0
- data/spec/dummy/app/controllers/my_dummy_controller.rb +9 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/dashboard/index.html.haml +5 -0
- data/spec/dummy/app/views/dashboard/splash.html.haml +10 -0
- data/spec/dummy/app/views/layouts/application.html.erb +29 -0
- data/spec/dummy/app/views/layouts/dummy.html.erb +22 -0
- data/spec/dummy/app/views/my_dummy/index.html.haml +5 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/account_roles.yml +3 -0
- data/spec/dummy/config/application.rb +66 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +37 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +40 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/iugusdk.rb +4 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +69 -0
- data/spec/dummy/config/social_accounts.yml +6 -0
- data/spec/dummy/db/schema.rb +95 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/sass/1f198e4a81e57d6c86c6fff1f0e13592b233ebc2/prettify.cssc +0 -0
- data/spec/dummy/tmp/cache/sass/40796b6ca2cf9112b889007328d8a4c5fdc634d8/_css3.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/40796b6ca2cf9112b889007328d8a4c5fdc634d8/_support.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/components.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/iugu-ux.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/mixins.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/reset.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/typography.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/utilities.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/variables.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_appearance.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-clip.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-origin.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-size.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_border-radius.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box-shadow.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box-sizing.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_columns.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_font-face.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_images.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_inline-block.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_opacity.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_shared.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_text-shadow.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_transform.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_transition.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/9da4e62a062dae83baa33f29455be2ba30cf5dce/_sprites.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/db2a23483187bf5625185da2d6f47de2a6de4989/_base.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/db2a23483187bf5625185da2d6f47de2a6de4989/_sprite-img.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/e5be18dde92936a4632e65289dad5788ed73dd60/base_settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e5be18dde92936a4632e65289dad5788ed73dd60/settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/application.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/base_settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/default.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/eab9c0816f626278a6731ce2928de6fdbe99322b/_hacks.scssc +0 -0
- data/spec/dummy/tmp/restart.txt +0 -0
- data/spec/fabricators/account_domain_fabricator.rb +4 -0
- data/spec/fabricators/account_fabricator.rb +4 -0
- data/spec/fabricators/account_role_fabricator.rb +3 -0
- data/spec/fabricators/account_user_fabricator.rb +4 -0
- data/spec/fabricators/social_account_fabricator.rb +10 -0
- data/spec/fabricators/user_fabricator.rb +10 -0
- data/spec/fabricators/user_invitation_fabricator.rb +4 -0
- data/spec/mailers/iugu_mailer_spec.rb +22 -0
- data/spec/models/account_domain_spec.rb +111 -0
- data/spec/models/account_role_spec.rb +24 -0
- data/spec/models/account_spec.rb +155 -0
- data/spec/models/account_user_spec.rb +158 -0
- data/spec/models/social_account_spec.rb +36 -0
- data/spec/models/user_invitation_spec.rb +92 -0
- data/spec/models/user_spec.rb +187 -0
- data/spec/requests/account_domain_spec.rb +77 -0
- data/spec/requests/account_roles_spec.rb +45 -0
- data/spec/requests/account_spec.rb +97 -0
- data/spec/requests/account_users_spec.rb +129 -0
- data/spec/requests/omniauth_spec.rb +79 -0
- data/spec/requests/settings_spec.rb +53 -0
- data/spec/requests/user_invitation_spec.rb +40 -0
- data/spec/requests/user_spec.rb +34 -0
- data/spec/spec_helper.rb +116 -0
- data/spec/validators/email_validator_spec.rb +21 -0
- metadata +729 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
#OmniAuth.config.path_prefix = '/settings/account/link/'
|
2
|
+
#begin
|
3
|
+
#SOCIAL_ACCOUNTS = YAML.load_file("#{Rails.root.to_s}/config/social_accounts.yml")
|
4
|
+
#rescue
|
5
|
+
#SOCIAL_ACCOUNTS = {}
|
6
|
+
#end
|
7
|
+
|
8
|
+
#Rails.application.config.middleware.use OmniAuth::Builder do
|
9
|
+
#configure do |config|
|
10
|
+
#config.path_prefix = "/login/using"
|
11
|
+
#end
|
12
|
+
#provider :developer unless Rails.env.production?
|
13
|
+
#SOCIAL_ACCOUNTS.keys.each do |provider_name|
|
14
|
+
#provider provider_name.to_sym, SOCIAL_ACCOUNTS[provider_name]['token'], SOCIAL_ACCOUNTS[provider_name]['secret']
|
15
|
+
#end
|
16
|
+
#end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
errors:
|
5
|
+
messages:
|
6
|
+
expired: "has expired, please request a new one"
|
7
|
+
not_found: "not found"
|
8
|
+
already_confirmed: "was already confirmed, please try signing in"
|
9
|
+
not_locked: "was not locked"
|
10
|
+
not_saved:
|
11
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
12
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
13
|
+
|
14
|
+
devise:
|
15
|
+
failure:
|
16
|
+
already_authenticated: 'You are already signed in.'
|
17
|
+
unauthenticated: 'You need to login or create account before continuing.'
|
18
|
+
unconfirmed: 'You have to confirm your account before continuing.'
|
19
|
+
locked: 'Your account is locked.'
|
20
|
+
invalid: 'Invalid email or password.'
|
21
|
+
invalid_token: 'Invalid authentication token.'
|
22
|
+
timeout: 'Your session expired, please sign in again to continue.'
|
23
|
+
inactive: 'Your account was not activated yet.'
|
24
|
+
sessions:
|
25
|
+
signed_in: 'Signed in successfully.'
|
26
|
+
signed_out: 'Signed out successfully.'
|
27
|
+
passwords:
|
28
|
+
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
|
29
|
+
updated: 'Your password was changed successfully. You are now signed in.'
|
30
|
+
updated_not_active: 'Your password was changed successfully.'
|
31
|
+
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."
|
32
|
+
confirmations:
|
33
|
+
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
|
34
|
+
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.'
|
35
|
+
confirmed: 'Your account was successfully confirmed. You are now signed in.'
|
36
|
+
registrations:
|
37
|
+
signed_up: 'Welcome! You have signed up successfully.'
|
38
|
+
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.'
|
39
|
+
signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
|
40
|
+
signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
|
41
|
+
updated: 'You updated your account successfully.'
|
42
|
+
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."
|
43
|
+
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
|
44
|
+
unlocks:
|
45
|
+
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
|
46
|
+
unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
|
47
|
+
send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
|
48
|
+
omniauth_callbacks:
|
49
|
+
success: 'Successfully authenticated from %{kind} account.'
|
50
|
+
failure: 'Could not authenticate you from %{kind} because "%{reason}".'
|
51
|
+
mailer:
|
52
|
+
confirmation_instructions:
|
53
|
+
subject: 'Confirmation instructions'
|
54
|
+
reset_password_instructions:
|
55
|
+
subject: 'Reset password instructions'
|
56
|
+
unlock_instructions:
|
57
|
+
subject: 'Unlock Instructions'
|
@@ -0,0 +1,55 @@
|
|
1
|
+
pt-BR:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
expired: "expirou, por favor, solicite uma nova"
|
5
|
+
not_found: "não encontrado"
|
6
|
+
already_confirmed: "já foi confirmado"
|
7
|
+
not_locked: "não foi bloqueado"
|
8
|
+
not_saved:
|
9
|
+
one: "Não foi possível salvar %{resource}: 1 erro"
|
10
|
+
other: "Não foi possível salvar %{resource}: %{count} erros."
|
11
|
+
|
12
|
+
devise:
|
13
|
+
failure:
|
14
|
+
already_authenticated: 'Você já está logado.'
|
15
|
+
unauthenticated: 'Para continuar, efetue login ou registre-se.'
|
16
|
+
unconfirmed: 'Antes de continuar, confirme a sua conta.'
|
17
|
+
locked: 'Sua conta está bloqueada.'
|
18
|
+
invalid: 'E-mail ou senha inválidos.'
|
19
|
+
invalid_token: 'O token de autenticação não é válido.'
|
20
|
+
timeout: 'Sua sessão expirou, por favor, efetue login novamente para continuar.'
|
21
|
+
inactive: 'Sua conta ainda não foi ativada.'
|
22
|
+
sessions:
|
23
|
+
signed_in: 'Login efetuado com sucesso!'
|
24
|
+
signed_out: 'Saiu com sucesso.'
|
25
|
+
passwords:
|
26
|
+
send_instructions: 'Dentro de minutos, você receberá um e-mail com instruções para a troca da sua senha.'
|
27
|
+
updated: 'Sua senha foi alterada com sucesso. Você está logado.'
|
28
|
+
updated_not_active: 'Sua senha foi alterada com sucesso.'
|
29
|
+
send_paranoid_instructions: 'Se o seu endereço de e-mail estiver cadastrado, você receberá um link de recuperação da senha via e-mail.'
|
30
|
+
confirmations:
|
31
|
+
send_instructions: 'Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta.'
|
32
|
+
send_paranoid_instructions: 'Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta.'
|
33
|
+
confirmed: 'Sua conta foi confirmada com sucesso. Você está logado.'
|
34
|
+
registrations:
|
35
|
+
signed_up: 'Login efetuado com sucesso. Se não foi autorizado, a confirmação será enviada por e-mail.'
|
36
|
+
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.'
|
37
|
+
signed_up_but_inactive: 'Você foi cadastrado com sucesso. No entanto, não foi possível efetuar login, pois sua conta não foi ativada.'
|
38
|
+
signed_up_but_locked: 'Você foi cadastrado com sucesso. No entanto, não foi possível efetuar login, pois sua conta está bloqueada.'
|
39
|
+
updated: 'Sua conta foi atualizada com sucesso.'
|
40
|
+
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."
|
41
|
+
destroyed: 'Tchau! Sua conta foi cancelada com sucesso. Esperamos vê-lo novamente em breve.'
|
42
|
+
unlocks:
|
43
|
+
send_instructions: 'Dentro de minutos, você receberá um email com instruções para o desbloqueio da sua conta.'
|
44
|
+
unlocked: 'Sua conta foi desbloqueada com sucesso. Efetue login para continuar.'
|
45
|
+
send_paranoid_instructions: 'Se sua conta existir, você receberá um e-mail com instruções para desbloqueá-la em alguns minutos.'
|
46
|
+
omniauth_callbacks:
|
47
|
+
success: 'Autenticado com sucesso com uma conta de %{kind}.'
|
48
|
+
failure: 'Não foi possível autenticá-lo como %{kind} porque "%{reason}".'
|
49
|
+
mailer:
|
50
|
+
confirmation_instructions:
|
51
|
+
subject: 'Instruções de confirmação'
|
52
|
+
reset_password_instructions:
|
53
|
+
subject: 'Instruções de troca de senha'
|
54
|
+
unlock_instructions:
|
55
|
+
subject: 'Instruções de desbloqueio'
|
@@ -0,0 +1,73 @@
|
|
1
|
+
en:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
only_owners_can_destroy_accounts: "Only owners can destroy Accounts"
|
5
|
+
invalid_role: "Not a valid role"
|
6
|
+
only_social_and_no_email: "You need email and password to unlink this Social Account"
|
7
|
+
email_already_in_use: "This email is already in use"
|
8
|
+
iugu:
|
9
|
+
create_account: "Create Account"
|
10
|
+
add: "Add"
|
11
|
+
active: "Active"
|
12
|
+
unnamed: "Unnamed"
|
13
|
+
back_to: "Back to"
|
14
|
+
save: "Save"
|
15
|
+
invited_by: "Invited by"
|
16
|
+
accept: "Accept"
|
17
|
+
invite: "Invite"
|
18
|
+
permissions: "Permissions"
|
19
|
+
select: "Select"
|
20
|
+
configs: "Configs"
|
21
|
+
error: "Error"
|
22
|
+
errors: "Errors"
|
23
|
+
account: "Account"
|
24
|
+
accounts: "Accounts"
|
25
|
+
account_domains: "Account Domains"
|
26
|
+
social_unlinked: "Social Account successfully unlink"
|
27
|
+
account_destruction_in: "Account will be remove at "
|
28
|
+
account_destruction_undone: "Account destruction canceled"
|
29
|
+
account_user_destruction_undone: "Account user destruction canceled"
|
30
|
+
account_user_destruction_in: "Account user will be remove at "
|
31
|
+
user_destruction_in: "User will be remove at "
|
32
|
+
user_destruction_undone: "User destruction canceled"
|
33
|
+
users: "Users"
|
34
|
+
users_and_roles: "Users and Roles"
|
35
|
+
are_you_sure?: "Are you sure?"
|
36
|
+
remove: "Remove"
|
37
|
+
remove_user: "Remove User"
|
38
|
+
removing: "Removing..."
|
39
|
+
cancel_account: "Cancel Account"
|
40
|
+
undo: "Undo"
|
41
|
+
signed_in: "You are signed in as"
|
42
|
+
settings: "Settings"
|
43
|
+
in_your_settings_form: "in your settings form"
|
44
|
+
sign_out: "Sign out"
|
45
|
+
sign_in: "Sign in"
|
46
|
+
sign_up: "Sign up"
|
47
|
+
profile: "Profile"
|
48
|
+
profile_settings: "Profile Settings"
|
49
|
+
account_settings: "Account Settings"
|
50
|
+
account_number: "Account Number"
|
51
|
+
account_roles: "User roles on account"
|
52
|
+
change_password: "Change password"
|
53
|
+
change: "Change"
|
54
|
+
manage: "Manage"
|
55
|
+
social_account: "Social network accounts"
|
56
|
+
payment_history: "Payment History"
|
57
|
+
primary: "Primary"
|
58
|
+
set_primary: "Set Primary"
|
59
|
+
verified: "Verified"
|
60
|
+
not_verified: "Not Verified"
|
61
|
+
instructions: "Instructions"
|
62
|
+
notices:
|
63
|
+
user_invited: "User invited"
|
64
|
+
sign_up: "Thank you for signing up"
|
65
|
+
user_update: "User was successfully updated."
|
66
|
+
roles_changed: "Roles successfully changed"
|
67
|
+
domain_created: "Account Domain successfully created"
|
68
|
+
domain_not_found: "Domain not found"
|
69
|
+
domain_destroyed: "Domain successfully removed"
|
70
|
+
domain_verified: "Domain successfully verified"
|
71
|
+
domain_not_verified: "Domain could not be verified"
|
72
|
+
domain_set_primary: "Domain successfully set as primary"
|
73
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
pt-BR:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
only_owners_can_destroy_accounts: "Apenas donos podem remover contas"
|
5
|
+
invalid_role: "Cargo invalido"
|
6
|
+
only_social_and_no_email: "Você precisa de um email para poder apagar essa rede social"
|
7
|
+
email_already_in_use: "Esse email já foi utilizado"
|
8
|
+
iugu:
|
9
|
+
create_account: "Criar Conta"
|
10
|
+
add: "Adicionar"
|
11
|
+
active: "Ativa"
|
12
|
+
unnamed: "Sem nome"
|
13
|
+
back_to: "Voltar para"
|
14
|
+
save: "Salvar"
|
15
|
+
invited_by: "Convidado por"
|
16
|
+
accept: "Aceitar"
|
17
|
+
invite: "Convidar"
|
18
|
+
permissions: "Permissões"
|
19
|
+
select: "Selecionar"
|
20
|
+
configs: "Configurações"
|
21
|
+
error: "Erro"
|
22
|
+
errors: "Erros"
|
23
|
+
account: "Conta"
|
24
|
+
accounts: "Contas"
|
25
|
+
account_domains: "Domínios"
|
26
|
+
social_unlinked: "Rede social desvinculada com sucesso"
|
27
|
+
account_destruction_in: "A conta será removida em "
|
28
|
+
account_destruction_undone: "Remoção da conta cancelada"
|
29
|
+
account_user_destruction_undone: "Remoção do usuário da conta cancelada"
|
30
|
+
account_user_destruction_in: "O usuário da conta será removido em "
|
31
|
+
user_destruction_in: "O usuário será removido em "
|
32
|
+
user_destruction_undone: "Remoção do usuário cancelada"
|
33
|
+
users: "Usuários"
|
34
|
+
users_and_roles: "Usuários e Papéis"
|
35
|
+
are_you_sure?: "Tem certeza disso?"
|
36
|
+
remove: "Excluir"
|
37
|
+
remove_user: "Remover Usuário"
|
38
|
+
cancel_account: "Cancelar Conta"
|
39
|
+
removing: "Excluindo..."
|
40
|
+
undo: "Desfazer"
|
41
|
+
signed_in: "Você está logado como"
|
42
|
+
settings: "Preferencias"
|
43
|
+
in_your_settings_form: "no seu formulario de configurações"
|
44
|
+
sign_out: "Deslogar"
|
45
|
+
sign_in: "Logar"
|
46
|
+
sign_up: "Cadastro"
|
47
|
+
profile: "Perfil"
|
48
|
+
profile_settings: "Configurações de Perfil"
|
49
|
+
account_settings: "Account Settings"
|
50
|
+
account_number: "Account Number"
|
51
|
+
account_roles: "User roles on account"
|
52
|
+
change_password: "Mudar senha"
|
53
|
+
change: "Alterar"
|
54
|
+
manage: "Manejar"
|
55
|
+
social_account: "Redes sociais"
|
56
|
+
payment_history: "Histórico de pagamentos"
|
57
|
+
primary: "Primario"
|
58
|
+
set_primary: "Setar primario"
|
59
|
+
verified: "Verificado"
|
60
|
+
not_verified: "Não Verificado"
|
61
|
+
instructions: "Instruções"
|
62
|
+
notices:
|
63
|
+
user_invited: "Usuário convidado"
|
64
|
+
sign_up: "Obrigado por se cadastrar."
|
65
|
+
user_update: "Seus dados foram atualizados."
|
66
|
+
roles_changed: "Papeis alterados com sucesso"
|
67
|
+
domain_created: "Dominio de conta criado com sucesso"
|
68
|
+
domain_not_found: "Dominio não encontrado"
|
69
|
+
domain_destroyed: "Dominio apagado"
|
70
|
+
domain_verified: "Dominio verificado"
|
71
|
+
domain_not_verified: "Não foi possivel verificar o dominio"
|
72
|
+
domain_set_primary: "O dominio foi configurado como primario"
|
73
|
+
|
data/config/routes.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
|
3
|
+
constraints(IuguSDK::ValidTenancyUrls) do
|
4
|
+
end
|
5
|
+
|
6
|
+
constraints(IuguSDK::RootTenancyUrl) do
|
7
|
+
|
8
|
+
get "settings" => "iugu/settings#index", :as => "settings"
|
9
|
+
get "settings/account" => "iugu/account#index", :as => "account_settings"
|
10
|
+
get "settings/account/(:id)" => "iugu/account#view", :as => "account_view"
|
11
|
+
delete "settings/account/(:id)" => "iugu/account#destroy", :as => "account_destroy"
|
12
|
+
delete "settings/account/(:id)/cancel" => "iugu/account#cancel_destruction", :as => "account_cancel_destruction"
|
13
|
+
put "settings/account/(:id)" => "iugu/account#update", :as => "account_update"
|
14
|
+
post "settings/account" => "iugu/account#create", :as => "account_create"
|
15
|
+
|
16
|
+
get "settings/account/:account_id/users" => "iugu/account_users#index", :as => "account_users_index"
|
17
|
+
get "settings/account/:account_id/user/:user_id" => "iugu/account_users#view", :as => "account_users_view"
|
18
|
+
delete "settings/account/:account_id/user/:user_id" => "iugu/account_users#destroy", :as => "account_users_destroy"
|
19
|
+
delete "settings/account/:account_id/user/:user_id/cancel" => "iugu/account_users#cancel_destruction", :as => "account_users_cancel_destruction"
|
20
|
+
|
21
|
+
get "settings/account/:account_id/domains" => "iugu/account_domains#index", :as => "account_domains_index"
|
22
|
+
post '/settings/account/:account_id/domain' => 'iugu/account_domains#create', :as => 'create_domain'
|
23
|
+
delete "settings/account/:account_id/domain/:domain_id" => "iugu/account_domains#destroy", :as => "account_domains_destroy"
|
24
|
+
get "settings/account/:account_id/domain/:domain_id" => "iugu/account_domains#instructions", :as => "account_domains_instructions"
|
25
|
+
post '/settings/account/:account_id/domain/:domain_id' => 'iugu/account_domains#verify', :as => 'verify_domain'
|
26
|
+
post '/settings/account/:account_id/domain/:domain_id/primary' => 'iugu/account_domains#primary', :as => 'primary_domain'
|
27
|
+
|
28
|
+
get "select_account/:id" => "iugu/account#select", :as => "account_select"
|
29
|
+
get "settings/profile" => "iugu/profile#index", :as => "profile_settings"
|
30
|
+
get "settings/profile/destroy" => "iugu/profile#destroy", :as => "profile_destroy"
|
31
|
+
get "settings/profile/cancel_destruction" => "iugu/profile#cancel_destruction", :as => "profile_cancel_destruction"
|
32
|
+
post "settings/profile" => "iugu/profile#update", :as => "profile_update"
|
33
|
+
get "settings/profile/social/destroy" => "iugu/profile#destroy_social", :as => "social_destroy"
|
34
|
+
|
35
|
+
get '/settings/account/:account_id/invite' => 'iugu/invitations#new', :as => 'new_invite'
|
36
|
+
post '/settings/account/:account_id/invite' => 'iugu/invitations#create', :as => 'create_invite'
|
37
|
+
get '/accept_invite/:invitation_token' => 'iugu/invitations#edit', :as => 'edit_invite'
|
38
|
+
post '/accept_invite' => 'iugu/invitations#update', :as => 'update_invite'
|
39
|
+
get "/settings/account/(:id)/user/:user_id/roles" => "iugu/account_roles#edit", :as => "account_roles_edit"
|
40
|
+
post "/settings/account/(:id)/user/:user_id/roles" => "iugu/account_roles#update", :as => "account_roles_update"
|
41
|
+
|
42
|
+
devise_for :users,
|
43
|
+
:path => 'account',
|
44
|
+
:module => 'iugu',
|
45
|
+
:only => :omniauth_callbacks
|
46
|
+
# :skip => :all
|
47
|
+
|
48
|
+
as :user do
|
49
|
+
# Session Stuff
|
50
|
+
get 'login' => 'iugu/sessions#new', :as => 'new_user_session'
|
51
|
+
post 'login' => 'iugu/sessions#create', :as => 'user_session'
|
52
|
+
delete 'logout' => 'iugu/sessions#destroy', :as => 'destroy_user_session'
|
53
|
+
|
54
|
+
# Registration Stuff
|
55
|
+
get 'signup' => 'iugu/registrations#new', :as => 'new_user_registration'
|
56
|
+
post 'signup' => 'iugu/registrations#create', :as => 'user_registration'
|
57
|
+
get 'cancel_signup' => 'iugu/registrations#cancel', :as => 'cancel_user_registration'
|
58
|
+
|
59
|
+
# Confirmation Stuff
|
60
|
+
post 'confirmation' => 'iugu/confirmations#create', :as => 'user_confirmation'
|
61
|
+
get 'confirmation/new' => 'iugu/confirmations#new', :as => 'new_user_confirmation'
|
62
|
+
get 'confirmation' => 'iugu/confirmations#show', :as => 'show_user_confirmation'
|
63
|
+
|
64
|
+
# Forgot Stuff
|
65
|
+
post 'forgot_password' => 'iugu/passwords#create', :as => 'user_password'
|
66
|
+
get 'forgot_password' => 'iugu/passwords#new', :as => 'new_user_password'
|
67
|
+
get 'forgot_password/edit' => 'iugu/passwords#edit', :as => 'edit_user_password'
|
68
|
+
put 'forgot_password' => 'iugu/passwords#update', :as => 'update_user_pasword'
|
69
|
+
|
70
|
+
# Omniauth Stuff
|
71
|
+
get '/account/auth/:provider' => 'iugu/omniauth_callbacks#passthru'
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
class AddDeviseToUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Database authenticatable
|
5
|
+
t.string :email, :null => false, :default => ""
|
6
|
+
t.string :encrypted_password, :null => false, :default => ""
|
7
|
+
|
8
|
+
## Recoverable
|
9
|
+
t.string :reset_password_token
|
10
|
+
t.datetime :reset_password_sent_at
|
11
|
+
|
12
|
+
## Rememberable
|
13
|
+
t.datetime :remember_created_at
|
14
|
+
|
15
|
+
## Trackable
|
16
|
+
# t.integer :sign_in_count, :default => 0
|
17
|
+
# t.datetime :current_sign_in_at
|
18
|
+
# t.datetime :last_sign_in_at
|
19
|
+
# t.string :current_sign_in_ip
|
20
|
+
# t.string :last_sign_in_ip
|
21
|
+
|
22
|
+
## Confirmable
|
23
|
+
t.string :confirmation_token
|
24
|
+
t.datetime :confirmed_at
|
25
|
+
t.datetime :confirmation_sent_at
|
26
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
27
|
+
|
28
|
+
## Lockable
|
29
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
30
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
+
# t.datetime :locked_at
|
32
|
+
|
33
|
+
## Token authenticatable
|
34
|
+
# t.string :authentication_token
|
35
|
+
|
36
|
+
|
37
|
+
# Uncomment below if timestamps were not included in your original model.
|
38
|
+
t.timestamps
|
39
|
+
end
|
40
|
+
|
41
|
+
add_index :users, :email, :unique => true
|
42
|
+
add_index :users, :reset_password_token, :unique => true
|
43
|
+
add_index :users, :confirmation_token, :unique => true
|
44
|
+
# add_index :users, :unlock_token, :unique => true
|
45
|
+
# add_index :users, :authentication_token, :unique => true
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.down
|
49
|
+
# By default, we don't want to make any assumption about how to roll back a migration when your
|
50
|
+
# model already existed. Please edit below which fields you would like to remove in this migration.
|
51
|
+
raise ActiveRecord::IrreversibleMigration
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddNameAndSubscriptionIdAndUserIdToAccount < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :accounts, :name, :string
|
4
|
+
add_column :accounts, :subscription_id, :integer
|
5
|
+
add_column :accounts, :user_id, :integer
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
remove_column :accounts, :name
|
10
|
+
remove_column :accounts, :subscription_id
|
11
|
+
remove_column :accounts, :user_id
|
12
|
+
end
|
13
|
+
end
|