Skip to content
Snippets Groups Projects
Commit 02a5b84e authored by Otto Zaiser's avatar Otto Zaiser
Browse files

Nuevos updates TSA2

parent bdcf5abb
No related branches found
No related tags found
No related merge requests found
tsa2_api: 'https://tsaapi.bfa.ar/api/tsa/'
tsa2_timer: 5
mainBody: '<p>El servicio de Sello de Tiempo de BFA permite demostrar que el contenido de cualquier documento digital existió en un momento y que desde entonces, no ha cambiado. Al sellar un archivo, cualquiera podrá verificar el día y la hora en que su hash fue almacenado en Blockchain Federal Argentina. Tené en cuenta que el documento seleccionado nunca se sube a la red, garantizando su privacidad.</p><p class="font_small"><a href="https://bfa.ar/sello">Si tenés un archivo con Recibo Digital (.rd) verificalo aquí</a></p>'
errorJS: 'Lo sentimos pero el sello de tiempo no funciona sin JavaScript. Por favor, habilitalo para continuar.'
lb00: ' El archivo '
lb01: ' fue enviado con éxito para ser sellado'
lb02: 'Se ha producido un error al intentar sellar '
lb03: ' se encuentra sellado por: '
lb04: ' en el bloque '
lb05: 'No se ha podido verificar el archivo '
lb06: 'Volver a Sellar o Verificar'
lb07: 'Cargando'
lb08: 'Arrastrá un archivo aquí<br>ó'
lb09: 'Seleccioná un archivo <span class="sr-only">para Sellar o Verificar</span>'
lb10: 'Nombre del archivo: '
lb11: 'Hash del archivo: '
lb12: 'Sellar'
lb13: 'Verificar'
lb14: 'Seleccionar otro archivo'
\ No newline at end of file
tsa2.settings:
type: mapping
label: 'Configuración TSA2'
mapping:
tsa2_api:
type: string
label: 'URLs de APIs'
tsa2_timer:
type: integer
label: 'Tiempo para verificar'
mainBody:
type: text
label: 'Text Principal'
errorJS:
type: text
label: 'Error sin JS'
lb00:
type: string
label: 'Label 0 TSA2 app'
lb01:
type: string
label: 'Label 1 TSA2 app'
lb02:
type: string
label: 'Label 2 TSA2 app'
lb03:
type: string
label: 'Label 3 TSA2 app'
lb04:
type: string
label: 'Label 4 TSA2 app'
lb05:
type: string
label: 'Label 5 TSA2 app'
lb06:
type: string
label: 'Label 6 TSA2 app'
lb07:
type: string
label: 'Label 7 TSA2 app'
lb08:
type: string
label: 'Label 8 TSA2 app'
lb09:
type: string
label: 'Label 9 TSA2 app'
lb10:
type: string
label: 'Label 10 TSA2 app'
lb11:
type: string
label: 'Label 11 TSA2 app'
lb12:
type: string
label: 'Label 12 TSA2 app'
lb13:
type: string
label: 'Label 13 TSA2 app'
lb14:
type: string
label: 'Label 14 TSA2 app'
\ No newline at end of file
......@@ -116,7 +116,9 @@
margin-top: 15px;
text-align: left;
}
.tsa2 .gobackLink{
margin-top: 20px;
}
.tsa2 .alert p{
margin-bottom: 0;
}
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -21,8 +21,41 @@ class tsa2Controller extends ControllerBase {
// Default settings.
$config = \Drupal::config('tsa2.settings');
$tsa2_api = $config->get('tsa2_api');
$tsa2_timer = $config->get('tsa2_timer');
$lb00 = $config->get('lb00');
$lb01 = $config->get('lb01');
$lb02 = $config->get('lb02');
$lb03 = $config->get('lb03');
$lb04 = $config->get('lb04');
$lb05 = $config->get('lb05');
$lb06 = $config->get('lb06');
$lb07 = $config->get('lb07');
$lb08 = $config->get('lb08');
$lb09 = $config->get('lb09');
$lb10 = $config->get('lb10');
$lb11 = $config->get('lb11');
$lb12 = $config->get('lb12');
$lb13 = $config->get('lb13');
$lb14 = $config->get('lb14');
$element['#tsa2_api'] = Html::escape($tsa2_api);
$element['#tsa2_timer'] = Html::escape($tsa2_timer);
$element['#lb00'] = Html::escape($lb00);
$element['#lb01'] = Html::escape($lb01);
$element['#lb02'] = Html::escape($lb02);
$element['#lb03'] = Html::escape($lb03);
$element['#lb04'] = Html::escape($lb04);
$element['#lb05'] = Html::escape($lb05);
$element['#lb06'] = Html::escape($lb06);
$element['#lb07'] = Html::escape($lb07);
$element['#lb08'] = Html::escape($lb08);
$element['#lb09'] = Html::escape($lb09);
$element['#lb10'] = Html::escape($lb10);
$element['#lb11'] = Html::escape($lb11);
$element['#lb12'] = Html::escape($lb12);
$element['#lb13'] = Html::escape($lb13);
$element['#lb14'] = Html::escape($lb14);
$element['#mainBody'] = $config->get('mainBody');
$element['#errorJS'] = $config->get('errorJS');
$element['#theme'] = 'tsa2_theme';
return $element;
}
......
......@@ -18,25 +18,107 @@ class tsa2Form extends ConfigFormBase {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Form constructor.
$form = parent::buildForm($form, $form_state);
// Default settings.
$config = $this->config('tsa2.settings');
// Form constructor.
$form = parent::buildForm($form, $form_state);
// Default settings.
$config = $this->config('tsa2.settings');
// API
$form['tsa2_api'] = array(
'#type' => 'textfield',
'#title' => $this->t('URLs de APIs'),
'#description' => $this->t('Separados por coma'),
'#default_value' => $config->get('tsa2_api'),
);
// API
$form['tsa2_api'] = array(
'#type' => 'textfield',
'#title' => $this->t('URLs de APIs'),
'#description' => $this->t('Separados por coma'),
'#default_value' => $config->get('tsa2_api'),
);
$form['tsa2_timer'] = array(
'#type' => 'textfield',
'#title' => $this->t('Tiempo para verificar'),
'#description' => $this->t('Expresado en segundos'),
'#default_value' => $config->get('tsa2_timer'),
);
$form['mainBody'] = array(
'#type' => 'textarea',
'#title' => $this->t('Texto Principal'),
'#default_value' => ($config->get('mainBody')) ? $config->get('mainBody') : '<p>El servicio de Sello de Tiempo de BFA permite demostrar que el contenido de cualquier documento digital existió en un momento y que desde entonces, no ha cambiado. Al sellar un archivo, cualquiera podrá verificar el día y la hora en que su hash fue almacenado en Blockchain Federal Argentina. Tené en cuenta que el documento seleccionado nunca se sube a la red, garantizando su privacidad.</p><p class="font_small"><a href="https://bfa.ar/sello">Si tenés un archivo con Recibo Digital (.rd) verificalo aquí</a></p>'
);
$form['mainBody'] = array(
'#type' => 'textarea',
'#title' => $this->t('Texto Principal'),
'#default_value' => $config->get('mainBody'),
);
$form['lb00'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 0 TSA2 app'),
'#default_value' => $config->get('lb00'),
);
$form['lb01'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 1 TSA2 app'),
'#default_value' => $config->get('lb01'),
);
$form['lb02'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 2 TSA2 app'),
'#default_value' => $config->get('lb02'),
);
$form['lb03'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 3 TSA2 app'),
'#default_value' => $config->get('lb03'),
);
$form['lb04'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 4 TSA2 app'),
'#default_value' => $config->get('lb04'),
);
$form['lb05'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 5 TSA2 app'),
'#default_value' => $config->get('lb05'),
);
$form['lb06'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 6 TSA2 app'),
'#default_value' => $config->get('lb06'),
);
$form['lb07'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 7 TSA2 app'),
'#default_value' => $config->get('lb07'),
);
$form['lb08'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 8 TSA2 app'),
'#default_value' => $config->get('lb08'),
);
$form['lb09'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 9 TSA2 app'),
'#default_value' => $config->get('lb09'),
);
$form['lb10'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 10 TSA2 app'),
'#default_value' => $config->get('lb10'),
);
$form['lb11'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 11 TSA2 app'),
'#default_value' => $config->get('lb11'),
);
$form['lb12'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 12 TSA2 app'),
'#default_value' => $config->get('lb12'),
);
$form['lb13'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 13 TSA2 app'),
'#default_value' => $config->get('lb13'),
);
$form['lb14'] = array(
'#type' => 'textarea',
'#title' => $this->t('Label 14 TSA2 app'),
'#default_value' => $config->get('lb14'),
);
return $form;
}
......@@ -54,7 +136,24 @@ class tsa2Form extends ConfigFormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('tsa2.settings');
$config->set('tsa2_api', $form_state->getValue('tsa2_api'));
$config->set('tsa2_timer', $form_state->getValue('tsa2_timer'));
$config->set('mainBody', $form_state->getValue('mainBody'));
$config->set('errorJS', $form_state->getValue('errorJS'));
$config->set('lb00', $form_state->getValue('lb00'));
$config->set('lb01', $form_state->getValue('lb01'));
$config->set('lb02', $form_state->getValue('lb02'));
$config->set('lb03', $form_state->getValue('lb03'));
$config->set('lb04', $form_state->getValue('lb04'));
$config->set('lb05', $form_state->getValue('lb05'));
$config->set('lb06', $form_state->getValue('lb06'));
$config->set('lb07', $form_state->getValue('lb07'));
$config->set('lb08', $form_state->getValue('lb08'));
$config->set('lb09', $form_state->getValue('lb09'));
$config->set('lb10', $form_state->getValue('lb10'));
$config->set('lb11', $form_state->getValue('lb11'));
$config->set('lb12', $form_state->getValue('lb12'));
$config->set('lb13', $form_state->getValue('lb13'));
$config->set('lb14', $form_state->getValue('lb14'));
$config->save();
return parent::submitForm($form, $form_state);
}
......
{% autoescape false %}
<div class="tsa2">
<noscript><b>Lo sentimos pero el sello de tiempo no funciona sin JavaScript. Por favor, habilitalo para continuar.</b></noscript>
<noscript><b>{{ errorJS }}</b></noscript>
<div>{{ mainBody }}</div>
<div id="app" apiurl="{{tsa2_api}}"> </div>
<div id="app"
apiurl="{{tsa2_api}}"
timer="{{tsa2_timer}}"
lb_00="{{lb00}}"
lb_01="{{lb01}}"
lb_02="{{lb02}}"
lb_03="{{lb03}}"
lb_04="{{lb04}}"
lb_05="{{lb05}}"
lb_06="{{lb06}}"
lb_07="{{lb07}}"
lb_08="{{lb08}}"
lb_09="{{lb09}}"
lb_10="{{lb10}}"
lb_11="{{lb11}}"
lb_12="{{lb12}}"
lb_13="{{lb13}}"
lb_14="{{lb14}}"
></div>
</div>
{% endautoescape %}
\ No newline at end of file
tsa2:
title: 'Configuración TSA2'
base_route_name: tsa2.form
names:
- 'tsa2.settings'
tsa2.tsa2_form_tab:
route_name: tsa2.form
title: Configuración
base_route: tsa2.form
......@@ -15,7 +15,24 @@ function tsa2_theme($existing, $type, $theme, $path) {
'tsa2_theme' => array(
'variables' => array(
'tsa2_api' => NULL,
'tsa2_timer' => NULL,
'mainBody' => NULL,
'errorJS' => NULL,
'lb00' => NULL,
'lb01' => NULL,
'lb02' => NULL,
'lb03' => NULL,
'lb04' => NULL,
'lb05' => NULL,
'lb06' => NULL,
'lb07' => NULL,
'lb08' => NULL,
'lb09' => NULL,
'lb10' => NULL,
'lb11' => NULL,
'lb12' => NULL,
'lb13' => NULL,
'lb14' => NULL,
),
'template' => 'tsa2-template',
),
......@@ -30,5 +47,38 @@ function tsa2_preprocess_html(&$variables) {
$config = \Drupal::config('tsa2.settings');
$tsa2_api = $config->get('tsa2_api');
$tsa2_timer = $config->get('tsa2_timer');
$lb00 = $config->get('lb00');
$lb01 = $config->get('lb01');
$lb02 = $config->get('lb02');
$lb03 = $config->get('lb03');
$lb04 = $config->get('lb04');
$lb05 = $config->get('lb05');
$lb06 = $config->get('lb06');
$lb07 = $config->get('lb07');
$lb08 = $config->get('lb08');
$lb09 = $config->get('lb09');
$lb10 = $config->get('lb10');
$lb11 = $config->get('lb11');
$lb12 = $config->get('lb12');
$lb13 = $config->get('lb13');
$lb14 = $config->get('lb14');
$variables['#attached']['drupalSettings']['tsa2']['tsa2_api'] = $tsa2_api;
$variables['#attached']['drupalSettings']['tsa2']['tsa2_timer'] = $tsa2_timer;
$variables['#attached']['drupalSettings']['tsa2']['lb00'] = $lb00;
$variables['#attached']['drupalSettings']['tsa2']['lb01'] = $lb01;
$variables['#attached']['drupalSettings']['tsa2']['lb02'] = $lb02;
$variables['#attached']['drupalSettings']['tsa2']['lb03'] = $lb03;
$variables['#attached']['drupalSettings']['tsa2']['lb04'] = $lb04;
$variables['#attached']['drupalSettings']['tsa2']['lb05'] = $lb05;
$variables['#attached']['drupalSettings']['tsa2']['lb06'] = $lb06;
$variables['#attached']['drupalSettings']['tsa2']['lb07'] = $lb07;
$variables['#attached']['drupalSettings']['tsa2']['lb08'] = $lb08;
$variables['#attached']['drupalSettings']['tsa2']['lb09'] = $lb09;
$variables['#attached']['drupalSettings']['tsa2']['lb10'] = $lb10;
$variables['#attached']['drupalSettings']['tsa2']['lb11'] = $lb11;
$variables['#attached']['drupalSettings']['tsa2']['lb12'] = $lb12;
$variables['#attached']['drupalSettings']['tsa2']['lb13'] = $lb13;
$variables['#attached']['drupalSettings']['tsa2']['lb14'] = $lb14;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment