summaryrefslogtreecommitdiff
path: root/templates/webmail/login.html.ep
blob: 54ab40a0277b78e2b954289a0574e8c524e6581c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% layout 'mainlayout';

% my $uses_cram = config->{session}{secure} eq 'cram';

<section class=section>
  <div class="container is-max-desktop box">

    <h1 class=title>
      <%= ucfirst l 'login' %>
    </h1>
    <h2 class=subtitle>
      JWebmail 
    </h2>

% if (my $msg = flash('message') || stash('warning')) {
  <div class="message is-warning">
    <div class=message-header>
      %= $msg
    </div>
  </div>
% }

  %= form_for login => (name => 'login1') => (method => 'post') => (class => 'pure-form pure-form-aligned jwm-round') => begin

    <div class="field is-horizontal">
      <div class=field-label>
        %= label_for userid => ucfirst l 'userid' => (class => 'label')
      </div>
      <div class=field-body>
        <div class=field>
          <div class=control>
            %= text_field 'userid' => '' => (required => undef) => (class => 'input')
          </div>
        </div>
      </div>
    </div>

    <div class="field is-horizontal">
      <div class=field-label>
        %= label_for password => ucfirst l 'password' => (class => 'label')
      </div>
      <div class=field-body>
        <div class=field>
          <div class=control>
            %= password_field 'password' => (required => undef) => (class => 'input')
          </div>
        </div>
      </div>
    </div>
% if ($uses_cram) {
      %= hidden_field challenge => rand
% }
    <div class="field is-horizontal">
      <div class=field-label>
      </div>
      <div class=field-body>
        <div class=field>
          <div class=control>
            %= submit_button ucfirst l('login') => (class => 'button is-primary') => (name => 'submit_button') => $uses_cram ? (disabled => undef) : ()
          </div>
        </div>
      </div>
    </div>
  % end

  </div>
</section>

% if ($uses_cram) {
%= javascript '/src/login_cram.js'
% }

%= javascript begin
  if (!document.login1.userid.value) {
    document.login1.userid.focus();
  } else {
    document.login1.password.focus();
  }
% end