Skip to content

Commit

Permalink
Change profile metadata from 4 to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo committed Jan 16, 2023
1 parent 7e8c445 commit ad6255c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class Account < ApplicationRecord
MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[[:word:]\.\-]+[a-z0-9]+)?)/i
URL_PREFIX_RE = /\Ahttp(s?):\/\/[^\/]+/

DEFAULT_FIELDS_SIZE = 8

include AccountAssociations
include AccountAvatar
include AccountFinderConcern
Expand Down Expand Up @@ -98,7 +100,7 @@ class Account < ApplicationRecord
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 :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 :local, -> { where(domain: nil) }
Expand Down Expand Up @@ -348,8 +350,6 @@ def fields_attributes=(attributes)
self[:fields] = fields
end

DEFAULT_FIELDS_SIZE = 4

def build_fields
return if fields.size >= DEFAULT_FIELDS_SIZE

Expand Down
2 changes: 1 addition & 1 deletion app/views/settings/profiles/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
.fields-row__column.fields-group.fields-row__column-6
.input.with_block_label
%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|
.row
Expand Down
2 changes: 1 addition & 1 deletion config/locales/simple_form.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ en:
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
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
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
Expand Down
2 changes: 1 addition & 1 deletion config/locales/simple_form.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ja:
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
discoverable: ディレクトリはあなたのアカウントをより多くの人に見つけてもらうためのひとつの手段です
email: 確認のメールが送信されます
fields: プロフィールに表として4つまでの項目を表示することができます
fields: プロフィールに表として%{size}つまでの項目を表示することができます
header: "%{size}までのPNG、GIF、JPGが利用可能です。 %{dimensions}pxまで縮小されます"
inbox_url: 使用したいリレーサーバーのトップページからURLをコピーします
irreversible: フィルターが後で削除されても、除外された投稿は元に戻せなくなります
Expand Down

0 comments on commit ad6255c

Please sign in to comment.