Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/lib/formatter.rb`: Upstream completely refactored the formatting code and removed that file, while glitch-soc had code for Markdown and HTML toots. Took upstream code, glitch-soc changes will be re-implemented on top of the refactored classes in a later commit. - `app/models/status.rb`: Upstream refactored status edit handling and moved code to `app/models/concerns/status_snapshot_concern.rb`. Applied glitch-soc's changes to that file. - `app/serializers/activitypub/note_serializer.rb`: Not really a conflict, just a line added too close to one modified by glitch-soc. Applied upstream changes while keeping the glitch-soc-modified one. - `app/services/update_status_service.rb`: Not really a conflict, upstream modified a line adjacent to one added by glitch-soc. Applied upstream changes while keeping the glitch-soc line. - `app/views/statuses/_simple_status.html.haml`: Upstream refactored formatting, glitch-soc changed the markup slightly. Applied upstream changes. - `spec/lib/formatter_spec.rb`: Upstream completely refactored the formatting code and removed that file, while glitch-soc had code for Markdown and HTML toots. Took upstream code, glitch-soc changes will be re-implemented on top of the refactored classes in a later commit.
This commit is contained in:
@ -5,17 +5,17 @@
|
||||
.account__header__fields
|
||||
- fields.each do |field|
|
||||
%dl
|
||||
%dt.emojify{ title: field.name }= Formatter.instance.format_field(account, field.name, custom_emojify: true)
|
||||
%dt.emojify{ title: field.name }= prerender_custom_emojis(h(field.name), account.emojis)
|
||||
%dd{ title: field.value, class: custom_field_classes(field) }
|
||||
- if field.verified?
|
||||
%span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
|
||||
= fa_icon 'check'
|
||||
= Formatter.instance.format_field(account, field.value, custom_emojify: true)
|
||||
= prerender_custom_emojis(html_aware_format(field.value, account.local?, with_rel_me: true, with_domains: true, multiline: false), account.emojis)
|
||||
|
||||
= account_badge(account)
|
||||
|
||||
- if account.note.present?
|
||||
.account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
|
||||
.account__header__content.emojify= prerender_custom_emojis(html_aware_format(account.note, account.local?), account.emojis)
|
||||
|
||||
.public-account-bio__extra
|
||||
= t 'accounts.joined', date: l(account.created_at, format: :month)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.batch-table__row{ class: [!account.suspended? && account.user_pending? && 'batch-table__row--attention', account.suspended? && 'batch-table__row--muted'] }
|
||||
.batch-table__row{ class: [!account.suspended? && account.user_pending? && 'batch-table__row--attention', (account.suspended? || account.user_unconfirmed?) && 'batch-table__row--muted'] }
|
||||
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
|
||||
= f.check_box :account_ids, { multiple: true, include_hidden: false }, account.id
|
||||
.batch-table__row__content.batch-table__row__content--unpadded
|
||||
|
@ -16,16 +16,16 @@
|
||||
.account__header__fields
|
||||
- fields.each do |field|
|
||||
%dl
|
||||
%dt.emojify{ title: field.name }= Formatter.instance.format_field(account, field.name, custom_emojify: true)
|
||||
%dt.emojify{ title: field.name }= prerender_custom_emojis(h(field.name), account.emojis)
|
||||
%dd{ title: field.value, class: custom_field_classes(field) }
|
||||
- if field.verified?
|
||||
%span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
|
||||
= fa_icon 'check'
|
||||
= Formatter.instance.format_field(account, field.value, custom_emojify: true)
|
||||
= prerender_custom_emojis(html_aware_format(field.value, account.local?, with_rel_me: true, with_domains: true, multiline: false), account.emojis)
|
||||
|
||||
- if account.note.present?
|
||||
%div
|
||||
.account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
|
||||
.account__header__content.emojify= prerender_custom_emojis(html_aware_format(account.note, account.local?), account.emojis)
|
||||
|
||||
.dashboard__counters.admin-account-counters
|
||||
%div
|
||||
|
@ -84,7 +84,8 @@
|
||||
- else
|
||||
%span.negative-hint
|
||||
= t('admin.instances.availability.failures_recorded', count: @instance.delivery_failure_tracker.days)
|
||||
= link_to t('admin.instances.delivery.clear'), clear_delivery_errors_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post } unless @instance.exhausted_deliveries_days.empty?
|
||||
%span= link_to t('admin.instances.delivery.clear'), clear_delivery_errors_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post } unless @instance.exhausted_deliveries_days.empty?
|
||||
%span= link_to t('admin.instances.delivery.stop'), stop_delivery_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post }
|
||||
|
||||
- if @instance.purgeable?
|
||||
%p= t('admin.instances.purge_description_html')
|
||||
|
@ -4,12 +4,12 @@
|
||||
.batch-table__row__content
|
||||
.status__content><
|
||||
- if status.proper.spoiler_text.blank?
|
||||
= Formatter.instance.format(status.proper, custom_emojify: true)
|
||||
= prerender_custom_emojis(status_content_format(status.proper), status.proper.emojis)
|
||||
- else
|
||||
%details<
|
||||
%summary><
|
||||
%strong> Content warning: #{Formatter.instance.format_spoiler(status.proper)}
|
||||
= Formatter.instance.format(status.proper, custom_emojify: true)
|
||||
%strong> Content warning: #{prerender_custom_emojis(h(status.proper.spoiler_text), status.proper.emojis)}
|
||||
= prerender_custom_emojis(status_content_format(status.proper), status.proper.emojis)
|
||||
|
||||
- unless status.proper.ordered_media_attachments.empty?
|
||||
- if status.proper.ordered_media_attachments.first.video?
|
||||
|
@ -23,7 +23,7 @@
|
||||
= fa_icon('lock') if @report.target_account.locked?
|
||||
- if @report.target_account.note.present?
|
||||
.account-card__bio.emojify
|
||||
= Formatter.instance.simplified_format(@report.target_account, custom_emojify: true)
|
||||
= prerender_custom_emojis(html_aware_format(@report.target_account.note, @report.target_account.local?), @report.target_account.emojis)
|
||||
.account-card__actions
|
||||
.account-card__counters
|
||||
.account-card__counters__item
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
.dashboard
|
||||
.dashboard__item
|
||||
= react_admin_component :counter, measure: 'tag_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_accounts_measure')
|
||||
= react_admin_component :counter, measure: 'tag_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_accounts_measure'), href: tag_url(@tag), target: '_blank'
|
||||
.dashboard__item
|
||||
= react_admin_component :counter, measure: 'tag_uses', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_uses_measure')
|
||||
.dashboard__item
|
||||
|
@ -34,7 +34,7 @@
|
||||
= fa_icon('lock') if account.locked?
|
||||
- if account.note.present?
|
||||
.account-card__bio.emojify
|
||||
= Formatter.instance.simplified_format(account, custom_emojify: true)
|
||||
= prerender_custom_emojis(html_aware_format(account.note, account.local?), account.emojis)
|
||||
- else
|
||||
.flex-spacer
|
||||
.account-card__actions
|
||||
|
@ -26,7 +26,7 @@
|
||||
%p= t "user_mailer.warning.explanation.#{@strike.action}", instance: Rails.configuration.x.local_domain
|
||||
|
||||
- unless @strike.text.blank?
|
||||
= Formatter.instance.linkify(@strike.text)
|
||||
= linkify(@strike.text)
|
||||
|
||||
- if @strike.report && !@strike.report.other?
|
||||
%p
|
||||
|
@ -28,10 +28,10 @@
|
||||
- if status.spoiler_text?
|
||||
%div.auto-dir
|
||||
%p
|
||||
= Formatter.instance.format_spoiler(status)
|
||||
= status.spoiler_text
|
||||
|
||||
%div.auto-dir
|
||||
= Formatter.instance.format(status)
|
||||
= status_content_format(status)
|
||||
|
||||
- if status.ordered_media_attachments.size > 0
|
||||
%p
|
||||
|
@ -3,6 +3,6 @@
|
||||
> ----
|
||||
>
|
||||
<% end %>
|
||||
> <%= raw word_wrap(Formatter.instance.plaintext(status), break_sequence: "\n> ") %>
|
||||
> <%= raw word_wrap(extract_plain_text(status.text, status.local?), break_sequence: "\n> ") %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= web_url("statuses/#{status.id}") %>
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
* <%= raw t('notification_mailer.digest.mention', name: notification.from_account.pretty_acct) %>
|
||||
|
||||
<%= raw Formatter.instance.plaintext(notification.target_status) %>
|
||||
<%= raw extract_plain_text(notification.target_status.text, notification.target_status.local?) %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= web_url("statuses/#{notification.target_status.id}") %>
|
||||
<% end %>
|
||||
|
@ -18,10 +18,11 @@
|
||||
.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> #{Formatter.instance.format_spoiler(status, autoplay: prefers_autoplay?)}
|
||||
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
||||
%button.status__content__spoiler-link= t('statuses.show_more')
|
||||
.e-content
|
||||
= Formatter.instance.format(status, custom_emojify: true, autoplay: prefers_autoplay?)
|
||||
= prerender_custom_emojis(status_content_format(status), status.emojis)
|
||||
|
||||
- if status.preloadable_poll
|
||||
= render_poll_component(status)
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
%span.poll__number><
|
||||
= "#{percent.round}%"
|
||||
%span.poll__option__text
|
||||
= Formatter.instance.format_poll_option(status, option, autoplay: prefers_autoplay?)
|
||||
= prerender_custom_emojis(h(option.title), status.emojis)
|
||||
- if own_votes.include?(index)
|
||||
%span.poll__voted
|
||||
%i.poll__voted__mark.fa.fa-check
|
||||
@ -23,7 +23,7 @@
|
||||
%label.poll__option><
|
||||
%span.poll__input{ class: poll.multiple? ? 'checkbox' : nil}><
|
||||
%span.poll__option__text
|
||||
= Formatter.instance.format_poll_option(status, option, autoplay: prefers_autoplay?)
|
||||
= prerender_custom_emojis(h(option.title), status.emojis)
|
||||
.poll__footer
|
||||
- unless show_results
|
||||
%button.button.button-secondary{ disabled: true }
|
||||
|
@ -30,10 +30,11 @@
|
||||
.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> #{Formatter.instance.format_spoiler(status, autoplay: prefers_autoplay?)}
|
||||
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
||||
%button.status__content__spoiler-link= t('statuses.show_more')
|
||||
.e-content<
|
||||
= Formatter.instance.format(status, custom_emojify: true, autoplay: prefers_autoplay?)
|
||||
= prerender_custom_emojis(status_content_format(status), status.emojis)
|
||||
|
||||
- if status.preloadable_poll
|
||||
= render_poll_component(status)
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
%p= t "user_mailer.warning.explanation.#{@warning.action}", instance: @instance
|
||||
|
||||
- unless @warning.text.blank?
|
||||
= Formatter.instance.linkify(@warning.text)
|
||||
= linkify(@warning.text)
|
||||
|
||||
- if @warning.report && !@warning.report.other?
|
||||
%p
|
||||
|
Reference in New Issue
Block a user