<?php
namespace Nibiru\Module\Users\Traits;
/**
 * @desc this file is for the autoloader to function properly,
 * you might as well use it as the primary user trait for your
 * application
 * Created by PhpStorm.
 * User: kasdorf
 * Date: 28.08.18
 * Time: 11:24
 */
use Nibiru\Factory\Form;

trait Users
{
    /**
     * @desc this  will return the login form
     * @return string
     */
    public function loginForm(): string
    {
        Form::create();
        //Start form field Username
        Form::addOpenDiv([
            'class' => 'form-group',
            'value' => ''
        ]);
        Form::addOpenDiv([
            'class' => 'input-group mb-3',
            'value' => ''
        ]);
        Form::addOpenAny([
            'any' => 'span',
            'class' => 'input-group-text bg-transparent',
            'value' => ''
        ]);
        Form::addOpenAny([
            'any' => 'i',
            'class' => 'ti-user',
            'value' => ''
        ]);
        Form::addCloseAny([
            'any' => 'i'
        ]);
        Form::addCloseAny([
            'any' => 'span'
        ]);
        Form::addInputTypeText([
            'class' => 'form-control ps-15 bg-transparent',
            'name'  => 'login',
            'placeholder' => 'Benutzername'
        ]);
        Form::addCloseDiv();
        Form::addCloseDiv();
        //Start form field Password
        Form::addOpenDiv([
            'class' => 'form-group',
            'value' => ''
        ]);
        Form::addOpenDiv([
            'class' => 'input-group mb-3',
            'value' => ''
        ]);
        Form::addOpenAny([
            'any' => 'span',
            'class' => 'input-group-text bg-transparent',
            'value' => ''
        ]);
        Form::addOpenAny([
            'any' => 'i',
            'class' => 'ti-lock',
            'value' => ''
        ]);
        Form::addCloseAny([
            'any' => 'i'
        ]);
        Form::addCloseAny([
            'any' => 'span'
        ]);
        Form::addInputTypePassword([
            'class' => 'form-control ps-15 bg-transparent',
            'name'  => 'password',
            'placeholder' => 'Passwort'
        ]);
        Form::addCloseDiv();
        Form::addCloseDiv();
        //End form field Password
        Form::addOpenDiv([
            'class' => 'row',
            'value' => ''
        ]);
        Form::addOpenDiv([
            'class' => 'col-6',
            'value' => ''
        ]);

        Form::addCloseDiv();


        Form::addOpenDiv([
            'class' => 'col-6',
            'value' => ''
        ]);
        Form::addOpenDiv([
            'class' => 'fog-pwd text-end',
            'value' => ''
        ]);

        Form::addOpenAny([
            'any' => 'a',
            'href' => 'javascript:void(0)',
            'class' => 'hover-warning',
            'value' => '<i class="ion ion-locked"></i> Passwort vergessen?'
        ]);
        Form::addCloseAny([
            'any' => 'a'
        ]);
        Form::addCloseDiv();
        Form::addCloseDiv();

        Form::addOpenDiv([
            'class' => 'col-12 text-center',
            'value' => ''
        ]);

        Form::addTypeButton([
            'type' => 'submit',
            'class' => 'btn btn-danger mt-10',
            'value' => 'Anmelden'
        ]);
        Form::addCloseDiv();
        Form::addCloseDiv();

        return Form::addForm([
            'name'  => 'loginForm',
            'action' => '/users/login',
            'method' => 'post',
            'target' => '_self'
        ]);
    }



}