ADDED bootstrap signature vue app

This commit is contained in:
nobohan 2024-06-18 17:31:29 +02:00
parent cc2c4be1b0
commit 9192883217
5 changed files with 116 additions and 0 deletions

View File

@ -197,4 +197,23 @@ class DocumentPersonController extends AbstractController
['document' => $document, 'person' => $person]
);
}
#[Route(path: '/{id}/signature', name: 'person_document_signature', methods: 'GET')]
public function signature(Person $person, PersonDocument $document): Response
{
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$this->denyAccessUnlessGranted('CHILL_PERSON_DOCUMENT_SEE', $document);
$event = new PrivacyEvent($person, [
'element_class' => PersonDocument::class,
'element_id' => $document->getId(),
'action' => 'show',
]);
$this->eventDispatcher->dispatch($event, PrivacyEvent::PERSON_PRIVACY_EVENT);
return $this->render(
'@ChillDocStore/PersonDocument/signature.html.twig',
['document' => $document, 'person' => $person]
);
}
}

View File

@ -0,0 +1,16 @@
<template>
<div>hello {{msg}}</div>
</template>
<script setup lang="ts">
import {ref, Ref} from "vue";
const msg: Ref<string> = ref('world !');
//console.log('signature', window.signature);
</script>
<style lang="scss">
</style>

View File

@ -0,0 +1,15 @@
import { createApp } from "vue";
// import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
// import { appMessages } from "ChillMainAssets/vuejs/HomepageWidget/js/i18n";
//import { store } from "ChillDocStoreAssets/vuejs/DocumentSignature/store";
import App from "./App.vue";
//const i18n = _createI18n(appMessages);
const app = createApp({
template: `<app></app>`,
})
//.use(store)
//.use(i18n)
.component("app", App)
.mount("#document-signature");

View File

@ -0,0 +1,65 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = '' %}
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
{% block title %}{{ 'Detail of document of %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %}
{% block js %}
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
<script type="text/javascript">
const signature = {
id: 1,
storedObject: 'pKNlhCrQDCRsAuC8vYHDKa', // filename, should be maybe a full StoredObjectCreated
zones: [
{page: 1, origin: [0,0], x: 10, y: 10}
]
};
window.signature = signature;
</script>
{{ encore_entry_script_tags('vue_document_signature') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
{% endblock %}
{% block content %}
<h1>{{ 'Document %title%' | trans({ '%title%': document.title }) }}</h1>
{{ mm.mimeIcon(document.object.type) }}
<dl class="chill_view_data">
<dt>{{ 'Title'|trans }}</dt>
<dd>{{ document.title }}</dd>
</dl>
<div id="document-signature"></div>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ chill_return_path_or('chill_docstore_generic-doc_by-person_index', {'id': person.id}) }}" class="btn btn-cancel">
{{ 'Back to the list' | trans }}
</a>
</li>
{% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_person_document_delete', {'person': person.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
<li>
{{ document.object|chill_document_button_group(document.title, is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document)) }}
</li>
{% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('person_document_edit', {'id': document.id, 'person': person.id}) }}" class="btn btn-edit">
{{ 'Edit' | trans }}
</a>
</li>
{% endif %}
{% endblock %}

View File

@ -5,4 +5,5 @@ module.exports = function(encore)
});
encore.addEntry('mod_async_upload', __dirname + '/Resources/public/module/async_upload/index.ts');
encore.addEntry('mod_document_action_buttons_group', __dirname + '/Resources/public/module/document_action_buttons_group/index');
encore.addEntry('vue_document_signature', __dirname + '/Resources/public/vuejs/DocumentSignature/index.ts');
};