3 # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
4 # Copyright (C) 2007, 2008 Johan Sørensen <johan@johansorensen.com>
5 # Copyright (C) 2008 Patrick Aljord <patcito@gmail.com>
6 # Copyright (C) 2008 Tor Arne Vestbø <tavestbo@trolltech.com>
7 # Copyright (C) 2009 Fabio Akita <fabio.akita@gmail.com>
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 <% form_tag sessions_path do -%>
27 <div class="form-wrapper" id="login">
29 <h1>Log in to Gitorious</h1>
30 <% if GitoriousConfig['authenticators'].index('openid') != nil and (GitoriousConfig['authenticators'].index('password') != nil or GitoriousConfig['authenticators'].index('ldap') != nil) -%>
31 <p class="openid-switch">Or log in with <a href="#" class="foo1">OpenID</a>.</p>
32 <p class="regular-switch" style="display: none">Or log in with your <a href="#" class="foo2">regular account</a>.</p>
34 <div class="horisontal-shadow"></div>
35 <% if GitoriousConfig['authenticators'].index('password') != nil or GitoriousConfig['authenticators'].index('ldap') != nil -%>
36 <div id="regular_login_fields">
42 if GitoriousConfig['authenticators'].index('password') != nil
43 labels[n] = t("views.sessions.label").call(self)
46 if (GitoriousConfig['authenticators'].index('ldap') != nil)
47 labels[n] = t("views.sessions.ldap_label")
49 labels = labels.join(" / ")
51 <%= text_field_tag 'login', params[:login] %>
54 <label for="password"><%
57 if GitoriousConfig['authenticators'].index('password') != nil
58 labels[n] = t("views.sessions.passwd")
61 if (GitoriousConfig['authenticators'].index('ldap') != nil)
62 labels[n] = t("views.sessions.ldap_passwd")
64 labels = labels.join(" / ")
66 <%= password_field_tag 'password', '' %>
70 <%= check_box_tag 'remember_me' %>
71 <label for="remember_me"><%= t("views.sessions.remember") %></label>
74 <%= submit_tag t("views.sessions.submit") %>
80 <% if GitoriousConfig['authenticators'].index('openid') != nil -%>
81 <% if GitoriousConfig['authenticators'].index('password') != nil or GitoriousConfig['authenticators'].index('ldap') != nil -%>
82 <div id="openid_login_fields" class="login_hidden">
84 <div id="openid_login_fields">
88 <label for="openid"><%= t("views.sessions.openid").call(self) %></label>
89 <%= text_field_tag 'openid_url', params[:openid_url] -%>
93 <%= check_box_tag 'remember_me' %>
94 <label for="remember_me"><%= t("views.sessions.remember") %></label>
97 <%= submit_tag t("views.sessions.submit") %>
106 </div><!-- end #log-in -->
107 </div><!-- end form-wrapper -->
108 <% end -%> <!-- end form -->
109 <% if(GitoriousConfig["authenticators"].index("password") != nil) -%>
110 <p class="alt_links">
112 <% if GitoriousConfig['public_mode'] -%>
113 <%= link_to t("views.sessions.register"), new_user_path -%>
116 <%= link_to t("views.sessions.forgot"), forgot_password_users_path -%>