Skip to content

Commit

Permalink
Merge pull request #1 from pfadipatria/StandardFeldZuweisung
Browse files Browse the repository at this point in the history
Standard feld zuweisung
  • Loading branch information
hairmare committed Apr 17, 2015
2 parents 795f36a + cc243b0 commit a37fb16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions app/models/pbs/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ module Pbs::Person
timeliness: { type: :date, allow_blank: true }

alias_method_chain :full_name, :title

after_initialize :defaults, unless: :persisted?
# ":if => :new_record?" is equivalent in this context

end

def defaults
self.country = "Schweiz"
self.salutation = "lieber_pfadiname"
self.correspondence_language = "de"
end

def salutation_label
Expand Down
4 changes: 2 additions & 2 deletions app/views/people/_fields_pbs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
= field_set_tag do
= f.labeled_input_field :title
= f.labeled_collection_select :salutation, Salutation.available, :first, :last, { include_blank: true }, class: 'span6'
= f.labeled_collection_select :salutation, Salutation.available, :first, :last, { include_blank: false }, class: 'span6'
= f.labeled_collection_select(:correspondence_language,
Settings.application.languages.to_hash,
:first,
:last,
{ prompt: true },
{ prompt: false },
class: 'span6')
= f.labeled_input_field :j_s_number
= f.labeled_input_field :grade_of_school, help_inline: t('.non_automatic_field')
Expand Down
8 changes: 4 additions & 4 deletions config/locales/models.pbs.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ de:
other: APVs
group/corps:
one: Corps
other: Corps
other: Corps
group/abteilung:
one: Abteilung
other: Abteilungen
Expand Down Expand Up @@ -74,7 +74,7 @@ de:
group/woelfe:
one: Wölfe
other: Wölfe

group/apv/präsident_apv:
one: Präsident APV
description:
Expand All @@ -87,7 +87,7 @@ de:
group/apv/mitglied:
one: Mitglied
description:

group/corps/corpsleitung:
one: Corpsleiter
description:
Expand All @@ -97,7 +97,7 @@ de:
group/corps/mitglied_corpsrat:
one: Corpsrat
description:

group/bund/mitarbeiter_gs:
one: Mitarbeiter GS
description:
Expand Down

0 comments on commit a37fb16

Please sign in to comment.