Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v5'
Browse files Browse the repository at this point in the history
  • Loading branch information
PanfilovDenis committed Feb 21, 2013
2 parents 589411d + 8645955 commit 756516c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class User < ActiveRecord::Base
attr_accessible :email, :password,
:first_name, :last_name, :city,
:company, :position,
:show_as_participant, :photo, :state_event, :about
:show_as_participant,
:photo, :state_event, :about

audit :email, :password, :first_name, :last_name, :city, :company, :show_as_participant, :photo, :state, :about

Expand Down
3 changes: 2 additions & 1 deletion app/types/user_registration_type.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
class UserRegistrationType < User
include BasicType

attr_accessible :password_confirmation, :state_event
attr_accessible :password_confirmation, :state_event, :process_personal_data

#has_secure_password

validates :first_name, presence: true
validates :last_name, presence: true
validates :city, presence: true
validates :password, presence: true, confirmation: true
validates :process_personal_data, acceptance: { accept: true }


def city=(city)
Expand Down
1 change: 1 addition & 0 deletions app/views/web/admin/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
= f.input :password_confirmation
= f.input :photo, as: :image_preview
= f.input :show_as_participant
= f.input :admin
= f.input :role
= f.association :topics, as: :chosen_select, input_html: { multiple: true }

Expand Down
2 changes: 2 additions & 0 deletions app/views/web/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
.row-fluid
.span4
= f.input :show_as_participant, :input_html => { :checked => true }, :wrapper => :inline_checkbox
.span6
= f.input :process_personal_data, as: :boolean, :input_html => { :checked => true }, :wrapper => :inline_checkbox
.center.form-actions
= f.button :submit, class: 'btn'

Expand Down
2 changes: 1 addition & 1 deletion app/views/web/users/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%table.table.table-striped
%thead
%tr
%th= sort_link(@search, :first_name, User.human_attribute_name(:first_name))
%th= sort_link(@search, :last_name, User.human_attribute_name(:first_name))
%th= sort_link(@search, :city, User.human_attribute_name(:city))
%th= sort_link(@search, :company, User.human_attribute_name(:company))
%th= sort_link(@search, :position, User.human_attribute_name(:position))
Expand Down
5 changes: 5 additions & 0 deletions config/locales/activerecord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ru:
company: "Компания"
position: "Должность"
show_as_participant: "Показывать на странице участников"
process_personal_data: "Согласен на обработку моих персональных данных"
photo: "Фото"
state_event: "Изменить состояние"
state: "Состояние"
Expand Down Expand Up @@ -68,3 +69,7 @@ ru:
email:
email: 'Введен некорректный email'
taken: 'Данный Email уже зарегистрирован'
process_personal_data:
blank: "Необходимо дать согласие на обработку персональных данных"
#blank: 'Согласиться вы должны (с) Йода'

18 changes: 7 additions & 11 deletions log/untranslated.ru.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
ru:
web:
admin:
audits:
index:
title: ''
layouts:
web:
admin:
shared:
navigation:
audits: ''
activerecord:
errors:
models:
user:
attributes:
state:
invalid_transition: ''
4 changes: 4 additions & 0 deletions test/factories/sequences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
n % 2
end

sequence :process_personal_data do |n|
true
end

end
1 change: 1 addition & 0 deletions test/factories/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
show_as_participant
email
photo
# process_personal_data

after(:create) do |u|
u.activate
Expand Down

0 comments on commit 756516c

Please sign in to comment.