Skip to content

Commit

Permalink
Merge pull request #479 from imas/imastodon
Browse files Browse the repository at this point in the history
#478 をバックポート
  • Loading branch information
takayamaki authored Jan 10, 2025
2 parents a13c9e1 + 911cc91 commit daf1b8c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class FavouriteToggle extends React.PureComponent {
};

removePublic = () => {
this.removeFavouriteTags(this.props.publicId)
}
this.removeFavouriteTags(this.props.publicId);
};

removeUnlisted = () => {
this.removeFavouriteTags(this.props.unlistedId)
}
this.removeFavouriteTags(this.props.unlistedId);
};

render () {
const { intl, unlistedId, publicId } = this.props;
Expand All @@ -56,11 +56,11 @@ class FavouriteToggle extends React.PureComponent {
<div className='column-settings__row'>
{
publicId != null ? <Button className='favourite-tags__remove-button-in-column' text={intl.formatMessage(messages.remove_favourite_tags_public)} onClick={this.removePublic} block />
: <Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_public)} onClick={this.addPublic} block />
: <Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_public)} onClick={this.addPublic} block />
}
{
unlistedId != null ? <Button className='favourite-tags__remove-button-in-column' text={intl.formatMessage(messages.remove_favourite_tags_unlisted)} onClick={this.removeUnlisted} block />
: <Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_unlisted)} onClick={this.addUnlisted} block />
: <Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_unlisted)} onClick={this.addUnlisted} block />
}
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions app/views/settings/favourite_tags/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
= render 'shared/error_messages', object: favourite_tag
= f.input :name, placeholder: t('favourite_tags.name_of_tag')
= f.input :visibility,
label: t('simple_form.labels.defaults.setting_default_privacy'),
collection: Status.visibilities.keys[0..1],
wrapper: :with_label,
include_blank: false,
label_method: ->(visibility) { safe_join([I18n.t("statuses.visibilities.#{visibility}"), content_tag(:span, I18n.t("statuses.visibilities.#{visibility}_long"), class: 'hint')]) },
required: false,
as: :radio_buttons,
collection_wrapper_tag: 'ul',
item_wrapper_tag: 'li'
label: t('simple_form.labels.defaults.setting_default_privacy'),
collection: Status.visibilities.keys[0..1],
wrapper: :with_label,
include_blank: false,
label_method: ->(visibility) { safe_join([I18n.t("statuses.visibilities.#{visibility}"), content_tag(:span, I18n.t("statuses.visibilities.#{visibility}_long"), class: 'hint')]) },
required: false,
as: :radio_buttons,
collection_wrapper_tag: 'ul',
item_wrapper_tag: 'li'
= f.input :order, wrapper: :with_label, as: :integer, hint: t('favourite_tags.form.hint.order'), label: t('favourite_tags.order')
.actions
= f.button :button, submit, type: :submit
2 changes: 1 addition & 1 deletion lib/tasks/imastodon.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace :imastodon do
task migrate_favourite_tags: :environment do
FavouriteTag.all.includes(:tag).find_in_batches do |favourite_tags|
FavouriteTag.includes(:tag).find_in_batches do |favourite_tags|
Rails.logger.info("imastodon:migrate_favourite_tags: #{favourite_tags.first.id}..#{favourite_tags.last.id}")
favourite_tags.each(&:migrate_tag_name!)
end
Expand Down

0 comments on commit daf1b8c

Please sign in to comment.