property_hire/app/views/email/edit_email.html.erb

47 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2020-05-20 09:34:30 +00:00
<% property = Property.where(id: @data['property_id']).first %>
<% email_set = property.hire_email_sets.select{|v| v.field_name == 'edit'} %>
2020-03-23 17:26:52 +00:00
<% if email_set.length != 0 %>
<% if !(email_set[0].content.nil?) %>
<%= email_set[0].content[@data['locale']].html_safe %>
<% end %>
<% else %>
<%= t('property_hire.email_edit_success') %>
2020-05-20 09:34:30 +00:00
<% end %>
2022-12-07 03:39:42 +00:00
<h3><%= property.title_translations.collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %></h3>
2020-05-20 09:34:30 +00:00
<% I18n.with_locale(@data['locale']) do %>
<table>
<thead>
<tr>
<td></td>
<td></td>
</tr>
</thead>
<tbody>
2020-05-20 12:20:19 +00:00
<% ['editor','property_usage','note','category','property_location','property_number','can_be_hired','purchase_date','owners','other_owner','owner_email','owner_phone','price'].each do |k| %>
<% v = property.send(k) rescue nil %>
2020-05-20 09:34:30 +00:00
<tr>
<td>
<%= k=='category' ? t('category') : t("property_hire.#{k}") %>:&nbsp;
</td>
<td>
2020-05-20 12:20:19 +00:00
<% if k == 'editor' %>
<%= User.find(user_id).name rescue nil %>
<% elsif ['purchase_date'].include?(k) %>
2020-05-20 09:34:30 +00:00
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
<% elsif ['property_usage','note'].include?(k) %>
2022-12-07 03:39:42 +00:00
<%= property.send("#{k}_translations").collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %>
2020-05-20 09:34:30 +00:00
<% elsif k=='owners' %>
2021-01-25 07:01:07 +00:00
<%= property.owner_profiles.collect{|v| v.name}.join(', ') rescue nil %>
2020-05-20 09:53:06 +00:00
<% elsif ['category','property_location'].include?(k) %>
2021-01-25 07:01:07 +00:00
<%= v.title rescue nil %>
2020-05-20 09:34:30 +00:00
<% elsif k == 'can_be_hired' %>
<%= v ? t('yes_') : t('no_') %>
<% else %>
<%= v %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
2020-03-23 17:26:52 +00:00
<% end %>