Skip to content

Commit

Permalink
thoughtbot customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisk-tbot committed Dec 29, 2023
1 parent 90371a4 commit 3002845
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;

return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (isOnlyWhitespace && !anyMedia));
};

handleSubmit = (e) => {
Expand Down Expand Up @@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent {
</div>

<div className='character-counter__wrapper'>
<CharacterCounter max={500} text={this.getFulltextForCharacterCounting()} />
<CharacterCounter max={5000} text={this.getFulltextForCharacterCounting()} />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ class InteractionModal extends React.PureComponent {
<IntlLoginForm resourceUrl={url} />

<p className='hint'><FormattedMessage id='interaction_modal.sign_in_hint' defaultMessage="Tip: That's the website where you signed up. If you don't remember, look for the welcome e-mail in your inbox. You can also enter your full username! (e.g. @Mastodon@mastodon.social)" /></p>
<p><FormattedMessage id='interaction_modal.no_account_yet' defaultMessage='Not on Mastodon?' /> {signupButton}</p>
</div>
);
}
Expand Down
1 change: 0 additions & 1 deletion app/javascript/mastodon/features/ui/components/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class Header extends PureComponent {

content = (
<>
{signupButton}
<a href='/auth/sign_in' className='button button-tertiary'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Login' /></a>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const SignInBanner = () => {
return (
<div className='sign-in-banner'>
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Login to follow profiles or hashtags, favorite, share and reply to posts. You can also interact from your account on a different server.' /></p>
{signupButton}
<a href='/auth/sign_in' className='button button--block button-tertiary'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Login' /></a>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/account_avatar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module AccountAvatar
extend ActiveSupport::Concern

IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
LIMIT = 2.megabytes
LIMIT = 10.megabytes

class_methods do
def avatar_styles(file)
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/account_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module AccountHeader
extend ActiveSupport::Concern

IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
LIMIT = 2.megabytes
MAX_PIXELS = 750_000 # 1500x500px
LIMIT = 10.megabytes
MAX_PIXELS = MAX_PIXELS = 5_000_000 # 1500x500px

class_methods do
def header_styles(file)
Expand Down
6 changes: 5 additions & 1 deletion app/serializers/rest/instance_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ContactSerializer < ActiveModel::Serializer

attributes :domain, :title, :version, :source_url, :description,
:usage, :thumbnail, :languages, :configuration,
:registrations
:registrations, :max_toot_chars

has_one :contact, serializer: ContactSerializer
has_many :rules, serializer: REST::RuleSerializer
Expand Down Expand Up @@ -89,6 +89,10 @@ def registrations
}
end

def max_toot_chars
5000
end

private

def registrations_enabled?
Expand Down
2 changes: 1 addition & 1 deletion app/validators/status_length_validator.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = 5000
URL_PLACEHOLDER_CHARS = 23
URL_PLACEHOLDER = 'x' * 23

Expand Down
Loading

0 comments on commit 3002845

Please sign in to comment.