Skip to content

Commit

Permalink
Merge branch 'dev' into 238_Event_Description_Textfield
Browse files Browse the repository at this point in the history
  • Loading branch information
corinnaj authored Jan 25, 2017
2 parents 3a0ebb0 + ba518d3 commit 7a71e80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Request < ActiveRecord::Base
validates_format_of :email, :with => Devise::email_regexp

enum form_of_address: [:mr, :mrs, :prefer_to_omit]
enum status: [:open, :accepted] # per database declaration, the first value is default
enum status: [:open, :accepted, :declined] # per database declaration, the first value is default

def name
"#{first_name} #{last_name}"
Expand Down
2 changes: 2 additions & 0 deletions app/views/requests/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<th><%= model_class.human_attribute_name(:name) %></th>
<th><%= model_class.human_attribute_name(:time_period) %></th>
<th><%= model_class.human_attribute_name(:number_of_participants) %></th>
<th><%= model_class.human_attribute_name(:status) %></th>
<th><%=t '.actions', :default => t("helpers.actions") %></th>
</tr>
</thead>
Expand All @@ -19,6 +20,7 @@
<td><%= request.name %></td>
<td><%= request.time_period %></td>
<td><%= request.number_of_participants %></td>
<td><%= t("activerecord.attributes.request.statuses.#{request.status}") %></td>
<td>
<% if can? :edit, request %>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
Expand Down
3 changes: 2 additions & 1 deletion config/locales/de.requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ de:
contact_person: "Ansprechpartner"
status: "Status"
statuses:
open: "Noch nicht angenommen"
open: "Offen"
accepted: "Angenommen"
declined: "Abgelehnt"
dialogues:
confirm_delete: "Bist du sicher, dass du diese Anfrage löschen möchtest? Diese Aktion kann nicht widerrufen werden."
1 change: 1 addition & 0 deletions spec/views/requests/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
assert_select 'td', :text => r.name
assert_select 'td', :text => r.time_period
assert_select 'td', :text => r.number_of_participants.to_s
assert_select 'td', :text => I18n.t("activerecord.attributes.request.statuses.#{r.status}")
end
end

Expand Down

0 comments on commit 7a71e80

Please sign in to comment.