Change profile metadata from 4 to 8
This commit is contained in:
parent
531fa67246
commit
2ba7bd61e9
4 changed files with 6 additions and 6 deletions
|
@ -66,6 +66,8 @@ class Account < ApplicationRecord
|
||||||
MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[[:word:]\.\-]+[a-z0-9]+)?)/i
|
MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[[:word:]\.\-]+[a-z0-9]+)?)/i
|
||||||
URL_PREFIX_RE = /\Ahttp(s?):\/\/[^\/]+/
|
URL_PREFIX_RE = /\Ahttp(s?):\/\/[^\/]+/
|
||||||
|
|
||||||
|
DEFAULT_FIELDS_SIZE = 8
|
||||||
|
|
||||||
include AccountAssociations
|
include AccountAssociations
|
||||||
include AccountAvatar
|
include AccountAvatar
|
||||||
include AccountFinderConcern
|
include AccountFinderConcern
|
||||||
|
@ -100,7 +102,7 @@ class Account < ApplicationRecord
|
||||||
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? }
|
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? }
|
||||||
validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
|
validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
|
||||||
validates :note, note_length: { maximum: 500 }, if: -> { local? && will_save_change_to_note? }
|
validates :note, note_length: { maximum: 500 }, if: -> { local? && will_save_change_to_note? }
|
||||||
validates :fields, length: { maximum: 4 }, if: -> { local? && will_save_change_to_fields? }
|
validates :fields, length: { maximum: DEFAULT_FIELDS_SIZE }, if: -> { local? && will_save_change_to_fields? }
|
||||||
|
|
||||||
scope :remote, -> { where.not(domain: nil) }
|
scope :remote, -> { where.not(domain: nil) }
|
||||||
scope :local, -> { where(domain: nil) }
|
scope :local, -> { where(domain: nil) }
|
||||||
|
@ -360,8 +362,6 @@ class Account < ApplicationRecord
|
||||||
self[:fields] = fields
|
self[:fields] = fields
|
||||||
end
|
end
|
||||||
|
|
||||||
DEFAULT_FIELDS_SIZE = 4
|
|
||||||
|
|
||||||
def build_fields
|
def build_fields
|
||||||
return if fields.size >= DEFAULT_FIELDS_SIZE
|
return if fields.size >= DEFAULT_FIELDS_SIZE
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
.fields-row__column.fields-group.fields-row__column-6
|
.fields-row__column.fields-group.fields-row__column-6
|
||||||
.input.with_block_label
|
.input.with_block_label
|
||||||
%label= t('simple_form.labels.defaults.fields')
|
%label= t('simple_form.labels.defaults.fields')
|
||||||
%span.hint= t('simple_form.hints.defaults.fields')
|
%span.hint= t('simple_form.hints.defaults.fields', size: Account::DEFAULT_FIELDS_SIZE)
|
||||||
|
|
||||||
= f.simple_fields_for :fields do |fields_f|
|
= f.simple_fields_for :fields do |fields_f|
|
||||||
.row
|
.row
|
||||||
|
|
|
@ -42,7 +42,7 @@ en:
|
||||||
digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence
|
digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence
|
||||||
discoverable: Allow your account to be discovered by strangers through recommendations and other features
|
discoverable: Allow your account to be discovered by strangers through recommendations and other features
|
||||||
email: You will be sent a confirmation e-mail
|
email: You will be sent a confirmation e-mail
|
||||||
fields: You can have up to 4 items displayed as a table on your profile
|
fields: You can have up to %{size} items displayed as a table on your profile
|
||||||
header: PNG, GIF or JPG. At most %{size}. Will be downscaled to %{dimensions}px
|
header: PNG, GIF or JPG. At most %{size}. Will be downscaled to %{dimensions}px
|
||||||
inbox_url: Copy the URL from the frontpage of the relay you want to use
|
inbox_url: Copy the URL from the frontpage of the relay you want to use
|
||||||
irreversible: Filtered posts will disappear irreversibly, even if filter is later removed
|
irreversible: Filtered posts will disappear irreversibly, even if filter is later removed
|
||||||
|
|
|
@ -42,7 +42,7 @@ ja:
|
||||||
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
|
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
|
||||||
discoverable: ディレクトリはあなたのアカウントをより多くの人に見つけてもらうためのひとつの手段です
|
discoverable: ディレクトリはあなたのアカウントをより多くの人に見つけてもらうためのひとつの手段です
|
||||||
email: 確認のメールが送信されます
|
email: 確認のメールが送信されます
|
||||||
fields: プロフィールに表として4つまでの項目を表示することができます
|
fields: プロフィールに表として%{size}つまでの項目を表示することができます
|
||||||
header: "%{size}までのPNG、GIF、JPGが利用可能です。 %{dimensions}pxまで縮小されます"
|
header: "%{size}までのPNG、GIF、JPGが利用可能です。 %{dimensions}pxまで縮小されます"
|
||||||
inbox_url: 使用したいリレーサーバーのトップページからURLをコピーします
|
inbox_url: 使用したいリレーサーバーのトップページからURLをコピーします
|
||||||
irreversible: フィルターが後で削除されても、除外された投稿は元に戻せなくなります
|
irreversible: フィルターが後で削除されても、除外された投稿は元に戻せなくなります
|
||||||
|
|
Loading…
Reference in a new issue