Skip to content

Commit

Permalink
Wip: いろいろ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Nov 28, 2024
1 parent 9bd0a92 commit 61e1031
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const Account = ({ size = 46, account, onBlock, onMute, onMuteNotifications, hid
} else {
buttons = <FollowButton accountId={account.get('id')} />;
}
} else {
} else if (!hideButtons) {
buttons = <FollowButton accountId={account.get('id')} />;
}

Expand Down
49 changes: 37 additions & 12 deletions app/javascript/mastodon/features/antennas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ const messages = defineMessages({
edit: { id: 'antennas.edit', defaultMessage: 'Edit antenna' },
delete: { id: 'antennas.delete', defaultMessage: 'Delete antenna' },
more: { id: 'status.more', defaultMessage: 'More' },
insert_list: { id: 'antennas.insert_list', defaultMessage: 'List' },
insert_home: { id: 'antennas.insert_home', defaultMessage: 'Home' },
});

const AntennaItem: React.FC<{
Expand All @@ -35,7 +33,9 @@ const AntennaItem: React.FC<{
insert_feeds: boolean;
isList: boolean;
listTitle?: string;
}> = ({ id, title, insert_feeds, isList, listTitle }) => {
stl: boolean;
ltl: boolean;
}> = ({ id, title, insert_feeds, isList, listTitle, stl, ltl }) => {
const dispatch = useAppDispatch();
const intl = useIntl();

Expand All @@ -62,15 +62,38 @@ const AntennaItem: React.FC<{
<div className='lists__item'>
<Link to={`/antennas/${id}`} className='lists__item__title'>
<Icon id='antenna-ul' icon={AntennaIcon} />
<span>{title}</span>
{insert_feeds ? (
<span className='column-link__badge'>
{isList
? (listTitle?.slice(0, 4) ??
intl.formatMessage(messages.insert_list))
: intl.formatMessage(messages.insert_home)}
</span>
) : undefined}
<span>
{title}

{stl && (
<span className='column-link__badge'>
<FormattedMessage id='antennas.badge_stl' defaultMessage='STL' />
</span>
)}
{ltl && (
<span className='column-link__badge'>
<FormattedMessage id='antennas.badge_ltl' defaultMessage='LTL' />
</span>
)}

{insert_feeds && (
<span className='lists__item__memo'>
{isList && listTitle && (
<FormattedMessage
id='antennas.memo_insert_list'
defaultMessage='List: "{title}"'
values={{ title: listTitle }}
/>
)}
{!isList && (
<FormattedMessage
id='antennas.memo_insert_home'
defaultMessage='Inserts home timeline.'
/>
)}
</span>
)}
</span>
</Link>

<DropdownMenuContainer
Expand Down Expand Up @@ -149,6 +172,8 @@ const Antennas: React.FC<{
insert_feeds={antenna.insert_feeds}
isList={!!antenna.list}
listTitle={antenna.list?.title}
stl={antenna.stl}
ltl={antenna.ltl}
/>
))}
</ScrollableList>
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/features/antennas/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const AccountItem: React.FC<{
<ShortNumber
value={account.followers_count}
renderer={FollowersCounter}
isHide={account.other_settings.hide_followers_count}
/>{' '}
{firstVerifiedField && (
<VerifiedBadge link={firstVerifiedField.value} />
Expand Down
23 changes: 18 additions & 5 deletions app/javascript/mastodon/features/antennas/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ const NewAntenna: React.FC<{
<div className='label_input'>
<label htmlFor='antenna_list'>
<FormattedMessage
id='antennas.insert_list'
defaultMessage='List'
id='antennas.list_selection'
defaultMessage='List to insert'
/>
</label>

Expand All @@ -382,11 +382,24 @@ const NewAntenna: React.FC<{
)}

{id && mode === 'filtering' && (
<>
<div className='fields-group'>
<FiltersLink id={id} />
<div className='fields-group'>
<FiltersLink id={id} />
</div>
)}

{!id && mode === 'filtering' && (
<div className='fields-group'>
<div className='app-form__memo'>
<FormattedMessage
id='antennas.save_to_edit_filtering'
defaultMessage='You can edit the filtering after saving.'
/>
</div>
</div>
)}

{mode === 'filtering' && (
<>
<div className='fields-group'>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className='app-form__toggle'>
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/features/circles/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const AccountItem: React.FC<{
<ShortNumber
value={account.followers_count}
renderer={FollowersCounter}
isHide={account.other_settings.hide_followers_count}
/>{' '}
{firstVerifiedField && (
<VerifiedBadge link={firstVerifiedField.value} />
Expand Down
10 changes: 10 additions & 0 deletions app/javascript/mastodon/features/circles/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ const NewCircle: React.FC<{
<MembersLink id={id} />
</div>
)}
{!id && (
<div className='fields-group'>
<div className='app-form__memo'>
<FormattedMessage
id='circles.save_to_edit_member'
defaultMessage='You can edit circle members after saving.'
/>
</div>
</div>
)}

<div className='actions'>
<button className='button' type='submit'>
Expand Down
18 changes: 12 additions & 6 deletions app/javascript/mastodon/features/lists/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ const ListItem: React.FC<{
<div className='lists__item'>
<Link to={`/lists/${id}`} className='lists__item__title'>
<Icon id='list-ul' icon={ListAltIcon} />
<span>{title}</span>
{antennaTitles?.map((at) => (
<span key={at} className='column-link__badge'>
{at.slice(0, 4)}
</span>
))}
<span>
{title}
{antennaTitles?.map((at) => (
<span key={at} className='lists__item__memo'>
<FormattedMessage
id='lists.memo_related_antenna'
defaultMessage='Antenna: "{title}"'
values={{ title: at }}
/>
</span>
))}
</span>
</Link>

<DropdownMenuContainer
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/features/lists/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const AccountItem: React.FC<{
<ShortNumber
value={account.followers_count}
renderer={FollowersCounter}
isHide={account.other_settings.hide_followers_count}
/>{' '}
{firstVerifiedField && (
<VerifiedBadge link={firstVerifiedField.value} />
Expand Down
10 changes: 10 additions & 0 deletions app/javascript/mastodon/features/lists/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ const NewList: React.FC<{
<MembersLink id={id} />
</div>
)}
{!id && (
<div className='fields-group'>
<div className='app-form__memo'>
<FormattedMessage
id='lists.save_to_edit_member'
defaultMessage='You can edit list members after saving.'
/>
</div>
</div>
)}

<div className='fields-group'>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ const FollowerCount: React.FC<{ accountId: string }> = ({ accountId }) => {

if (!account) return null;

const isHide = account.other_settings.hide_followers_count;

return (
<ShortNumber
value={account.followers_count}
renderer={FollowersCounter}
isHide={isHide}
isHide={account.other_settings.hide_followers_count}
/>
);
};
Expand Down
11 changes: 9 additions & 2 deletions app/javascript/mastodon/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
"antennas.antenna_accounts": "Antenna accounts",
"antennas.antenna_accounts_count": "{count, plural, one {# member} other {# accounts}}",
"antennas.antenna_name": "Antenna name",
"antennas.badge_ltl": "LTL",
"antennas.badge_stl": "STL",
"antennas.create": "Create",
"antennas.create_a_antenna_to_organize": "Create a new antenna to organize your Home feed",
"antennas.create_antenna": "Create antenna",
Expand All @@ -155,11 +157,12 @@
"antennas.ignore_reblog_hint": "Boosts will be excluded from antenna detection.",
"antennas.in_ltl_mode": "This antenna is in LTL mode.",
"antennas.in_stl_mode": "This antenna is in STL mode.",
"antennas.insert_home": "Home",
"antennas.insert_list": "List",
"antennas.keywords": "{count} keywords",
"antennas.list_selection": "List to insert",
"antennas.media_only": "Media only",
"antennas.media_only_hint": "Only posts with media will be added antenna.",
"antennas.memo_insert_home": "Inserts home timeline.",
"antennas.memo_insert_list": "List: \"{title}\"",
"antennas.mode": "Mode",
"antennas.mode.filtering": "Filtering",
"antennas.mode.ltl": "Local timeline mode",
Expand All @@ -170,6 +173,7 @@
"antennas.no_results_found": "No results found.",
"antennas.remove_member": "Remove",
"antennas.save": "Save",
"antennas.save_to_edit_filtering": "You can edit the filtering after saving.",
"antennas.search_placeholder": "Search people you follow",
"antennas.select.no_options_message": "Empty lists",
"antennas.select.placeholder": "Select list",
Expand Down Expand Up @@ -232,6 +236,7 @@
"circles.no_results_found": "No results found.",
"circles.remove_member": "Remove",
"circles.save": "Save",
"circles.save_to_edit_member": "You can edit circle members after saving.",
"circles.search_placeholder": "Search people you follow",
"closed_registrations.other_server_instructions": "Since Mastodon is decentralized, you can create an account on another server and still interact with this one.",
"closed_registrations_modal.description": "Creating an account on {domain} is currently not possible, but please keep in mind that you do not need an account specifically on {domain} to use Mastodon.",
Expand Down Expand Up @@ -625,6 +630,7 @@
"lists.list_members": "List members",
"lists.list_members_count": "{count, plural, one {# member} other {# members}}",
"lists.list_name": "List name",
"lists.memo_related_antenna": "Antenna: \"{title}\"",
"lists.new_list_name": "New list name",
"lists.no_lists_yet": "No lists yet.",
"lists.no_members_yet": "No members yet.",
Expand All @@ -636,6 +642,7 @@
"lists.replies_policy.list": "Members of the list",
"lists.replies_policy.none": "No one",
"lists.save": "Save",
"lists.save_to_edit_member": "You can edit list members after saving.",
"lists.search_placeholder": "Search people you follow",
"lists.show_replies_to": "Include replies from list members to",
"load_pending": "{count, plural, one {# new item} other {# new items}}",
Expand Down
9 changes: 7 additions & 2 deletions app/javascript/mastodon/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@
"antennas.ignore_reblog_hint": "ブーストはアンテナの検出対象から外れます",
"antennas.in_ltl_mode": "LTLモードが有効になっています",
"antennas.in_stl_mode": "STLモードが有効になっています",
"antennas.insert_home": "ホーム",
"antennas.insert_list": "リスト",
"antennas.keywords": "{count} のキーワード",
"antennas.list_selection": "投稿追加先のリスト",
"antennas.media_only": "メディアのみ",
"antennas.media_only_hint": "メディアの添付された投稿のみがアンテナに検出されます",
"antennas.memo_insert_home": "ホームタイムラインに挿入",
"antennas.memo_insert_list": "リスト: {title}",
"antennas.mode": "動作モード",
"antennas.mode.filtering": "フィルタリング",
"antennas.mode.ltl": "ローカルタイムラインモード",
Expand All @@ -165,6 +166,7 @@
"antennas.new.title_placeholder": "新規アンテナ名",
"antennas.not_related_list": "このアンテナはどのリストにも関連付けられていません。",
"antennas.related_list": "このアンテナは {listTitle} に関連付けられています。",
"antennas.save_to_edit_filtering": "絞り込み条件は、このアンテナを保存した後に編集できます",
"antennas.search": "すべてのユーザーから検索",
"antennas.select.no_options_message": "リストがありません",
"antennas.select.placeholder": "リストを選択",
Expand Down Expand Up @@ -214,6 +216,7 @@
"circles.edit.submit": "タイトルを変更",
"circles.new.create": "サークルを作成",
"circles.new.title_placeholder": "新規サークル名",
"circles.save_to_edit_member": "メンバーは、このサークルを保存した後に編集できます",
"circles.search": "フォロワーの中から検索",
"circles.subheading": "あなたのサークル",
"closed_registrations.other_server_instructions": "Mastodonは分散型なので他のサーバーにアカウントを作ってもこのサーバーとやり取りできます。",
Expand Down Expand Up @@ -582,10 +585,12 @@
"lists.antennas": "関連付けられたアンテナ",
"lists.delete": "リストを削除",
"lists.edit": "リストを編集",
"lists.memo_related_antenna": "アンテナ: {title}",
"lists.notify": "これらの投稿を通知する",
"lists.replies_policy.followed": "フォロー中のユーザー全員",
"lists.replies_policy.list": "リストのメンバー",
"lists.replies_policy.none": "表示しない",
"lists.save_to_edit_member": "メンバーは、このリストを保存した後に編集できます",
"load_pending": "{count}件の新着",
"loading_indicator.label": "読み込み中…",
"media_gallery.hide": "隠す",
Expand Down
7 changes: 7 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11387,6 +11387,13 @@ noscript {
}
}
}

&__memo {
display: block;
color: $dark-text-color;
font-size: 14px;
line-height: 18px;
}
}

.column-search-header {
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/styles/mastodon/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,12 @@ code {
}
}
}

&__memo {
color: $dark-text-color;
font-size: 14px;
margin: 16px 0;
}
}

.avatar-pile {
Expand Down

0 comments on commit 61e1031

Please sign in to comment.