Browse Source

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 submitted
Eugen Rochko 2 weeks ago
parent
commit
8b69a66380
57 changed files with 125 additions and 62 deletions
  1. 4
    1
      app/controllers/about_controller.rb
  2. 1
    1
      app/controllers/admin/pending_accounts_controller.rb
  3. 9
    5
      app/controllers/auth/registrations_controller.rb
  4. 26
    0
      app/javascript/styles/mastodon/accounts.scss
  5. 9
    0
      app/javascript/styles/mastodon/widgets.scss
  6. 3
    0
      app/models/user.rb
  7. 17
    0
      app/models/user_invite_request.rb
  8. 5
    0
      app/views/about/_registration.html.haml
  9. 11
    11
      app/views/admin/pending_accounts/_account.html.haml
  10. 8
    1
      app/views/auth/registrations/new.html.haml
  11. 0
    1
      config/locales/ar.yml
  12. 0
    1
      config/locales/ast.yml
  13. 0
    1
      config/locales/ca.yml
  14. 0
    1
      config/locales/co.yml
  15. 0
    1
      config/locales/cs.yml
  16. 0
    1
      config/locales/cy.yml
  17. 0
    1
      config/locales/da.yml
  18. 0
    1
      config/locales/de.yml
  19. 0
    1
      config/locales/el.yml
  20. 0
    1
      config/locales/en.yml
  21. 0
    1
      config/locales/en_GB.yml
  22. 0
    1
      config/locales/eo.yml
  23. 0
    1
      config/locales/es.yml
  24. 0
    1
      config/locales/eu.yml
  25. 0
    1
      config/locales/fa.yml
  26. 0
    1
      config/locales/fi.yml
  27. 0
    1
      config/locales/fr.yml
  28. 0
    1
      config/locales/gl.yml
  29. 0
    1
      config/locales/hu.yml
  30. 0
    1
      config/locales/it.yml
  31. 0
    1
      config/locales/ja.yml
  32. 0
    1
      config/locales/ka.yml
  33. 0
    1
      config/locales/kk.yml
  34. 0
    1
      config/locales/ko.yml
  35. 0
    1
      config/locales/lt.yml
  36. 0
    1
      config/locales/nl.yml
  37. 0
    1
      config/locales/no.yml
  38. 0
    1
      config/locales/oc.yml
  39. 0
    1
      config/locales/pl.yml
  40. 0
    1
      config/locales/pt-BR.yml
  41. 0
    1
      config/locales/pt.yml
  42. 0
    1
      config/locales/ro.yml
  43. 0
    1
      config/locales/ru.yml
  44. 4
    0
      config/locales/simple_form.en.yml
  45. 0
    1
      config/locales/sk.yml
  46. 0
    1
      config/locales/sq.yml
  47. 0
    1
      config/locales/sr-Latn.yml
  48. 0
    1
      config/locales/sr.yml
  49. 0
    1
      config/locales/sv.yml
  50. 0
    1
      config/locales/uk.yml
  51. 0
    1
      config/locales/zh-CN.yml
  52. 0
    1
      config/locales/zh-HK.yml
  53. 0
    1
      config/locales/zh-TW.yml
  54. 10
    0
      db/migrate/20190409054914_create_user_invite_requests.rb
  55. 10
    1
      db/schema.rb
  56. 4
    0
      spec/fabricators/user_invite_request_fabricator.rb
  57. 4
    0
      spec/models/user_invite_request_spec.rb

+ 4
- 1
app/controllers/about_controller.rb View File

@@ -16,7 +16,10 @@ class AboutController < ApplicationController
16 16
   private
17 17
 
18 18
   def new_user
19
-    User.new.tap(&:build_account)
19
+    User.new.tap do |user|
20
+      user.build_account
21
+      user.build_invite_request
22
+    end
20 23
   end
21 24
 
22 25
   helper_method :new_user

+ 1
- 1
app/controllers/admin/pending_accounts_controller.rb View File

@@ -30,7 +30,7 @@ module Admin
30 30
     private
31 31
 
32 32
     def set_accounts
33
-      @accounts = Account.joins(:user).merge(User.pending).page(params[:page])
33
+      @accounts = Account.joins(:user).merge(User.pending).includes(user: :invite_request).page(params[:page])
34 34
     end
35 35
 
36 36
     def form_account_batch_params

+ 9
- 5
app/controllers/auth/registrations_controller.rb View File

@@ -10,6 +10,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
10 10
   before_action :set_instance_presenter, only: [:new, :create, :update]
11 11
   before_action :set_body_classes, only: [:new, :create, :edit, :update]
12 12
 
13
+  def new
14
+    super(&:build_invite_request)
15
+  end
16
+
13 17
   def destroy
14 18
     not_found
15 19
   end
@@ -24,17 +28,17 @@ class Auth::RegistrationsController < Devise::RegistrationsController
24 28
   def build_resource(hash = nil)
25 29
     super(hash)
26 30
 
27
-    resource.locale      = I18n.locale
28
-    resource.invite_code = params[:invite_code] if resource.invite_code.blank?
29
-    resource.agreement   = true
31
+    resource.locale             = I18n.locale
32
+    resource.invite_code        = params[:invite_code] if resource.invite_code.blank?
33
+    resource.agreement          = true
34
+    resource.current_sign_in_ip = request.remote_ip
30 35
 
31
-    resource.current_sign_in_ip = request.remote_ip if resource.current_sign_in_ip.nil?
32 36
     resource.build_account if resource.account.nil?
33 37
   end
34 38
 
35 39
   def configure_sign_up_params
36 40
     devise_parameter_sanitizer.permit(:sign_up) do |u|
37
-      u.permit({ account_attributes: [:username] }, :email, :password, :password_confirmation, :invite_code)
41
+      u.permit({ account_attributes: [:username], invite_request_attributes: [:text] }, :email, :password, :password_confirmation, :invite_code)
38 42
     end
39 43
   end
40 44
 

+ 26
- 0
app/javascript/styles/mastodon/accounts.scss View File

@@ -292,3 +292,29 @@
292 292
 .directory__tag .trends__item__current {
293 293
   width: auto;
294 294
 }
295
+
296
+.pending-account {
297
+  &__header {
298
+    color: $darker-text-color;
299
+
300
+    a {
301
+      color: $ui-secondary-color;
302
+      text-decoration: none;
303
+
304
+      &:hover,
305
+      &:active,
306
+      &:focus {
307
+        text-decoration: underline;
308
+      }
309
+    }
310
+
311
+    strong {
312
+      color: $primary-text-color;
313
+      font-weight: 700;
314
+    }
315
+  }
316
+
317
+  &__body {
318
+    margin-top: 10px;
319
+  }
320
+}

+ 9
- 0
app/javascript/styles/mastodon/widgets.scss View File

@@ -377,6 +377,10 @@
377 377
     border: 0;
378 378
   }
379 379
 
380
+  strong {
381
+    font-weight: 700;
382
+  }
383
+
380 384
   thead th {
381 385
     text-align: center;
382 386
     text-transform: uppercase;
@@ -414,6 +418,11 @@
414 418
     }
415 419
   }
416 420
 
421
+  &__comment {
422
+    width: 50%;
423
+    vertical-align: initial !important;
424
+  }
425
+
417 426
   @media screen and (max-width: $no-gap-breakpoint) {
418 427
     tbody td.optional {
419 428
       display: none;

+ 3
- 0
app/models/user.rb View File

@@ -74,6 +74,9 @@ class User < ApplicationRecord
74 74
   has_many :applications, class_name: 'Doorkeeper::Application', as: :owner
75 75
   has_many :backups, inverse_of: :user
76 76
 
77
+  has_one :invite_request, class_name: 'UserInviteRequest', inverse_of: :user, dependent: :destroy
78
+  accepts_nested_attributes_for :invite_request, reject_if: ->(attributes) { attributes['text'].blank? }
79
+
77 80
   validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
78 81
   validates_with BlacklistedEmailValidator, if: :email_changed?
79 82
   validates_with EmailMxValidator, if: :validate_email_dns?

+ 17
- 0
app/models/user_invite_request.rb View File

@@ -0,0 +1,17 @@
1
+# frozen_string_literal: true
2
+
3
+# == Schema Information
4
+#
5
+# Table name: user_invite_requests
6
+#
7
+#  id         :bigint(8)        not null, primary key
8
+#  user_id    :bigint(8)
9
+#  text       :text
10
+#  created_at :datetime         not null
11
+#  updated_at :datetime         not null
12
+#
13
+
14
+class UserInviteRequest < ApplicationRecord
15
+  belongs_to :user, inverse_of: :invite_request
16
+  validates :text, presence: true, length: { maximum: 420 }
17
+end

+ 5
- 0
app/views/about/_registration.html.haml View File

@@ -10,6 +10,11 @@
10 10
       = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations?
11 11
       = f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations?
12 12
 
13
+    - if approved_registrations?
14
+      .fields-group
15
+        = f.simple_fields_for :invite_request do |invite_request_fields|
16
+          = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: false
17
+
13 18
     .fields-group
14 19
       = f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: closed_registrations?
15 20
 

+ 11
- 11
app/views/admin/pending_accounts/_account.html.haml View File

@@ -1,14 +1,14 @@
1 1
 .batch-table__row
2 2
   %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
3 3
     = f.check_box :account_ids, { multiple: true, include_hidden: false }, account.id
4
-  .batch-table__row__content.batch-table__row__content--unpadded
5
-    %table.accounts-table
6
-      %tbody
7
-        %tr
8
-          %td
9
-            = account.user_email
10
-            = "(@#{account.username})"
11
-            %br/
12
-            = account.user_current_sign_in_ip
13
-          %td.accounts-table__count
14
-            = table_link_to 'pencil', t('admin.accounts.edit'), admin_account_path(account.id)
4
+  .batch-table__row__content.pending-account
5
+    .pending-account__header
6
+      = link_to admin_account_path(account.id) do
7
+        %strong= account.user_email
8
+        = "(@#{account.username})"
9
+      %br/
10
+      = account.user_current_sign_in_ip
11
+
12
+    - if account.user&.invite_request&.text&.present?
13
+      .pending-account__body
14
+        %p= account.user&.invite_request&.text

+ 8
- 1
app/views/auth/registrations/new.html.haml View File

@@ -21,12 +21,19 @@
21 21
 
22 22
   .fields-group
23 23
     = f.input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }
24
+
24 25
   .fields-group
25 26
     = f.input :password_confirmation, wrapper: :with_label, label: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }
26 27
 
28
+  - if approved_registrations? && !@invite.present?
29
+    .fields-group
30
+      = f.simple_fields_for :invite_request do |invite_request_fields|
31
+        = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: false
32
+
27 33
   = f.input :invite_code, as: :hidden
28 34
 
29
-  %p.hint= t('auth.agreement_html', rules_path: about_more_path, terms_path: terms_path)
35
+  .fields-group
36
+    = f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path)
30 37
 
31 38
   .actions
32 39
     = f.button :button, sign_up_message, type: :submit

+ 0
- 1
config/locales/ar.yml View File

@@ -498,7 +498,6 @@ ar:
498 498
     warning: كن حذرا مع هذه البيانات. لا تقم أبدا بمشاركتها مع الآخَرين !
499 499
     your_token: رمز نفاذك
500 500
   auth:
501
-    agreement_html: بمجرد النقر على "التسجيل" أسفله، فإنك تُصرِّح قبول <a href="%{rules_path}">قواعد مثيل الخادوم</a> و <a href="%{terms_path}">شروط الخدمة التي نوفرها لك</a>.
502 501
     change_password: الكلمة السرية
503 502
     confirm_email: تأكيد عنوان البريد الإلكتروني
504 503
     delete_account: حذف حساب

+ 0
- 1
config/locales/ast.yml View File

@@ -123,7 +123,6 @@ ast:
123 123
     invalid_url: La URL apurrida nun ye válida
124 124
     warning: Ten curiáu con estos datos, ¡enxamás nun los compartas con naide!
125 125
   auth:
126
-    agreement_html: Faciendo clic en «Aniciar sesión» aceutes siguir <a href="%{rules_path}"> les regles de la instancia</a> y <a href="%{terms_path}">los nuesos términos del serviciu</a>.
127 126
     change_password: Contraseña
128 127
     delete_account: Desaniciu de la cuenta
129 128
     delete_account_html: Si deseyes desaniciar la to cuenta, pues <a href="%{path}">siguir equí</a>. Va pidísete la confirmación.

+ 0
- 1
config/locales/ca.yml View File

@@ -507,7 +507,6 @@ ca:
507 507
     warning: Aneu amb compte amb aquestes dades. No les compartiu mai amb ningú!
508 508
     your_token: El teu identificador d'accés
509 509
   auth:
510
-    agreement_html: Al fer clic en "Registre" acceptes respectar <a href="%{rules_path}">les normes del servidor</a> i <a href="%{terms_path}">els nostres termes del servei</a>.
511 510
     apply_for_account: Demana una invitació
512 511
     change_password: Contrasenya
513 512
     checkbox_agreement_html: Estic d'acord amb les <a href="%{rules_path}" target="_blank">normes del servidor</a> i <a href="%{terms_path}" target="_blank"> els termes del servei</a>

+ 0
- 1
config/locales/co.yml View File

@@ -513,7 +513,6 @@ co:
513 513
     warning: Abbadate à quessi dati. Ùn i date à nisunu!
514 514
     your_token: Rigenerà a fiscia d’accessu
515 515
   auth:
516
-    agreement_html: Cliccà "Arregistrassi" quì sottu vole dì chì site d’accunsentu per siguità <a href="%{rules_path}">e regule di u servore</a> è <a href="%{terms_path}">e cundizione d’usu</a>.
517 516
     apply_for_account: Dumandà un'invitazione
518 517
     change_password: Chjave d’accessu
519 518
     checkbox_agreement_html: Sò d'accunsentu cù e <a href="%{rules_path}" target="_blank">regule di u servore</a> è i <a href="%{terms_path}" target="_blank">termini di u serviziu</a>

+ 0
- 1
config/locales/cs.yml View File

@@ -518,7 +518,6 @@ cs:
518 518
     warning: Buďte s těmito daty velmi opatrní. Nikdy je s nikým nesdílejte!
519 519
     your_token: Váš přístupový token
520 520
   auth:
521
-    agreement_html: Kliknutím na tlačítko „Registrovat“ souhlasíte s následováním <a href="%{rules_path}">pravidel tohoto serveru</a> a <a href="%{terms_path}">našich podmínek používání</a>.
522 521
     apply_for_account: Vyžádat si pozvánku
523 522
     change_password: Heslo
524 523
     checkbox_agreement_html: Souhlasím s <a href="%{rules_path}" target="_blank">pravidly serveru</a> a <a href="%{terms_path}" target="_blank">podmínkami používání</a>

+ 0
- 1
config/locales/cy.yml View File

@@ -506,7 +506,6 @@ cy:
506 506
     warning: Byddwch yn ofalus a'r data hyn. Peidiwch a'i rannu byth!
507 507
     your_token: Eich tocyn mynediad
508 508
   auth:
509
-    agreement_html: Wrth glicio "Cofrestru" isod yr ydych yn cytuno i ddilyn <a href="%{rules_path}">y rheolau ar gyfer yr achos hwn</a> a <a href="%{terms_path}">ein termau gwasanaeth</a>.
510 509
     change_password: Cyfrinair
511 510
     confirm_email: Cadarnhau e-bost
512 511
     delete_account: Dileu cyfrif

+ 0
- 1
config/locales/da.yml View File

@@ -432,7 +432,6 @@ da:
432 432
     warning: Vær meget forsigtig med disse data. Del dem aldrig med nogen!
433 433
     your_token: Din adgangs token
434 434
   auth:
435
-    agreement_html: Ved at oprette dig erklærer du dig enig i at følge <a href="%{rules_path}">serverens regler</a> og <a href="%{terms_path}">vores servicevilkår</a>.
436 435
     change_password: Kodeord
437 436
     confirm_email: Bekræft email
438 437
     delete_account: Slet konto

+ 0
- 1
config/locales/de.yml View File

@@ -511,7 +511,6 @@ de:
511 511
     warning: Sei mit diesen Daten sehr vorsichtig. Teile sie mit niemandem!
512 512
     your_token: Dein Zugangs-Token
513 513
   auth:
514
-    agreement_html: Indem du dich registrierst, erklärst du dich mit den untenstehenden <a href="%{rules_path}">Regeln des Servers</a> und der <a href="%{terms_path}">Datenschutzerklärung</a> einverstanden.
515 514
     apply_for_account: Eine Einladung anfragen
516 515
     change_password: Passwort
517 516
     checkbox_agreement_html: Ich akzeptiere die <a href="%{rules_path}" target="_blank">Server-Regeln</a> und die <a href="%{terms_path}" target="_blank">Nutzungsbedingungen</a>

+ 0
- 1
config/locales/el.yml View File

@@ -506,7 +506,6 @@ el:
506 506
     warning: Μεγάλη προσοχή με αυτά τα στοιχεία. Μην τα μοιραστείς ποτέ με κανέναν!
507 507
     your_token: Το διακριτικό πρόσβασής σου (access token)
508 508
   auth:
509
-    agreement_html: Επιλέγοντας το "Εγγραφή", συμφωνείς πως δέχεσαι <a href="%{rules_path}">τους κανόνες αυτού του κόμβου</a> και <a href="%{terms_path}">τους όρους χρήσης του</a>.
510 509
     apply_for_account: Αίτηση πρόσκλησης
511 510
     change_password: Συνθηματικό
512 511
     checkbox_agreement_html: Συμφωνώ με τους <a href="%{rules_path}" target="_blank">κανονισμούς του κόμβου</a> και <a href="%{terms_path}" target="_blank">τους όρους χρήσης</a>

+ 0
- 1
config/locales/en.yml View File

@@ -513,7 +513,6 @@ en:
513 513
     warning: Be very careful with this data. Never share it with anyone!
514 514
     your_token: Your access token
515 515
   auth:
516
-    agreement_html: By clicking "Sign up" below you agree to follow <a href="%{rules_path}">the rules of the server</a> and <a href="%{terms_path}">our terms of service</a>.
517 516
     apply_for_account: Request an invite
518 517
     change_password: Password
519 518
     checkbox_agreement_html: I agree to the <a href="%{rules_path}" target="_blank">server rules</a> and <a href="%{terms_path}" target="_blank">terms of service</a>

+ 0
- 1
config/locales/en_GB.yml View File

@@ -506,7 +506,6 @@ en_GB:
506 506
     warning: Be very careful with this data. Never share it with anyone!
507 507
     your_token: Your access token
508 508
   auth:
509
-    agreement_html: By clicking "Sign up" below you agree to follow <a href="%{rules_path}">the rules of the server</a> and <a href="%{terms_path}">our terms of service</a>.
510 509
     apply_for_account: Request an invite
511 510
     change_password: Password
512 511
     checkbox_agreement_html: I agree to the <a href="%{rules_path}" target="_blank">server rules</a> and <a href="%{terms_path}" target="_blank">terms of service</a>

+ 0
- 1
config/locales/eo.yml View File

@@ -507,7 +507,6 @@ eo:
507 507
     warning: Estu tre atenta kun ĉi tiu datumo. Neniam diskonigu ĝin al iu ajn!
508 508
     your_token: Via alira ĵetono
509 509
   auth:
510
-    agreement_html: Klakante “Registriĝi” sube, vi konsentas kun <a href="%{rules_path}">la reguloj de la servilo</a> kaj <a href="%{terms_path}">niaj uzkondiĉoj</a>.
511 510
     apply_for_account: Peti inviton
512 511
     change_password: Pasvorto
513 512
     checkbox_agreement_html: Mi samopinii al la <a href="%{rules_path}" target="_blank">Servo reguloj</a> kaj <a href="%{terms_path}" target="_blank">kondiĉo al servadon</a>

+ 0
- 1
config/locales/es.yml View File

@@ -437,7 +437,6 @@ es:
437 437
     warning: Ten mucho cuidado con estos datos. ¡No los compartas con nadie!
438 438
     your_token: Tu token de acceso
439 439
   auth:
440
-    agreement_html: Al hacer click en "Registrarse" acepta seguir <a href="%{rules_path}">las reglas de la instancia</a> y <a href="%{terms_path}">nuestros términos de servicio</a>.
441 440
     change_password: Contraseña
442 441
     confirm_email: Confirmar email
443 442
     delete_account: Borrar cuenta

+ 0
- 1
config/locales/eu.yml View File

@@ -481,7 +481,6 @@ eu:
481 481
     warning: Kontuz datu hauekin, ez partekatu inoiz inorekin!
482 482
     your_token: Zure sarbide token-a
483 483
   auth:
484
-    agreement_html: '"Izena eman" botoia sakatzean <a href="%{rules_path}">zerbitzariaren arauak</a> eta <a href="%{terms_path}">erabilera baldintzak</a> onartzen dituzu.'
485 484
     change_password: Pasahitza
486 485
     confirm_email: Berretsi e-mail helbidea
487 486
     delete_account: Ezabatu kontua

+ 0
- 1
config/locales/fa.yml View File

@@ -506,7 +506,6 @@ fa:
506 506
     warning: خیلی مواظب این اطلاعات باشید و آن را به هیچ کس ندهید!
507 507
     your_token: کد دسترسی شما
508 508
   auth:
509
-    agreement_html: با کلیک روی دکمهٔ عضو شدن، شما <a href="%{rules_path}">قوانین این سرور</a> و <a href="%{terms_path}">شرایط استفادهٔ</a> ما را می‌پذیرید.
510 509
     apply_for_account: درخواست دعوت‌نامه
511 510
     change_password: رمز
512 511
     checkbox_agreement_html: من <a href="%{rules_path}" target="_blank">قانون‌های این سرور</a> و <a href="%{terms_path}" target="_blank">شرایط کاربری</a> را می‌پذیرم

+ 0
- 1
config/locales/fi.yml View File

@@ -370,7 +370,6 @@ fi:
370 370
     warning: Säilytä tietoa hyvin. Älä milloinkaan jaa sitä muille!
371 371
     your_token: Pääsytunnus
372 372
   auth:
373
-    agreement_html: Rekisteröityessäsi sitoudut noudattamaan <a href="%{rules_path}">instanssin sääntöjä</a> ja <a href="%{terms_path}">käyttöehtoja</a>.
374 373
     change_password: Salasana
375 374
     confirm_email: Vahvista sähköpostiosoite
376 375
     delete_account: Poista tili

+ 0
- 1
config/locales/fr.yml View File

@@ -482,7 +482,6 @@ fr:
482 482
     warning: Soyez prudent⋅e avec ces données. Ne les partagez pas !
483 483
     your_token: Votre jeton d’accès
484 484
   auth:
485
-    agreement_html: En cliquant sur "S'inscrire" ci-dessous, vous souscrivez <a href="%{rules_path}">aux règles du serveur</a> et à <a href="%{terms_path}">nos conditions d’utilisation</a>.
486 485
     change_password: Mot de passe
487 486
     confirm_email: Confirmer mon adresse mail
488 487
     delete_account: Supprimer le compte

+ 0
- 1
config/locales/gl.yml View File

@@ -506,7 +506,6 @@ gl:
506 506
     warning: Teña moito tino con estos datos. Nunca os comparta con ninguén!
507 507
     your_token: O seu testemuño de acceso
508 508
   auth:
509
-    agreement_html: Ao pulsar "Rexistrar" vostede acorda seguir <a href="%{rules_path}">as normas do servidor</a> e <a href="%{terms_path}">os termos do servizo</a>.
510 509
     apply_for_account: Solicite un convite
511 510
     change_password: Contrasinal
512 511
     checkbox_agreement_html: Acepto as <a href="%{rules_path}" target="_blank">regras do servidor</a> e os <a href="%{terms_path}" target="_blank">termos do servizo</a>

+ 0
- 1
config/locales/hu.yml View File

@@ -309,7 +309,6 @@ hu:
309 309
     warning: Ez érzékeny adat. Soha ne oszd meg másokkal!
310 310
     your_token: Hozzáférési kulcsod
311 311
   auth:
312
-    agreement_html: A feliratkozással elfogatod az <a href="%{rules_path}">instancia szabályzatát</a> és a <a href="%{terms_path}">felhasználási feltételeket</a>.
313 312
     delete_account: Felhasználói fiók törlése
314 313
     delete_account_html: Felhasználói fiókod törléséhez <a href="%{path}">kattints ide</a>. A rendszer újbóli megerősítést fog kérni.
315 314
     didnt_get_confirmation: Nem kaptad meg a megerősítési lépéseket?

+ 0
- 1
config/locales/it.yml View File

@@ -467,7 +467,6 @@ it:
467 467
     token_regenerated: Token di accesso rigenerato
468 468
     warning: Fa' molta attenzione con questi dati. Non fornirli mai a nessun altro!
469 469
   auth:
470
-    agreement_html: Iscrivendoti, accetti di seguire <a href="%{rules_path}">le regole del server</a> e <a href="%{terms_path}"> le nostre condizioni di servizio</a>.
471 470
     change_password: Password
472 471
     confirm_email: Conferma email
473 472
     delete_account: Elimina account

+ 0
- 1
config/locales/ja.yml View File

@@ -512,7 +512,6 @@ ja:
512 512
     warning: このデータは気をつけて取り扱ってください。他の人と共有しないでください!
513 513
     your_token: アクセストークン
514 514
   auth:
515
-    agreement_html: 登録するをクリックすると <a href="%{rules_path}">サーバーのルール</a> と <a href="%{terms_path}">プライバシーポリシー</a> に従うことに同意したことになります。
516 515
     apply_for_account: 登録を申請する
517 516
     change_password: パスワード
518 517
     checkbox_agreement_html: <a href="%{rules_path}" target="_blank">サーバーのルール</a> と <a href="%{terms_path}" target="_blank">プライバシーポリシー</a> に同意します

+ 0
- 1
config/locales/ka.yml View File

@@ -401,7 +401,6 @@ ka:
401 401
     warning: იყავით ძალიან ფრთხილად ამ მონაცემთან. არასდროს გააზიაროთ ეს!
402 402
     your_token: თქვენი წვდომის ტოკენი
403 403
   auth:
404
-    agreement_html: რეგისტრაციით თქვენ ეთანხმებით <a href="%{rules_path}">ინსტანციის წესებს</a> და <a href="%{terms_path}">ჩვენ მომსახურების პირობებს</a>.
405 404
     change_password: პაროლი
406 405
     confirm_email: ელ-ფოსტის დამოწმება
407 406
     delete_account: ანგარიშის გაუქმება

+ 0
- 1
config/locales/kk.yml View File

@@ -482,7 +482,6 @@ kk:
482 482
     warning: Be very carеful with this data. Never share it with anyone!
483 483
     your_token: Your access tokеn
484 484
   auth:
485
-    agreement_html: '"Тіркелу" батырмасын басу арқылы <a href="%{rules_path}">сервер ережелері</a> мен <a href="%{terms_path}">қолдану шарттарына</a> келісесіз.'
486 485
     change_password: Құпиясөз
487 486
     confirm_email: Еmаil құптау
488 487
     delete_account: Аккаунт өшіру

+ 0
- 1
config/locales/ko.yml View File

@@ -514,7 +514,6 @@ ko:
514 514
     warning: 이 데이터를 조심히 다뤄 주세요. 다른 사람들과 절대로 공유하지 마세요!
515 515
     your_token: 액세스 토큰
516 516
   auth:
517
-    agreement_html: 이 등록으로 이 서버의 <a href="%{rules_path}">이용규약</a> 과 <a href="%{terms_path}">약관</a>에 동의하는 것으로 간주됩니다.
518 517
     apply_for_account: 가입 요청하기
519 518
     change_password: 패스워드
520 519
     checkbox_agreement_html: <a href="%{rules_path}" target="_blank">서버 규칙</a>과 <a href="%{terms_path}" target="_blank">이용약관</a>에 동의합니다

+ 0
- 1
config/locales/lt.yml View File

@@ -490,7 +490,6 @@ lt:
490 490
     warning: Būkite atsargūs su šia informacija. Niekada jos nesidalinkite!
491 491
     your_token: Jūsų prieigos žetonas
492 492
   auth:
493
-    agreement_html: Paspaudus "Sign up" Jūs sutinkate sekti <a href="%{rules_path}">serverio taisykles</a> bei <a href="%{terms_path}">naudojimo sąlygas</a>.
494 493
     change_password: Slaptažodis
495 494
     confirm_email: Patvirtinti el paštą
496 495
     delete_account: Ištrinti paskyrą

+ 0
- 1
config/locales/nl.yml View File

@@ -506,7 +506,6 @@ nl:
506 506
     warning: Wees voorzichtig met deze gegevens. Deel het nooit met iemand anders!
507 507
     your_token: Jouw toegangscode
508 508
   auth:
509
-    agreement_html: Wanneer je op registreren klikt ga je akkoord met het opvolgen van <a href="%{rules_path}">de regels van deze server</a> en <a href="%{terms_path}">onze gebruiksvoorwaarden</a>.
510 509
     apply_for_account: Een uitnodiging aanvragen
511 510
     change_password: Wachtwoord
512 511
     checkbox_agreement_html: Ik ga akkoord met de <a href="%{rules_path}" target="_blank">regels van deze server</a> en de <a href="%{terms_path}" target="_blank">gebruiksvoorwaarden</a>

+ 0
- 1
config/locales/no.yml View File

@@ -309,7 +309,6 @@
309 309
     warning: Vær veldig forsiktig med denne data. Aldri del den med noen!
310 310
     your_token: Din tilgangsnøkkel
311 311
   auth:
312
-    agreement_html: Ved å registrere deg godtar du å følge <a href="%{rules_path}">instansens regler</a> og <a href="%{terms_path}">våre brukervilkår</a>.
313 312
     delete_account: Slett konto
314 313
     delete_account_html: Hvis du ønsker å slette din konto kan du <a href="%{path}">fortsette her</a>. Du vil bli spurt om bekreftelse.
315 314
     didnt_get_confirmation: Mottok du ikke instruksjoner om bekreftelse?

+ 0
- 1
config/locales/oc.yml View File

@@ -498,7 +498,6 @@ oc:
498 498
     warning: Mèfi ! Agachatz de partejar aquela donada amb degun !
499 499
     your_token: Vòstre geton d’accès
500 500
   auth:
501
-    agreement_html: En vos marcar acceptatz <a href="%{rules_path}">las règlas del servidor</a> e <a href="%{terms_path}">politica de confidencialitat</a>.
502 501
     apply_for_account: Demandar una invitacion
503 502
     change_password: Senhal
504 503
     checkbox_agreement_html: Accepti las <a href="%{rules_path}" target="_blank">règlas del servidor</a> e <a href="%{terms_path}" target="_blank">los tèrmes del servici</a>

+ 0
- 1
config/locales/pl.yml View File

@@ -519,7 +519,6 @@ pl:
519 519
     warning: Przechowuj te dane ostrożnie. Nie udostępniaj ich nikomu!
520 520
     your_token: Twój token dostępu
521 521
   auth:
522
-    agreement_html: Rejestrując się, oświadczasz, że zapoznałeś(-aś) się z <a href="%{rules_path}">informacjami o serwerze</a> i <a href="%{terms_path}">zasadami korzystania z usługi</a>.
523 522
     apply_for_account: Poproś o zaproszenie
524 523
     change_password: Hasło
525 524
     checkbox_agreement_html: Zgadzam się z <a href="%{rules_path}" target="_blank">regułami serwera</a> i <a href="%{terms_path}" target="_blank">zasadami korzystania z usługi</a>

+ 0
- 1
config/locales/pt-BR.yml View File

@@ -507,7 +507,6 @@ pt-BR:
507 507
     warning: Tenha cuidado com estes dados. Nunca compartilhe com alguém!
508 508
     your_token: Seu token de acesso
509 509
   auth:
510
-    agreement_html: Ao se cadastrar você concorda em seguir <a href="%{rules_path}">as regras da instância</a> e <a href="%{terms_path}">os nossos termos de serviço</a>.
511 510
     apply_for_account: Pedir um convite
512 511
     change_password: Senha
513 512
     checkbox_agreement_html: Eu concordo com <a href="%{rules_path}" target="_blank">as regras do servidor</a> e com <a href="%{terms_path}" target="_blank">os termos de serviço</a>

+ 0
- 1
config/locales/pt.yml View File

@@ -482,7 +482,6 @@ pt:
482 482
     warning: Cuidado com estes dados. Não partilhar com ninguém!
483 483
     your_token: O teu token de acesso
484 484
   auth:
485
-    agreement_html: Registando-te concordas em seguir <a href="%{rules_path}">as regras da instância</a> e <a href="%{terms_path}">os nossos termos de serviço</a>.
486 485
     change_password: Palavra-passe
487 486
     confirm_email: Confirmar e-mail
488 487
     delete_account: Eliminar conta

+ 0
- 1
config/locales/ro.yml View File

@@ -8,7 +8,6 @@ ro:
8 8
       one: Toot
9 9
       other: Toots
10 10
   auth:
11
-    agreement_html: Prin apăsarea butonului Înscriere de mai jos ești deacord cu <a href="%{rules_path}">regulile acestei instanțe</a> și <a href="%{terms_path}">termenii de utilizare al acestui serviciu</a>.
12 11
     change_password: Parolă
13 12
     confirm_email: Confirmă email
14 13
     delete_account: Șterge contul

+ 0
- 1
config/locales/ru.yml View File

@@ -424,7 +424,6 @@ ru:
424 424
     warning: Будьте очень внимательны с этими данными. Не делитесь ими ни с кем!
425 425
     your_token: Ваш токен доступа
426 426
   auth:
427
-    agreement_html: Создавая аккаунт, вы соглашаетесь с <a href="%{rules_path}">правилами узла</a> и <a href="%{terms_path}">нашими условиями обслуживания</a>.
428 427
     change_password: Пароль
429 428
     confirm_email: Подтвердите email
430 429
     delete_account: Удалить аккаунт

+ 4
- 0
config/locales/simple_form.en.yml View File

@@ -41,6 +41,8 @@ en:
41 41
         name: 'You might want to use one of these:'
42 42
       imports:
43 43
         data: CSV file exported from another Mastodon server
44
+      invite_request:
45
+        text: This will help us review your application
44 46
       sessions:
45 47
         otp: 'Enter the two-factor code generated by your phone app or use one of your recovery codes:'
46 48
       user:
@@ -118,6 +120,8 @@ en:
118 120
         must_be_follower: Block notifications from non-followers
119 121
         must_be_following: Block notifications from people you don't follow
120 122
         must_be_following_dm: Block direct messages from people you don't follow
123
+      invite_request:
124
+        text: Why do you want to join?
121 125
       notification_emails:
122 126
         digest: Send digest e-mails
123 127
         favourite: Send e-mail when someone favourites your status

+ 0
- 1
config/locales/sk.yml View File

@@ -511,7 +511,6 @@ sk:
511 511
     warning: Na tieto údaje dávajte ohromný pozor. Nikdy ich s nikým nezďieľajte!
512 512
     your_token: Váš prístupový token
513 513
   auth:
514
-    agreement_html: V rámci registrácie súhlasíš, že sa budeš riadiť <a href="%{rules_path}"> pravidlami tohto servera</a>, a taktiež <a href="%{terms_path}"> našími prevádzkovými podmienkami</a>.
515 514
     change_password: Heslo
516 515
     confirm_email: Potvrdiť email
517 516
     delete_account: Vymaž účet

+ 0
- 1
config/locales/sq.yml View File

@@ -479,7 +479,6 @@ sq:
479 479
     warning: Hapni sytë me ato të dhëna. Mos ia jepni kurrë njeriu!
480 480
     your_token: Token-i juaj për hyrje
481 481
   auth:
482
-    agreement_html: Duke klikuar mbi "Regjistrohuni" më poshtë, pajtoheni të ndiqni <a href="%{rules_path}">rregullat e shërbyesit</a> dhe <a href="%{terms_path}">kushtet tona të shërbimit</a>.
483 482
     change_password: Fjalëkalim
484 483
     confirm_email: Ripohoni email-in
485 484
     delete_account: Fshije llogarinë

+ 0
- 1
config/locales/sr-Latn.yml View File

@@ -302,7 +302,6 @@ sr-Latn:
302 302
     warning: Oprezno sa ovim podacima. Nikad je ne delite ni sa kim!
303 303
     your_token: Vaš pristupni token
304 304
   auth:
305
-    agreement_html: Pristupanjem instanci se slažete sa <a href="%{rules_path}">pravilima instance</a> i <a href="%{terms_path}">uslovima korišćenja</a>.
306 305
     delete_account: Obriši nalog
307 306
     delete_account_html: Ako želite da obrišete Vaš nalog, možete <a href="%{path}">nastaviti ovde</a>. Bićete upitani da potvrdite.
308 307
     didnt_get_confirmation: Niste dobili poruku sa uputstvima za potvrdu naloga?

+ 0
- 1
config/locales/sr.yml View File

@@ -492,7 +492,6 @@ sr:
492 492
     warning: Опрезно са овим подацима. Никад је не делите ни са ким!
493 493
     your_token: Ваш приступни токен
494 494
   auth:
495
-    agreement_html: Приступањем инстанци се слажете са <a href="%{rules_path}">правилима инстанце</a> и <a href="%{terms_path}">условима коришћења</a>.
496 495
     change_password: Лозинка
497 496
     confirm_email: Потврдите адресу е-поште
498 497
     delete_account: Обриши налог

+ 0
- 1
config/locales/sv.yml View File

@@ -354,7 +354,6 @@ sv:
354 354
     warning: Var mycket försiktig med denna data. Dela aldrig den med någon!
355 355
     your_token: Din access token
356 356
   auth:
357
-    agreement_html: Genom att registrera dig godkänner du att följa <a href="%{rules_path}">instansens regler</a> och <a href="%{terms_path}">våra användarvillkor</a>.
358 357
     change_password: Lösenord
359 358
     confirm_email: Bekräfta e-postadress
360 359
     delete_account: Ta bort konto

+ 0
- 1
config/locales/uk.yml View File

@@ -386,7 +386,6 @@ uk:
386 386
     warning: Будьте дуже обережні з цими даними. Ніколи не діліться ними ні з ким!
387 387
     your_token: Ваш токен доступу
388 388
   auth:
389
-    agreement_html: Реєструючись, ви погоджуєтеся виконувати <a href="%{rules_path}">правила інстанції</a> та <a href="%{terms_path}">наші умови використання</a>.
390 389
     change_password: Пароль
391 390
     confirm_email: Підтвердьте e-mail адресу
392 391
     delete_account: Видалити аккаунт

+ 0
- 1
config/locales/zh-CN.yml View File

@@ -410,7 +410,6 @@ zh-CN:
410 410
     warning: 一定小心,千万不要把它分享给任何人!
411 411
     your_token: 你的访问令牌
412 412
   auth:
413
-    agreement_html: 点击注册即表示你同意遵守<a href="%{rules_path}">本站的相关规定</a>和<a href="%{terms_path}">我们的使用条款</a>。
414 413
     change_password: 密码
415 414
     confirm_email: 确认电子邮件地址
416 415
     delete_account: 删除帐户

+ 0
- 1
config/locales/zh-HK.yml View File

@@ -352,7 +352,6 @@ zh-HK:
352 352
     warning: 警告,不要把它分享給任何人!
353 353
     your_token: token
354 354
   auth:
355
-    agreement_html: 登記即表示你同意遵守<a href="%{rules_path}">本服務站的規則</a>和<a href="%{terms_path}">使用條款</a>。
356 355
     change_password: 密碼
357 356
     confirm_email: 確認電郵
358 357
     delete_account: 刪除帳戶

+ 0
- 1
config/locales/zh-TW.yml View File

@@ -436,7 +436,6 @@ zh-TW:
436 436
     warning: 警告,不要把它分享給任何人!
437 437
     your_token: 你的 token
438 438
   auth:
439
-    agreement_html: 按下下方的「註冊」即代表同意遵守 <a href="%{rules_path}">此伺服器的規則</a> 以及 <a href="%{terms_path}">使用條款</a>。
440 439
     change_password: 密碼
441 440
     confirm_email: 確認電子信箱位址
442 441
     delete_account: 刪除帳戶

+ 10
- 0
db/migrate/20190409054914_create_user_invite_requests.rb View File

@@ -0,0 +1,10 @@
1
+class CreateUserInviteRequests < ActiveRecord::Migration[5.2]
2
+  def change
3
+    create_table :user_invite_requests do |t|
4
+      t.belongs_to :user, foreign_key: { on_delete: :cascade }
5
+      t.text :text
6
+
7
+      t.timestamps
8
+    end
9
+  end
10
+end

+ 10
- 1
db/schema.rb View File

@@ -10,7 +10,7 @@
10 10
 #
11 11
 # It's strongly recommended that you check this file into your version control system.
12 12
 
13
-ActiveRecord::Schema.define(version: 2019_03_17_135723) do
13
+ActiveRecord::Schema.define(version: 2019_04_09_054914) do
14 14
 
15 15
   # These are extensions that must be enabled in order to support this database
16 16
   enable_extension "plpgsql"
@@ -679,6 +679,14 @@ ActiveRecord::Schema.define(version: 2019_03_17_135723) do
679 679
     t.index ["uri"], name: "index_tombstones_on_uri"
680 680
   end
681 681
 
682
+  create_table "user_invite_requests", force: :cascade do |t|
683
+    t.bigint "user_id"
684
+    t.text "text"
685
+    t.datetime "created_at", null: false
686
+    t.datetime "updated_at", null: false
687
+    t.index ["user_id"], name: "index_user_invite_requests_on_user_id"
688
+  end
689
+
682 690
   create_table "users", force: :cascade do |t|
683 691
     t.string "email", default: "", null: false
684 692
     t.datetime "created_at", null: false
@@ -816,6 +824,7 @@ ActiveRecord::Schema.define(version: 2019_03_17_135723) do
816 824
   add_foreign_key "stream_entries", "accounts", name: "fk_5659b17554", on_delete: :cascade
817 825
   add_foreign_key "subscriptions", "accounts", name: "fk_9847d1cbb5", on_delete: :cascade
818 826
   add_foreign_key "tombstones", "accounts", on_delete: :cascade
827
+  add_foreign_key "user_invite_requests", "users", on_delete: :cascade
819 828
   add_foreign_key "users", "accounts", name: "fk_50500f500d", on_delete: :cascade
820 829
   add_foreign_key "users", "invites", on_delete: :nullify
821 830
   add_foreign_key "users", "oauth_applications", column: "created_by_application_id", on_delete: :nullify

+ 4
- 0
spec/fabricators/user_invite_request_fabricator.rb View File

@@ -0,0 +1,4 @@
1
+Fabricator(:user_invite_request) do
2
+  user
3
+  text { Faker::Lorem.sentence }
4
+end

+ 4
- 0
spec/models/user_invite_request_spec.rb View File

@@ -0,0 +1,4 @@
1
+require 'rails_helper'
2
+
3
+RSpec.describe UserInviteRequest, type: :model do
4
+end

Loading…
Cancel
Save