Commit b7fc0e81 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #5849 from bke-drewb/feature/hide_no_ssh_key_message

Allow user to hide the message to add an ssh key permanently
parents d46dba58 d9b5777d
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
# confirmed_at :datetime # confirmed_at :datetime
# confirmation_sent_at :datetime # confirmation_sent_at :datetime
# unconfirmed_email :string(255) # unconfirmed_email :string(255)
# hide_no_ssh_key :boolean default(FALSE), not null
# #
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
...@@ -52,7 +53,7 @@ class User < ActiveRecord::Base ...@@ -52,7 +53,7 @@ class User < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username,
:skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password, :skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password,
:extern_uid, :provider, :password_expires_at, :avatar, :extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key,
as: [:default, :admin] as: [:default, :admin]
attr_accessible :projects_limit, :can_create_group, attr_accessible :projects_limit, :can_create_group,
......
- if cookies[:hide_no_ssh_message].blank? && current_user.require_ssh_key? - if cookies[:hide_no_ssh_message].blank? && current_user.require_ssh_key? && !current_user.hide_no_ssh_key
.no-ssh-key-message .no-ssh-key-message
.container .container
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 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
= link_to '#', class: 'pull-right hide-no-ssh-message' do %div.pull-right
%i.icon-remove = link_to "Don't show again", profile_path(user: {hide_no_ssh_key: true}), method: :put, class: 'hide-no-ssh-message', remote: true
|
= link_to 'Remind later', '#', class: 'hide-no-ssh-message'
class AddHideNoSshKeyToUsers < ActiveRecord::Migration
def change
add_column :users, :hide_no_ssh_key, :boolean, :default => false
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment