Skip to content

Commit

Permalink
Update share form
Browse files Browse the repository at this point in the history
  • Loading branch information
martinyde committed Sep 11, 2024
1 parent 58a5802 commit d3c633c
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,36 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/** @var \Drupal\node\NodeInterface $node */
$node = $this->routeMatcher->getParameter('node');

$form['title'] = [
$form['wrapper'] = [
'#type' => 'container',
'#attributes' => ['class' => ['container', 'col-6']],
];

$form['wrapper']['title'] = [
'#type' => 'page_title',
'#title' => $this->t('Share the following with a friend: @document', ['@document' => $node->label()]),
];

$form['message'] = [
'#type' => 'textarea',
'#title' => $this->t('Message'),
'#description' => $this->t('Write a message to the recipient'),
$form['wrapper']['to_email'] = [
'#type' => 'email',
'#required' => TRUE,
'#title' => $this->t('Email address of recipient'),
'#attributes' => [
'class' => [
'form-control',
],
],
];

$form['to_email'] = [
'#type' => 'email',
$form['wrapper']['message'] = [
'#type' => 'textarea',
'#title' => $this->t('Message'),
'#description' => $this->t('Write a message to the recipient'),
'#required' => TRUE,
'#title' => $this->t('Email address of recipient'),
];

$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = [
$form['wrapper']['actions']['#type'] = 'actions';
$form['wrapper']['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Send'),
'#attributes' => [
Expand All @@ -120,7 +130,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
],
],
];
$form['actions']['cancel'] = [
$form['wrapper']['actions']['cancel'] = [
'#type' => 'link',
'#url' => $node->toUrl(),
'#title' => $this->t('Cancel'),
Expand Down

0 comments on commit d3c633c

Please sign in to comment.