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

Commit Inicial

parents
No related branches found
No related tags found
No related merge requests found
# Módulo customizado para la TSA2 de BFA
\ No newline at end of file
#app{
margin-bottom: 20px;
}
.tsa2 .dropArea {
border: 1px dashed #0094D4;
background-color: #ffffff;
padding: 50px;
text-align: center;
-webkit-border-radius: 5px;
border-radius: 5px;
/* transition: 0.3s; */
position: relative;
}
.tsa2 .btn-primary:active, .tsa2 .btn-primary:active:hover, .tsa2 .btn-primary:focus, .tsa2 .btn-primary:hover {
background-color: #fff;
color: #0094d4;
border-color: #0094d4;
}
.tsa2 .btn-success:active, .tsa2 .btn-success:active:hover, .tsa2 .btn-success:focus, .tsa2 .btn-success:hover {
background-color: #fff;
color: #4cae4c;
border-color: #4cae4c;
}
.tsa2 .btn-pill {
border-radius: 50px;
border-width: 2px;
font-weight: 400;
}
.tsa2 .hash {
word-wrap: break-word;
}
.tsa2 .dropArea p {
margin-bottom: 5px;
}
.tsa2 .dropArea:hover {
border-style: solid;
background: rgba(0, 148, 212, 0.05);
}
.tsa2 .dropArea .droptxt {
font-size: 1.2em;
margin-bottom: 10px;
}
.tsa2 .dropArea .glyphicon-cloud-upload {
font-size: 8em;
margin-bottom: 40px;
color: #ccc;
}
.tsa2 .overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9999999999;
color: #fff;
background: rgba(0, 148, 212, 0.10);
}
.tsa2 .pulse{
-webkit-animation: pulse 1s infinite ease-in-out;
-o-animation: pulse 1s infinite ease-in-out;
-ms-animation: pulse 1s infinite ease-in-out;
-moz-animation: pulse 1s infinite ease-in-out;
animation: pulse 1s infinite ease-in-out;
}
.tsa2 .loading {
background-color: rgba(0, 148, 212, 0.75);
text-align: center;
-webkit-border-radius: 5px;
border-radius: 5px;
}
@keyframes pulse {
0% {
opacity: 1.0;
}
50% {
opacity: 0;
}
100% {
opacity: 1.0;
}
}
@media screen and (max-width: 768px) {
.tsa2 .dropArea .glyphicon-cloud-upload {
font-size: 4em;
margin-bottom: 20px;
}
.tsa2 .dropArea {
padding: 20px;
}
}
.tsa2 [hidden]{
display: none !important;
}
.tsa2 .btn-lg {
min-width: 150px;
margin: 0 5px;
margin-top: 20px;
}
.tsa2 .alert {
margin-top: 15px;
text-align: left;
}
.tsa2 .alert p{
margin-bottom: 0;
}
.drop-file {
width: 100%;
height: 100%;
}
.tsa2 .center-v {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@media screen and (max-width: 992px) {
.tsa2 h3 {
margin-top: 30px;
}
.tsa2 .nav-tabs {
font-size: 1.3em;
}
}
@media screen and (max-width: 1200px) {
.tsa2 .dropArea .droptxt {
font-size: 1em;
margin-bottom: 15px;
}
}
This diff is collapsed.
This diff is collapsed.
<?php
namespace Drupal\tsa2\Controller;
use Drupal\Core\Url;
use Drupal\Component\Utility\Html;
use Drupal\Core\Controller\ControllerBase;
/**
* Defines HelloController class.
*/
class tsa2Controller extends ControllerBase {
/**
* Display the markup.
*
* @return array
* Return markup array.
*/
public function content() {
// Default settings.
$config = \Drupal::config('tsa2.settings');
$tsa2_api = $config->get('tsa2_api');
$element['#tsa2_api'] = Html::escape($tsa2_api);
$element['#mainBody'] = $config->get('mainBody');
$element['#theme'] = 'tsa2_theme';
return $element;
}
}
\ No newline at end of file
<?php
namespace Drupal\tsa2\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
class tsa2Form extends ConfigFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'tsa2_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// 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'),
);
$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>'
);
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('tsa2.settings');
$config->set('tsa2_api', $form_state->getValue('tsa2_api'));
$config->set('mainBody', $form_state->getValue('mainBody'));
$config->save();
return parent::submitForm($form, $form_state);
}
protected function getEditableConfigNames() {
return [
'tsa2.settings',
];
}
}
{% 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>
<div>{{ mainBody }}</div>
<div id="app" apiurl="{{tsa2_api}}"> </div>
</div>
{% endautoescape %}
\ No newline at end of file
name: tsa2
description: Modulo Custom de TSA2
package: BFA
type: module
core: 8.x
\ No newline at end of file
tsa2:
version: 2.x
css:
theme:
css/tsa2.css: {}
js:
js/tsa2.js: {}
js/tsa2.js.map: {}
dependencies:
- core/drupalSettings
tsa2.admin:
title: 'Configuración TSA2'
description: 'Un módulo customizado para la TSA2'
parent: system.admin_config_development
route_name: tsa2.form
weight: 100
\ No newline at end of file
<?php
use Drupal\Core\Routing\RouteMatchInterface;
function tsa2_theme($existing, $type, $theme, $path) {
// return [
// 'tsa_template' => [
// 'variables' => ['source_text' => NULL],
// ],
// ];
$variables = array(
'tsa2_theme' => array(
'variables' => array(
'tsa2_api' => NULL,
'mainBody' => NULL,
),
'template' => 'tsa2-template',
),
);
return $variables;
}
function tsa2_preprocess_html(&$variables) {
$variables['#attached']['library'][] = 'tsa2/tsa2';
$config = \Drupal::config('tsa2.settings');
$tsa2_api = $config->get('tsa2_api');
$variables['#attached']['drupalSettings']['tsa2']['tsa2_api'] = $tsa2_api;
}
\ No newline at end of file
tsa2.content:
path: '/tsa2'
defaults:
_controller: '\Drupal\tsa2\Controller\tsa2Controller::content'
_title: 'Sello de Tiempo'
requirements:
_permission: 'access content'
tsa2.form:
path: '/admin/config/development/tsa2'
defaults:
_form: 'Drupal\tsa2\Form\tsa2Form'
_title: 'Configuración TSA2'
requirements:
_permission: 'administer site configuration'
\ 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