diff options
Diffstat (limited to 'app/views/profiles/keys')
-rw-r--r-- | app/views/profiles/keys/_key.html.haml | 61 | ||||
-rw-r--r-- | app/views/profiles/keys/_key_details.html.haml | 2 | ||||
-rw-r--r-- | app/views/profiles/keys/index.html.haml | 4 |
3 files changed, 34 insertions, 33 deletions
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index eaf00ce6709..cc2e2a30052 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -1,32 +1,33 @@ -%li.d-flex.align-items-center.key-list-item - .gl-mr-3 - - if key.valid? - - if key.expired? - %span.d-inline-block.has-tooltip{ title: s_('Profiles|Your key has expired') } - = sprite_icon('warning-solid', css_class: 'settings-list-icon d-none d-sm-block') - - else - = sprite_icon('key', css_class: 'settings-list-icon d-none d-sm-block ') - - else - %span.d-inline-block.has-tooltip{ title: key.errors.full_messages.join(', ') } - = sprite_icon('warning-solid', css_class: 'settings-list-icon d-none d-sm-block') +%li.key-list-item + .gl-display-flex.gl-align-items-flex-start + .key-list-item-info.gl-w-full.float-none + = link_to path_to_key(key, is_admin), class: "title text-3" do + = key.title - .key-list-item-info.w-100.float-none - = link_to path_to_key(key, is_admin), class: "title" do - = key.title - %span.text-truncate - = key.fingerprint + .gl-display-flex.gl-align-items-center.gl-mt-2 + - if key.valid? + - if key.expired? + %span.gl-display-inline-block.has-tooltip{ title: s_('Profiles|Your key has expired') } + = sprite_icon('warning-solid', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') + - else + = sprite_icon('key', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') + - else + %span.gl-display-inline-block.has-tooltip{ title: key.errors.full_messages.join(', ') } + = sprite_icon('warning-solid', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') - .key-list-item-dates.d-flex.align-items-start.justify-content-between - %span.last-used-at.gl-mr-3 - = s_('Profiles|Last used:') - = key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : _('Never') - %span.expires.gl-mr-3 - = s_('Profiles|Expires:') - = key.expires_at ? key.expires_at.to_date : _('Never') - %span.key-created-at.gl-display-flex.gl-align-items-center - = s_('Profiles|Created%{time_ago}'.html_safe) % { time_ago: time_ago_with_tooltip(key.created_at, html_class: 'gl-ml-2')} - - if key.can_delete? - .gl-ml-3 - = button_to '#', class: "btn btn-default gl-button btn-default-tertiary js-confirm-modal-button", data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin)) do - %span.sr-only= _('Delete') - = sprite_icon('remove') + %span.gl-text-truncate.gl-sm-ml-3 + = key.fingerprint + + .gl-mt-3= s_('Profiles|Created%{time_ago}'.html_safe) % { time_ago: time_ago_with_tooltip(key.created_at, html_class: 'gl-ml-2')} + + .key-list-item-dates + %span.last-used-at.gl-mr-3 + = s_('Profiles|Last used:') + = key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : _('Never') + %span.expires.gl-mr-3 + = s_('Profiles|Expires:') + = key.expires_at ? key.expires_at.to_date : _('Never') + %span.key-created-at.gl-display-flex.gl-align-items-center + - if key.can_delete? + .gl-ml-3 + = render 'shared/ssh_keys/key_delete', html_class: "btn gl-button btn-icon btn-danger js-confirm-modal-button", button_data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin)) diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index 22d795ca831..8016d989ff1 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -38,4 +38,4 @@ .col-md-12 .float-right - if @key.can_delete? - = button_to _('Delete'), '#', class: "btn btn-danger gl-button delete-key js-confirm-modal-button", data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin)) + = render 'shared/ssh_keys/key_delete', text: _('Delete'), html_class: "btn btn-danger gl-button delete-key js-confirm-modal-button", button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin)) diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 7b7c24f3ac8..80027cdfed0 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -11,8 +11,8 @@ %h5.gl-mt-0 = _('Add an SSH key') %p.profile-settings-content - - generate_link_url = help_page_path("ssh/README", anchor: 'generating-a-new-ssh-key-pair') - - existing_link_url = help_page_path("ssh/README", anchor: 'review-existing-ssh-keys') + - generate_link_url = help_page_path("ssh/README", anchor: 'generate-an-ssh-key-pair') + - existing_link_url = help_page_path("ssh/README", anchor: 'see-if-you-have-an-existing-ssh-key-pair') - generate_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: generate_link_url } - existing_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: existing_link_url } = _('To add an SSH key you need to %{generate_link_start}generate one%{link_end} or use an %{existing_link_start}existing key%{link_end}.').html_safe % { generate_link_start: generate_link_start, existing_link_start: existing_link_start, link_end: '</a>'.html_safe } |