summaryrefslogtreecommitdiff
path: root/app/views/profiles
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 09:09:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 09:09:23 +0000
commit4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4 (patch)
tree82591df15758864325897043f855b4e4dfcb6a56 /app/views/profiles
parent0301a0cad0063d76b1607358dc6c711ea043fdda (diff)
downloadgitlab-ce-4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/profiles')
-rw-r--r--app/views/profiles/keys/_form.html.haml13
-rw-r--r--app/views/profiles/keys/_key.html.haml41
-rw-r--r--app/views/profiles/keys/_key_details.html.haml5
-rw-r--r--app/views/profiles/keys/_key_table.html.haml2
4 files changed, 38 insertions, 23 deletions
diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml
index 63ef5eaa172..34e81285328 100644
--- a/app/views/profiles/keys/_form.html.haml
+++ b/app/views/profiles/keys/_form.html.haml
@@ -6,10 +6,15 @@
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
%p= _("Paste your public SSH key, which is usually contained in the file '~/.ssh/id_ed25519.pub' or '~/.ssh/id_rsa.pub' and begins with 'ssh-ed25519' or 'ssh-rsa'. Don't use your private SSH key.")
= f.text_area :key, class: "form-control js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, placeholder: s_('Profiles|Typically starts with "ssh-ed25519 …" or "ssh-rsa …"')
- .form-group
- = f.label :title, _('Title'), class: 'label-bold'
- = f.text_field :title, class: "form-control input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
- %p.form-text.text-muted= _('Name your individual key via a title')
+ .form-row
+ .col.form-group
+ = f.label :title, _('Title'), class: 'label-bold'
+ = f.text_field :title, class: "form-control input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
+ %p.form-text.text-muted= s_('Profiles|Give your individual key a title')
+
+ .col.form-group
+ = f.label :expires_at, s_('Profiles|Expires at'), class: 'label-bold'
+ = f.date_field :expires_at, class: "form-control input-lg qa-key-expiry-field", min: Date.tomorrow
.js-add-ssh-key-validation-warning.hide
.bs-callout.bs-callout-warning{ role: 'alert', aria_live: 'assertive' }
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
index 0e94e6563fd..b227041c9de 100644
--- a/app/views/profiles/keys/_key.html.haml
+++ b/app/views/profiles/keys/_key.html.haml
@@ -1,24 +1,31 @@
-%li.key-list-item
- .float-left.append-right-10
+%li.d-flex.align-items-center.key-list-item
+ .append-right-10
- if key.valid?
- = icon 'key', class: 'settings-list-icon d-none d-sm-block'
+ - if key.expired?
+ %span.d-inline-block.has-tooltip{ title: s_('Profiles|Your key has expired') }
+ = sprite_icon('warning-solid', size: 16, css_class: 'settings-list-icon d-none d-sm-block')
+ - else
+ = sprite_icon('key', size: 16, css_class: 'settings-list-icon d-none d-sm-block ')
- else
- = icon 'exclamation-triangle', class: 'settings-list-icon d-none d-sm-block has-tooltip',
- title: key.errors.full_messages.join(', ')
+ %span.d-inline-block.has-tooltip{ title: key.errors.full_messages.join(', ') }
+ = sprite_icon('warning-solid', size: 16, css_class: 'settings-list-icon d-none d-sm-block')
-
- .key-list-item-info
+ .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
- .last-used-at
- last used:
- = key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : 'n/a'
- .float-right
- %span.key-created-at
- = s_('Profiles|Created %{time_ago}'.html_safe) % { time_ago:time_ago_with_tooltip(key.created_at)}
- - if key.can_delete?
- = link_to path_to_key(key, is_admin), data: { confirm: _('Are you sure?')}, method: :delete, class: "btn btn-transparent prepend-left-10" do
- %span.sr-only= _('Remove')
- = icon('trash')
+
+ .key-list-item-dates.d-flex.align-items-start.justify-content-between
+ %span.last-used-at.append-right-10
+ = s_('Profiles|Last used:')
+ = key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : _('Never')
+ %span.expires.append-right-10
+ = s_('Profiles|Expires:')
+ = key.expires_at ? key.expires_at.to_date : _('Never')
+ %span.key-created-at
+ = s_('Profiles|Created %{time_ago}'.html_safe) % { time_ago:time_ago_with_tooltip(key.created_at)}
+ - if key.can_delete?
+ = link_to path_to_key(key, is_admin), data: { confirm: _('Are you sure?')}, method: :delete, class: "btn btn-transparent prepend-left-10 align-baseline" do
+ %span.sr-only= _('Remove')
+ = sprite_icon('remove', size: 16)
diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml
index 02f1a267044..88deb0f11cb 100644
--- a/app/views/profiles/keys/_key_details.html.haml
+++ b/app/views/profiles/keys/_key_details.html.haml
@@ -12,8 +12,11 @@
%span.light= _('Created on:')
%strong= @key.created_at.to_s(:medium)
%li
+ %span.light= _('Expires:')
+ %strong= @key.expires_at.try(:to_s, :medium) || _('Never')
+ %li
%span.light= _('Last used on:')
- %strong= @key.last_used_at.try(:to_s, :medium) || 'N/A'
+ %strong= @key.last_used_at.try(:to_s, :medium) || _('Never')
.col-md-8
= form_errors(@key, type: 'key') unless @key.valid?
diff --git a/app/views/profiles/keys/_key_table.html.haml b/app/views/profiles/keys/_key_table.html.haml
index 8b862522645..176d7a42002 100644
--- a/app/views/profiles/keys/_key_table.html.haml
+++ b/app/views/profiles/keys/_key_table.html.haml
@@ -1,7 +1,7 @@
- is_admin = local_assigns.fetch(:admin, false)
- if @keys.any?
- %ul.content-list{ data: { qa_selector: 'ssh_keys_list' } }
+ %ul.content-list.ssh-keys-list{ data: { qa_selector: 'ssh_keys_list' } }
= render partial: 'profiles/keys/key', collection: @keys, locals: { is_admin: is_admin }
- else
%p.settings-message.text-center