Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 61f34a4a

Von Sven Schöling vor mehr als 3 Jahren hinzugefügt

  • ID 61f34a4af517ac2a49d253bd4d5103d67cdea8fa
  • Vorgänger d413408f
  • Nachfolger 023edaf2

Mobile Layout: Loginscreen für mobile User rendern

Unterschiede anzeigen:

SL/Controller/LoginScreen.pm
165 165
}
166 166

  
167 167
sub set_layout {
168
  $::request->{layout} = SL::Layout::Dispatcher->new(style => 'login');
168
  $::request->{layout} = $::request->is_mobile
169
    ? SL::Layout::Dispatcher->new(style => 'mobile_login')
170
    : SL::Layout::Dispatcher->new(style => 'login');
171

  
172
  $::lxdebug->dump(0,  "layout", $::request->{layout});
169 173
}
170 174

  
171 175
sub init_clients {
......
181 185
sub show_login_form {
182 186
  my ($self, %params) = @_;
183 187

  
184
  $self->render('login_screen/user_login', %params, version => SL::Version->get_version, callback => $::form->{callback});
188
  if ($::request->is_mobile) {
189
    $self->render('login_screen/mobile_login', %params, version => SL::Version->get_version, callback => $::form->{callback});
190
  } else {
191
    $self->render('login_screen/user_login', %params, version => SL::Version->get_version, callback => $::form->{callback});
192
  }
185 193
}
186 194

  
187 195
1;
templates/webpages/login_screen/mobile_login.html
1
[%- USE T8 %]
2
[%- USE HTML %][%- USE L -%][%- USE LxERP -%]
3

  
4
<center>
5
  <a href="https://www.kivitendo.de" target="_top" class="no-underlined-links center-align">
6
    <img src="image/kivitendo.png" class="responsive-img kivitendo-logo">
7
  </a>
8
</center>
9
<h3 class="center-align">[% LxERP.t8('kivitendo v#1', version) %]</h3>
10

  
11
<div class="section">
12
<div class="container">
13
[% IF error %]
14
  <div class="col s12 red">[% error | html %]</div>
15
[% END %]
16
[% IF warning %]
17
  <div class="col s12 blue lighten-3">[% warning | html %]</div>
18
[% END %]
19
[% IF info %]
20
  <div class="col s12 green lighten-1">[% ok | html %]</div>
21
[% END %]
22
</div>
23
</div>
24

  
25
<div class="section">
26
<div class="container">
27
  <div class="z-depth-1 grey lighten-4 row" style="padding: 32px 48px 0px 48px; border: 1px solid #EEE;">
28

  
29
    <form method="post" name="loginscreen" action="controller.pl" target="_top" class="col s12">
30
      <div class="row">
31
        <div class="input-field col s12">
32
          [% L.input_tag('{AUTH}login', FORM.$auth_login, id='auth_login', class='initial_focus validate', label=LxERP.t8('Login Name')) %]
33
          <label for='auth_login'>[% 'Login Name' | $T8 %]</label>
34
        </div>
35
      </div>
36
      <div class="row">
37
        <div class="input-field col s12">
38
          [% L.input_tag('{AUTH}password', '', type='password', id='auth_password', class='validate', label=LxERP.t8('Password')) %]
39
          <label for='auth_password'>[% 'Password' | $T8 %]</label>
40
        </div>
41
      </div>
42
      <div class="row">
43
        <div class="input-field col s12">
44
          [% L.select_tag('{AUTH}client_id', SELF.clients, id='auth_client_id', title_key='name', default=SELF.default_client_id) %]
45
          <label for='auth_client_id'>[% 'Client' | $T8 %]</label>
46
        </div>
47
      </div>
48

  
49

  
50
      <div class="row">
51
        [% L.hidden_tag("action", "LoginScreen/login") %]
52
        <button type='submit' name='btn_login' class='col s12 btn btn-large waves-effect'>Login</button>
53
      </div>
54
    </form>
55

  
56
  </div>
57
</div>
58
</div>

Auch abrufbar als: Unified diff