Show confirmed status in enterprise managers UI

This commit is contained in:
Matt-Yorkley
2017-07-27 13:50:59 +01:00
committed by Rob Harrington
parent 9ccb3ee80b
commit 5dc8f21b7b
4 changed files with 30 additions and 4 deletions

View File

@@ -1,3 +1,21 @@
form[name="enterprise_form"] div.row.warning {
color: #DA7F52;
form[name="enterprise_form"] {
div.row.warning {
color: #DA7F52;
}
table.managers {
i.confirmation {
float: right;
font-size: 1.5em;
cursor: pointer;
&.confirmed {
color: #1ece1e;
}
&.unconfirmed {
color: #ed9524;
}
}
}
}

View File

@@ -1,7 +1,7 @@
require 'open_food_network/last_used_address'
class Api::Admin::UserSerializer < ActiveModel::Serializer
attributes :id, :email
attributes :id, :email, :confirmed
has_one :ship_address, serializer: Api::AddressSerializer
has_one :bill_address, serializer: Api::AddressSerializer
@@ -15,4 +15,8 @@ class Api::Admin::UserSerializer < ActiveModel::Serializer
object.bill_address ||
OpenFoodNetwork::LastUsedAddress.new(object.email).last_used_bill_address
end
def confirmed
object.confirmed?
end
end

View File

@@ -44,7 +44,7 @@
%a= t('admin.whats_this')
.eight.columns.omega
- if full_permissions
%table
%table.managers
%tr
%td
- # Ignore this input in the submit
@@ -55,6 +55,8 @@
%td
= hidden_field_tag "enterprise[user_ids][]", nil, multiple: true, 'ng-value' => 'manager.id'
{{ manager.email }}
%i.confirmation.confirmed.fa.fa-check-circle{ 'ofn-with-tip' => t('.email_confirmed'), ng: {show: 'manager.confirmed'} }
%i.confirmation.unconfirmed.fa.fa-exclamation-triangle{ 'ofn-with-tip' => t('.email_not_confirmed'), ng: {show: '!manager.confirmed'} }
%td.actions
%a{ ng: {click: 'removeManager(manager)', class: "{disabled: manager.id == Enterprise.owner.id}"}, :class => "icon-trash no-text" }
- else

View File

@@ -570,6 +570,8 @@ en:
notifications_note: 'Note: A new email address may need to be confirmed prior to use'
managers: Managers
managers_tip: The other users with permission to manage this enterprise.
email_confirmed: "Email confirmed"
email_not_confirmed: "Email not confirmed"
actions:
edit_profile: Edit Profile
properties: Properties