- {{d-icon "far-image"}}
- {{#if this.uploading}}
- {{i18n "uploading"}}
- {{this.uploadProgress}}%
- {{else}}
- {{i18n "upload"}}
- {{/if}}
-
-
+/>
{{#if this.imageIsNotASquare}}
{{i18n "user.change_avatar.image_is_not_a_square"}}
diff --git a/app/assets/javascripts/discourse/app/components/avatar-uploader.js b/app/assets/javascripts/discourse/app/components/avatar-uploader.js
index f72a0d71943..6796d94a052 100644
--- a/app/assets/javascripts/discourse/app/components/avatar-uploader.js
+++ b/app/assets/javascripts/discourse/app/components/avatar-uploader.js
@@ -2,6 +2,8 @@ import Component from "@ember/component";
import { isBlank } from "@ember/utils";
import UppyUploadMixin from "discourse/mixins/uppy-upload";
import discourseComputed from "discourse-common/utils/decorators";
+import { action } from "@ember/object";
+import I18n from "I18n";
export default Component.extend(UppyUploadMixin, {
type: "avatar",
@@ -31,4 +33,16 @@ export default Component.extend(UppyUploadMixin, {
data(user_id) {
return { user_id };
},
+
+ @discourseComputed("uploading", "uploadProgress")
+ uploadLabel() {
+ return this.uploading
+ ? `${I18n.t("uploading")} ${this.uploadProgress}%`
+ : I18n.t("upload");
+ },
+
+ @action
+ chooseImage() {
+ this.fileInputEl.click();
+ },
});