BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b7fc0e81
Commit
b7fc0e81
authored
Dec 16, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
user.rb
app/models/user.rb
+2
-1
_no_ssh.html.haml
app/views/shared/_no_ssh.html.haml
+5
-3
20131214224427_add_hide_no_ssh_key_to_users.rb
db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb
+5
-0
No files found.
app/models/user.rb
View file @
b7fc0e81
...
...
@@ -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
,
...
...
app/views/shared/_no_ssh.html.haml
View file @
b7fc0e81
-
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'
db/migrate/20131214224427_add_hide_no_ssh_key_to_users.rb
0 → 100644
View file @
b7fc0e81
class
AddHideNoSshKeyToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:hide_no_ssh_key
,
:boolean
,
:default
=>
false
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment