Class: TinyAdmin::Views::Pages::SimpleAuthLogin

Inherits:
DefaultLayout show all
Defined in:
lib/tiny_admin/views/pages/simple_auth_login.rb

Instance Attribute Summary

Attributes inherited from DefaultLayout

#flash_component, #head_component, #messages, #navbar_component, #options

Attributes inherited from BasicLayout

#content, #params, #widgets

Instance Method Summary collapse

Methods inherited from BasicLayout

#label_for, #update_attributes

Methods included from Utils

#humanize, #params_to_s, #prepare_page, #to_class

Instance Method Details

#titleObject



30
31
32
# File 'lib/tiny_admin/views/pages/simple_auth_login.rb', line 30

def title
  'Login'
end

#view_templateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tiny_admin/views/pages/simple_auth_login.rb', line 7

def view_template
  super do
    div(class: 'simple_auth_login') {
      h1(class: 'title') { title }

      form(class: 'form_login', method: 'post') {
        div(class: 'mt-3') {
          label(for: 'secret', class: 'form-label') {
            label_for('Password', options: ['pages.simple_auth_login.inputs.password'])
          }
          input(type: 'password', name: 'secret', class: 'form-control', id: 'secret')
        }

        div(class: 'mt-3') {
          button(type: 'submit', class: 'button_login btn btn-primary') {
            label_for('Login', options: ['pages.simple_auth_login.buttons.submit'])
          }
        }
      }
    }
  end
end