Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 743deae
Showing
11 changed files
with
597 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module DeviseHelper | ||
|
||
def devise_error_messages! | ||
return "" if resource.errors.empty? | ||
|
||
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join | ||
sentence = I18n.t('errors.template.body') | ||
html = <<-HTML | ||
<div id="error_explanation"> | ||
<h2>#{sentence}</h2> | ||
<ul>#{messages}</ul> | ||
</div> | ||
HTML | ||
|
||
html.html_safe | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class User < ActiveRecord::Base | ||
|
||
# Include default devise modules. Others available are: | ||
# :token_authenticatable, :confirmable, :lockable and :timeoutable | ||
devise :database_authenticatable, :registerable, | ||
:recoverable, :rememberable, :trackable, :validatable, :confirmable | ||
|
||
# Setup accessible (or protected) attributes for your model | ||
attr_accessible :email, :password, :password_confirmation, :name | ||
|
||
def first_name | ||
name.split(' ')[0] unless name.blank? | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
pt-BR: | ||
# formatos de data e hora | ||
date: | ||
formats: | ||
default: "%d/%m/%Y" | ||
short: "%d de %B" | ||
long: "%d de %B de %Y" | ||
|
||
day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta, Sábado] | ||
abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb] | ||
month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro] | ||
abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez] | ||
order: [:day, :month, :year] | ||
|
||
time: | ||
formats: | ||
default: "%A, %d de %B de %Y, %H:%M h" | ||
short: "%d/%m, %H:%M h" | ||
long: "%A, %d de %B de %Y, %H:%M h" | ||
am: '' | ||
pm: '' | ||
|
||
# distancia do tempo em palavras | ||
datetime: | ||
distance_in_words: | ||
half_a_minute: 'meio minuto' | ||
less_than_x_seconds: | ||
one: 'menos de 1 segundo' | ||
other: 'menos de %{count} segundos' | ||
|
||
x_seconds: | ||
one: '1 segundo' | ||
other: '%{count} segundos' | ||
|
||
less_than_x_minutes: | ||
one: 'menos de um minuto' | ||
other: 'menos de %{count} minutos' | ||
|
||
x_minutes: | ||
one: '1 minuto' | ||
other: '%{count} minutos' | ||
|
||
about_x_hours: | ||
one: 'aproximadamente 1 hora' | ||
other: 'aproximadamente %{count} horas' | ||
|
||
x_days: | ||
one: '1 dia' | ||
other: '%{count} dias' | ||
|
||
about_x_months: | ||
one: 'aproximadamente 1 mês' | ||
other: 'aproximadamente %{count} meses' | ||
|
||
x_months: | ||
one: '1 mês' | ||
other: '%{count} meses' | ||
|
||
about_x_years: | ||
one: 'aproximadamente 1 ano' | ||
other: 'aproximadamente %{count} anos' | ||
|
||
over_x_years: | ||
one: 'mais de 1 ano' | ||
other: 'mais de %{count} anos' | ||
|
||
almost_x_years: | ||
one: 'quase 1 ano' | ||
other: 'quase %{count} anos' | ||
|
||
prompts: | ||
year: "Ano" | ||
month: "Mês" | ||
day: "Dia" | ||
hour: "Hora" | ||
minute: "Minuto" | ||
second: "Segundos" | ||
|
||
# numeros | ||
number: | ||
format: | ||
precision: 3 | ||
separator: ',' | ||
delimiter: '.' | ||
currency: | ||
format: | ||
unit: 'R$' | ||
precision: 2 | ||
format: '%u %n' | ||
separator: ',' | ||
delimiter: '.' | ||
percentage: | ||
format: | ||
delimiter: '.' | ||
precision: | ||
format: | ||
delimiter: '.' | ||
human: | ||
format: | ||
precision: 2 | ||
delimiter: '.' | ||
significant: true | ||
strip_unsignificant_zeros: true | ||
# number_to_human_size() | ||
storage_units: | ||
format: "%n %u" | ||
units: | ||
byte: | ||
one: "Byte" | ||
other: "Bytes" | ||
kb: "KB" | ||
mb: "MB" | ||
gb: "GB" | ||
tb: "TB" | ||
# number_to_human() | ||
# new in rails 3: please add to other locales | ||
decimal_units: | ||
format: "%n %u" | ||
units: | ||
unit: "" | ||
thousand: "mil" | ||
million: | ||
one: milhão | ||
other: milhões | ||
billion: | ||
one: bilhão | ||
other: bilhões | ||
trillion: | ||
one: trilhão | ||
other: trilhões | ||
quadrillion: | ||
one: quatrilhão | ||
other: quatrilhões | ||
|
||
# Usado no Array.to_sentence | ||
support: | ||
array: | ||
words_connector: ", " | ||
two_words_connector: " e " | ||
last_word_connector: " e " | ||
|
||
errors: | ||
template: | ||
header: | ||
one: "Não foi possível gravar %{model}: 1 erro" | ||
other: "Não foi possível gravar %{model}: %{count} erros." | ||
body: "Por favor, verifique o(s) seguinte(s) campo(s):" | ||
messages: | ||
inclusion: "não está incluído na lista" | ||
exclusion: "não está disponível" | ||
invalid: "não é válido" | ||
confirmation: "não está de acordo com a confirmação" | ||
accepted: "deve ser aceito" | ||
empty: "não pode ficar vazio" | ||
blank: "não pode ficar em branco" | ||
too_long: "é muito longo(a) (máximo: %{count} caracteres)" | ||
too_short: "é muito curto(a) (mínimo: %{count} caracteres)" | ||
wrong_length: "não possui o tamanho esperado (%{count} caracteres)" | ||
taken: "já está em uso" | ||
not_a_number: "não é um número" | ||
not_an_integer: "não é um número inteiro" | ||
greater_than: "deve ser maior do que %{count}" | ||
greater_than_or_equal_to: "deve ser maior ou igual a %{count}" | ||
equal_to: "deve ser igual a %{count}" | ||
less_than: "deve ser menor do que %{count}" | ||
less_than_or_equal_to: "deve ser menor ou igual a %{count}" | ||
odd: "deve ser ímpar" | ||
even: "deve ser par" | ||
record_invalid: "A validação falhou: %{errors}" | ||
not_found: "não encontrado" | ||
already_confirmed: "já foi confirmado" | ||
not_locked: "não estava bloqueado" | ||
|
||
attributes: | ||
email: Email | ||
password: Senha | ||
password_confirmation: Confirmação de senha | ||
|
||
activerecord: | ||
models: | ||
user: Usuário | ||
attributes: | ||
user: | ||
password: Senha | ||
|
||
helpers: | ||
label: | ||
user: | ||
password_confirmation: Repita a senha | ||
submit: | ||
create: "Criar um {{model}}" | ||
|
||
devise: | ||
failure: | ||
unauthenticated: 'Você precisa fazer login ou criar uma conta antes de continuar.' | ||
unconfirmed: 'Você precisa confirmar sua conta antes de continuar.' | ||
locked: 'Sua conta foi bloqueada.' | ||
invalid: 'Email e/ou senha inválidos.' | ||
invalid_token: 'Token de autenticação inválido.' | ||
timeout: 'Sua sessão expirou, por favor faça login novamente para continuar.' | ||
inactive: 'Sua conta ainda não foi ativada.' | ||
sessions: | ||
signed_in: 'Login realizado com sucesso.' | ||
signed_out: 'A sessão foi encerrada com sucesso.' | ||
passwords: | ||
send_instructions: 'Você receberá um email com instruções de como gerar nova senha.' | ||
updated: 'Sua senha foi alterada com sucesso. Você agora está logado.' | ||
confirmations: | ||
send_instructions: 'Você receberá um email com instruções de como confirmar sua conta.' | ||
confirmed: 'Sua conta foi confirmada com sucesso. Você agora está logado.' | ||
registrations: | ||
signed_up: 'Sua conta foi criada com sucesso. Foi enviado para seu email instruções de como confirmar sua conta.' | ||
updated: 'Sua conta foi alterada com sucesso.' | ||
destroyed: 'Sua conta foi cancelada com sucesso.' | ||
unlocks: | ||
send_instructions: 'Você receberá um email com instruções de como desbloquear sua conta.' | ||
unlocked: 'Sua conta foi desbloqueada com sucesso. Você agora está logado.' | ||
mailer: | ||
confirmation_instructions: | ||
subject: 'Instruções para confirmar conta' | ||
reset_password_instructions: | ||
subject: 'Instruções para gerar nova senha' | ||
unlock_instructions: | ||
subject: 'Instruções para desbloqueio de conta' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class DeviseCreateUsers < ActiveRecord::Migration | ||
def self.up | ||
create_table(:users) do |t| | ||
t.database_authenticatable :null => false | ||
t.recoverable | ||
t.rememberable | ||
t.trackable | ||
t.confirmable | ||
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both | ||
# t.token_authenticatable | ||
t.string :name | ||
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 | ||
end | ||
|
||
def self.down | ||
drop_table :users | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
vendor/rails/* | ||
log/*.log | ||
tmp/**/* | ||
public/system/* | ||
.DS_Store | ||
db/schema.rb | ||
db/*.sqlite3 | ||
public/cache | ||
public/system | ||
doc/* | ||
.bundle | ||
cache | ||
|
||
|
Oops, something went wrong.