Change avatar file size to 200kb.
This commit is contained in:
parent
3a723ad24c
commit
8f60144782
4 changed files with 4 additions and 4 deletions
|
@ -8,7 +8,7 @@ v 7.6.0
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
- Change maximum avatar file size from 100KB to 200KB
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
|
|
@ -124,7 +124,7 @@ class User < ActiveRecord::Base
|
||||||
validate :namespace_uniq, if: ->(user) { user.username_changed? }
|
validate :namespace_uniq, if: ->(user) { user.username_changed? }
|
||||||
validate :avatar_type, if: ->(user) { user.avatar_changed? }
|
validate :avatar_type, if: ->(user) { user.avatar_changed? }
|
||||||
validate :unique_email, if: ->(user) { user.email_changed? }
|
validate :unique_email, if: ->(user) { user.email_changed? }
|
||||||
validates :avatar, file_size: { maximum: 100.kilobytes.to_i }
|
validates :avatar, file_size: { maximum: 200.kilobytes.to_i }
|
||||||
|
|
||||||
before_validation :generate_password, on: :create
|
before_validation :generate_password, on: :create
|
||||||
before_validation :sanitize_attrs
|
before_validation :sanitize_attrs
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
%span.file_name.js-avatar-filename File name...
|
%span.file_name.js-avatar-filename File name...
|
||||||
= f.file_field :avatar, class: "js-user-avatar-input hidden"
|
= f.file_field :avatar, class: "js-user-avatar-input hidden"
|
||||||
.light The maximum file size allowed is 100KB.
|
.light The maximum file size allowed is 200KB.
|
||||||
- if @user.avatar?
|
- if @user.avatar?
|
||||||
%hr
|
%hr
|
||||||
= link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar"
|
= link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-small remove-avatar"
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
%span.file_name.js-avatar-filename File name...
|
%span.file_name.js-avatar-filename File name...
|
||||||
= f.file_field :avatar, class: 'js-group-avatar-input hidden'
|
= f.file_field :avatar, class: 'js-group-avatar-input hidden'
|
||||||
.light The maximum file size allowed is 100KB.
|
.light The maximum file size allowed is 200KB.
|
||||||
|
|
Loading…
Reference in a new issue