Commit 3a90b3ee authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

UI de gestion des référents (globale ?)

parent 0e895c52
Loading
Loading
Loading
Loading
+17 −1
Changes for module/Oscar/view/oscar/project-grant/show.phtml: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -505,8 +505,11 @@


        <h3>Déclarants</h3>
        <?php foreach ($entity->getPersonsDeep() as $personActivity): ?>
        <?php
        $declarers = [];
        foreach ($entity->getPersonsDeep() as $personActivity): ?>
            <?php if( $entity->hasDeclarant($personActivity->getPerson()) ):
                $declarers[] = $personActivity->getPerson()->toJson();
                $hasDeclaration = $personActivity->getPerson()->hasDeclarationIn($entity);
                ?>

@@ -520,6 +523,19 @@
                </a>
            <?php endif; ?>
        <?php endforeach; ?>
            <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::PERSON_EDIT)): ?>
            <div id="referents"></div>
            <script>
                require(['vue', 'vue-resource', 'ReferentUI'], function(Vue, VueResource, ReferentUI){
                    //new Vue({
                    //    el: '#referents',
                    //    render(h){ return h(ReferentUI.default, { props: {
                    //            persons: <?//= json_encode($declarers) ?>
                    //        }}) }
                    //})
                });
            </script>
        <?php endif; ?>
    <?php endif; ?>

<?php endif; ?>
+1 −0
Changes for public/js/oscar-config.js: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ requirejs.config({
        'Keyvalue': 'oscar/dist/Keyvalue',
        'DocumentSectionAdmin': 'oscar/dist/DocumentSectionAdmin',
        'Referent': 'oscar/dist/Referent',
        'ReferentUI': 'oscar/dist/ReferentUI',
        'EntityWithRole': 'oscar/dist/EntityWithRole'
    },
    shim: {
+173 −0

File added.

Preview size limit exceeded, changes collapsed.

+73 −0
Changes for public/js/oscar/src/ReferentUI.vue: 73 added lines, 0 removed lines.
Original line number Diff line number Diff line
<template>
    <div class="">
        <transition name="fade">
            <div v-if="showUI" class="overlay">
                <div class="overlay-content">
                    <div class="row">
                        <div class="col-md-6">
                            {{ persons }}
                            <ul>
                                <li>Personnes</li>
                            </ul>
                        </div>
                        <div class="col-md-6">
                            Détails
                        </div>
                    </div>
                    <hr />
                    INFOS ICI
                    <button class="btn btn-danger" @click="showUI=false">Annuler</button>
                </div>
            </div>
        </transition>
        <div class="btn-group-sm btn-group">
            <a href="#" @click.prevent="manageReferent"class="btn btn-sm btn-primary"><i class="icon-cw-outline"></i>Gérer les référents</a>
        </div>
    </div>

</template>
<script>
    // nodejs ./node_modules/.bin/poi watch --format umd --moduleName  ReferentUI --filename.js ReferentUI.js --dist public/js/oscar/dist public/js/oscar/src/ReferentUI.vue

    import PersonAutoCompleter from "./PersonAutoCompleter";

    export default {

        components: {
            personselector: PersonAutoCompleter
        },

        props: {
            // Nom du référent
            persons: { require: true },
            url: { require: true }
        },

        data(){
            return {
                loading: false,
                datas: null,
                showUI: false
            }
        },

        methods:{
            manageReferent(){
                this.showUI = true;
                if( !this.datas ){
                    this.fetch();
                }
            },
            fetch(){
                this.$http.get(this.url).then(
                    ok => {

                    },
                    ko => {

                    }
                );
            }
        }
    }
</script>
 No newline at end of file