Commit 54d1f87
authored
Add Agreements and Agreement Terms (#884)
## Pull Request #884: Add Agreements and Agreement Terms
### Overview
- Base branch: main
- Feature branch: feature/agreements
- Commits: 38 commits (from May to August 2025)
- File changes: 238 files changed (+3644 / -2463)
### Key Highlights by File
1. app/builders/better_together/agreement_builder.rb
- Introduces a seeding builder for default agreements:
- Privacy Policy
- Terms of Service
- Code of Conduct
- Sets default titles, descriptions, and privacy settings.
- Includes linking to existing pages if available.
2. app/controllers/better_together/agreements_controller.rb
- New AgreementsController (inherits from FriendlyResourceController).
- Handles show action:
- If @agreement.page exists, renders within the appropriate layout.
- Supports Turbo Frame responses for modal display.
3. app/controllers/better_together/users/registrations_controller.rb
- Adds flows for agreement acceptance during user signup:
- set_required_agreements to load required Agreement records
(privacy_policy, terms_of_service, and optionally code_of_conduct).
- Validates checkbox acceptance in agreements_accepted?.
- Creates AgreementParticipant records upon successful signup to track
acceptance.
4. Styling & Layout
- Adds CSS classes in app/assets/stylesheets/better_together/forms.scss
for agreement modals and spacing (e.g., .agreement-modal-link,
.bt-mb-3).
5. Helper Module
- Adds an empty helper module BetterTogether::AgreementsHelper for
future use.
### Summary
This PR lays the groundwork for a structured agreements system:
- Seeds default agreements for users to consent to during signup.
- Renders agreements via modals using Turbo Frames for smooth UX.
- Tracks agreement acceptance per user via AgreementParticipant records.
### Next Steps / Considerations
- Review and refine acceptance flows and error messaging UX.
- Confirm localization support and styling for agreement modals.
- Ensure existing migrations (e.g., agreement_participants) are applied
without conflict.File tree
238 files changed
+3644
-2463
lines changed- app
- assets/stylesheets/better_together
- builders/better_together
- controllers/better_together
- users
- helpers/better_together
- javascript/controllers/better_together
- mailers/better_together
- models
- better_together
- geography
- concerns/better_together
- policies/better_together
- views
- better_together
- agreement_terms
- agreements
- calendars
- people
- devise/registrations
- config
- locales
- db
- migrate
- future_spec
- concerns/better_together
- models/better_together
- requests/better_together/api
- auth
- v1
- lib
- better_together
- tasks
- spec
- builders/better_together
- channels/better_together
- concerns/better_together
- dummy
- config/environments
- db
- factories/better_together
- features
- agreements
- conversations
- devise
- invitations
- joatu
- notifications
- helpers/better_together
- content
- geography
- metrics
- jobs/better_together
- metrics
- mailers/better_together
- models/better_together
- ai/log
- content
- geography
- infrastructure
- joatu
- metrics
- notifiers/better_together
- joatu
- policies/better_together
- joatu
- requests/better_together
- geography
- joatu
- metrics
- services/better_together/joatu
- support/better_together
- views
- better_together
- calls_for_interest
- files
- hub
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
238 files changed
+3644
-2463
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | | - | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| 56 | + | |
| 57 | + | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
56 | 71 | | |
57 | 72 | | |
58 | 73 | | |
| |||
72 | 87 | | |
73 | 88 | | |
74 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
75 | 107 | | |
76 | 108 | | |
77 | 109 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments