mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 08:34:13 -05:00
Add hints for rules (#29539)
This commit is contained in:
parent
98ef38e34e
commit
5b3a8737d6
@ -53,7 +53,7 @@ module Admin
|
||||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:rule).permit(:text, :priority)
|
||||
params.require(:rule).permit(:text, :hint, :priority)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -170,7 +170,8 @@ class About extends PureComponent {
|
||||
<ol className='rules-list'>
|
||||
{server.get('rules').map(rule => (
|
||||
<li key={rule.get('id')}>
|
||||
<span className='rules-list__text'>{rule.get('text')}</span>
|
||||
<div className='rules-list__text'>{rule.get('text')}</div>
|
||||
{rule.get('hint').length > 0 && (<div className='rules-list__hint'>{rule.get('hint')}</div>)}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
@ -53,4 +53,10 @@ $fluid-breakpoint: $maximum-width + 20px;
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__hint {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: $darker-text-color;
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
# text :text default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# hint :text default(""), not null
|
||||
#
|
||||
class Rule < ApplicationRecord
|
||||
include Discard::Model
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::RuleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :text
|
||||
attributes :id, :text, :hint
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
|
@ -7,5 +7,8 @@
|
||||
.fields-group
|
||||
= f.input :text, wrapper: :with_block_label
|
||||
|
||||
.fields-group
|
||||
= f.input :hint, wrapper: :with_block_label
|
||||
|
||||
.actions
|
||||
= f.button :button, t('generic.save_changes'), type: :submit
|
||||
|
@ -12,6 +12,9 @@
|
||||
.fields-group
|
||||
= f.input :text, wrapper: :with_block_label
|
||||
|
||||
.fields-group
|
||||
= f.input :hint, wrapper: :with_block_label
|
||||
|
||||
.actions
|
||||
= f.button :button, t('admin.rules.add_new'), type: :submit
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
- @rules.each do |rule|
|
||||
%li
|
||||
.rules-list__text= rule.text
|
||||
.rules-list__hint= rule.hint
|
||||
|
||||
.stacked-actions
|
||||
- accept_path = @invite_code.present? ? public_invite_url(invite_code: @invite_code, accept: @accept_token) : new_user_registration_path(accept: @accept_token)
|
||||
|
@ -116,6 +116,7 @@ en:
|
||||
sign_up_requires_approval: New sign-ups will require your approval
|
||||
severity: Choose what will happen with requests from this IP
|
||||
rule:
|
||||
hint: Optional. Provide more details about the 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:'
|
||||
@ -299,6 +300,7 @@ en:
|
||||
patch: Notify on bugfix updates
|
||||
trending_tag: New trend requires review
|
||||
rule:
|
||||
hint: Additional information
|
||||
text: Rule
|
||||
settings:
|
||||
indexable: Include profile page in search engines
|
||||
|
7
db/migrate/20240310123453_add_hint_to_rules.rb
Normal file
7
db/migrate/20240310123453_add_hint_to_rules.rb
Normal file
@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddHintToRules < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :rules, :hint, :text, null: false, default: ''
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2024_03_04_090449) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2024_03_10_123453) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@ -915,6 +915,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_04_090449) do
|
||||
t.text "text", default: "", null: false
|
||||
t.datetime "created_at", precision: nil, null: false
|
||||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.text "hint", default: "", null: false
|
||||
end
|
||||
|
||||
create_table "scheduled_statuses", force: :cascade do |t|
|
||||
|
Loading…
Reference in New Issue
Block a user