Skip to content

Commit

Permalink
add the dang template, string stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
qadan committed Aug 4, 2020
1 parent 0ac5e56 commit 3b1e2a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Form/EmbargoesEmbargoEntityForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,13 @@ public function save(array $form, FormStateInterface $form_state) {

if ($status == SAVED_NEW) {
$log_values['action'] = $embargo::STATUS_CREATED;
$action = 'created';
$this->messenger->addMessage($this->t('Your embargo has been created.'));
}
else {
$log_values['action'] = $embargo::STATUS_UPDATED;
$action = 'updated';
$this->messenger->addMessage($this->t('Your embargo has been updated.'));
}

$this->messenger()->addMessage("Your embargo has been {$action}.");
$this->embargoesLog->logEmbargoEvent($log_values);
$form_state->setRedirectUrl($embargo->toUrl('collection'));
}
Expand Down
22 changes: 22 additions & 0 deletions templates/embargoes-policies.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{#
/**
* @file
* Formats an IP restricted page.
*
* Available variables:
* - 'count': the count to display
* - 'embargoes_info': an indexed array containing any information required to
* display each individual embargo.
*/
#}

<span id='embargoes_embargo_policy_block_preamble' class='embargoes_embargo_policy_block'>{{ count }}</span>

{% for info in embargoes_info %}
<hr id='embargoes_embargo_policy_block_separator' class='embargoes_embargo_policy_block'>
<ul class='embargoes_embargo_policy_block embargoes_embargo_policy_block_list'>
<li id='embargoes_embargo_policy_block_expiration_item' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item'><strong id='embargoes_embargo_policy_block_expiration_label' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item_label'>{{ info.expiration }}</strong></li>
<li id='embargoes_embargo_policy_block_type_item' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item'><strong id='embargoes_embargo_policy_block_type_label' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item_label'>{{ info.type }}</strong></li>
<li id='embargoes_embargo_policy_block_network_item' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item'><strong id='embargoes_embargo_policy_block_network_label' class='embargoes_embargo_policy_block embargoes_embargo_policy_block_item_label'>{{ info.exempt_ips }}</strong></li>
</ul>
{% endfor %}

0 comments on commit 3b1e2a6

Please sign in to comment.