Merge remote-tracking branch 'parent/main' into upstream-20240913

This commit is contained in:
KMY 2024-09-13 10:31:48 +09:00
commit fc9d27ff91
392 changed files with 3757 additions and 3233 deletions

View file

@ -1,90 +0,0 @@
:ruby
grouped_emoji_reactions ||= Oj.load(status.status_stat&.emoji_reactions || '', mode: :strict) || []
.detailed-status.detailed-status--flex{ class: "detailed-status-#{status.visibility}" }
.p-author.h-card
= link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'detailed-status__display-name u-url', target: stream_link_target, rel: 'noopener' do
.detailed-status__display-avatar
- if prefers_autoplay?
= image_tag status.account.avatar_original_url, alt: '', class: 'account__avatar u-photo'
- else
= image_tag status.account.avatar_static_url, alt: '', class: 'account__avatar u-photo'
%span.display-name
%bdi
%strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
%span.display-name__account
= acct(status.account)
= material_symbol('lock') if status.account.locked?
= account_action_button(status.account)
.status__content.emojify{ data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
- if status.spoiler_text?
%p<
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}&nbsp;
%button.status__content__spoiler-link= t('statuses.show_more')
.e-content{ lang: status.language }
= prerender_custom_emojis(status_content_format(status), status.emojis)
- if status.preloadable_poll
= render_poll_component(status)
- if !status.ordered_media_attachments.empty?
- if status.ordered_media_attachments.first.video?
= render_video_component(status, width: 670, height: 380, detailed: true)
- elsif status.ordered_media_attachments.first.audio?
= render_audio_component(status, width: 670, height: 380)
- else
= render_media_gallery_component(status, height: 380, standalone: true)
- elsif status.preview_card
= render_card_component(status)
- if grouped_emoji_reactions.size.positive?
.status__emoji-reactions-bar
- grouped_emoji_reactions.each do |reaction|
%button.emoji-reactions-bar__button
%span.emojify= prerender_custom_emojis_from_hash(emoji_name_format(reaction, status), reaction)
%span.count= reaction['count']
.detailed-status__meta
%data.dt-published{ value: status.created_at.to_time.iso8601 }
- if status.edited?
%data.dt-updated{ value: status.edited_at.to_time.iso8601 }
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
%time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
·
- if status.edited?
= t('statuses.edited_at_html', date: content_tag(:time, l(status.edited_at), datetime: status.edited_at.iso8601, title: l(status.edited_at), class: 'formatted'))
·
%span.detailed-status__visibility-icon
= visibility_icon status
·
- if status.application && status.account.user&.setting_show_application
- if status.application.website.blank?
%strong.detailed-status__application= status.application.name
- else
= link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'
·
%span.detailed-status__link
- if status.in_reply_to_id.nil?
= material_symbol('reply')
- else
= material_symbol('reply_all')
%span.detailed-status__reblogs>= friendly_number_to_human status.replies_count
&nbsp;
·
- if status.public_visibility? || status.unlisted_visibility?
%span.detailed-status__link
= material_symbol('repeat')
%span.detailed-status__reblogs>= friendly_number_to_human status.reblogs_count
&nbsp;
·
%span.detailed-status__link
= material_symbol('star')
%span.detailed-status__favorites>= friendly_number_to_human status.favourites_count
&nbsp;
- if user_signed_in?
·
= link_to t('statuses.open_in_web'), web_url("@#{status.account.pretty_acct}/#{status.id}"), class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'

View file

@ -1,36 +0,0 @@
:ruby
show_results = (user_signed_in? && poll.voted?(current_account)) || poll.expired?
total_votes_count = poll.voters_count || poll.votes_count
.poll
%ul
- poll.loaded_options.each do |option|
%li
- if show_results
- percent = total_votes_count.positive? ? 100 * option.votes_count / total_votes_count : 0
%label.poll__option><
%span.poll__number><
#{percent.round}%
%span.poll__option__text
= prerender_custom_emojis(h(option.title), status.emojis)
%progress{ max: 100, value: [percent, 1].max, 'aria-hidden': 'true' }
%span.poll__chart
- else
%label.poll__option><
%span.poll__input{ class: poll.multiple? ? 'checkbox' : nil }><
%span.poll__option__text
= prerender_custom_emojis(h(option.title), status.emojis)
.poll__footer
- unless show_results
%button.button.button-secondary{ disabled: true }
= t('statuses.poll.vote')
- if poll.voters_count.nil?
%span= t('statuses.poll.total_votes', count: poll.votes_count)
- else
%span= t('statuses.poll.total_people', count: poll.voters_count)
- unless poll.expires_at.nil?
·
%span= l poll.expires_at

View file

@ -1,78 +0,0 @@
:ruby
hide_show_thread ||= false
grouped_emoji_reactions ||= Oj.load(status.status_stat&.emoji_reactions || '', mode: :strict) || []
.status{ class: "status-#{status.visibility}" }
.status__info
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'status__relative-time u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
%span.status__visibility-icon><
= visibility_icon status
%time.time-ago{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
- if status.edited?
%abbr{ title: t('statuses.edited_at_html', date: l(status.edited_at.to_date)) }
*
%data.dt-published{ value: status.created_at.to_time.iso8601 }
.p-author.h-card
= link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'status__display-name u-url', target: stream_link_target, rel: 'noopener noreferrer' do
.status__avatar
%div
- if prefers_autoplay?
= image_tag status.account.avatar_original_url, alt: '', class: 'u-photo account__avatar'
- else
= image_tag status.account.avatar_static_url, alt: '', class: 'u-photo account__avatar'
%span.display-name
%bdi
%strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
&nbsp;
%span.display-name__account
= acct(status.account)
= material_symbol('lock') if status.account.locked?
.status__content.emojify{ data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
- if status.spoiler_text?
%p<
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}&nbsp;
%button.status__content__spoiler-link= t('statuses.show_more')
.e-content{ lang: status.language }
= prerender_custom_emojis(status_content_format(status), status.emojis)
- if status.preloadable_poll
= render_poll_component(status)
- if !status.ordered_media_attachments.empty?
- if status.ordered_media_attachments.first.video?
= render_video_component(status, width: 610, height: 343)
- elsif status.ordered_media_attachments.first.audio?
= render_audio_component(status, width: 610, height: 343)
- else
= render_media_gallery_component(status, height: 343)
- elsif status.preview_card
= render_card_component(status)
- if !status.in_reply_to_id.nil? && status.in_reply_to_account_id == status.account.id && !hide_show_thread
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'status__content__read-more-button', target: stream_link_target, rel: 'noopener noreferrer' do
= t 'statuses.show_thread'
- if grouped_emoji_reactions.size.positive?
.status__emoji-reactions-bar
- grouped_emoji_reactions.each do |reaction|
%button.emoji-reactions-bar__button
%span.emojify= prerender_custom_emojis_from_hash(emoji_name_format(reaction, status), reaction)
%span.count= reaction['count']
.status__action-bar
%span.status__action-bar-button.icon-button.icon-button--with-counter
- if status.in_reply_to_id.nil?
= material_symbol 'reply'
- else
= material_symbol 'reply_all'
%span.icon-button__counter= obscured_counter status.replies_count
%span.status__action-bar-button.icon-button
- if status.distributable?
= material_symbol 'repeat'
- elsif status.private_visibility? || status.limited_visibility?
= material_symbol 'lock'
- else
= material_symbol 'alternate_email'
%span.status__action-bar-button.icon-button
= material_symbol 'star'

View file

@ -1,2 +0,0 @@
.entry
= render (centered ? 'statuses/detailed_status' : 'statuses/simple_status'), status: status.proper, hide_show_thread: false

View file

@ -1,2 +1 @@
.activity-stream.activity-stream--headless
= render 'status', status: @status, centered: true
#mastodon-status{ data: { props: Oj.dump(default_props.merge(id: @status.id.to_s)) } }