Add server rules (#15769)

This commit is contained in:
Eugen Rochko 2021-02-21 19:50:12 +01:00 committed by GitHub
parent dcc7c686f3
commit 8331fdf7e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 258 additions and 2 deletions

View file

@ -26,6 +26,8 @@ en:
It is used for federation purposes and should not be blocked unless you want to block the whole instance, in which case you should use a domain block.
learn_more: Learn more
privacy_policy: Privacy policy
rules: Server rules
rules_html: 'Below is a summary of rules you need to follow if you want to have an account on this server of Mastodon:'
see_whats_happening: See what's happening
server_stats: 'Server stats:'
source_code: Source code
@ -542,6 +544,11 @@ en:
unassign: Unassign
unresolved: Unresolved
updated_at: Updated
rules:
add_new: Add rule
description: While most claim to have read and agree to the terms of service, usually people do not read through until after a problem arises. Make it easier to see your server's rules at a glance by providing them in a flat bullet point list. Try to keep individual rules short and simple, but try not to split them up into many separate items either.
edit: Edit rule
title: Server rules
settings:
activity_api_enabled:
desc_html: Counts of locally posted statuses, active users, and new registrations in weekly buckets

View file

@ -73,6 +73,8 @@ en:
no_access: Block access to all resources
sign_up_requires_approval: New sign-ups will require your approval
severity: Choose what will happen with requests from this IP
rule:
text: Describe a rule or requirement for users on this server. Try to keep it short and simple
sessions:
otp: 'Enter the two-factor code generated by your phone app or use one of your recovery codes:'
webauthn: If it's an USB key be sure to insert it and, if necessary, tap it.
@ -197,6 +199,8 @@ en:
reblog: Someone boosted your status
report: New report is submitted
trending_tag: An unreviewed hashtag is trending
rule:
text: Rule
tag:
listable: Allow this hashtag to appear in searches and on the profile directory
name: Hashtag

View file

@ -47,6 +47,7 @@ SimpleNavigation::Configuration.run do |navigation|
n.item :admin, safe_join([fa_icon('cogs fw'), t('admin.title')]), admin_dashboard_url, if: proc { current_user.staff? } do |s|
s.item :dashboard, safe_join([fa_icon('tachometer fw'), t('admin.dashboard.title')]), admin_dashboard_url
s.item :settings, safe_join([fa_icon('cogs fw'), t('admin.settings.title')]), edit_admin_settings_url, if: -> { current_user.admin? }, highlights_on: %r{/admin/settings}
s.item :rules, safe_join([fa_icon('gavel fw'), t('admin.rules.title')]), admin_rules_path, highlights_on: %r{/admin/rules}
s.item :announcements, safe_join([fa_icon('bullhorn fw'), t('admin.announcements.title')]), admin_announcements_path, highlights_on: %r{/admin/announcements}
s.item :custom_emojis, safe_join([fa_icon('smile-o fw'), t('admin.custom_emojis.title')]), admin_custom_emojis_url, highlights_on: %r{/admin/custom_emojis}
s.item :relays, safe_join([fa_icon('exchange fw'), t('admin.relays.title')]), admin_relays_url, if: -> { current_user.admin? && !whitelist_mode? }, highlights_on: %r{/admin/relays}

View file

@ -220,6 +220,7 @@ Rails.application.routes.draw do
end
resources :instances, only: [:index, :show], constraints: { id: /[^\/]+/ }
resources :rules
resources :reports, only: [:index, :show] do
member do
@ -405,6 +406,7 @@ Rails.application.routes.draw do
resource :instance, only: [:show] do
resources :peers, only: [:index], controller: 'instances/peers'
resource :activity, only: [:show], controller: 'instances/activity'
resources :rules, only: [:index], controller: 'instances/rules'
end
resource :domain_blocks, only: [:show, :create, :destroy]