[UI] Rename all forms to more specific names, to avoid form name collisions

This commit is contained in:
Hugo Sales 2021-08-18 18:38:54 +01:00
parent c03c6f1bb5
commit 2c10ce5cfc
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
7 changed files with 8 additions and 8 deletions

View File

@ -68,7 +68,7 @@ class Avatar extends Controller
['avatar', FileType::class, ['label' => _m('Avatar'), 'help' => _m('You can upload your personal avatar. The maximum file size is 2MB.'), 'multiple' => false, 'required' => false]], ['avatar', FileType::class, ['label' => _m('Avatar'), 'help' => _m('You can upload your personal avatar. The maximum file size is 2MB.'), 'multiple' => false, 'required' => false]],
['remove', CheckboxType::class, ['label' => _m('Remove avatar'), 'help' => _m('Remove your avatar and use the default one'), 'required' => false, 'value' => false]], ['remove', CheckboxType::class, ['label' => _m('Remove avatar'), 'help' => _m('Remove your avatar and use the default one'), 'required' => false, 'value' => false]],
['hidden', HiddenType::class, []], ['hidden', HiddenType::class, []],
['save', SubmitType::class, ['label' => _m('Submit')]], ['save_avatar', SubmitType::class, ['label' => _m('Submit')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -82,7 +82,7 @@ END;
['attachments', FileType::class, ['label' => ' ', 'data' => null, 'multiple' => true, 'required' => false]], ['attachments', FileType::class, ['label' => ' ', 'data' => null, 'multiple' => true, 'required' => false]],
['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'expanded' => true, 'data' => 'public', 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]], ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'expanded' => true, 'data' => 'public', 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]],
['to', ChoiceType::class, ['label' => _m('To:'), 'multiple' => true, 'expanded' => true, 'choices' => $to_tags]], ['to', ChoiceType::class, ['label' => _m('To:'), 'multiple' => true, 'expanded' => true, 'choices' => $to_tags]],
['post', SubmitType::class, ['label' => _m('Post')]], ['post_note', SubmitType::class, ['label' => _m('Post')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -82,7 +82,7 @@ class Cover
'mimeTypesMessage' => 'Please upload a valid image', 'mimeTypesMessage' => 'Please upload a valid image',
]), ], ]], ]), ], ]],
['hidden', HiddenType::class, []], ['hidden', HiddenType::class, []],
['save', SubmitType::class, ['label' => _m('Submit')]], ['save_color', SubmitType::class, ['label' => _m('Submit')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -66,7 +66,7 @@ class ProfileColor
$form = Form::create([ $form = Form::create([
['color', ColorType::class, ['data' => $color, 'label' => _m('Profile Color'), 'help' => _m('Choose your Profile Color')] ], ['color', ColorType::class, ['data' => $color, 'label' => _m('Profile Color'), 'help' => _m('Choose your Profile Color')] ],
['hidden', HiddenType::class, []], ['hidden', HiddenType::class, []],
['save', SubmitType::class, ['label' => _m('Submit')]], ['save_profile_color', SubmitType::class, ['label' => _m('Submit')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -64,7 +64,7 @@ class AdminPanel extends Controller
$form = Form::create([ $form = Form::create([
['setting', ChoiceType::class, ['label' => _m('Setting'), 'choices' => $options]], ['setting', ChoiceType::class, ['label' => _m('Setting'), 'choices' => $options]],
['value', TextType::class, ['label' => _m('Value')]], ['value', TextType::class, ['label' => _m('Value')]],
['save', SubmitType::class, ['label' => _m('Set site setting')]], ['save_admin', SubmitType::class, ['label' => _m('Set site setting')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -100,7 +100,7 @@ class UserPanel extends AbstractController
['bio', TextareaType::class, ['label' => _m('Bio'), 'required' => false, 'help' => _m('Describe yourself and your interests.')]], ['bio', TextareaType::class, ['label' => _m('Bio'), 'required' => false, 'help' => _m('Describe yourself and your interests.')]],
['location', TextType::class, ['label' => _m('Location'), 'required' => false, 'help' => _m('Where you are, like "City, State (or Region), Country".')]], ['location', TextType::class, ['label' => _m('Location'), 'required' => false, 'help' => _m('Where you are, like "City, State (or Region), Country".')]],
['self_tags', TextType::class, ['label' => _m('Self Tags'), 'required' => false, 'help' => _m('Tags for yourself (letters, numbers, -, ., and _), comma- or space-separated.'), 'transformer' => ArrayTransformer::class]], ['self_tags', TextType::class, ['label' => _m('Self Tags'), 'required' => false, 'help' => _m('Tags for yourself (letters, numbers, -, ., and _), comma- or space-separated.'), 'transformer' => ArrayTransformer::class]],
['save', SubmitType::class, ['label' => _m('Save personal info')]], ['save_personal_info', SubmitType::class, ['label' => _m('Save personal info')]],
]; ];
$extra_step = function ($data, $extra_args) use ($user) { $extra_step = function ($data, $extra_args) use ($user) {
$user->setNickname($data['nickname']); $user->setNickname($data['nickname']);
@ -124,7 +124,7 @@ class UserPanel extends AbstractController
FormFields::repeated_password(['required' => false]), FormFields::repeated_password(['required' => false]),
['language', LocaleType::class, ['label' => _m('Language'), 'required' => false, 'help' => _m('Your preferred language')]], ['language', LocaleType::class, ['label' => _m('Language'), 'required' => false, 'help' => _m('Your preferred language')]],
['phone_number', PhoneNumberType::class, ['label' => _m('Phone number'), 'required' => false, 'help' => _m('Your phone number'), 'data_class' => null]], ['phone_number', PhoneNumberType::class, ['label' => _m('Phone number'), 'required' => false, 'help' => _m('Your phone number'), 'data_class' => null]],
['save', SubmitType::class, ['label' => _m('Save account info')]], ['save_account_info', SubmitType::class, ['label' => _m('Save account info')]],
]); ]);
$form->handleRequest($request); $form->handleRequest($request);

View File

@ -28,7 +28,7 @@
{{ form_widget(post_form.attachments) }} {{ form_widget(post_form.attachments) }}
</label> </label>
{{ form_row(post_form.post, {'attr': {'class': 'section-form-send'}}) }} {{ form_row(post_form.post_note, {'attr': {'class': 'section-form-send'}}) }}
{{ form_end(post_form) }} {{ form_end(post_form) }}
</div> </div>