helloasso_synchro.html.twig 5.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
{% extends '@kohinos/bundles/SonataAdminBundle/standard_layout.html.twig' %}

{% block sonata_page_content %}
    <section class="content-header">
        <div class="sticky-wrapper">
            <nav class="navbar navbar-default" role='navigation'>
                <div class="container-fluid">
                    <div class="navbar-collapse">
                        <ul class="nav navbar-nav navbar-right">
                            <li>
                                <a class="sonata-action-element" href="{{ admin.generateUrl('list') }}"><i class="fa fa-undo"></i> Retour à la liste
                                </a>
                            </li>
                            {% if test %}
                                <li>
                                    <a class="sonata-action-element" href="{{ admin.generateUrl('synchro') }}"><i class="fa fa-refresh"></i> Synchronisation
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a class="sonata-action-element" href="{{ admin.generateUrl('synchro') }}?test=true"><i class="fa fa-refresh"></i> Test Synchronisation</a>
                                </li>
                            {% endif %}
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </section>
    <section class="content">
    	<div class="row">
    		<div class="col-xs-12 col-md-12">
                <div class="box box-primary" style="margin-bottom: 100px;">
                	<div class="box-body table-responsive">
                        <h4>Synchronisation avec HelloAsso {{test?'(TEST)':'effectué !'}}:</h4>
                        {% if updatedData|length > 0 or newData|length > 0 %}
                            <table class="table table-bordered table-striped table-hover sonata-ba-list">
                                <thead>
                                    <tr class="sonata-ba-list-field-header-text">
                                        <td>Id</td>
                                        <td>HelloAsso Id</td>
                                        <td>Message</td>
                                        <td>Adhérent</td>
                                        <td>Prestataire</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% if updatedData|length > 0 %}
                                        <tr>
                                            <td colspan="5" class='text-center'>
                                                <b>MISE(S) À JOUR</b>
                                            </td>
                                        </tr>
                                        {% for key, data in updatedData %}
                                            <tr>
                                                <td>{{key}}</td>
                                                <td>{{data.data.helloassoid}}</td>
                                                <td>{{data.message}}</td>
                                                <td>{{data.data.adherent?("<a href='"~path('adherent_edit', {id: data.data.adherent.id})~"'>" ~ data.data.adherent.name~"</a>")|raw:''}}</td>
                                                <td>{{data.data.prestataire?("<a href='"~path('prestataire_edit', {id: data.data.prestataire.id})~"'>" ~ data.data.prestataire.raison~"</a>")|raw:''}}</a></td>
                                            </tr>
                                        {% endfor %}
                                    {% endif %}
                                    {% if newData|length > 0 %}
                                        <tr>
                                            <td colspan="5" class='text-center'>
                                                <b>NOUVEAUTÉ(S)</b>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="5" class='text-center'>
                                                <em>Toutes ces transactions sont importées mais aucunes opérations ne sera effectuées sur les comptes des adhérents/prestataires</em>
                                            </td>
                                        </tr>
                            			{% for key, data in newData %}
                                            <tr>
                                                <td>{{key}}</td>
                                                <td>{{data.data.helloassoid}}</td>
                                                <td>{{data.message}}</td>
                                                <td>{{data.data.adherent?("<a href='"~path('adherent_edit', {id: data.data.adherent.id})~"'>" ~ data.data.adherent.name~"</a>")|raw:''}}</td>
                                                <td>{{data.data.prestataire?data.data.prestataire.raison:''}}</td>
                                            </tr>
                                        {% endfor %}
                                    {% endif %}
                                </tbody>
                            </table>
                        {% else %}
                            <br/>
                            <p>
                                {{ "Aucunes informations nouvelles venant d'HelloAsso"|trans }}
                            </p>
                        {% endif %}
        			</div>
    			</div>
    		</div>
    	</div>
    </section>
{% endblock %}