From b1b32fe1f9b2a24b2cff608f6796dad1304a6755 Mon Sep 17 00:00:00 2001 From: iglocska Date: Sun, 13 Mar 2022 12:39:05 +0100 Subject: [PATCH] new: [cryptographic keys] views added --- app/View/CryptographicKeys/add.ctp | 48 +++++++++++++++++++++++++++++ app/View/CryptographicKeys/view.ctp | 18 +++++++++++ 2 files changed, 66 insertions(+) create mode 100644 app/View/CryptographicKeys/add.ctp create mode 100644 app/View/CryptographicKeys/view.ctp diff --git a/app/View/CryptographicKeys/add.ctp b/app/View/CryptographicKeys/add.ctp new file mode 100644 index 000000000..ffa4f2ec4 --- /dev/null +++ b/app/View/CryptographicKeys/add.ctp @@ -0,0 +1,48 @@ +'; + echo $this->element('genericElements/Form/genericForm', [ + 'data' => [ + 'description' => __('Add a signing key to be used to validate the origin of event updates. By putting an event into protected mode, the event cannot reliably be propagated to / updated at instances beyond the reach of those that can sign with the listed keys below.'), + 'model' => 'CryptographicKey', + 'title' => __('Add Cryptographic key'), + 'fields' => [ + [ + 'field' => 'type', + 'class' => 'span6', + 'type' => 'dropdown', + 'options' => [ + 'pgp' => 'PGP' + ] + ], + [ + 'field' => 'instance_key', + 'type' => 'action', + 'class' => 'btn btn-inverse', + 'icon' => 'key', + 'text' => __('Use the instance\'s signing key'), + 'onClick' => 'insertInstanceKey();' + ], + [ + 'field' => 'key_data', + 'label' => __('Key contents'), + 'type' => 'textarea', + 'class' => 'input span6' + ], + ], + 'submit' => [ + 'action' => $this->request->params['action'], + 'ajaxSubmit' => 'submitGenericFormInPlace();' + ] + ] + ]); + + if (!$ajax) { + echo $this->element('/genericElements/SideMenu/side_menu', $menuData); + } +?> + diff --git a/app/View/CryptographicKeys/view.ctp b/app/View/CryptographicKeys/view.ctp new file mode 100644 index 000000000..5d80dbbbb --- /dev/null +++ b/app/View/CryptographicKeys/view.ctp @@ -0,0 +1,18 @@ +element( + 'genericElements/SingleViews/single_view', + [ + 'title' => 'Cryptographic key view', + 'data' => $data, + 'fields' => [ + [ + 'key' => __('type'), + 'path' => 'CryptographicKey.type' + ], + [ + 'key' => __('key_data'), + 'path' => 'CryptographicKey.key_data' + ] + ] + ] +);