summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew.blessing@buckle.com>2013-12-14 19:28:17 -0600
committerDrew Blessing <drew.blessing@buckle.com>2013-12-14 20:21:12 -0600
commitd9b5777db182ba3ee2341b19246feba86adb5708 (patch)
treef3fbb8540c7c9a121b266471e9b4b61b9b6be554
parentd476ac7d41f117ad9cf612e99216a4e7eaa04fb6 (diff)
downloadgitlab-ce-d9b5777db182ba3ee2341b19246feba86adb5708.tar.gz
Allow user to hide the message to add an ssh key permanently
Favor links instead of buttons Remove unnecessary class Remove extra space
-rw-r--r--app/models/user.rb3
-rw-r--r--app/views/shared/_no_ssh.html.haml8
-rw-r--r--db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb5
3 files changed, 12 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 25a04089d33..ea6ecc3c3b7 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -41,6 +41,7 @@
# confirmed_at :datetime
# confirmation_sent_at :datetime
# unconfirmed_email :string(255)
+# hide_no_ssh_key :boolean default(FALSE), not null
#
require 'carrierwave/orm/activerecord'
@@ -52,7 +53,7 @@ class User < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username,
: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]
attr_accessible :projects_limit, :can_create_group,
diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml
index 2a365ce4f63..077e6c6a808 100644
--- a/app/views/shared/_no_ssh.html.haml
+++ b/app/views/shared/_no_ssh.html.haml
@@ -1,6 +1,8 @@
-- 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
.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
- = link_to '#', class: 'pull-right hide-no-ssh-message' do
- %i.icon-remove
+ %div.pull-right
+ = 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'
diff --git a/db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb b/db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb
new file mode 100644
index 00000000000..7cec79e7ee8
--- /dev/null
+++ b/db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb
@@ -0,0 +1,5 @@
+class AddHideNoSshKeyToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :hide_no_ssh_key, :boolean, :default => false
+ end
+end