commit
cdcb74ffb6
@ -0,0 +1,14 @@
|
||||
* text=auto eol=lf
|
||||
*.eot -text
|
||||
*.gif -text
|
||||
*.gz -text
|
||||
*.ico -text
|
||||
*.jpg -text
|
||||
*.mp3 -text
|
||||
*.ogg -text
|
||||
*.png -text
|
||||
*.ttf -text
|
||||
*.webm -text
|
||||
*.woff -text
|
||||
*.woff2 -text
|
||||
spec/fixtures/requests/** -text !eol
|
@ -1,50 +0,0 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export default class ColumnCollapsable extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
icon: PropTypes.string.isRequired,
|
||||
title: PropTypes.string,
|
||||
fullHeight: PropTypes.number.isRequired,
|
||||
children: PropTypes.node,
|
||||
onCollapse: PropTypes.func,
|
||||
};
|
||||
|
||||
state = {
|
||||
collapsed: true,
|
||||
animating: false,
|
||||
};
|
||||
|
||||
handleToggleCollapsed = () => {
|
||||
const currentState = this.state.collapsed;
|
||||
|
||||
this.setState({ collapsed: !currentState, animating: true });
|
||||
|
||||
if (!currentState && this.props.onCollapse) {
|
||||
this.props.onCollapse();
|
||||
}
|
||||
}
|
||||
|
||||
handleTransitionEnd = () => {
|
||||
this.setState({ animating: false });
|
||||
}
|
||||
|
||||
render () {
|
||||
const { icon, title, fullHeight, children } = this.props;
|
||||
const { collapsed, animating } = this.state;
|
||||
|
||||
return (
|
||||
<div className={`column-collapsable ${collapsed ? 'collapsed' : ''}`} onTransitionEnd={this.handleTransitionEnd}>
|
||||
<div role='button' tabIndex='0' title={`${title}`} className='column-collapsable__button column-icon' onClick={this.handleToggleCollapsed}>
|
||||
<i className={`fa fa-${icon}`} />
|
||||
</div>
|
||||
|
||||
<div className='column-collapsable__content' style={{ height: `${fullHeight}px` }}>
|
||||
{(!collapsed || animating) && children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AdminMailer < ApplicationMailer
|
||||
def new_report(recipient, report)
|
||||
@report = report
|
||||
@me = recipient
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
|
||||
locale_for_account(@me) do
|
||||
mail to: @me.user_email, subject: I18n.t('admin_mailer.new_report.subject', instance: @instance, id: @report.id)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
<%= display_name(@me) %>,
|
||||
|
||||
<%= raw t('admin_mailer.new_report.body', target: @report.target_account.acct, reporter: @report.account.acct) %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= admin_report_url(@report) %>
|
@ -0,0 +1,23 @@
|
||||
%h6= t 'sessions.title'
|
||||
%p.muted-hint= t 'sessions.explanation'
|
||||
|
||||
%table.table.inline-table
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'sessions.browser'
|
||||
%th= t 'sessions.ip'
|
||||
%th= t 'sessions.activity'
|
||||
%tbody
|
||||
- @sessions.each do |session|
|
||||
%tr
|
||||
%td
|
||||
%span{ title: session.user_agent }= fa_icon session_device_icon(session)
|
||||
= ' '
|
||||
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
|
||||
%td
|
||||
%samp= session.ip
|
||||
%td
|
||||
- if request.session['auth_id'] == session.session_id
|
||||
= t 'sessions.current_session'
|
||||
- else
|
||||
%time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
|
@ -1,26 +1,34 @@
|
||||
- content_for :page_title do
|
||||
= t('settings.two_factor_authentication')
|
||||
|
||||
.simple_form
|
||||
%p.hint
|
||||
= t('two_factor_authentication.description_html')
|
||||
- if current_user.otp_required_for_login
|
||||
%p.positive-hint
|
||||
= fa_icon 'check'
|
||||
= ' '
|
||||
= t 'two_factor_authentication.enabled'
|
||||
|
||||
- if current_user.otp_required_for_login
|
||||
= link_to t('two_factor_authentication.disable'),
|
||||
settings_two_factor_authentication_path,
|
||||
data: { method: :delete },
|
||||
class: 'block-button'
|
||||
- else
|
||||
= link_to t('two_factor_authentication.setup'),
|
||||
settings_two_factor_authentication_path,
|
||||
data: { method: :post },
|
||||
class: 'block-button'
|
||||
%hr/
|
||||
|
||||
- if current_user.otp_required_for_login
|
||||
.simple_form
|
||||
%p.hint
|
||||
= t('two_factor_authentication.lost_recovery_codes')
|
||||
= simple_form_for @confirmation, url: settings_two_factor_authentication_path, method: :delete do |f|
|
||||
= f.input :code, hint: t('two_factor_authentication.code_hint'), placeholder: t('simple_form.labels.defaults.otp_attempt')
|
||||
|
||||
.actions
|
||||
= f.button :button, t('two_factor_authentication.disable'), type: :submit
|
||||
|
||||
%hr/
|
||||
|
||||
%h6= t('two_factor_authentication.recovery_codes')
|
||||
%p.muted-hint
|
||||
= t('two_factor_authentication.lost_recovery_codes')
|
||||
= link_to t('two_factor_authentication.generate_recovery_codes'),
|
||||
settings_two_factor_authentication_recovery_codes_path,
|
||||
data: { method: :post }
|
||||
|
||||
- else
|
||||
.simple_form
|
||||
%p.hint= t('two_factor_authentication.description_html')
|
||||
|
||||
= link_to t('two_factor_authentication.setup'),
|
||||
settings_two_factor_authentication_path,
|
||||
data: { method: :post },
|
||||
class: 'block-button'
|
||||
|
@ -1,3 +1,3 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that your password on Mastodon has been changed.</p>
|
||||
<p>We're contacting you to notify you that your password on <%= @instance %> has been changed.</p>
|
||||
|
@ -1,3 +1,3 @@
|
||||
Hello <%= @resource.email %>!
|
||||
|
||||
We're contacting you to notify you that your password on Mastodon has been changed.
|
||||
We're contacting you to notify you that your password on <%= @instance %> has been changed.
|
||||
|
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
require 'sidekiq-scheduler'
|
||||
|
||||
class Scheduler::DoorkeeperCleanupScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||||
Doorkeeper::AccessGrant.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddDescriptionToSessionActivations < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_column :session_activations, :user_agent, :string, null: false, default: ''
|
||||
add_column :session_activations, :ip, :inet
|
||||
add_foreign_key :session_activations, :users, on_delete: :cascade
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class AddAccessTokenIdToSessionActivations < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_column :session_activations, :access_token_id, :integer
|
||||
add_foreign_key :session_activations, :oauth_access_tokens, column: :access_token_id, on_delete: :cascade
|
||||
end
|
||||
end
|
@ -1,3 +1,3 @@
|
||||
Fabricator(:domain_block) do
|
||||
domain "example.com"
|
||||
domain { sequence(:domain) { |i| "#{i}#{Faker::Internet.domain_name}" } }
|
||||
end
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"transform-object-rest-spread"
|
||||
]
|
||||
}
|
Loading…
Reference in new issue