Commit 00b75f01 by Diana Huang

Merge pull request #7783 from edx/hotfix/2015-04-22

Change image upload input name and not make duplicate of file in data.
parents a0feb211 09d6bb3e
...@@ -605,3 +605,5 @@ PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME' ...@@ -605,3 +605,5 @@ PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME'
PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY) PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY)
PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES) PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES)
PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES) PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES)
if FEATURES['IS_EDX_DOMAIN']:
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/edx-theme/default-profile'
...@@ -2274,9 +2274,7 @@ PROFILE_IMAGE_BACKEND = { ...@@ -2274,9 +2274,7 @@ PROFILE_IMAGE_BACKEND = {
'base_url': os.path.join(MEDIA_URL, 'profile-images/'), 'base_url': os.path.join(MEDIA_URL, 'profile-images/'),
}, },
} }
PROFILE_IMAGE_DEFAULT_FILENAME = ( PROFILE_IMAGE_DEFAULT_FILENAME = 'images/default-theme/default-profile'
'images/edx-theme/default-profile' if FEATURES['IS_EDX_DOMAIN'] else 'images/default-theme/default-profile'
)
PROFILE_IMAGE_DEFAULT_FILE_EXTENSION = 'png' PROFILE_IMAGE_DEFAULT_FILE_EXTENSION = 'png'
# This secret key is used in generating unguessable URLs to users' # This secret key is used in generating unguessable URLs to users'
# profile images. Once it has been set, changing it will make the # profile images. Once it has been set, changing it will make the
......
...@@ -583,6 +583,7 @@ ...@@ -583,6 +583,7 @@
render: function () { render: function () {
this.$el.html(this.template({ this.$el.html(this.template({
id: this.options.valueAttribute, id: this.options.valueAttribute,
inputName: (this.options.inputName || 'file'),
imageUrl: _.result(this, 'imageUrl'), imageUrl: _.result(this, 'imageUrl'),
imageAltText: _.result(this, 'imageAltText'), imageAltText: _.result(this, 'imageAltText'),
uploadButtonIcon: _.result(this, 'iconUpload'), uploadButtonIcon: _.result(this, 'iconUpload'),
...@@ -679,7 +680,6 @@ ...@@ -679,7 +680,6 @@
fileSelected: function (e, data) { fileSelected: function (e, data) {
if (_.isUndefined(data.files[0].size) || this.validateImageSize(data.files[0].size)) { if (_.isUndefined(data.files[0].size) || this.validateImageSize(data.files[0].size)) {
data.formData = {file: data.files[0]};
this.setCurrentStatus('uploading'); this.setCurrentStatus('uploading');
this.setRemoveButtonVisibility('none'); this.setRemoveButtonVisibility('none');
this.showUploadInProgressMessage(); this.showUploadInProgressMessage();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<label class="u-field-upload-button"> <label class="u-field-upload-button">
<span class="upload-button-icon" aria-hidden="true"><%= uploadButtonIcon %></span> <span class="upload-button-icon" aria-hidden="true"><%= uploadButtonIcon %></span>
<span class="upload-button-title" aria-live="polite"><%= uploadButtonTitle %></span> <span class="upload-button-title" aria-live="polite"><%= uploadButtonTitle %></span>
<input class="upload-button-input" type="file" name="<%= id %>"/> <input class="upload-button-input" type="file" name="<%= inputName %>"/>
</label> </label>
<button class="upload-submit" type="button" hidden="true"><%= uploadButtonTitle %></button> <button class="upload-submit" type="button" hidden="true"><%= uploadButtonTitle %></button>
......
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