Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title><%= title() // loc('korap_desc') %></title> |
| 5 | <meta charset="utf-8" /> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=false, user-scalable=no" /> |
Akron | b302518 | 2015-05-27 23:02:44 +0200 | [diff] [blame] | 7 | <link href="<%= stash 'prefix' %>/favicon.ico" rel="shortcut icon" type="image/x-icon" /> |
Nils Diewald | 705b74a | 2015-05-07 23:57:34 +0000 | [diff] [blame] | 8 | <link href="<%= stash 'prefix' %>/css/kalamar-<%= $Kalamar::VERSION %>.css" type="text/css" rel="stylesheet" /> |
Akron | 4036d54 | 2018-02-12 13:17:09 +0100 | [diff] [blame] | 9 | %= javascript begin |
Nils Diewald | 845282c | 2015-05-14 07:53:03 +0000 | [diff] [blame] | 10 | window.KorAP = window.KorAP || {}; |
| 11 | % my $api = url_for('index'); |
| 12 | % $api =~ s!/$!!; |
| 13 | KorAP.URL = '<%== $api %>'; |
| 14 | % end |
Akron | 4036d54 | 2018-02-12 13:17:09 +0100 | [diff] [blame] | 15 | |
| 16 | % if ($c->app->mode eq 'development') { |
Akron | a68559c | 2018-02-13 15:02:18 +0100 | [diff] [blame] | 17 | <script data-main="/js/src/app/devel" src="/js/lib/require.js" async="async"></script> |
Akron | 4036d54 | 2018-02-12 13:17:09 +0100 | [diff] [blame] | 18 | % } else { |
Nils Diewald | e2647aa | 2015-05-08 00:54:45 +0000 | [diff] [blame] | 19 | <script src="<%= (stash('prefix') // '') . '/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js') %>" async="async"></script> |
Akron | 4036d54 | 2018-02-12 13:17:09 +0100 | [diff] [blame] | 20 | % }; |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 21 | </head> |
| 22 | % my $embedded = 0; |
| 23 | % $embedded = 1 if stash('embedded'); |
Akron | ae8f31c | 2017-11-28 18:05:52 +0100 | [diff] [blame] | 24 | <body class="no-js<% if ($embedded) { %> embedded<% } %>"> |
| 25 | <script>document.body.classList.remove('no-js');</script> |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 26 | <div id="kalamar-bg"></div> |
| 27 | |
Akron | 50eb841 | 2017-08-31 17:02:13 +0200 | [diff] [blame] | 28 | % if (!$embedded && !user_auth && stash('auth_support')) { # user not logged in |
Akron | 189b359 | 2016-01-04 20:56:46 +0100 | [diff] [blame] | 29 | % content_for 'sidebar', begin |
Akron | 2e3d377 | 2017-04-14 16:20:40 +0200 | [diff] [blame] | 30 | % if (flash('handle_or_email') && !param('handle_or_email')) { |
| 31 | % param(handle_or_email => flash('handle_or_email')); |
| 32 | % }; |
Akron | 189b359 | 2016-01-04 20:56:46 +0100 | [diff] [blame] | 33 | <fieldset> |
Akron | ae8f31c | 2017-11-28 18:05:52 +0100 | [diff] [blame] | 34 | %= form_for 'login', class => 'login', begin |
Akron | 741b2b1 | 2017-04-13 22:15:59 +0200 | [diff] [blame] | 35 | <legend><span><%= loc 'login' %></span></legend> |
Akron | 15158e0 | 2018-03-19 12:42:46 +0100 | [diff] [blame] | 36 | %= csrf_field |
Akron | 2670f5b | 2017-05-31 17:54:07 +0200 | [diff] [blame] | 37 | %= text_field 'handle_or_email', placeholder => loc('userormail') |
Akron | 429aeda | 2018-03-19 16:02:29 +0100 | [diff] [blame] | 38 | %= hidden_field fwd => $c->url_with |
Akron | 189b359 | 2016-01-04 20:56:46 +0100 | [diff] [blame] | 39 | <div> |
Akron | 741b2b1 | 2017-04-13 22:15:59 +0200 | [diff] [blame] | 40 | %= password_field 'pwd', placeholder => loc('pwd') |
Akron | 189b359 | 2016-01-04 20:56:46 +0100 | [diff] [blame] | 41 | <button type="submit"><span><%= loc 'go' %></span></button> |
| 42 | </div> |
Akron | 2670f5b | 2017-05-31 17:54:07 +0200 | [diff] [blame] | 43 | % end |
| 44 | <p><%= loc 'loginExplanation' %></p> |
Akron | e5ef4e0 | 2017-04-19 17:07:52 +0200 | [diff] [blame] | 45 | %# <ul> |
| 46 | %# <li><%= link_to loc('register') => 'register' %></li> |
| 47 | %# <li><%= link_to loc('pwdforgotten') => 'pwd_forgotten' %></li> |
| 48 | %# </ul> |
Akron | 50eb841 | 2017-08-31 17:02:13 +0200 | [diff] [blame] | 49 | |
Akron | 189b359 | 2016-01-04 20:56:46 +0100 | [diff] [blame] | 50 | </fieldset> |
| 51 | % end |
| 52 | % } |
| 53 | |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 54 | % my $aside = content_for('sidebar'); |
| 55 | <aside tabindex="0" class="<% unless (length($aside) > 0) { %>off<% } elsif (stash('sidebar_active')) { %>active<% } %>"> |
| 56 | <div> |
Akron | 27ae9ec | 2015-06-23 00:43:21 +0200 | [diff] [blame] | 57 | %= $aside |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 58 | </div> |
| 59 | </aside> |
| 60 | |
Akron | 4751da6 | 2017-06-07 22:37:10 +0200 | [diff] [blame] | 61 | % unless ($embedded) { |
| 62 | %= include 'partial/header' |
| 63 | % } |
Akron | d1741ae | 2017-11-29 09:58:53 +0100 | [diff] [blame] | 64 | |
| 65 | |
| 66 | <noscript> |
| 67 | <p id="activate"><%= loc 'activateJS' %></p> |
| 68 | </noscript> |
Akron | 4751da6 | 2017-06-07 22:37:10 +0200 | [diff] [blame] | 69 | |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 70 | <main<% if (stash 'main_class') { %> class="<%= stash 'main_class' %>"<% } %>> |
| 71 | %= content |
| 72 | </main> |
| 73 | |
| 74 | % unless ($embedded) { |
| 75 | <footer> |
| 76 | <a href="http://korap.ids-mannheim.de/"><%= loc 'about' %></a> |
| 77 | <%= doc_link_to 'V '. $Kalamar::VERSION, 'korap', 'kalamar' %> |
| 78 | </footer> |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 79 | % }; |
Akron | 27ae9ec | 2015-06-23 00:43:21 +0200 | [diff] [blame] | 80 | %= notifications 'Kalamar::Plugin::Notifications' |
Nils Diewald | 5e48546 | 2015-05-07 20:33:04 +0000 | [diff] [blame] | 81 | </body> |
| 82 | </html> |