diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-06-10 06:19:05 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-06-10 08:00:49 +0300 |
commit | e18a08fd89f59088db22208069370a85f6a33001 (patch) | |
tree | 51752b67d9085580c6694e362ae2f5fb18df8b1b | |
parent | 1779d68bfe2872c36f475798c5e1b82678f3225d (diff) |
Implement second round of comments from @jschatz1.
- Just use a link for the clipboard button. Having a non-clickable
container (that looks like a button) is confusing.
- Use `text-danger` for the "you won't be able to access it again" message.
- Highlight the created token so people know to look there.
-rw-r--r-- | app/assets/stylesheets/pages/profile.scss | 11 | ||||
-rw-r--r-- | app/views/profiles/personal_access_tokens/index.html.haml | 11 | ||||
-rw-r--r-- | spec/features/profiles/personal_access_tokens_spec.rb | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/app/assets/stylesheets/pages/profile.scss b/app/assets/stylesheets/pages/profile.scss index 88e062d156f..46371ec6871 100644 --- a/app/assets/stylesheets/pages/profile.scss +++ b/app/assets/stylesheets/pages/profile.scss @@ -200,6 +200,17 @@ text-align: center; } +.created-personal-access-token-container { + #created-personal-access-token { + width: 90%; + display: inline; + } + + .btn-clipboard { + margin-left: 5px; + } +} + .user-profile { @media (max-width: $screen-xs-max) { .cover-block { diff --git a/app/views/profiles/personal_access_tokens/index.html.haml b/app/views/profiles/personal_access_tokens/index.html.haml index 4ad07df42dc..456e770dc80 100644 --- a/app/views/profiles/personal_access_tokens/index.html.haml +++ b/app/views/profiles/personal_access_tokens/index.html.haml @@ -9,14 +9,13 @@ .col-lg-9 - if flash[:personal_access_token] - .created-personal-access-token + .created-personal-access-token-container %h5.prepend-top-0 Your New Personal Access Token .form-group - .input-group - = text_field_tag 'created-personal-access-token', flash[:personal_access_token], readonly: true, class: "form-control", 'aria-describedby' => "created-personal-access-token-help-block" - .input-group-addon= clipboard_button(clipboard_text: flash[:personal_access_token]) - %span#created-personal-access-token-help-block.help-block Make sure you save it - you won't be able to access it again. + = text_field_tag 'created-personal-access-token', flash[:personal_access_token], readonly: true, class: "form-control", 'aria-describedby' => "created-personal-access-token-help-block" + = clipboard_button(clipboard_text: flash[:personal_access_token]) + %span#created-personal-access-token-help-block.help-block.text-danger Make sure you save it - you won't be able to access it again. %hr @@ -111,3 +110,5 @@ $("#created-personal-access-token").click(function() { this.select(); }); + + $("#created-personal-access-token").effect('highlight', { color: '#ffff99' }, 2000); diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 105c5dae34e..d824e1d288d 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -12,7 +12,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do end def created_personal_access_token - find(".created-personal-access-token input").value + find("#created-personal-access-token").value end def disallow_personal_access_token_saves! |