Rename 'login' field back to 'email'
[gitorious:gitorious-fiit-mainline.git] / app / views / sessions / new.html.erb
1 <%
2 #--
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>
8 #
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.
13 #
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.
18 #
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/>.
21 #++
22 %>
23
24 <div id="content">
25   <%= login_method %>
26   <% form_tag sessions_path  do -%>
27         <div class="form-wrapper" id="login">
28                 <div id="log-in">
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>
33                         <% end %>
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">
37                                         <ul>
38                                                 <li>
39                                                          <label for="email"><%
40                                                          labels = Array.new
41                                                          n = 0
42                                                          if GitoriousConfig['authenticators'].index('password') != nil
43                                                            labels[n] = t("views.sessions.label").call(self)
44                                                            n=n+1
45                                                          end
46                                                          if (GitoriousConfig['authenticators'].index('ldap') != nil)
47                                                            labels[n] = t("views.sessions.ldap_label")
48                                                          end
49                                                          labels = labels.join(" / ")
50                                                        %><%=labels%></label>
51                                                         <%= text_field_tag 'email', params[:email] %>
52                                                 </li>
53                                                 <li>
54                                                         <label for="password"><%
55                                                          labels = Array.new
56                                                          n = 0
57                                                          if GitoriousConfig['authenticators'].index('password') != nil
58                                                            labels[n] = t("views.sessions.passwd")
59                                                            n=n+1
60                                                          end
61                                                          if (GitoriousConfig['authenticators'].index('ldap') != nil)
62                                                            labels[n] = t("views.sessions.ldap_passwd")
63                                                          end
64                                                          labels = labels.join(" / ")
65                                                        %><%=labels%></label>
66                                                         <%= password_field_tag 'password', '' %>
67                                                 </li>
68                                                 <li>
69                                                         <div class="tos">
70                                                                 <%= check_box_tag 'remember_me' %>
71                                                                 <label for="remember_me"><%= t("views.sessions.remember") %></label>
72                                                         </div>
73                                                         <div class="submit">
74                                                                 <%= submit_tag t("views.sessions.submit") %>
75                                                         </div>
76                                                 </li>
77                                         </ul>
78                                 </div>
79                         <% end %>
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">
83                             <% else -%>
84                                 <div id="openid_login_fields">
85                             <% end  %>
86                                         <ul>
87                                                 <li>
88                                                         <label for="openid"><%= t("views.sessions.openid").call(self) %></label>
89                                                         <%= text_field_tag 'openid_url', params[:openid_url] -%>
90                                                 </li>
91                                                 <li>
92                                                         <div class="tos">
93                                                                 <%= check_box_tag 'remember_me' %>
94                                                                 <label for="remember_me"><%= t("views.sessions.remember") %></label>
95                                                         </div>
96                                                         <div class="submit">
97                                                                 <%= submit_tag t("views.sessions.submit") %>
98                                                         </div>
99                                                 </li>
100                                         </ul>
101                                 </div>
102                         <% end %>
103
104
105
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">
111             <small>
112             <% if GitoriousConfig['public_mode'] -%>
113               <%= link_to t("views.sessions.register"), new_user_path -%>
114               &mdash;
115             <% end -%>
116             <%= link_to t("views.sessions.forgot"), forgot_password_users_path -%>
117             </small>
118           </p>
119           <% end %>
120         </div>
121
122
123
124 </div>
125