<commit_before>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.nanos.auth',
  name: 'ChangePasswordView',
  extends: 'foam.u2.Controller',

  documentation: 'renders a password change model',

  imports: [
    'stack',
    'theme',
    'user'
  ],

  css: `
    ^ {
      background: #ffffff;
      height: 100vh;
    }
    ^top-bar {
      background: /*%LOGOBACKGROUNDCOLOUR%*/ #202341;
      width: 100%;
      height: 8vh;
      border-bottom: solid 1px #e2e2e3;
    }
    ^top-bar img {
      height: 4vh;
      padding-top: 2vh;
      display: block;
      margin: 0 auto;
    }
    ^content {
      max-width: 30vw;
      padding-top: 4vh;
      margin: 0 auto;
    }
    ^section {
    }
    /* title  */
    ^ ^section h2 {
      margin-top: 0;
      margin-bottom: 4vh;
      font-size: 2.5rem;
    }
    /* subtitle */
    ^ ^section .subtitle {
      color: /*%GREY2%*/ #8e9090;
      font-size: 1rem;
      margin-top: 0;
      margin-bottom: 3vh;
      line-height: 1.5;
      text-align: center;
    }
    ^link {
      color: /*%PRIMARY3%*/ #604aff;
      cursor: pointer;
      text-align: center;
      padding-top: 1.5vh;
    }
  `,

  properties: [
    {
      class: 'Boolean',
      name: 'showHeader',
      documentation: `This property toggles the view from having a top bar displayed.`,
      value: true,
      hidden: true
    },
    {
      class: 'String',
      name: 'modelOf',
      documentation: `Password model used for this view.
                      Pass this property along when you create this view.
                      e.g., stack.push({
                        class: 'foam.nanos.auth.ChangePasswordView',
                        modelOf: 'foam.nanos.auth.RetrievePassword'
                      })
                     `,
    },
    {
      class: 'FObjectProperty',
      of: this.modelOf,
      name: 'model',
      documentation: 'instance of password model used for this view',
      expression: function(modelOf) {
        return foam.lookup(modelOf).create({}, this);
      }
    }
  ],

  methods: [
    function initE() {
      const self = this;
      const logo = this.theme.largeLogo || this.theme.logo;

      this.addClass(this.myClass())
        // header
        .callIf(this.showHeader, function() {
          this.start().addClass(self.myClass('top-bar'))
            .start('img').attr('src', logo).end()
          .end();
        })
        // body
        .start().addClass(this.myClass('content'))
          // section
          .start().addClass(this.myClass('section'))
            .start(foam.u2.detail.SectionView, {
              data: this.model,
              sectionName: this.model.cls_.model_.sections[0].name,
              isCentered: true
            }).end()
          .end()
          // link
          .callIf(this.model.hasBackLink, function() {
            this.start().addClass(self.myClass('link'))
              .add(self.model.REDIRECTION_TO)
              .on('click', function() {
                self.stack.push({ class: 'foam.u2.view.LoginView', mode_: 'SignIn' }, self);
              })
            .end();
          })
        .end();
    }
  ]
});
<commit_msg>remove trailing commas<commit_after>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.nanos.auth',
  name: 'ChangePasswordView',
  extends: 'foam.u2.Controller',

  documentation: 'renders a password change model',

  imports: [
    'stack',
    'theme',
    'user'
  ],

  css: `
    ^ {
      background: #ffffff;
      height: 100vh;
    }
    ^top-bar {
      background: /*%LOGOBACKGROUNDCOLOUR%*/ #202341;
      width: 100%;
      height: 8vh;
      border-bottom: solid 1px #e2e2e3;
    }
    ^top-bar img {
      height: 4vh;
      padding-top: 2vh;
      display: block;
      margin: 0 auto;
    }
    ^content {
      max-width: 30vw;
      padding-top: 4vh;
      margin: 0 auto;
    }
    ^section {
    }
    /* title  */
    ^ ^section h2 {
      margin-top: 0;
      margin-bottom: 4vh;
      font-size: 2.5rem;
    }
    /* subtitle */
    ^ ^section .subtitle {
      color: /*%GREY2%*/ #8e9090;
      font-size: 1rem;
      margin-top: 0;
      margin-bottom: 3vh;
      line-height: 1.5;
      text-align: center;
    }
    ^link {
      color: /*%PRIMARY3%*/ #604aff;
      cursor: pointer;
      text-align: center;
      padding-top: 1.5vh;
    }
  `,

  properties: [
    {
      class: 'Boolean',
      name: 'showHeader',
      documentation: `This property toggles the view from having a top bar displayed.`,
      value: true,
      hidden: true
    },
    {
      class: 'String',
      name: 'modelOf',
      documentation: `Password model used for this view.
                      Pass this property along when you create this view.
                      e.g., stack.push({
                        class: 'foam.nanos.auth.ChangePasswordView',
                        modelOf: 'foam.nanos.auth.RetrievePassword'
                      })
                     `
    },
    {
      class: 'FObjectProperty',
      of: this.modelOf,
      name: 'model',
      documentation: 'instance of password model used for this view',
      expression: function(modelOf) {
        return foam.lookup(modelOf).create({}, this);
      }
    }
  ],

  methods: [
    function initE() {
      const self = this;
      const logo = this.theme.largeLogo || this.theme.logo;

      this.addClass(this.myClass())
        // header
        .callIf(this.showHeader, function() {
          this.start().addClass(self.myClass('top-bar'))
            .start('img').attr('src', logo).end()
          .end();
        })
        // body
        .start().addClass(this.myClass('content'))
          // section
          .start().addClass(this.myClass('section'))
            .start(foam.u2.detail.SectionView, {
              data: this.model,
              sectionName: this.model.cls_.model_.sections[0].name,
              isCentered: true
            }).end()
          .end()
          // link
          .callIf(this.model.hasBackLink, function() {
            this.start().addClass(self.myClass('link'))
              .add(self.model.REDIRECTION_TO)
              .on('click', function() {
                self.stack.push({ class: 'foam.u2.view.LoginView', mode_: 'SignIn' }, self);
              })
            .end();
          })
        .end();
    }
  ]
});

{'fraction_non_alphanumeric': 0.14370982552800735, 'fraction_numerical': 0.017141108050198958, 'mean_word_length': 1.63614360629286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2638063', 'n_tokens_mistral': 2157, 'n_tokens_neox': 2039, 'n_words': 428}