Add badges to Fedibird-specific settings

This commit is contained in:
noellabo 2022-02-08 13:33:44 +09:00
parent b5b756df95
commit 1877a1dff1
26 changed files with 65 additions and 14 deletions

View file

@ -696,6 +696,18 @@ html {
color: $ui-highlight-color;
background-color: rgba($ui-highlight-color, 0.1);
}
.fedibird_features {
border-color: $fedibird-theme-color;
color: $fedibird-theme-color;
background-color: rgba($fedibird-theme-color, 0.1);
}
}
.fedibird_features {
border-color: $fedibird-theme-color;
color: $fedibird-theme-color;
background-color: rgba($fedibird-theme-color, 0.1);
}
.compose-form .compose-form__warning {

View file

@ -202,6 +202,8 @@
}
.account-role,
.fedibird_features,
.simple_form .fedibird_features,
.simple_form .recommended {
padding: 4px 8px;
border-radius: 17px;

View file

@ -21,6 +21,7 @@
&.with_block_label .hint { margin-bottom: 16px }
&.boolean {
.fedibird_features,
.recommended { margin: 0 8px }
.label_input>label { padding-top: 3px }

View file

@ -202,6 +202,8 @@
}
.account-role,
.fedibird_features,
.simple_form .fedibird_features,
.simple_form .recommended {
display: inline-block;
padding: 4px 6px;
@ -227,6 +229,12 @@
}
}
.fedibird_features,
.simple_form .fedibird_features {
background-color: rgba($fedibird-theme-color, 0.5);
border: 1px solid $fedibird-theme-color;
}
.account__header__fields {
max-width: 100vw;
padding: 0;

View file

@ -102,6 +102,7 @@ code {
}
}
.fedibird_features,
.recommended {
position: absolute;
margin: 0 4px;

View file

@ -5,6 +5,7 @@ $success-green: #79bd9a !default; // Padua
$error-red: #df405a !default; // Cerise
$warning-red: #ff5050 !default; // Sunset Orange
$gold-star: #ca8f04 !default; // Dark Goldenrod
$fedibird-theme-color: #990099; // Violet
$red-bookmark: $warning-red;

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('account_subscribes.edit.title')
%span.fedibird_features Fedibird
= simple_form_for @form_account_subscribing, url: settings_account_subscribe_path(@form_account_subscribing.id), method: :put do |f|
= render 'shared/error_messages', object: @form_account_subscribing

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('settings.account_subscribes')
%span.fedibird_features Fedibird
%p= t('account_subscribes.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('account_subscribes.new.title')
%span.fedibird_features Fedibird
= simple_form_for @form_account_subscribing, url: settings_account_subscribes_path do |f|
= render 'shared/error_messages', object: @form_account_subscribing

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('domain_subscribes.edit.title')
%span.fedibird_features Fedibird
= simple_form_for @domain_subscribe, url: settings_domain_subscribe_path(@domain_subscribe), method: :put do |f|
= render 'shared/error_messages', object: @domain_subscribe

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('settings.domain_subscribes')
%span.fedibird_features Fedibird
%p= t('domain_subscribes.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('domain_subscribes.new.title')
%span.fedibird_features Fedibird
= simple_form_for @domain_subscribe, url: settings_domain_subscribes_path do |f|
= render 'shared/error_messages', object: @domain_subscribe

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('settings.favourite_domains')
%span.fedibird_features Fedibird
%p= t('favourite_domains.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('settings.favourite_tags')
%span.fedibird_features Fedibird
%p= t('favourite_tags.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('follow_tags.edit.title')
%span.fedibird_features Fedibird
= simple_form_for @follow_tag, url: settings_follow_tag_path(@follow_tag), method: :put do |f|
= render 'shared/error_messages', object: @follow_tag

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('settings.follow_tags')
%span.fedibird_features Fedibird
%p= t('follow_tags.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('follow_tags.new.title')
%span.fedibird_features Fedibird
= simple_form_for @follow_tag, url: settings_follow_tags_path do |f|
= render 'shared/error_messages', object: @follow_tag

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('keyword_subscribes.edit.title')
%span.fedibird_features Fedibird
= simple_form_for @keyword_subscribe, url: settings_keyword_subscribe_path(@keyword_subscribe), method: :put do |f|
= render 'shared/error_messages', object: @keyword_subscribe

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('keyword_subscribes.index.title')
%span.fedibird_features Fedibird
%p= t('keyword_subscribes.hint_html')

View file

@ -1,5 +1,6 @@
- content_for :page_title do
= t('keyword_subscribes.new.title')
%span.fedibird_features Fedibird
= simple_form_for @keyword_subscribe, url: settings_keyword_subscribes_path do |f|
= render 'shared/error_messages', object: @keyword_subscribe

View file

@ -47,7 +47,7 @@
.fields-group
= f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
= f.input :setting_unsubscribe_modal, as: :boolean, wrapper: :with_label
= f.input :setting_unsubscribe_modal, as: :boolean, wrapper: :with_label, fedibird_features: true
= f.input :setting_boost_modal, as: :boolean, wrapper: :with_label
= f.input :setting_delete_modal, as: :boolean, wrapper: :with_label

View file

@ -17,7 +17,7 @@
= ff.input :follow_request, as: :boolean, wrapper: :with_label
= ff.input :reblog, as: :boolean, wrapper: :with_label
= ff.input :favourite, as: :boolean, wrapper: :with_label
= ff.input :emoji_reaction, as: :boolean, wrapper: :with_label
= ff.input :emoji_reaction, as: :boolean, wrapper: :with_label, fedibird_features: true
= ff.input :mention, as: :boolean, wrapper: :with_label
- if current_user.staff?

View file

@ -34,40 +34,40 @@
%h4= t 'preferences.fedibird_features'
.fields-group
= f.input :setting_show_follow_button_on_timeline, as: :boolean, wrapper: :with_label
= f.input :setting_show_follow_button_on_timeline, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_subscribe_button_on_timeline, as: :boolean, wrapper: :with_label
= f.input :setting_show_subscribe_button_on_timeline, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_followed_by, as: :boolean, wrapper: :with_label
= f.input :setting_show_followed_by, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_follow_button_to_list_adder, as: :boolean, wrapper: :with_label
= f.input :setting_follow_button_to_list_adder, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_navigation_panel, as: :boolean, wrapper: :with_label
= f.input :setting_show_navigation_panel, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_quote_button, as: :boolean, wrapper: :with_label
= f.input :setting_show_quote_button, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_bookmark_button, as: :boolean, wrapper: :with_label
= f.input :setting_show_bookmark_button, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_place_tab_bar_at_bottom, as: :boolean, wrapper: :with_label
= f.input :setting_place_tab_bar_at_bottom, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_tab_bar_label, as: :boolean, wrapper: :with_label
= f.input :setting_show_tab_bar_label, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_enable_limited_timeline, as: :boolean, wrapper: :with_label
= f.input :setting_enable_limited_timeline, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_enable_reaction, as: :boolean, wrapper: :with_label
= f.input :setting_enable_reaction, as: :boolean, wrapper: :with_label, fedibird_features: true
.fields-group
= f.input :setting_show_reply_tree_button, as: :boolean, wrapper: :with_label
= f.input :setting_show_reply_tree_button, as: :boolean, wrapper: :with_label, fedibird_features: true
-# .fields-group
-# = f.input :setting_show_target, as: :boolean, wrapper: :with_label

View file

@ -16,8 +16,17 @@ module RecommendedComponent
end
end
module FedibirdFeaturesComponent
def fedibird_features(_wrapper_options = nil)
return unless options[:fedibird_features]
options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t('simple_form.fedibird_features'), class: 'fedibird_features')]) }
nil
end
end
SimpleForm.include_component(AppendComponent)
SimpleForm.include_component(RecommendedComponent)
SimpleForm.include_component(FedibirdFeaturesComponent)
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
@ -75,6 +84,7 @@ SimpleForm.setup do |config|
b.wrapper tag: :div, class: :label_input do |ba|
ba.optional :recommended
ba.optional :fedibird_features
ba.use :label
ba.wrapper tag: :div, class: :label_input__wrapper do |bb|

View file

@ -1,6 +1,7 @@
---
en:
simple_form:
fedibird_features: Fedibird
hints:
account_alias:
acct: Specify the username@domain of the account you want to move from

View file

@ -1,6 +1,7 @@
---
ja:
simple_form:
fedibird_features: Fedibird
hints:
account_alias:
acct: 引っ越し元のユーザー名@ドメインを指定してください