mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-26 07:21:51 +00:00
Compare commits
6 Commits
e09234126c
...
74b7f68ab4
Author | SHA1 | Date | |
---|---|---|---|
|
74b7f68ab4 | ||
|
6d62581da1 | ||
|
9a7130d6da | ||
|
e3d9b4405b | ||
|
502fc50939 | ||
|
d52abc6a13 |
2
.github/workflows/bundler-audit.yml
vendored
2
.github/workflows/bundler-audit.yml
vendored
|
@ -36,4 +36,4 @@ jobs:
|
|||
bundler-cache: true
|
||||
|
||||
- name: Run bundler-audit
|
||||
run: bundle exec bundler-audit check --update
|
||||
run: bin/bundler-audit check --update
|
||||
|
|
10
.github/workflows/check-i18n.yml
vendored
10
.github/workflows/check-i18n.yml
vendored
|
@ -35,18 +35,18 @@ jobs:
|
|||
git diff --exit-code
|
||||
|
||||
- name: Check locale file normalization
|
||||
run: bundle exec i18n-tasks check-normalized
|
||||
run: bin/i18n-tasks check-normalized
|
||||
|
||||
- name: Check for unused strings
|
||||
run: bundle exec i18n-tasks unused
|
||||
run: bin/i18n-tasks unused
|
||||
|
||||
- name: Check for missing strings in English YML
|
||||
run: |
|
||||
bundle exec i18n-tasks add-missing -l en
|
||||
bin/i18n-tasks add-missing -l en
|
||||
git diff --exit-code
|
||||
|
||||
- name: Check for wrong string interpolations
|
||||
run: bundle exec i18n-tasks check-consistent-interpolations
|
||||
run: bin/i18n-tasks check-consistent-interpolations
|
||||
|
||||
- name: Check that all required locale files exist
|
||||
run: bundle exec rake repo:check_locales_files
|
||||
run: bin/rake repo:check_locales_files
|
||||
|
|
|
@ -46,7 +46,7 @@ jobs:
|
|||
uses: ./.github/actions/setup-ruby
|
||||
|
||||
- name: Run i18n normalize task
|
||||
run: bundle exec i18n-tasks normalize
|
||||
run: bin/i18n-tasks normalize
|
||||
|
||||
# Create or update the pull request
|
||||
- name: Create Pull Request
|
||||
|
|
2
.github/workflows/crowdin-download.yml
vendored
2
.github/workflows/crowdin-download.yml
vendored
|
@ -48,7 +48,7 @@ jobs:
|
|||
uses: ./.github/actions/setup-ruby
|
||||
|
||||
- name: Run i18n normalize task
|
||||
run: bundle exec i18n-tasks normalize
|
||||
run: bin/i18n-tasks normalize
|
||||
|
||||
# Create or update the pull request
|
||||
- name: Create Pull Request
|
||||
|
|
2
.github/workflows/lint-haml.yml
vendored
2
.github/workflows/lint-haml.yml
vendored
|
@ -43,4 +43,4 @@ jobs:
|
|||
- name: Run haml-lint
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/haml-lint-problem-matcher.json"
|
||||
bundle exec haml-lint --reporter github
|
||||
bin/haml-lint --reporter github
|
||||
|
|
|
@ -1031,7 +1031,7 @@ DEPENDENCIES
|
|||
xorcist (~> 1.1)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.3.5p100
|
||||
ruby 3.3.6p108
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.22
|
||||
2.5.23
|
||||
|
|
|
@ -19,6 +19,11 @@ import { useAppSelector, useAppDispatch } from 'mastodon/store';
|
|||
import { EmbeddedStatusContent } from './embedded_status_content';
|
||||
|
||||
export type Mention = RecordOf<{ url: string; acct: string }>;
|
||||
export type MediaAttachment = RecordOf<{
|
||||
id: string;
|
||||
type: string;
|
||||
description?: string;
|
||||
}>;
|
||||
|
||||
export const EmbeddedStatus: React.FC<{ statusId: string }> = ({
|
||||
statusId,
|
||||
|
@ -120,9 +125,14 @@ export const EmbeddedStatus: React.FC<{ statusId: string }> = ({
|
|||
const language = status.get('language') as string;
|
||||
const mentions = status.get('mentions') as ImmutableList<Mention>;
|
||||
const expanded = !status.get('hidden') || !contentWarning;
|
||||
const mediaAttachmentsSize = (
|
||||
status.get('media_attachments') as ImmutableList<unknown>
|
||||
).size;
|
||||
const mediaAttachments = status.get(
|
||||
'media_attachments',
|
||||
) as ImmutableList<MediaAttachment>;
|
||||
const mediaAttachmentsWithDescription = mediaAttachments.filter(
|
||||
(attachment) => !!attachment.get('description'),
|
||||
);
|
||||
const uncaptionedMediaCount =
|
||||
mediaAttachments.size - mediaAttachmentsWithDescription.size;
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -156,26 +166,46 @@ export const EmbeddedStatus: React.FC<{ statusId: string }> = ({
|
|||
/>
|
||||
)}
|
||||
|
||||
{expanded && (poll || mediaAttachmentsSize > 0) && (
|
||||
<div className='notification-group__embedded-status__attachments reply-indicator__attachments'>
|
||||
{!!poll && (
|
||||
<>
|
||||
<Icon icon={BarChart4BarsIcon} id='bar-chart-4-bars' />
|
||||
<FormattedMessage
|
||||
id='reply_indicator.poll'
|
||||
defaultMessage='Poll'
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{mediaAttachmentsSize > 0 && (
|
||||
<>
|
||||
<Icon icon={PhotoLibraryIcon} id='photo-library' />
|
||||
<FormattedMessage
|
||||
id='reply_indicator.attachments'
|
||||
defaultMessage='{count, plural, one {# attachment} other {# attachments}}'
|
||||
values={{ count: mediaAttachmentsSize }}
|
||||
/>
|
||||
</>
|
||||
{expanded && !!poll && (
|
||||
<div
|
||||
className='notification-group__embedded-status__attachments reply-indicator__attachments'
|
||||
key='poll-indicator'
|
||||
>
|
||||
<Icon icon={BarChart4BarsIcon} id='bar-chart-4-bars' />
|
||||
<FormattedMessage id='reply_indicator.poll' defaultMessage='Poll' />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{expanded &&
|
||||
mediaAttachmentsWithDescription.size > 0 &&
|
||||
mediaAttachmentsWithDescription.map((attachment) => (
|
||||
<div
|
||||
className='notification-group__embedded-status__attachments reply-indicator__attachments'
|
||||
key={`media-description-${attachment.get('id')}}`}
|
||||
>
|
||||
<Icon icon={PhotoLibraryIcon} id='photo-library' />
|
||||
<span>{attachment.get('description')}</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{expanded && uncaptionedMediaCount > 0 && (
|
||||
<div
|
||||
className='notification-group__embedded-status__attachments reply-indicator__attachments'
|
||||
key='uncaptioned-media-indicator'
|
||||
>
|
||||
<Icon icon={PhotoLibraryIcon} id='photo-library' />
|
||||
{mediaAttachmentsWithDescription.size > 0 ? (
|
||||
<FormattedMessage
|
||||
id='reply_indicator.other_attachments'
|
||||
defaultMessage='{count, plural, one {# other attachment} other {# other attachments}}'
|
||||
values={{ count: uncaptionedMediaCount }}
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id='reply_indicator.attachments'
|
||||
defaultMessage='{count, plural, one {# attachment} other {# attachments}}'
|
||||
values={{ count: uncaptionedMediaCount }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -729,6 +729,7 @@
|
|||
"relative_time.today": "today",
|
||||
"reply_indicator.attachments": "{count, plural, one {# attachment} other {# attachments}}",
|
||||
"reply_indicator.cancel": "Cancel",
|
||||
"reply_indicator.other_attachments": "{count, plural, one {# other attachment} other {# other attachments}}",
|
||||
"reply_indicator.poll": "Poll",
|
||||
"report.block": "Block",
|
||||
"report.block_explanation": "You will not see their posts. They will not be able to see your posts or follow you. They will be able to tell that they are blocked.",
|
||||
|
|
|
@ -10743,6 +10743,12 @@ noscript {
|
|||
font-size: 15px;
|
||||
line-height: 22px;
|
||||
color: $dark-text-color;
|
||||
|
||||
span {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ class FeedManager
|
|||
# @param [Boolean] update
|
||||
# @return [Boolean]
|
||||
def push_to_home(account, status, update: false)
|
||||
return false unless account.user&.signed_in_recently?
|
||||
return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?)
|
||||
|
||||
trim(:home, account.id)
|
||||
|
@ -83,7 +84,9 @@ class FeedManager
|
|||
# @param [Boolean] update
|
||||
# @return [Boolean]
|
||||
def push_to_list(list, status, update: false)
|
||||
return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?)
|
||||
return false if filter_from_list?(status, list)
|
||||
return false unless list.account.user&.signed_in_recently?
|
||||
return false unless add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?)
|
||||
|
||||
trim(:list, list.id)
|
||||
PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}", { 'update' => update }) if push_update_required?("timeline:list:#{list.id}")
|
||||
|
|
|
@ -165,6 +165,10 @@ class User < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def signed_in_recently?
|
||||
current_sign_in_at.present? && current_sign_in_at >= ACTIVE_DURATION.ago
|
||||
end
|
||||
|
||||
def confirmed?
|
||||
confirmed_at.present?
|
||||
end
|
||||
|
|
27
bin/bundler-audit
Executable file
27
bin/bundler-audit
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'bundler-audit' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("bundler-audit", "bundler-audit")
|
27
bin/haml-lint
Executable file
27
bin/haml-lint
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'haml-lint' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("haml_lint", "haml-lint")
|
27
bin/i18n-tasks
Executable file
27
bin/i18n-tasks
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'i18n-tasks' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("i18n-tasks", "i18n-tasks")
|
16
bin/rspec
16
bin/rspec
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
|
@ -7,9 +8,18 @@
|
|||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
|
|
@ -3,7 +3,7 @@ const config = {
|
|||
'Capfile|Gemfile|*.{rb,ruby,ru,rake}': 'bin/rubocop --force-exclusion -a',
|
||||
'*.{js,jsx,ts,tsx}': 'eslint --fix',
|
||||
'*.{css,scss}': 'stylelint --fix',
|
||||
'*.haml': 'bundle exec haml-lint -a',
|
||||
'*.haml': 'bin/haml-lint -a',
|
||||
'**/*.ts?(x)': () => 'tsc -p tsconfig.json --noEmit',
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user