<commit_before>{% extends '::frontend.html.twig' %}

{% block title %}Nueva publicación{% endblock %}

{% block article %}

    <h2>Nueva publicación</h2>
    
    {% if app.user and app.user.role.contribute %} 
    {% include 'ColectaItemBundle:Default:newItemForm.html.twig' %}
    {% endif %}

{% endblock %}

{% block stylesheets %}
    {% if app.user and app.user.role.contribute %} 
        {% if rich_text_editor %}
            <link rel="stylesheet" href="/css/summernote.css" />
        {% endif %}
        <link rel="stylesheet" href="/js/pickadate/themes/default.css" />
        <link rel="stylesheet" href="/js/pickadate/themes/default.date.css" />
        <link rel="stylesheet" href="/js/pickadate/themes/default.time.css" />
        <style>
        .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
            cursor: pointer;
            background-color: #FFF;
        }
        </style>
    {% endif %}
{% endblock %}

{% block javascripts %}  
    {% if app.user and app.user.role.contribute %} 
        {% if rich_text_editor %}
            <script src="/js/summernote.min.js"></script>
        {% endif %}
        
        <script src="/js/bootstrap.min.js"></script>
        <script src="/js/pickadate/picker.js"></script>
        <script src="/js/pickadate/picker.date.js"></script>
        <script src="/js/pickadate/picker.time.js"></script>
        <script src="/js/pickadate/legacy.js"></script>
        <script src="/js/pickadate/translations/es_ES.js"></script>
        
        <script src="/js/userInteraction.js"></script>
        <script>        
        {% include 'ColectaItemBundle:Category:categoryform.js.twig' %}
    
        {% if rich_text_editor %}
            $(document).ready(function() {
                $('#FileText').summernote({
                    height: 180,
                    toolbar: [
                    //['style', ['style']], // no style button
                    ['style', ['bold', 'italic', 'underline', 'clear']],
                    //['fontsize', ['fontsize']],
                    //['color', ['color']],
                    ['para', ['ul', 'ol']],
                    //['height', ['height']],
                    ['insert', [/*'picture',*/ 'link']], // no insert buttons
                    //['table', ['table']], // no table button
                    ['help', ['help']] //no help button
                    ]
                });
            });
            
            var postForm = function() {
                var content = $('textarea[name="text"]').html($('#FileText').code());
            }
        {% endif %}
        
        var EventDateini = $('#EventDateini').pickadate({
            format: 'dd-mm-yyyy',
            onSet: function(context) {
                var picker = EventDateend.pickadate('picker');
                if(context.select > picker.get('select').pick)
                {
                    picker.set('select', context.select);
                }
                picker.set('min', new Date(context.select));
            }
        });
        
        var EventDateend = $( "#EventDateend" ).pickadate({
            format: 'dd-mm-yyyy',
            min: $('#EventDateini').val()
        });
        
        $('#EventDateiniTime').pickatime({
            interval: 10,
            format: 'HH:i'
        });
        $('#EventDateendTime').pickatime({
            interval: 10,
            format: 'HH:i'
        });
        
        {% if item is defined %}
            {% if item.type == 'Activity/Event' %}
                $(document).ready(function() {typeChosen('event');});
            {% elseif item.type == 'Item/Post' or item.type == 'Files/Folder' or item.type == 'Files/File' %}
                $(document).ready(function() {typeChosen('text');});
            {% elseif item.type == 'Activity/Route' or item.type == 'Activity/Place' %}
                $(document).ready(function() {typeChosen('map');});
            {% endif %}
        {% endif %}
        </script>
    {% endif %}
{% endblock %}<commit_msg>Improve UX<commit_after>{% extends '::frontend.html.twig' %}

{% block title %}Nueva publicación{% endblock %}

{% block article %}

    <h2>Nueva publicación</h2>
    
    {% if app.user and app.user.role.contribute %} 
    {% include 'ColectaItemBundle:Default:newItemForm.html.twig' %}
    {% endif %}

{% endblock %}

{% block stylesheets %}
    {% if app.user and app.user.role.contribute %} 
        {% if rich_text_editor %}
            <link rel="stylesheet" href="/css/summernote.css" />
        {% endif %}
        <link rel="stylesheet" href="/js/pickadate/themes/default.css" />
        <link rel="stylesheet" href="/js/pickadate/themes/default.date.css" />
        <link rel="stylesheet" href="/js/pickadate/themes/default.time.css" />
        <style>
        .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
            cursor: pointer;
            background-color: #FFF;
        }
        </style>
    {% endif %}
{% endblock %}

{% block javascripts %}  
    {% if app.user and app.user.role.contribute %} 
        {% if rich_text_editor %}
            <script src="/js/summernote.min.js"></script>
        {% endif %}
        
        <script src="/js/bootstrap.min.js"></script>
        <script src="/js/pickadate/picker.js"></script>
        <script src="/js/pickadate/picker.date.js"></script>
        <script src="/js/pickadate/picker.time.js"></script>
        <script src="/js/pickadate/legacy.js"></script>
        <script src="/js/pickadate/translations/es_ES.js"></script>
        
        <script src="/js/userInteraction.js"></script>
        <script>        
        {% include 'ColectaItemBundle:Category:categoryform.js.twig' %}
    
        {% if rich_text_editor %}
            $(document).ready(function() {
                $('#FileText').summernote({
                    height: 180,
                    toolbar: [
                    //['style', ['style']], // no style button
                    ['style', ['bold', 'italic', 'underline', 'clear']],
                    //['fontsize', ['fontsize']],
                    //['color', ['color']],
                    ['para', ['ul', 'ol']],
                    //['height', ['height']],
                    ['insert', [/*'picture',*/ 'link']], // no insert buttons
                    //['table', ['table']], // no table button
                    ['help', ['help']] //no help button
                    ]
                });
            });
            
            var postForm = function() {
                var content = $('textarea[name="text"]').html($('#FileText').code());
            }
        {% endif %}
        
        var EventDateini = $('#EventDateini').pickadate({
            format: 'dd-mm-yyyy',
            onSet: function(context) {
                var picker = EventDateend.pickadate('picker');
                if(context.select > picker.get('select').pick)
                {
                    picker.set('select', context.select);
                }
                picker.set('min', new Date(context.select));
            }
        });
        
        var EventDateend = $( "#EventDateend" ).pickadate({
            format: 'dd-mm-yyyy',
            min: $('#EventDateini').val()
        });
        
        $('#EventDateiniTime').pickatime({
            interval: 10,
            format: 'HH:i'
        });
        $('#EventDateendTime').pickatime({
            interval: 10,
            format: 'HH:i'
        });
        
        {% if item is defined %}
            {% if item.type == 'Activity/Event' %}
                $(document).ready(function() {typeChosen('event');});
            {% elseif item.type == 'Item/Post' or item.type == 'Files/Folder' or item.type == 'Files/File' %}
                $(document).ready(function() {typeChosen('text');});
            {% elseif item.type == 'Activity/Route' or item.type == 'Activity/Place' %}
                $(document).ready(function() {typeChosen('map');});
            {% endif %}
        {% elseif type is defined %}
            {% if type == 'Event' %}
                $(document).ready(function() {typeChosen('event');});
            {% elseif type == 'Post' or type == 'Folder' or type == 'File' %}
                $(document).ready(function() {typeChosen('text');});
            {% elseif type == 'Route' or type == 'Place' %}
                $(document).ready(function() {typeChosen('map');});
            {% endif %}
        {% endif %}
        
        </script>
    {% endif %}
{% endblock %}
{'fraction_non_alphanumeric': 0.1819455798201565, 'fraction_numerical': 0.002102067032582039, 'mean_word_length': 1.675413933145892, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1218061', 'n_tokens_mistral': 2595, 'n_tokens_neox': 2360, 'n_words': 426}