Commit b983e9ef0a599c591606d30a450b9fe7e78c6c85

Authored by Dmitriy Zaporozhets
1 parent 986697a9

Add ability to hide no ssh key message

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/javascripts/project.js.coffee
@@ -40,3 +40,8 @@ $ -&gt; @@ -40,3 +40,8 @@ $ -&gt;
40 # Ref switcher 40 # Ref switcher
41 $('.project-refs-select').on 'change', -> 41 $('.project-refs-select').on 'change', ->
42 $(@).parents('form').submit() 42 $(@).parents('form').submit()
  43 +
  44 + $('.hide-no-ssh-message').on 'click', (e) ->
  45 + $.cookie('hide_no_ssh_message', 'false')
  46 + $(@).parents('.no-ssh-key-message').hide()
  47 + e.preventDefault()
app/assets/stylesheets/common.scss
@@ -220,7 +220,6 @@ li.note { @@ -220,7 +220,6 @@ li.note {
220 .error-message { 220 .error-message {
221 padding: 10px; 221 padding: 10px;
222 background: #C67; 222 background: #C67;
223 - padding-left: 20px;  
224 margin: 0; 223 margin: 0;
225 color: #FFF; 224 color: #FFF;
226 225
@@ -228,8 +227,18 @@ li.note { @@ -228,8 +227,18 @@ li.note {
228 color: #fff; 227 color: #fff;
229 text-decoration: underline; 228 text-decoration: underline;
230 } 229 }
231 - &.centered {  
232 - text-align: center; 230 +}
  231 +
  232 +.no-ssh-key-message {
  233 + padding: 10px 0;
  234 + background: #C67;
  235 + margin: 0;
  236 + color: #FFF;
  237 + text-align: center;
  238 +
  239 + a {
  240 + color: #fff;
  241 + text-decoration: underline;
233 } 242 }
234 } 243 }
235 244
app/views/shared/_no_ssh.html.haml
1 -- if current_user.require_ssh_key? && alert.blank? && notice.blank?  
2 - %p.error-message.centered  
3 - 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 1 +- if cookies[:hide_no_ssh_message].blank? && current_user.require_ssh_key?
  2 + .no-ssh-key-message
  3 + .container
  4 + 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
  5 + = link_to '#', class: 'pull-right hide-no-ssh-message' do
  6 + %i.icon-remove