layout.html.twig 8.82 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
{% extends 'SonataAdminBundle::standard_layout.html.twig' %}

{% block stylesheets %}
    {{ parent() }}

    {# CKEDITOR FORMATTER #}
    <link rel="stylesheet" href="{{ asset('bundles/sonataformatter/markitup/skins/sonata/style.css') }}" type="text/css" media="all" />
    <link rel="stylesheet" href="{{ asset('bundles/sonataformatter/markitup/sets/markdown/style.css') }}" type="text/css" media="all" />
    <link rel="stylesheet" href="{{ asset('bundles/sonataformatter/markitup/sets/html/style.css') }}" type="text/css" media="all" />
    <link rel="stylesheet" href="{{ asset('bundles/sonataformatter/markitup/sets/textile/style.css') }}" type="text/css" media="all" />

12 13
    <style>
        .side-bar-links {
14 15 16
            margin-left: 15px;
            margin-top: 15px;
            margin-bottom: 5px;
17
        }
18 19 20
        .side-bar-links > a { color:white !important; }
        .side-bar-links .dropdown-menu>li>a {
            color: #777;
21
        }
22 23 24 25 26 27 28 29 30 31 32

        .bs-callout {
            padding: 20px;
            margin: 20px 0;
            border: 1px solid #eee;
            border-left-width: 5px;
            border-radius: 3px;
            background-color: white;
        }

        .bs-callout-danger { border-left-color: #ce4844; }
Sebastian Castro's avatar
Sebastian Castro committed
33 34
        .bs-callout-success { border-left-color: #00a65a; }
        .bs-callout-warning { border-left-color: #f39c12; }
Sebastian Castro's avatar
Sebastian Castro committed
35 36

        .btn i { margin-right: 6px; }
37
        .btn i + i { margin-left: -4px; }
Sebastian Castro's avatar
Sebastian Castro committed
38 39 40 41

        .markItUpHeader ul li {
            padding-right: 5px;
            padding-bottom: 5px;
42
        }
Sebastian Castro's avatar
Sebastian Castro committed
43 44 45 46 47 48 49

        .markItUpHeader ul .markItUpSeparator
        {
            background-color: white;
            color: transparent;
            border-right: 1px solid #b9b9b9;
            margin: 0 15px 0 5px;
50
        }
Sebastian Castro's avatar
Sebastian Castro committed
51 52 53 54 55

        .markItUpEditor {
            font-size: 15px;
            padding: 10px;
            font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;
56
        }
Sebastian Castro's avatar
Sebastian Castro committed
57 58

        .markItUpButton4, .markItUpButton5, .markItUpButton6, .markItUpButton12 + .markItUpSeparator, .markItUpButton13, .markItUpButton14 { display: none; }
59

60
        .box-body > .alert:last-child { margin-bottom: 0 }
61 62 63 64 65 66 67 68 69 70

        label[title]:hover {
            cursor: help;
        }
        label[title]:after {
            content: "(?)";
            font-weight: normal;
            font-size: 13px;
            margin-left: 5px;
        }
71
        .box-body .iframe-container { text-align: center; margin-top: -20px; }
72
        .box-body .iframe-container-aside {
73 74 75 76 77
            float: left;
            margin: -20px 20px 20px 0;
        }
        .text-and-iframe-container:before { display: table; content: " "; }
        .text-and-iframe-container:after { clear: both; display: table; content: " ";}
78 79 80 81 82

        .main-header { display: flex; }
        .main-header .logo { width: auto; }
        .main-header .logo label:hover { cursor: pointer; }
        .main-header .navbar { flex: auto; margin-left: 0; }
83 84 85 86 87

        pre {
          font-size: 11px;
          line-height: 13px;
        }
88
    </style>
89

90

91 92 93
{% endblock %}

{% block javascripts %}
94 95
    {{ parent() }}

96

97
    {# CKEDITOR FORMATTER #}
98
    <script src="//cdn.ckeditor.com/4.7.3/full/ckeditor.js"></script>
99 100 101 102
    <script src="{{ asset('bundles/sonataformatter/vendor/markitup-markitup/markitup/jquery.markitup.js') }}" type="text/javascript"></script>
    <script src="{{ asset('bundles/sonataformatter/markitup/sets/markdown/set.js') }}" type="text/javascript"></script>
    <script src="{{ asset('bundles/sonataformatter/markitup/sets/html/set.js') }}" type="text/javascript"></script>
    <script src="{{ asset('bundles/sonataformatter/markitup/sets/textile/set.js') }}" type="text/javascript"></script>
103

Sebastian Castro's avatar
Sebastian Castro committed
104 105 106 107 108 109 110 111 112
    <script>
    // bootstrap-ckeditor-modal-fix.js
    // hack to fix ckeditor/bootstrap compatiability bug when ckeditor appears in a bootstrap modal dialog
    //
    // Include this AFTER both bootstrap and ckeditor are loaded.
    $.fn.modal.Constructor.prototype.enforceFocus = function() {
      modal_this = this;
      console.log("enforce focus");
      $(document).on('focusin.modal', function (e) {
113 114
        if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length
        && !$(e.target.parentNode).hasClass('cke_dialog_ui_input_select')
Sebastian Castro's avatar
Sebastian Castro committed
115 116 117 118
        && !$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) {
          modal_this.$element.focus()
        }
      })
119
    };
120

Sebastian Castro's avatar
Sebastian Castro committed
121
    // CONFIGURATION ADMIN, disable the whole feature box according to checkbox "feature active"
122 123 124
    $(document).ready(function() {
        checkCollaborativeVoteActivated();
        $('.collaborative-feature .sonata-ba-field.sonata-ba-field-inline-natural > .form-group:first-child .icheckbox_square-blue .iCheck-helper').click(checkCollaborativeVoteActivated);
Sebastian Castro's avatar
Sebastian Castro committed
125 126 127 128

        $('.gogo-feature').each(function() {
            checkGoGoFeatureActivated(this);
        });
129
        $('.gogo-feature .sonata-ba-field.sonata-ba-field-inline-natural > .form-group:first-child .icheckbox_square-blue .iCheck-helper').click(function() {
Sebastian Castro's avatar
Sebastian Castro committed
130 131 132
            var that = this;
            setTimeout(function() { checkGoGoFeatureActivated($(that).closest('.gogo-feature'));  }, 10);
        });
133 134 135 136 137 138 139
    });

    function checkCollaborativeVoteActivated() {
        var collabActive = $('.collaborative-feature .sonata-ba-field.sonata-ba-field-inline-natural > .form-group:first-child .icheckbox_square-blue').hasClass('checked');
        var opacity = collabActive ? '1' : '0.4';
        $('.collaborative-moderation-box').css('opacity', opacity);
    }
Sebastian Castro's avatar
Sebastian Castro committed
140

141 142
    function checkGoGoFeatureActivated(object) {
        console.log("feature", object);
Sebastian Castro's avatar
Sebastian Castro committed
143 144
        var featureActive = $(object).find('.sonata-ba-field.sonata-ba-field-inline-natural > .form-group:first-child .icheckbox_square-blue').hasClass('checked');
        var opacity = featureActive ? '1' : '0.5';
145
        $(object).css('opacity', opacity);
Sebastian Castro's avatar
Sebastian Castro committed
146
    }
147

Sebastian Castro's avatar
Sebastian Castro committed
148
    // Helpers
149 150 151
    var formBuilder;
    var formBuilderInitialized = false;

Sebastian Castro's avatar
Sebastian Castro committed
152
    window.SONATA_CONFIG.CONFIRM_EXIT = false;
Sebastian Castro's avatar
Sebastian Castro committed
153 154
    </script>

155
{% endblock %}
Sebastian Castro's avatar
Sebastian Castro committed
156

157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
{% block logo %}
    {% spaceless %}
        <a class="logo" href="{{ path('sonata_admin_dashboard') }}">
            <img src="{{ asset('assets/img/default-icon.png') }}">
            <span>GoGoCarto Administration</span>
            {% set newMsgsCount = new_msgs_count() %}
            {% if newMsgsCount > 0 %}
                <label class="label label-info" style="margin-left: 6px">
                    <i class="fa fa-bell" style="margin-right: 3px;"></i>
                    {{ newMsgsCount }} {{ newMsgsCount == 1 ? ' message' : ' messages' }}
                </label>
            {% endif %}
            {% set newErrorsCount = errors_count() %}
            {% if newErrorsCount > 0 %}
                <label class="label label-danger" style="margin-left: 6px">
                    <i class="fa fa-warning" style="margin-right: 3px;"></i>
                    {{ newErrorsCount }} {{ newErrorsCount == 1 ? 'erreur' : 'erreurs' }}
                </label>
            {% endif %}
176

177 178 179 180
        </a>
    {% endspaceless %}
{% endblock %}

Sebastian Castro's avatar
Sebastian Castro committed
181
{% block sonata_sidebar_search %}
182 183 184 185 186 187 188 189 190 191 192
    <div class="btn-group side-bar-links">
      <a type="button" href={{ path('biopen_homepage') }} target='_blank' class="btn btn-primary">Retour au site</a>
      <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <span class="caret"></span>
        <span class="sr-only">Toggle Dropdown</span>
      </button>
      <ul class="dropdown-menu">
        <li><a href={{ path('biopen_directory') }} target='_blank'>La Carte</a></li>
        <li><a href={{ path('biopen_element_add') }} target='_blank'>Formulaire</a></li>
        <li><a href={{ path('biopen_partners') }} target='_blank'>Qui sommes nous</a></li>
      </ul>
193
    </div>
194 195
{% endblock %}

196
{% block side_bar_after_nav %}
197 198
    {# CUSTOM Menu #}
    <ul class="sidebar-menu">
199 200
        <li class="first treeview">
            <a href="{{ path('biopen_bulk_actions_index') }}"><i class="fa fa-bullhorn"></i><span>Actions de masse</span></a>
201
        </li>
202 203 204
        <li>
            <a href="{{ path('biopen_core_help') }}"><i class="fa fa-question"></i><span>Aide</span></a>
        </li>
205
        {% if use_as_saas %}
Sebastian Castro's avatar
Sebastian Castro committed
206
            <li>
207 208
                {% if is_root_project() %}
                    <a href="{{ path('admin_biopen_saas_project_list') }}"><i class="fa fa-folder-open"></i><span>Projets</span></a>
209
                {% elseif is_granted("ROLE_SUPER_ADMIN") %}
210 211 212 213
                    <a href="{{ path('biopen_project_delete_my_project') }}" onclick="return confirm('Cette action ne peux pas être annulée. Vous allez supprimer entièrement votre projet. Etes vous sur de vouloir continuer?')">
                        <button class="btn btn-sm btn-danger"><i class="fa fa-trash"></i><span>Supprimer ce projet</span></button>
                    </a>
                {% endif %}
Sebastian Castro's avatar
Sebastian Castro committed
214 215
            </li>
        {% endif %}
216
    </ul>
Sebastian Castro's avatar
Sebastian Castro committed
217
{% endblock %}