Merge pull request #5639 from aka001/5373_technical_limitation

Technical limitations of how old one can be on D* #5373
This commit is contained in:
Jonne Haß 2015-02-09 02:26:41 +01:00
commit ab2e4781f8
3 changed files with 17 additions and 1 deletions

View file

@ -160,6 +160,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
* Add HTML view for pod statistics [#5464](https://github.com/diaspora/diaspora/pull/5464)
* Added/Moved hide, block user, report and delete button in SPV [#5547](https://github.com/diaspora/diaspora/pull/5547)
* Added keyboard shortcuts r(reshare), m(expand Post), o(open first link in post) [#5602](https://github.com/diaspora/diaspora/pull/5602)
* Dynamically compute minimum and maximum valid year for birthday field [#5639](https://github.com/diaspora/diaspora/pull/5639)
# 0.4.1.2

View file

@ -0,0 +1,15 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module ProfileHelper
def upper_limit_date_of_birth
minimum_year = AppConfig.settings.terms.minimum_age.get
minimum_year = minimum_year ? minimum_year.to_i : 13
minimum_year.years.ago.year
end
def lower_limit_date_of_birth
125.years.ago.year
end
end

View file

@ -35,7 +35,7 @@
= t('profiles.edit.your_birthday')
.row-fluid
= select_date profile.birthday, { :prompt => true, :default => true, :order => t('date.order'), :start_year => 2000, :end_year => 1910, :prefix => 'profile[date]' }, { :class => 'span4' }
= select_date profile.birthday, { :prompt => true, :default => true, :order => t('date.order'), :start_year => upper_limit_date_of_birth, :end_year => lower_limit_date_of_birth, :prefix => 'profile[date]' }, { :class => 'span4' }
.small-horizontal-spacer