]> cat aescling's git repositories - mastodon.git/commit
Add consumable invites (#5814)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 27 Nov 2017 15:07:59 +0000 (16:07 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2017 15:07:59 +0000 (16:07 +0100)
commit740f8a95a905e949b6a74bc69dcaf638d2d46248
tree8e09ff52b47c0cd303a9681014b34e68b5e28c51
parent0ea4478b68e60e442e5b254c2d2bc511e27fea83
Add consumable invites (#5814)

* Add consumable invites

* Add UI for generating invite codes

* Add tests

* Display max uses and expiration in invites table, delete invite

* Remove unused column and redundant validator

- Default follows not used, probably bad idea
- InviteCodeValidator is redundant because RegistrationsController
  checks invite code validity

* Add admin setting to disable invites

* Add admin UI for invites, configurable role for invite creation

- Admin UI that lists everyone's invites, always available
- Admin setting min_invite_role to control who can invite people
- Non-admin invite UI only visible if users are allowed to

* Do not remove invites from database, expire them instantly
28 files changed:
app/controllers/admin/invites_controller.rb [new file with mode: 0644]
app/controllers/admin/settings_controller.rb
app/controllers/auth/registrations_controller.rb
app/controllers/invites_controller.rb [new file with mode: 0644]
app/javascript/styles/mastodon/admin.scss
app/models/form/admin_settings.rb
app/models/invite.rb [new file with mode: 0644]
app/models/user.rb
app/policies/invite_policy.rb [new file with mode: 0644]
app/views/admin/action_logs/_action_log.html.haml
app/views/admin/invites/_invite.html.haml [new file with mode: 0644]
app/views/admin/invites/index.html.haml [new file with mode: 0644]
app/views/admin/settings/edit.html.haml
app/views/auth/registrations/new.html.haml
app/views/invites/_form.html.haml [new file with mode: 0644]
app/views/invites/_invite.html.haml [new file with mode: 0644]
app/views/invites/index.html.haml [new file with mode: 0644]
config/locales/en.yml
config/locales/simple_form.en.yml
config/navigation.rb
config/routes.rb
config/settings.yml
db/migrate/20171125024930_create_invites.rb [new file with mode: 0644]
db/migrate/20171125031751_add_invite_id_to_users.rb [new file with mode: 0644]
db/schema.rb
spec/fabricators/invite_fabricator.rb [new file with mode: 0644]
spec/models/invite_spec.rb [new file with mode: 0644]
spec/models/user_spec.rb