- @if (Model.Result == ConfirmOwnershipResult.Success - || Model.Result == ConfirmOwnershipResult.AlreadyOwner) + @switch (Model.Result) { - @:Email Confirmed - } - else - { - @:Email Confirmation Failed + case ConfirmOwnershipResult.Success: + case ConfirmOwnershipResult.AlreadyOwner: + @:Ownership Confirmed + break; + + case ConfirmOwnershipResult.Rejected: + @:Ownership Rejected + break; + + case ConfirmOwnershipResult.Cancelled: + @:Ownership Request Cancelled + break; + + default: + @:Ownership Confirmation Failed + break; }

- @if (Model.Result == ConfirmOwnershipResult.Success) - { -

- You are now an owner of the - '@Model.PackageId' package! -

- } - else if (Model.Result == ConfirmOwnershipResult.AlreadyOwner) + @switch (Model.Result) { - @ViewHelpers.AlertInfo( - @ - You are already an owner of the - '@Model.PackageId' package. - - ) + case ConfirmOwnershipResult.Success: +

+ You are now an owner of the + '@Model.PackageId' package! +

+ break; -

- If you manage multiple accounts, make sure you sign in as the user who received the request before clicking the confirmation link. -

- } - else if (Model.Result == ConfirmOwnershipResult.NotYourRequest) - { - @* Note that we're not confirming that a request even exists for this user, it's just a string compare against the name in the URL *@ - @ViewHelpers.AlertDanger( - @ - This request link is for the user '@Model.Username'. If you wish to accept it, - please sign in as that user and click the link again. - - ) - } - else - { - @ViewHelpers.AlertDanger( - @ - Could not confirm package ownership for '@Model.PackageId'. - - ) + case ConfirmOwnershipResult.Rejected: +

+ You have rejected a request to become an owner of the + '@Model.PackageId' package! +

+ break; + + case ConfirmOwnershipResult.Cancelled: +

+ You have cancelled your request for @Model.Username to become an owner of the + '@Model.PackageId' package! +

+ break; + + case ConfirmOwnershipResult.AlreadyOwner: + @ViewHelpers.AlertInfo( + @ + You are already an owner of the + '@Model.PackageId' package. + + ) + +

+ If you manage multiple accounts, make sure you sign in as the user who received the request before clicking the confirmation link. +

+ break; + + case ConfirmOwnershipResult.NotYourRequest: + @* Note that we're not confirming that a request even exists for this user, it's just a string compare against the name in the URL *@ + @ViewHelpers.AlertDanger( + @ + This request link is for the user '@Model.Username'. If you wish to accept it, + please sign in as that user and click the link again. + + ) + break; + + default: + @ViewHelpers.AlertDanger( + @ + Could not confirm package ownership for '@Model.PackageId'. + + ) -

- Make sure you clicked on the confirmation URL in the email we sent. - It's also possible that the existing owner revoked the - request to add you as an owner. -

+

+ Make sure you clicked on the confirmation URL in the email we sent. + It's also possible that the existing owner revoked the + request to add you as an owner. +

+ break; }