diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-13 13:33:28 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-13 14:44:42 +0100 |
commit | 25e44d05300a6b5b35232b27b4ccb27f47f09a67 (patch) | |
tree | f46c5753255cae37b492a988ffffd9d1dd4d1f6d /app/views | |
parent | 529188e4788991961796b1b6131389072ee61efb (diff) | |
download | gitlab-ce-25e44d05300a6b5b35232b27b4ccb27f47f09a67.tar.gz |
Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S).
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/profiles/passwords/edit.html.haml | 23 | ||||
-rw-r--r-- | app/views/profiles/passwords/new.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/empty.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 1 | ||||
-rw-r--r-- | app/views/shared/_clone_panel.html.haml | 16 | ||||
-rw-r--r-- | app/views/shared/_no_password.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/_no_ssh.html.haml | 2 |
7 files changed, 44 insertions, 16 deletions
diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml index 2a7d317aa3e..6b19db4eb5d 100644 --- a/app/views/profiles/passwords/edit.html.haml +++ b/app/views/profiles/passwords/edit.html.haml @@ -1,25 +1,30 @@ %h3.page-title Password %p.light - Change your password or recover your current one. + - if @user.password_automatically_set? + Set your password. + - else + Change your password or recover your current one. %hr .update-password = form_for @user, url: profile_password_path, method: :put, html: { class: 'form-horizontal' } do |f| %div %p.slead - You must provide current password in order to change it. - %br + - unless @user.password_automatically_set? + You must provide current password in order to change it. + %br After a successful password update you will be redirected to login page where you should login with your new password -if @user.errors.any? .alert.alert-danger %ul - @user.errors.full_messages.each do |msg| %li= msg - .form-group - = f.label :current_password, class: 'control-label' - .col-sm-10 - = f.password_field :current_password, required: true, class: 'form-control' - %div - = link_to "Forgot your password?", reset_profile_password_path, method: :put + - unless @user.password_automatically_set? + .form-group + = f.label :current_password, class: 'control-label' + .col-sm-10 + = f.password_field :current_password, required: true, class: 'form-control' + %div + = link_to "Forgot your password?", reset_profile_password_path, method: :put .form-group = f.label :password, 'New password', class: 'control-label' diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml index aef7348fd20..8bed6e0dbee 100644 --- a/app/views/profiles/passwords/new.html.haml +++ b/app/views/profiles/passwords/new.html.haml @@ -10,10 +10,11 @@ %ul - @user.errors.full_messages.each do |msg| %li= msg - - .form-group - = f.label :current_password, class: 'control-label' - .col-sm-10= f.password_field :current_password, required: true, class: 'form-control' + + - unless @user.password_automatically_set? + .form-group + = f.label :current_password, class: 'control-label' + .col-sm-10= f.password_field :current_password, required: true, class: 'form-control' .form-group = f.label :password, class: 'control-label' .col-sm-10= f.password_field :password, required: true, class: 'form-control' diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index d7dee2208de..b925bcb7fac 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -1,5 +1,6 @@ - if current_user && can?(current_user, :download_code, @project) = render 'shared/no_ssh' + = render 'shared/no_password' = render "home_panel" diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 737a34decde..435b2648404 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,5 +1,6 @@ - if current_user && can?(current_user, :download_code, @project) = render 'shared/no_ssh' + = render 'shared/no_password' = render "home_panel" diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 1cc6043f56b..df0bde76980 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,8 +1,20 @@ - project = project || @project .git-clone-holder.input-group .input-group-btn - %button{class: "btn #{ 'active' if default_clone_protocol == 'ssh' }", :"data-clone" => project.ssh_url_to_repo} SSH - %button{class: "btn #{ 'active' if default_clone_protocol == 'http' }", :"data-clone" => project.http_url_to_repo}= gitlab_config.protocol.upcase + %button{ | + class: "btn #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", | + :"data-clone" => project.ssh_url_to_repo, | + :"data-title" => "Add an SSH key to your profile<br> to pull or push via SSH", + :"data-html" => "true", + :"data-container" => "body"} + SSH + %button{ | + class: "btn #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.password_automatically_set? }", | + :"data-clone" => project.http_url_to_repo, | + :"data-title" => "Set a password on your account<br> to pull or push via #{gitlab_config.protocol.upcase}", + :"data-html" => "true", + :"data-container" => "body"} + = gitlab_config.protocol.upcase = text_field_tag :project_clone, default_url_to_repo(project), class: "one_click_select form-control", readonly: true - if project.kind_of?(Project) .input-group-addon diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml new file mode 100644 index 00000000000..022097cda16 --- /dev/null +++ b/app/views/shared/_no_password.html.haml @@ -0,0 +1,8 @@ +- if cookies[:hide_no_password_message].blank? && !current_user.hide_no_password && current_user.password_automatically_set? + .no-password-message.alert.alert-warning.hidden-xs + You won't be able to pull or push project code via #{gitlab_config.protocol.upcase} until you #{link_to 'set a password', edit_profile_password_path} on your account + + .pull-right + = link_to "Don't show again", profile_path(user: {hide_no_password: true}), method: :put + | + = link_to 'Remind later', '#', class: 'hide-no-password-message' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index 8e6f802fd3b..1a2946baccb 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -1,4 +1,4 @@ -- if cookies[:hide_no_ssh_message].blank? && current_user.require_ssh_key? && !current_user.hide_no_ssh_key +- if cookies[:hide_no_ssh_message].blank? && !current_user.hide_no_ssh_key && current_user.require_ssh_key? .no-ssh-key-message.alert.alert-warning.hidden-xs You won't be able to pull or push project code via SSH until you #{link_to 'add an SSH key', new_profile_key_path} to your profile |