//~OPTIONS
{
  extends:          "@controls:form",
  include:          ["fcfSimpleAuthorization:css/styles.css"],
  clientRendering:  false,
}

//~ARGUMENTS
{
  fcfClass: "fcf-simple-authorization-form",
  error:    "",
  fields:  [
    {
      alias: "user",
      type:  "string",
      notEmpty: true,
    },
    {
      alias: "password",
      type:  "string",
      notEmpty: true,
      template: "@controls:password",
    },
  ]
}

//~TEMPLATE
%{{ if (!fcf.empty(args.error)) { }}%
  
<errors class="container">@{{args.error}}@</errors>
%{{ } }}%


<table class="fcf-simple-authorization-form-table">
<tr>
  <td>
    !{{User name}}!&nbsp;<span class="fcf-simple-authorization-required-field">*</span>:
  </td>
  <td>
    @{{render.view({view: args.fieldsMap.user, mode: args.mode, args: { value: fcf.argRef("value.user") } })}}@
    %{{ if (args.errorsMap.user) { }}%
    <div class="@{{decor.formElementError}}@">
        @{{ fcf.first(args.errorsMap.user) }}@
    </div>
    %{{ } }}%
  </td>
</tr>
<tr>
  <td>
    !{{Password}}!&nbsp;<span class="fcf-simple-authorization-required-field">*</span>:
  </td>
  <td>
    @{{render.view({view: args.fieldsMap.password, mode: args.mode, args: { value: fcf.argRef("value.password") } })}}@
    %{{ if (args.errorsMap.password) { }}%
    <div class="@{{decor.formElementError}}@">
        @{{ fcf.first(args.errorsMap.password) }}@
    </div>
    %{{ } }}%
  </td>
</tr>

</table>

<description class="fcf-simple-authorization-links"><center>
  %{{ if (fcf.application.getConfiguration().fcfSimpleAuthorization_enableRegistration) { }}%
    <a fcfEventClick="event.preventDefault(); wrapper.onRegistration()">!{{Registration}}!</a>
  %{{ } }}%
  %{{ if (fcf.application.getConfiguration().fcfSimpleAuthorization_enableLoginByEmail) { }}%
    <a fcfEventClick="event.preventDefault(); wrapper.onLoginByEmail()">!{{Log in by email}}!</a>
  %{{ } }}%
</center></description>


 
