Преглед изворни кода

Change max length of media descriptions from 420 to 1500 characters (#11819)

Fix #11658
master^2
Eugen Rochko пре 4 година
committed by GitHub
родитељ
комит
b6381bdc7d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 измењених фајлова са 2 додато и 2 уклоњено
  1. +1
    -1
      app/javascript/mastodon/features/ui/components/focal_point_modal.js
  2. +1
    -1
      app/models/media_attachment.rb

+ 1
- 1
app/javascript/mastodon/features/ui/components/focal_point_modal.js Прегледај датотеку

@@ -223,7 +223,7 @@ class FocalPointModal extends ImmutablePureComponent {

<div className='setting-text__toolbar'>
<button disabled={detecting || media.get('type') !== 'image'} className='link-button' onClick={this.handleTextDetection}><FormattedMessage id='upload_modal.detect_text' defaultMessage='Detect text from picture' /></button>
<CharacterCounter max={420} text={detecting ? '' : description} />
<CharacterCounter max={1500} text={detecting ? '' : description} />
</div>

<Button disabled={!dirty || detecting || length(description) > 420} text={intl.formatMessage(messages.apply)} onClick={this.handleSubmit} />


+ 1
- 1
app/models/media_attachment.rb Прегледај датотеку

@@ -123,7 +123,7 @@ class MediaAttachment < ApplicationRecord
include Attachmentable

validates :account, presence: true
validates :description, length: { maximum: 420 }, if: :local?
validates :description, length: { maximum: 1_500 }, if: :local?

scope :attached, -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }


Loading…
Откажи
Сачувај