// Copyright 2019 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

{namespace registry.soy.registrar.registrylock.verification}


/**
 * Results page for a registry lock/unlock verification.
 */
{template .verificationPage}
  {@param username: string} /** Arbitrary username to display. */
  {@param analyticsConfig: [googleAnalyticsId: string|null]}
  {@param success: bool}
  {@param? errorMessage: string}
  {@param? isLock: bool}
  {@param? domainName: string}
  {call registry.soy.console.header}
    {param app: 'registrar' /}
    {param subtitle: 'Verify Registry Lock' /}
    {param analyticsConfig: $analyticsConfig /}
  {/call}
  {call registry.soy.console.googlebar data="all" /}
  <div id="reg-content-and-footer">
    <div id="reg-content">
      <h1>Registry Lock Verification</h1>
      {if $success}
        {call .success data="all" /}
      {else}
        {call .failure data="all" /}
      {/if}
      <h3><a href="/registrar">Return to Registrar Console</a></h3>
    </div>
    {call registry.soy.console.footer /}
  </div>
{/template}

/**
 * Result page for failure, e.g. the UUID was invalid
 */
{template .failure}
  {@param? errorMessage: string}
  <h2 class="{css('kd-errormessage')}">Failed: {if isNonnull($errorMessage)}
      {$errorMessage}
    {else}
      Undefined error message
    {/if}
  </h2>
{/template}

/**
 * Result page for a successful lock / unlock.
 */
{template .success}
  {@param? isLock: bool}
  {@param? domainName: string}
  <h3>
    Success: {if $isLock}lock{else}unlock{/if} has been applied to {$domainName}
  </h3>
{/template}

