1
0
Fork 0
forked from gitea/nas

Change RSS feeds (#18356)

* Change RSS feeds

- Use date and time for titles instead of ellipsized text
- Use full content in body, even when there is a content warning
- Use media extensions

* Change feed icons and add width and height attributes to custom emojis

* Fix custom emoji animate on hover breaking

* Fix tests
This commit is contained in:
Eugen Rochko 2022-05-09 07:43:08 +02:00 committed by GitHub
parent f17e73da09
commit 2b8dc58b7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 311 additions and 307 deletions

View file

@ -1,28 +0,0 @@
# frozen_string_literal: true
class RSS::AccountSerializer < RSS::Serializer
include ActionView::Helpers::NumberHelper
include AccountsHelper
include RoutingHelper
def render(account, statuses, tag)
builder = RSSBuilder.new
builder.title("#{display_name(account)} (@#{account.local_username_and_domain})")
.description(account_description(account))
.link(tag.present? ? short_account_tag_url(account, tag) : short_account_url(account))
.logo(full_pack_url('media/images/logo.svg'))
.accent_color('2b90d9')
builder.image(full_asset_url(account.avatar.url(:original))) if account.avatar?
builder.cover(full_asset_url(account.header.url(:original))) if account.header?
render_statuses(builder, statuses)
builder.to_xml
end
def self.render(account, statuses, tag)
new.render(account, statuses, tag)
end
end

View file

@ -1,25 +0,0 @@
# frozen_string_literal: true
class RSS::TagSerializer < RSS::Serializer
include ActionView::Helpers::NumberHelper
include ActionView::Helpers::SanitizeHelper
include RoutingHelper
def render(tag, statuses)
builder = RSSBuilder.new
builder.title("##{tag.name}")
.description(strip_tags(I18n.t('about.about_hashtag_html', hashtag: tag.name)))
.link(tag_url(tag))
.logo(full_pack_url('media/images/logo.svg'))
.accent_color('2b90d9')
render_statuses(builder, statuses)
builder.to_xml
end
def self.render(tag, statuses)
new.render(tag, statuses)
end
end