Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/application_controller.rb
  Minor conflict due to glitch-soc's theming system
This commit is contained in:
Thibaut Girka
2019-12-12 15:40:06 +01:00
10 changed files with 281 additions and 185 deletions

View File

@@ -212,6 +212,6 @@ class ApplicationController < ActionController::Base
def respond_with_error(code)
use_pack 'error'
render "errors/#{code}", layout: 'error', status: code
render "errors/#{code}", layout: 'error', status: code, formats: [:html]
end
end

View File

@@ -155,7 +155,7 @@ class PollForm extends ImmutablePureComponent {
<div className='poll__footer'>
<button disabled={options.size >= 5} className='button button-secondary' onClick={this.handleAddOption}><Icon id='plus' /> <FormattedMessage {...messages.add_option} /></button>
<select value={expiresIn} onBlur={this.handleSelectDuration}>
<select value={expiresIn} onChange={this.handleSelectDuration}>
<option value={300}>{intl.formatMessage(messages.minutes, { number: 5 })}</option>
<option value={1800}>{intl.formatMessage(messages.minutes, { number: 30 })}</option>
<option value={3600}>{intl.formatMessage(messages.hours, { number: 1 })}</option>

View File

@@ -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

View File

@@ -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