Skip to content

Commit

Permalink
Change: フィールド入力フォームのデザイン改善
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Mar 26, 2024
1 parent 31559f6 commit ceff476
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/javascript/styles/mastodon/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,18 @@ code {
display: flex;
margin: 0 -5px;

.input {
.input,
.fields-label {
box-sizing: border-box;
flex: 1 1 auto;
width: 50%;
padding: 0 5px;
}

.fields-label {
font-weight: bold;
margin-left: 12px;
}
}

.title {
Expand Down
8 changes: 6 additions & 2 deletions app/views/settings/profiles/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@
%label= t('simple_form.labels.defaults.fields')
%span.hint= t('simple_form.hints.account.fields')

.row
%p.fields-label= t('simple_form.labels.account.fields.name')
%p.fields-label= t('simple_form.labels.account.fields.value')

= f.simple_fields_for :fields do |fields_f|
.row
= fields_f.input :name, placeholder: t('simple_form.labels.account.fields.name'), input_html: { maxlength: 255 }
= fields_f.input :value, placeholder: t('simple_form.labels.account.fields.value'), input_html: { maxlength: 255 }
= fields_f.input :name, placeholder: fields_f.index.zero? ? t("simple_form.labels.account.fields_example.name_#{fields_f.index + 1}") : t('simple_form.labels.account.fields.name'), input_html: { maxlength: 255 }
= fields_f.input :value, placeholder: fields_f.index.zero? ? t("simple_form.labels.account.fields_example.value_#{fields_f.index + 1}") : t('simple_form.labels.account.fields.value'), input_html: { maxlength: 255 }

.fields-row
.fields-row__column.fields-row__column-6
Expand Down
3 changes: 3 additions & 0 deletions config/locales/simple_form.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ en:
fields:
name: Label
value: Content
fields_example:
name_1: ex) GitHub
value_1: ex) https://github.com/xxxxxx
indexable: Include public posts in search results
indexable_kmyblue: Enable indexable
searchability_kmyblue: Default searchability
Expand Down
3 changes: 3 additions & 0 deletions config/locales/simple_form.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ ja:
fields:
name: ラベル
value: 内容
fields_example:
name_1: 例) GitHub
value_1: 例) https://github.com/xxxxxx
indexable: 公開投稿を検索できるようにする
indexable_kmyblue: Indexableを有効にする
searchability_kmyblue: デフォルトの検索許可
Expand Down

0 comments on commit ceff476

Please sign in to comment.