mirror of https://github.com/mastodon/mastodon
Add "why do you want to join" field to invite requests (#10524)
* Add "why do you want to join" field to invite requests Fix #10512 * Remove unused translations * Fix broken registrations when no invite request text is submittedpull/10527/head
parent
0f3719f16f
commit
8b69a66380
@ -0,0 +1,17 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: user_invite_requests
|
||||||
|
#
|
||||||
|
# id :bigint(8) not null, primary key
|
||||||
|
# user_id :bigint(8)
|
||||||
|
# text :text
|
||||||
|
# created_at :datetime not null
|
||||||
|
# updated_at :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
class UserInviteRequest < ApplicationRecord
|
||||||
|
belongs_to :user, inverse_of: :invite_request
|
||||||
|
validates :text, presence: true, length: { maximum: 420 }
|
||||||
|
end
|
@ -1,14 +1,14 @@
|
|||||||
.batch-table__row
|
.batch-table__row
|
||||||
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
|
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
|
||||||
= f.check_box :account_ids, { multiple: true, include_hidden: false }, account.id
|
= f.check_box :account_ids, { multiple: true, include_hidden: false }, account.id
|
||||||
.batch-table__row__content.batch-table__row__content--unpadded
|
.batch-table__row__content.pending-account
|
||||||
%table.accounts-table
|
.pending-account__header
|
||||||
%tbody
|
= link_to admin_account_path(account.id) do
|
||||||
%tr
|
%strong= account.user_email
|
||||||
%td
|
= "(@#{account.username})"
|
||||||
= account.user_email
|
%br/
|
||||||
= "(@#{account.username})"
|
= account.user_current_sign_in_ip
|
||||||
%br/
|
|
||||||
= account.user_current_sign_in_ip
|
- if account.user&.invite_request&.text&.present?
|
||||||
%td.accounts-table__count
|
.pending-account__body
|
||||||
= table_link_to 'pencil', t('admin.accounts.edit'), admin_account_path(account.id)
|
%p= account.user&.invite_request&.text
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
class CreateUserInviteRequests < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :user_invite_requests do |t|
|
||||||
|
t.belongs_to :user, foreign_key: { on_delete: :cascade }
|
||||||
|
t.text :text
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
Fabricator(:user_invite_request) do
|
||||||
|
user
|
||||||
|
text { Faker::Lorem.sentence }
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe UserInviteRequest, type: :model do
|
||||||
|
end
|
Loading…
Reference in New Issue