Add kmyblue mark in config page
This commit is contained in:
parent
424dc584a9
commit
d1c625df7c
9 changed files with 34 additions and 11 deletions
|
@ -199,7 +199,8 @@
|
||||||
|
|
||||||
.account-role,
|
.account-role,
|
||||||
.simple_form .recommended,
|
.simple_form .recommended,
|
||||||
.simple_form .not_recommended {
|
.simple_form .not_recommended,
|
||||||
|
.simple_form .kmyblue {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 4px 6px;
|
padding: 4px 6px;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
@ -230,6 +231,12 @@
|
||||||
border-color: rgba(lighten($error-red, 12%), 0.5);
|
border-color: rgba(lighten($error-red, 12%), 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.simple_form .kmyblue {
|
||||||
|
color: lighten($kmyblue, 12%);
|
||||||
|
background-color: rgba(lighten($kmyblue, 12%), 0.1);
|
||||||
|
border-color: rgba(lighten($kmyblue, 12%), 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
.account__header__fields {
|
.account__header__fields {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -5,6 +5,7 @@ $success-green: #79bd9a !default; // Padua
|
||||||
$error-red: #df405a !default; // Cerise
|
$error-red: #df405a !default; // Cerise
|
||||||
$warning-red: #ff5050 !default; // Sunset Orange
|
$warning-red: #ff5050 !default; // Sunset Orange
|
||||||
$gold-star: #ca8f04 !default; // Dark Goldenrod
|
$gold-star: #ca8f04 !default; // Dark Goldenrod
|
||||||
|
$kmyblue: #29a5f7 !default;
|
||||||
|
|
||||||
$red-bookmark: $warning-red;
|
$red-bookmark: $warning-red;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
= ff.input :'web.display_media', collection: ['default', 'show_all', 'hide_all'],label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label, label: I18n.t('simple_form.labels.defaults.setting_display_media')
|
= ff.input :'web.display_media', collection: ['default', 'show_all', 'hide_all'],label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label, label: I18n.t('simple_form.labels.defaults.setting_display_media')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :'web.display_media_expand', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_display_media_expand'), hint: I18n.t('simple_form.hints.defaults.setting_display_media_expand')
|
= ff.input :'web.display_media_expand', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_display_media_expand'), hint: I18n.t('simple_form.hints.defaults.setting_display_media_expand')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :'web.use_blurhash', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_use_blurhash'), hint: I18n.t('simple_form.hints.defaults.setting_use_blurhash')
|
= ff.input :'web.use_blurhash', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_use_blurhash'), hint: I18n.t('simple_form.hints.defaults.setting_use_blurhash')
|
||||||
|
|
|
@ -36,4 +36,4 @@
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.simple_fields_for :settings, current_user.settings do |ff|
|
= f.simple_fields_for :settings, current_user.settings do |ff|
|
||||||
= ff.input :stop_emoji_reaction_streaming, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_stop_emoji_reaction_streaming'), hint: I18n.t('simple_form.hints.defaults.setting_stop_emoji_reaction_streaming')
|
= ff.input :stop_emoji_reaction_streaming, as: :boolean, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_stop_emoji_reaction_streaming'), hint: I18n.t('simple_form.hints.defaults.setting_stop_emoji_reaction_streaming')
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
= ff.input :noindex, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noindex'), hint: I18n.t('simple_form.hints.defaults.setting_noindex')
|
= ff.input :noindex, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noindex'), hint: I18n.t('simple_form.hints.defaults.setting_noindex')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :noai, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noai'), hint: I18n.t('simple_form.hints.defaults.setting_noai')
|
= ff.input :noai, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_noai'), hint: I18n.t('simple_form.hints.defaults.setting_noai')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs')
|
= ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs')
|
||||||
|
@ -27,10 +27,10 @@
|
||||||
= ff.input :default_language, collection: [nil] + filterable_languages, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.default_language') : native_locale_name(locale) }, required: false, include_blank: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_language')
|
= ff.input :default_language, collection: [nil] + filterable_languages, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.default_language') : native_locale_name(locale) }, required: false, include_blank: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_language')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :default_searchability, collection: Status.selectable_searchabilities, wrapper: :with_label, include_blank: false, label_method: lambda { |searchability| safe_join([I18n.t("statuses.searchabilities.#{searchability}"), I18n.t("statuses.searchabilities.#{searchability}_long")], ' - ') }, required: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_searchability')
|
= ff.input :default_searchability, collection: Status.selectable_searchabilities, wrapper: :with_label, kmyblue: true, include_blank: false, label_method: lambda { |searchability| safe_join([I18n.t("statuses.searchabilities.#{searchability}"), I18n.t("statuses.searchabilities.#{searchability}_long")], ' - ') }, required: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_searchability')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :public_post_to_unlisted, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_public_post_to_unlisted'), hint: I18n.t('simple_form.hints.defaults.setting_public_post_to_unlisted')
|
= ff.input :public_post_to_unlisted, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_public_post_to_unlisted'), hint: I18n.t('simple_form.hints.defaults.setting_public_post_to_unlisted')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive')
|
= ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive')
|
||||||
|
@ -41,13 +41,13 @@
|
||||||
%h4= t 'preferences.stop_deliver'
|
%h4= t 'preferences.stop_deliver'
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :setting_send_without_domain_blocks, as: :boolean, wrapper: :with_label
|
= f.input :setting_send_without_domain_blocks, kmyblue: true, recommended: :not_recommended, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :setting_reject_public_unlisted_subscription, as: :boolean, wrapper: :with_label
|
= f.input :setting_reject_public_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :setting_reject_unlisted_subscription, as: :boolean, wrapper: :with_label
|
= f.input :setting_reject_unlisted_subscription, kmyblue: true, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
%h4= t 'preferences.public_timelines'
|
%h4= t 'preferences.public_timelines'
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
= f.input :my_actor_type, collection: ['person', 'bot', 'group'],label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.#{item}"), content_tag(:span, I18n.t("simple_form.hints.defaults.#{item}"), class: 'hint')]) }, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label
|
= f.input :my_actor_type, collection: ['person', 'bot', 'group'],label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.#{item}"), content_tag(:span, I18n.t("simple_form.hints.defaults.#{item}"), class: 'hint')]) }, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :group_allow_private_message, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.group_allow_private_message')
|
= f.input :group_allow_private_message, as: :boolean, wrapper: :with_label, kmyblue: true, hint: t('simple_form.hints.defaults.group_allow_private_message')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable'), recommended: true
|
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable'), recommended: true
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
= f.input :hide_collections, as: :boolean, wrapper: :with_label, label: t('simple_form.labels.defaults.setting_hide_network'), hint: t('simple_form.hints.defaults.setting_hide_network')
|
= f.input :hide_collections, as: :boolean, wrapper: :with_label, label: t('simple_form.labels.defaults.setting_hide_network'), hint: t('simple_form.hints.defaults.setting_hide_network')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :dissubscribable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.dissubscribable')
|
= f.input :dissubscribable, as: :boolean, wrapper: :with_label, kmyblue: true, hint: t('simple_form.hints.defaults.dissubscribable')
|
||||||
|
|
||||||
%hr.spacer/
|
%hr.spacer/
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,20 @@ module RecommendedComponent
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module KmyblueComponent
|
||||||
|
def kmyblue(_wrapper_options = nil)
|
||||||
|
return unless options[:kmyblue]
|
||||||
|
|
||||||
|
key = options[:kmyblue].is_a?(Symbol) ? options[:kmyblue] : :kmyblue
|
||||||
|
options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t(key, scope: 'simple_form'), class: key)]) }
|
||||||
|
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
SimpleForm.include_component(AppendComponent)
|
SimpleForm.include_component(AppendComponent)
|
||||||
SimpleForm.include_component(RecommendedComponent)
|
SimpleForm.include_component(RecommendedComponent)
|
||||||
|
SimpleForm.include_component(KmyblueComponent)
|
||||||
|
|
||||||
SimpleForm.setup do |config|
|
SimpleForm.setup do |config|
|
||||||
# Wrappers are used by the form builder to generate a
|
# Wrappers are used by the form builder to generate a
|
||||||
|
@ -78,6 +90,7 @@ SimpleForm.setup do |config|
|
||||||
|
|
||||||
b.wrapper tag: :div, class: :label_input do |ba|
|
b.wrapper tag: :div, class: :label_input do |ba|
|
||||||
ba.optional :recommended
|
ba.optional :recommended
|
||||||
|
ba.optional :kmyblue
|
||||||
ba.use :label
|
ba.use :label
|
||||||
|
|
||||||
ba.wrapper tag: :div, class: :label_input__wrapper do |bb|
|
ba.wrapper tag: :div, class: :label_input__wrapper do |bb|
|
||||||
|
|
|
@ -136,6 +136,7 @@ en:
|
||||||
webhook:
|
webhook:
|
||||||
events: Select events to send
|
events: Select events to send
|
||||||
url: Where events will be sent to
|
url: Where events will be sent to
|
||||||
|
kmyblue: kmyblue
|
||||||
labels:
|
labels:
|
||||||
account:
|
account:
|
||||||
fields:
|
fields:
|
||||||
|
|
|
@ -142,6 +142,7 @@ ja:
|
||||||
webhook:
|
webhook:
|
||||||
events: 送信するイベントを選択
|
events: 送信するイベントを選択
|
||||||
url: イベントの送信先
|
url: イベントの送信先
|
||||||
|
kmyblue: kmyblue
|
||||||
labels:
|
labels:
|
||||||
account:
|
account:
|
||||||
fields:
|
fields:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue