diff --git a/alembic/versions/c98adf9bb431_record_invitation_status.py b/alembic/versions/c98adf9bb431_record_invitation_status.py index 5852f5e5..f017beef 100644 --- a/alembic/versions/c98adf9bb431_record_invitation_status.py +++ b/alembic/versions/c98adf9bb431_record_invitation_status.py @@ -1,7 +1,7 @@ """record invitation status Revision ID: c98adf9bb431 -Revises: da9d1c911a52 +Revises: 1f690989e38e Create Date: 2019-02-06 09:02:28.617202 """ @@ -11,7 +11,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c98adf9bb431' -down_revision = 'da9d1c911a52' +down_revision = '1f690989e38e' branch_labels = None depends_on = None diff --git a/atst/models/task_order.py b/atst/models/task_order.py index a9e187a9..4f43b206 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -159,6 +159,44 @@ class TaskOrder(Base, mixins.TimestampsMixin): def is_pending(self): return self.status == Status.PENDING + @property + def ko_invitable(self): + """ + The MO has indicated that the KO should be invited but we have not sent + an invite and attached the KO user + """ + return self.ko_invite and not self.contracting_officer + + @property + def cor_invitable(self): + """ + The MO has indicated that the COR should be invited but we have not sent + an invite and attached the COR user + """ + return self.cor_invite and not self.contracting_officer_representative + + @property + def so_invitable(self): + """ + The MO has indicated that the SO should be invited but we have not sent + an invite and attached the SO user + """ + return self.so_invite and not self.security_officer + + _OFFICER_PREFIXES = { + "contracting_officer": "ko", + "contracting_officer_representative": "cor", + "security_officer": "so", + } + _OFFICER_PROPERTIES = ["first_name", "last_name", "phone_number", "email", "dod_id"] + + def officer_dictionary(self, officer_type): + prefix = self._OFFICER_PREFIXES[officer_type] + return { + field: getattr(self, "{}_{}".format(prefix, field)) + for field in self._OFFICER_PROPERTIES + } + def to_dictionary(self): return { "portfolio_name": self.portfolio_name, diff --git a/styles/elements/_icons.scss b/styles/elements/_icons.scss index 5703356d..df42642c 100644 --- a/styles/elements/_icons.scss +++ b/styles/elements/_icons.scss @@ -70,4 +70,8 @@ &.icon--medium { @include icon-size(12); } + + &.icon--gold { + @include icon-color($color-gold-dark); + } } diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index f916a0b7..c9bb769b 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -230,14 +230,18 @@ } .task-order-invite-message { + font-weight: $font-bold; + &.not-sent { color: $color-red; - font-weight: $font-bold; } &.sent { color: $color-green; - font-weight: $font-bold; + } + + &.pending { + color: $color-gold-dark; } } diff --git a/templates/fragments/task_order_review/oversight.html b/templates/fragments/task_order_review/oversight.html index cc519892..cdeb883e 100644 --- a/templates/fragments/task_order_review/oversight.html +++ b/templates/fragments/task_order_review/oversight.html @@ -1,15 +1,17 @@ -{% macro ReviewOfficerInfo(heading, first_name, last_name, email, phone_number, dod_id, officer) %} +{% macro ReviewOfficerInfo(heading, officer_data, has_officer, invite_pending) %}