Add nonverified color email to registrar index

This commit is contained in:
Alex Sherman 2020-06-09 15:51:51 +05:00
parent af7e0f266d
commit e95996fa12
7 changed files with 29 additions and 5 deletions

View file

@ -30,6 +30,9 @@ class EmailAddressVerification < ApplicationRecord
if validation_request.result.success
update(verified_at: Time.zone.now,
success: true)
else
update(verified_at: nil,
success: false)
end
validation_request.result.success

View file

@ -13,6 +13,14 @@ class Registrar < ApplicationRecord
has_many :nameservers, through: :domains
has_many :whois_records
has_many :white_ips, dependent: :destroy
belongs_to :email_address_verification, class_name: 'EmailAddressVerification',
primary_key: 'email',
foreign_key: 'email',
optional: true
belongs_to :billing_email_address_verification, class_name: 'EmailAddressVerification',
primary_key: 'email',
foreign_key: 'billing_email',
optional: true
delegate :balance, to: :cash_account, allow_nil: true

View file

@ -28,6 +28,9 @@
<th class="col-xs-4">
<%= t(:test_registrar) %>
</th>
<th class="col-xs-4">
<%= t(:emails) %>
</th>
</tr>
</thead>
<tbody>
@ -45,6 +48,16 @@
<td>
<%= "#{x.test_registrar}" %>
</td>
<td>
<span class=<%= 'text-danger' unless x.email_address_verification.success %>>
<%= "#{x.email}" %>
</span>
<% if x[:billing_email].present? %>
<span class=<%= 'text-danger' unless x.billing_email_address_verification.success %>>
<%= "#{x[:billing_email]}" %>
</span>
<% end %>
</td>
</tr>
<% end %>
</tbody>