0
0
Fork 0

Add terms of service (#33055)

This commit is contained in:
Eugen Rochko 2024-12-09 11:04:46 +01:00 committed by GitHub
parent 7a2a345c08
commit 30aa0df88c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
129 changed files with 1456 additions and 238 deletions

View file

@ -0,0 +1,6 @@
.content__heading__tabs
= render_navigation renderer: :links do |primary|
:ruby
primary.item :current, safe_join([material_symbol('description'), t('admin.terms_of_service.current')]), admin_terms_of_service_index_path
primary.item :draft, safe_join([material_symbol('description'), t('admin.terms_of_service.draft')]), admin_terms_of_service_draft_path
primary.item :previous, safe_join([material_symbol('history'), t('admin.terms_of_service.history')]), admin_terms_of_service_history_path

View file

@ -0,0 +1,19 @@
- content_for :page_title do
= t('admin.terms_of_service.title')
- content_for :heading do
%h2= t('admin.terms_of_service.title')
= render partial: 'admin/terms_of_service/links'
= simple_form_for @terms_of_service, url: admin_terms_of_service_draft_path, method: :put do |form|
= render 'shared/error_messages', object: @terms_of_service
.fields-group
= form.input :text, wrapper: :with_block_label, input_html: { rows: 8 }
.fields-group
= form.input :changelog, wrapper: :with_block_label, input_html: { rows: 8 }
.actions
= form.button :button, t('admin.terms_of_service.save_draft'), type: :submit, name: :action_type, value: :save_draft, class: 'button button-secondary'
= form.button :button, t('admin.terms_of_service.publish'), type: :submit, name: :action_type, value: :publish

View file

@ -0,0 +1,41 @@
- content_for :page_title do
= t('admin.terms_of_service.generates.title')
- content_for :heading_actions do
.back-link
= link_to admin_terms_of_service_index_path do
= material_symbol 'chevron_left'
= t('admin.terms_of_service.back')
%p.lead= t('admin.terms_of_service.generates.explanation_html')
%p.lead= t('admin.terms_of_service.generates.chance_to_review_html')
%hr.spacer/
= simple_form_for @generator, url: admin_terms_of_service_generate_path, method: :post do |form|
= render 'shared/error_messages', object: @generator
.fields-group
= form.input :domain, wrapper: :with_label
.fields-group
= form.input :jurisdiction, wrapper: :with_label
.fields-group
= form.input :admin_email, wrapper: :with_label
.fields-group
= form.input :dmca_email, wrapper: :with_label
.fields-group
= form.input :dmca_address, wrapper: :with_label
.fields-group
= form.input :arbitration_address, wrapper: :with_label
.fields-group
= form.input :arbitration_website, wrapper: :with_label
.actions
= form.button :button, t('admin.terms_of_service.generates.action'), type: :submit

View file

@ -0,0 +1,16 @@
- content_for :page_title do
= t('admin.terms_of_service.history')
- content_for :heading do
%h2= t('admin.terms_of_service.title')
= render partial: 'admin/terms_of_service/links'
- if @terms_of_service.empty?
%p= t('admin.terms_of_service.no_history')
- else
%ol.admin__terms-of-service__history
- @terms_of_service.each do |terms_of_service|
%li
.admin__terms-of-service__history__item
%h5= l(terms_of_service.published_at)
.prose= markdown(terms_of_service.changelog)

View file

@ -0,0 +1,39 @@
- content_for :page_title do
= t('admin.terms_of_service.title')
- content_for :heading do
%h2= t('admin.terms_of_service.title')
= render partial: 'links'
- if @terms_of_service.present?
.admin__terms-of-service__container
.admin__terms-of-service__container__header
.dot-indicator.success
.dot-indicator__indicator
%span= t('admin.terms_of_service.live')
·
%span
= t('admin.terms_of_service.published_on_html', date: tag.time(l(@terms_of_service.published_at.to_date), class: 'formatted', date: @terms_of_service.published_at.to_date.iso8601))
·
- if @terms_of_service.notification_sent?
%span
= t('admin.terms_of_service.notified_on_html', date: tag.time(l(@terms_of_service.notification_sent_at.to_date), class: 'formatted', date: @terms_of_service.notification_sent_at.to_date.iso8601))
- else
= link_to t('admin.terms_of_service.notify_users'), admin_terms_of_service_preview_path(@terms_of_service), class: 'link-button'
.admin__terms-of-service__container__body
.prose
= markdown(@terms_of_service.text)
%hr.spacer/
%h3= t('admin.terms_of_service.changelog')
.prose
= markdown(@terms_of_service.changelog)
- else
%p.lead= t('admin.terms_of_service.no_terms_of_service_html')
.content__heading__actions
= link_to t('admin.terms_of_service.create'), admin_terms_of_service_draft_path, class: 'button'
= link_to t('admin.terms_of_service.generate'), admin_terms_of_service_generate_path, class: 'button button-secondary'

View file

@ -0,0 +1,20 @@
- content_for :page_title do
= t('admin.terms_of_service.preview.title')
- content_for :heading_actions do
.back-link
= link_to admin_terms_of_service_index_path do
= material_symbol 'chevron_left'
= t('admin.terms_of_service.back')
%p.lead
= t('admin.terms_of_service.preview.explanation_html', count: @user_count, display_count: number_with_delimiter(@user_count), date: l(@terms_of_service.published_at.to_date))
.prose
= markdown(@terms_of_service.changelog)
%hr.spacer/
.content__heading__actions
= link_to t('admin.terms_of_service.preview.send_preview', email: current_user.email), admin_terms_of_service_test_path(@terms_of_service), method: :post, class: 'button button-secondary'
= link_to t('admin.terms_of_service.preview.send_to_all', count: @user_count, display_count: number_with_delimiter(@user_count)), admin_terms_of_service_distribution_path(@terms_of_service), method: :post, class: 'button', data: { confirm: t('admin.reports.are_you_sure') }

View file

@ -72,7 +72,7 @@
.fields-group
= f.input :agreement,
as: :boolean,
label: t('auth.privacy_policy_agreement_html', rules_path: about_more_path, privacy_policy_path: privacy_policy_path),
label: t('auth.user_agreement_html', privacy_policy_path: privacy_policy_path, terms_of_service_path: terms_of_service_path),
required: false,
wrapper: :with_label

View file

@ -0,0 +1,6 @@
- content_for :page_title, t('terms_of_service.title')
- content_for :header_tags do
= render partial: 'shared/og'
= render 'shared/web_app'

View file

@ -0,0 +1,17 @@
= content_for :heading do
= render 'application/mailer/heading',
image_url: frontend_asset_url('images/mailer-new/heading/user.png'),
subtitle: t('user_mailer.terms_of_service_changed.subtitle', domain: site_hostname),
title: t('user_mailer.terms_of_service_changed.title')
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td.email-body-padding-td
%table.email-inner-card-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td.email-inner-card-td.email-prose
%p= t('user_mailer.terms_of_service_changed.description_html', path: terms_of_service_url, domain: site_hostname)
%p
%strong= t('user_mailer.terms_of_service_changed.changelog')
= markdown(@terms_of_service.changelog)
%p= t('user_mailer.terms_of_service_changed.agreement', domain: site_hostname)
%p= t('user_mailer.terms_of_service_changed.sign_off', domain: site_hostname)

View file

@ -0,0 +1,14 @@
<%= t('user_mailer.terms_of_service_changed.title') %>
===
<%= t('user_mailer.terms_of_service_changed.description', domain: site_hostname) %>
=> <%= terms_of_service_url %>
<%= t('user_mailer.terms_of_service_changed.changelog') %>
<%= @terms_of_service.changelog %>
<%= t('user_mailer.terms_of_service_changed.agreement', domain: site_hostname) %>
<%= t('user_mailer.terms_of_service_changed.sign_off', domain: site_hostname) %>