diff --git a/app/assets/stylesheets/content/_accounts.sass b/app/assets/stylesheets/content/_accounts.sass index 19b50b51ef..a0db8b0334 100644 --- a/app/assets/stylesheets/content/_accounts.sass +++ b/app/assets/stylesheets/content/_accounts.sass @@ -137,3 +137,6 @@ .login-auth-provider-list margin-top: -15px margin-bottom: 10px + +#top-menu #nav-login-content .login-auth-providers.no-pwd + margin-top: 0px diff --git a/app/views/account/_auth_providers.html.erb b/app/views/account/_auth_providers.html.erb index 809589ee21..0d70742187 100644 --- a/app/views/account/_auth_providers.html.erb +++ b/app/views/account/_auth_providers.html.erb @@ -8,12 +8,16 @@ # * https://www.openproject.org/work_packages/7192 # * http://stackoverflow.com/questions/13112430/find-loaded-providers-for-omniauth auth_provider_html = call_hook :view_account_login_auth_provider +no_pwd = OmniauthLogin.disable_password_login? +pclass = no_pwd ? 'no-pwd' : '' %> <% if auth_provider_html.strip != '' %> -
-

- <%= I18n.t('account.login_with_auth_provider')%> -

+
+ <% unless no_pwd %> + + <% end %> diff --git a/app/views/account/_password_login_form.html.erb b/app/views/account/_password_login_form.html.erb new file mode 100644 index 0000000000..3d522a73db --- /dev/null +++ b/app/views/account/_password_login_form.html.erb @@ -0,0 +1,63 @@ +<%#-- copyright +OpenProject is a project management system. +Copyright (C) 2012-2014 the OpenProject Foundation (OPF) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See doc/COPYRIGHT.rdoc for more details. + +++#%> + +<%= form_tag({:action=> "login"}, autocomplete: 'off') do %> + <%= back_url_hidden_field_tag %> + +
+ + <%= text_field_tag 'username', nil %> +
+ +
+ + <%= password_field_tag 'password', nil %> +
+ + + + <%= javascript_tag "Form.Element.focus('username');" %> +<% end %> diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index b8df5412af..2d78459b5d 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -31,42 +31,13 @@ See doc/COPYRIGHT.rdoc for more details. <% breadcrumb_paths(l(:label_login)) %> <%= call_hook :view_account_login_top %> -<%= form_tag({:action=> "login"}, autocomplete: 'off', id: 'login-form', class: 'form') do %> - <%= back_url_hidden_field_tag %> +

<%= I18n.t(:label_login) %>


- -
- - <%= text_field_tag 'username', nil %> -
- -
- - <%= password_field_tag 'password', nil %> -
- - - - <%= render :partial => 'auth_providers' %> - <%= javascript_tag "Form.Element.focus('username');" %> -<% end %> + <% unless OmniauthLogin.disable_password_login? %> + <%= render partial: 'password_login_form' %> + <% end %> + <%= render partial: 'auth_providers' %> +
<%= call_hook :view_account_login_bottom %>