Commit ce8cf72b authored by antony liu's avatar antony liu Committed by Fatih Acet

Externalize strings of access tokens page in user profile

parent 23f5dcf6
- breadcrumb_title "Access Tokens"
- page_title "Personal Access Tokens"
- breadcrumb_title s_('AccessTokens|Access Tokens')
- page_title s_('AccessTokens|Personal Access Tokens')
- @content_class = "limit-container-width" unless fluid_layout
.row.prepend-top-default
......@@ -7,10 +7,10 @@
%h4.prepend-top-0
= page_title
%p
You can generate a personal access token for each application you use that needs access to the GitLab API.
= s_('AccessTokens|You can generate a personal access token for each application you use that needs access to the GitLab API.')
%p
You can also use personal access tokens to authenticate against Git over HTTP.
They are the only accepted password when you have Two-Factor Authentication (2FA) enabled.
= s_('AccessTokens|You can also use personal access tokens to authenticate against Git over HTTP.')
= s_('AccessTokens|They are the only accepted password when you have Two-Factor Authentication (2FA) enabled.')
.col-lg-8
- if @new_personal_access_token
......@@ -24,35 +24,33 @@
.row.prepend-top-default
.col-lg-4.profile-settings-sidebar
%h4.prepend-top-0
Feed token
= s_('AccessTokens|Feed token')
%p
Your feed token is used to authenticate you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar, and is included in those feed URLs.
= s_('AccessTokens|Your feed token is used to authenticate you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar, and is included in those feed URLs.')
%p
It cannot be used to access any other data.
= s_('AccessTokens|It cannot be used to access any other data.')
.col-lg-8.feed-token-reset
= label_tag :feed_token, 'Feed token', class: "label-bold"
= label_tag :feed_token, s_('AccessTokens|Feed token'), class: "label-bold"
= text_field_tag :feed_token, current_user.feed_token, class: 'form-control', readonly: true, onclick: 'this.select()'
%p.form-text.text-muted
Keep this token secret. Anyone who gets ahold of it can read activity and issue RSS feeds or your calendar feed as if they were you.
You should
= link_to 'reset it', [:reset, :feed_token, :profile], method: :put, data: { confirm: 'Are you sure? Any RSS or calendar URLs currently in use will stop working.' }
if that ever happens.
- reset_link = link_to s_('AccessTokens|reset it'), [:reset, :feed_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any RSS or calendar URLs currently in use will stop working.') }
- reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can read activity and issue RSS feeds or your calendar feed as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link }
= reset_message.html_safe
- if incoming_email_token_enabled?
%hr
.row.prepend-top-default
.col-lg-4.profile-settings-sidebar
%h4.prepend-top-0
Incoming email token
= s_('AccessTokens|Incoming email token')
%p
Your incoming email token is used to authenticate you when you create a new issue by email, and is included in your personal project-specific email addresses.
= s_('AccessTokens|Your incoming email token is used to authenticate you when you create a new issue by email, and is included in your personal project-specific email addresses.')
%p
It cannot be used to access any other data.
= s_('AccessTokens|It cannot be used to access any other data.')
.col-lg-8.incoming-email-token-reset
= label_tag :incoming_email_token, 'Incoming email token', class: "label-bold"
= label_tag :incoming_email_token, s_('AccessTokens|Incoming email token'), class: "label-bold"
= text_field_tag :incoming_email_token, current_user.incoming_email_token, class: 'form-control', readonly: true, onclick: 'this.select()'
%p.form-text.text-muted
Keep this token secret. Anyone who gets ahold of it can create issues as if they were you.
You should
= link_to 'reset it', [:reset, :incoming_email_token, :profile], method: :put, data: { confirm: 'Are you sure? Any issue email addresses currently in use will stop working.' }
if that ever happens.
- reset_link = link_to s_('AccessTokens|reset it'), [:reset, :incoming_email_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any issue email addresses currently in use will stop working.') }
- reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can create issues as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link }
= reset_message.html_safe
- container_title = local_assigns.fetch(:container_title, 'Your New Personal Access Token')
- clipboard_button_title = local_assigns.fetch(:clipboard_button_title, 'Copy personal access token to clipboard')
- container_title = local_assigns.fetch(:container_title, _('Your New Personal Access Token'))
- clipboard_button_title = local_assigns.fetch(:clipboard_button_title, _('Copy personal access token to clipboard'))
.created-personal-access-token-container
%h5.prepend-top-0
......@@ -9,6 +9,7 @@
= text_field_tag 'created-personal-access-token', new_token_value, readonly: true, class: "qa-created-personal-access-token form-control js-select-on-focus", 'aria-describedby' => "created-token-help-block"
%span.input-group-append
= clipboard_button(text: new_token_value, title: clipboard_button_title, placement: "left", class: "input-group-text btn-default btn-clipboard")
%span#created-token-help-block.form-text.text-muted.text-danger Make sure you save it - you won't be able to access it again.
%span#created-token-help-block.form-text.text-muted.text-danger
= _("Make sure you save it - you won't be able to access it again.")
%hr
- type = impersonation ? "impersonation" : "personal access"
- type = impersonation ? s_('Profiles|impersonation') : s_('Profiles|personal access')
%h5.prepend-top-0
Add a #{type} token
= _('Add a %{type} token') % { type: type }
%p.profile-settings-content
Pick a name for the application, and we'll give you a unique #{type} token.
= _("Pick a name for the application, and we'll give you a unique %{type} token.") % { type: type }
= form_for token, url: path, method: :post, html: { class: 'js-requires-input' } do |f|
......@@ -11,19 +11,19 @@
.row
.form-group.col-md-6
= f.label :name, class: 'label-bold'
= f.label :name, _('Name'), class: 'label-bold'
= f.text_field :name, class: "form-control qa-personal-access-token-name-field", required: true
.row
.form-group.col-md-6
= f.label :expires_at, class: 'label-bold'
= f.label :expires_at, _('Expires at'), class: 'label-bold'
.input-icon-wrapper
= f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD'
= icon('calendar', { class: 'input-icon-right' })
.form-group
= f.label :scopes, class: 'label-bold'
= f.label :scopes, _('Scopes'), class: 'label-bold'
= render 'shared/tokens/scopes_form', prefix: 'personal_access_token', token: token, scopes: scopes
.prepend-top-default
= f.submit "Create #{type} token", class: "btn btn-success qa-create-token-button"
= f.submit _('Create %{type} token') % { type: type }, class: "btn btn-success qa-create-token-button"
- type = impersonation ? "Impersonation" : "Personal Access"
- type = impersonation ? s_('Profiles|Impersonation') : s_('Profiles|Personal Access')
%hr
%h5 Active #{type} Tokens (#{active_tokens.length})
%h5
= _('Active %{type} Tokens (%{token_length})') % { type: type, token_length: active_tokens.length }
- if impersonation
%p.profile-settings-content
To see all the user's personal access tokens you must impersonate them first.
= _("To see all the user's personal access tokens you must impersonate them first.")
- if active_tokens.present?
.table-responsive
%table.table.active-tokens
%thead
%tr
%th Name
%th Created
%th Expires
%th Scopes
%th= _('Name')
%th= s_('AccessTokens|Created')
%th= _('Expires')
%th= _('Scopes')
%th
%tbody
- active_tokens.each do |token|
......@@ -26,10 +27,10 @@
%span{ class: ('text-warning' if token.expires_soon?) }
In #{distance_of_time_in_words_to_now(token.expires_at)}
- else
%span.token-never-expires-label Never
%td= token.scopes.present? ? token.scopes.join(", ") : "<no scopes selected>"
%span.token-never-expires-label= _('Never')
%td= token.scopes.present? ? token.scopes.join(", ") : _('<no scopes selected>')
- path = impersonation ? revoke_admin_user_impersonation_token_path(token.user, token) : revoke_profile_personal_access_token_path(token)
%td= link_to "Revoke", path, method: :put, class: "btn btn-danger float-right qa-revoke-button", data: { confirm: "Are you sure you want to revoke this #{type} Token? This action cannot be undone." }
%td= link_to _('Revoke'), path, method: :put, class: "btn btn-danger float-right qa-revoke-button", data: { confirm: _('Are you sure you want to revoke this %{type} Token? This action cannot be undone.') % { type: type } }
- else
.settings-message.text-center
This user has no active #{type} Tokens.
= _('This user has no active %{type} Tokens.') % { type: type }
......@@ -4,7 +4,7 @@
%tr
%td
Scopes
= _('Scopes')
%td
%ul.scopes-list.append-bottom-0
- token.scopes.each do |scope|
......
......@@ -396,6 +396,9 @@ msgstr ""
msgid "<no name set>"
msgstr ""
msgid "<no scopes selected>"
msgstr ""
msgid "<strong>%{changedFilesLength} unstaged</strong> and <strong>%{stagedFilesLength} staged</strong> changes"
msgstr ""
......@@ -507,6 +510,54 @@ msgstr ""
msgid "Access to '%{classification_label}' not allowed"
msgstr ""
msgid "AccessTokens|Access Tokens"
msgstr ""
msgid "AccessTokens|Are you sure? Any RSS or calendar URLs currently in use will stop working."
msgstr ""
msgid "AccessTokens|Are you sure? Any issue email addresses currently in use will stop working."
msgstr ""
msgid "AccessTokens|Created"
msgstr ""
msgid "AccessTokens|Feed token"
msgstr ""
msgid "AccessTokens|Incoming email token"
msgstr ""
msgid "AccessTokens|It cannot be used to access any other data."
msgstr ""
msgid "AccessTokens|Keep this token secret. Anyone who gets ahold of it can create issues as if they were you. You should %{link_reset_it} if that ever happens."
msgstr ""
msgid "AccessTokens|Keep this token secret. Anyone who gets ahold of it can read activity and issue RSS feeds or your calendar feed as if they were you. You should %{link_reset_it} if that ever happens."
msgstr ""
msgid "AccessTokens|Personal Access Tokens"
msgstr ""
msgid "AccessTokens|They are the only accepted password when you have Two-Factor Authentication (2FA) enabled."
msgstr ""
msgid "AccessTokens|You can also use personal access tokens to authenticate against Git over HTTP."
msgstr ""
msgid "AccessTokens|You can generate a personal access token for each application you use that needs access to the GitLab API."
msgstr ""
msgid "AccessTokens|Your feed token is used to authenticate you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar, and is included in those feed URLs."
msgstr ""
msgid "AccessTokens|Your incoming email token is used to authenticate you when you create a new issue by email, and is included in your personal project-specific email addresses."
msgstr ""
msgid "AccessTokens|reset it"
msgstr ""
msgid "Account"
msgstr ""
......@@ -519,6 +570,9 @@ msgstr ""
msgid "Active"
msgstr ""
msgid "Active %{type} Tokens (%{token_length})"
msgstr ""
msgid "Active Sessions"
msgstr ""
......@@ -537,6 +591,9 @@ msgstr ""
msgid "Add README"
msgstr ""
msgid "Add a %{type} token"
msgstr ""
msgid "Add a GPG key"
msgstr ""
......@@ -1164,6 +1221,9 @@ msgstr ""
msgid "Are you sure you want to reset the health check token?"
msgstr ""
msgid "Are you sure you want to revoke this %{type} Token? This action cannot be undone."
msgstr ""
msgid "Are you sure you want to revoke this nickname?"
msgstr ""
......@@ -2992,6 +3052,9 @@ msgstr ""
msgid "Copy link"
msgstr ""
msgid "Copy personal access token to clipboard"
msgstr ""
msgid "Copy reference to clipboard"
msgstr ""
......@@ -3040,6 +3103,9 @@ msgstr ""
msgid "Create"
msgstr ""
msgid "Create %{type} token"
msgstr ""
msgid "Create New Directory"
msgstr ""
......@@ -4245,6 +4311,12 @@ msgstr ""
msgid "Expired %{expiredOn}"
msgstr ""
msgid "Expires"
msgstr ""
msgid "Expires at"
msgstr ""
msgid "Expires in %{expires_at}"
msgstr ""
......@@ -5957,6 +6029,9 @@ msgstr ""
msgid "Make issue confidential."
msgstr ""
msgid "Make sure you save it - you won't be able to access it again."
msgstr ""
msgid "Make sure you're logged into the account that owns the projects you'd like to import."
msgstr ""
......@@ -7086,6 +7161,9 @@ msgstr ""
msgid "Pick a name"
msgstr ""
msgid "Pick a name for the application, and we'll give you a unique %{type} token."
msgstr ""
msgid "Pin code"
msgstr ""
......@@ -7611,6 +7689,9 @@ msgstr ""
msgid "Profiles|Full name"
msgstr ""
msgid "Profiles|Impersonation"
msgstr ""
msgid "Profiles|Include private contributions on my profile"
msgstr ""
......@@ -7653,6 +7734,9 @@ msgstr ""
msgid "Profiles|Path"
msgstr ""
msgid "Profiles|Personal Access"
msgstr ""
msgid "Profiles|Position and size your new avatar"
msgstr ""
......@@ -7788,6 +7872,12 @@ msgstr ""
msgid "Profiles|e.g. My MacBook key"
msgstr ""
msgid "Profiles|impersonation"
msgstr ""
msgid "Profiles|personal access"
msgstr ""
msgid "Profiles|username"
msgstr ""
......@@ -8821,6 +8911,9 @@ msgstr ""
msgid "Scoped label"
msgstr ""
msgid "Scopes"
msgstr ""
msgid "Scroll down to <strong>Google Code Project Hosting</strong> and enable the switch on the right."
msgstr ""
......@@ -10538,6 +10631,9 @@ msgstr ""
msgid "This user cannot be unlocked manually from GitLab"
msgstr ""
msgid "This user has no active %{type} Tokens."
msgstr ""
msgid "This user has no identities"
msgstr ""
......@@ -10803,6 +10899,9 @@ msgstr ""
msgid "To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed."
msgstr ""
msgid "To see all the user's personal access tokens you must impersonate them first."
msgstr ""
msgid "To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there."
msgstr ""
......@@ -12026,6 +12125,9 @@ msgstr ""
msgid "Your Groups"
msgstr ""
msgid "Your New Personal Access Token"
msgstr ""
msgid "Your Primary Email will be used for avatar detection."
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment