Merge branch '40780-choose-file' into 'master'

Resolve "Rename "Browse file" inputs to "Choose file""

Closes #40780

See merge request gitlab-org/gitlab-ce!16092
This commit is contained in:
Tim Zallmann 2018-01-02 11:23:22 +00:00
commit 91864a92b9
5 changed files with 28 additions and 30 deletions

View file

@ -13,13 +13,13 @@
= group_icon(@group, alt: '', class: 'avatar group-avatar s160')
%p.light
- if @group.avatar?
You can change your group avatar here
You can change the group avatar here
- else
You can upload a group avatar here
= render 'shared/choose_group_avatar_button', f: f
- if @group.avatar?
%hr
= link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
= link_to _('Remove avatar'), group_avatar_path(@group.to_param), data: { confirm: _("Avatar will be removed. Are you sure?")}, method: :delete, class: "btn btn-danger btn-inverted"
= render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group

View file

@ -22,18 +22,15 @@
.clearfix.avatar-image.append-bottom-default
= link_to avatar_icon(@user, 400), target: '_blank', rel: 'noopener noreferrer' do
= image_tag avatar_icon(@user, 160), alt: '', class: 'avatar s160'
%h5.prepend-top-0
Upload new avatar
%h5.prepend-top-0= _("Upload new avatar")
.prepend-top-5.append-bottom-10
%a.btn.js-choose-user-avatar-button
Browse file...
%span.avatar-file-name.prepend-left-default.js-avatar-filename No file chosen
%button.btn.js-choose-user-avatar-button{ type: 'button' }= _("Choose file...")
%span.avatar-file-name.prepend-left-default.js-avatar-filename= _("No file chosen")
= f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*'
.help-block
The maximum file size allowed is 200KB.
.help-block= _("The maximum file size allowed is 200KB.")
- if @user.avatar?
%hr
= link_to 'Remove avatar', profile_avatar_path, data: { confirm: 'Avatar will be removed. Are you sure?' }, method: :delete, class: 'btn btn-gray'
= link_to _('Remove avatar'), profile_avatar_path, data: { confirm: _('Avatar will be removed. Are you sure?') }, method: :delete, class: 'btn btn-danger btn-inverted'
%hr
.row
.col-lg-4.profile-settings-sidebar

View file

@ -42,24 +42,23 @@
= f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control"
%p.help-block Separate tags with commas.
%fieldset.features
%h5.prepend-top-0
Project avatar
%h5.prepend-top-0= _("Project avatar")
.form-group
- if @project.avatar?
.avatar-container.s160
.avatar-container.s160.append-bottom-15
= project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160')
%p.light
- if @project.avatar_in_git
Project avatar in repository: #{ @project.avatar_in_git }
%a.choose-btn.btn.js-choose-project-avatar-button
Browse file...
%span.file_name.prepend-left-default.js-avatar-filename No file chosen
= f.file_field :avatar, class: "js-project-avatar-input hidden"
.help-block The maximum file size allowed is 200KB.
- if @project.avatar_in_git
%p.light
= _("Project avatar in repository: %{link}").html_safe % { link: @project.avatar_in_git }
.prepend-top-5.append-bottom-10
%button.btn.js-choose-project-avatar-button{ type: 'button' }= _("Choose file...")
%span.file_name.prepend-left-default.js-avatar-filename= _("No file chosen")
= f.file_field :avatar, class: "js-project-avatar-input hidden"
.help-block= _("The maximum file size allowed is 200KB.")
- if @project.avatar?
%hr
= link_to 'Remove avatar', project_avatar_path(@project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
= f.submit 'Save changes', class: "btn btn-save"
= link_to _('Remove avatar'), project_avatar_path(@project), data: { confirm: _("Avatar will be removed. Are you sure?") }, method: :delete, class: "btn btn-danger btn-inverted"
= f.submit 'Save changes', class: "btn btn-success"
%section.settings.sharing-permissions.no-animate{ class: ('expanded' if expanded) }
.settings-header

View file

@ -1,7 +1,4 @@
%button.choose-btn.btn.btn-sm.js-choose-group-avatar-button{ type: 'button' }
%i.fa.fa-paperclip
%span Choose File ...
 
%span.file_name.js-avatar-filename File name...
= f.file_field :avatar, class: 'js-group-avatar-input hidden'
.light The maximum file size allowed is 200KB.
%button.btn.js-choose-group-avatar-button{ type: 'button' }= _("Choose File ...")
%span.file_name.js-avatar-filename= _("No file chosen")
= f.file_field :avatar, class: "js-group-avatar-input hidden"
.help-block= _("The maximum file size allowed is 200KB.")

View file

@ -0,0 +1,5 @@
---
title: Update Browse file to Choose file in all occurences
merge_request:
author:
type: other