From f3d232381d60cbc93cb7a35285eb24c30cd0aba0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 8 Dec 2019 15:37:12 +0100 Subject: Add `tootctl media remove-orphans` (#12568) --- app/models/media_attachment.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app') diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 5d5034a52..573ef5dfc 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -167,6 +167,18 @@ class MediaAttachment < ApplicationRecord audio? || video? end + def variant?(other_file_name) + return true if file_file_name == other_file_name + + formats = file.styles.values.map(&:format).compact + + return false if formats.empty? + + extension = File.extname(other_file_name) + + formats.include?(extension.delete('.')) && File.basename(other_file_name, extension) == File.basename(file_file_name, File.extname(file_file_name)) + end + def to_param shortcode end -- cgit From ab91e7480bcea4624c6eea3e0f06a9b86b866b31 Mon Sep 17 00:00:00 2001 From: Sasha Sorokin Date: Mon, 9 Dec 2019 10:30:58 +0700 Subject: Use codeblock for native redirect URI (#12570) This commit changes how doorkeeper.applications.help.native_redirect_uri string is being formatted to use tag for native_redirect_uri placeholder. This makes the URI look more distinguishable. --- app/views/settings/applications/_fields.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/settings/applications/_fields.html.haml b/app/views/settings/applications/_fields.html.haml index 6a2863b20..ffd2491d2 100644 --- a/app/views/settings/applications/_fields.html.haml +++ b/app/views/settings/applications/_fields.html.haml @@ -7,7 +7,7 @@ .fields-group = f.input :redirect_uri, wrapper: :with_block_label, label: t('activerecord.attributes.doorkeeper/application.redirect_uri'), hint: t('doorkeeper.applications.help.redirect_uri') - %p.hint= t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: Doorkeeper.configuration.native_redirect_uri) + %p.hint= t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: content_tag(:code, Doorkeeper.configuration.native_redirect_uri)).html_safe .field-group .input.with_block_label -- cgit From 7ee6f51b7865ff8f5dd21a8a4ec3aad23170b8c6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 10 Dec 2019 07:39:54 +0100 Subject: Fix missing error templates for non-HTML requests (#12593) --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e19d5b142..ca5229f79 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -136,6 +136,6 @@ class ApplicationController < ActionController::Base end def respond_with_error(code) - render "errors/#{code}", layout: 'error', status: code + render "errors/#{code}", layout: 'error', status: code, formats: [:html] end end -- cgit From 77e7b33deabf2d3827c65313f5d5edd5a1bd6828 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 10 Dec 2019 19:39:02 +0100 Subject: Revert "Fix an eslint warning (#12426)" (#12596) This reverts commit 054ef83fc5808596643dd366286b4e85446b850c. --- app/javascript/mastodon/features/compose/components/poll_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/mastodon/features/compose/components/poll_form.js b/app/javascript/mastodon/features/compose/components/poll_form.js index 81ab0ec1a..e9bbb4ba4 100644 --- a/app/javascript/mastodon/features/compose/components/poll_form.js +++ b/app/javascript/mastodon/features/compose/components/poll_form.js @@ -155,7 +155,7 @@ class PollForm extends ImmutablePureComponent {
- -- cgit