<commit_before>{% extends "p3/base.html" %}
{% load conference assopy_tags %}

{% block EXTRA_HEAD %}
    {{ block.super }}
    <style type="text/css">
        #form-options .inline .field {
            float: left;
        }
    </style>
{% endblock %}
{% block PAGE_TITLE %}Talk voting &mdash; {% endblock %}

{% block MAIN_CONTENT %}
    {% if not voting_allowed %}
    <section class="notice">
        {% if request.user.is_authenticated %}
        <p>To join the community voting, you must buy a ticket. You can buy one <a href="{% url p3-cart %}">here</a>.</p>
        {% else %}
        <p>To join the community voting, you must buy a ticket.</p>
        <p>If you already bought a ticket please <a href="/accounts/login/">log in</a>, otherwise you can buy one <a href="{% url p3-cart %}">here</a>.</p>
        {% endif %}
    </section>
    {% endif %}
    <h1>Talk Voting</h1>
    
    <div class="page-summary">        
        <p>{Summary} Loren Ipsum</p>
    </div>
    
    <form action="{% url conference-voting %}" method="GET" id="form-options">
        <div class="span-5 inline">
            {{ form.abstracts|field }}
            {{ form.talk_type|field }}
            {{ form.language|field }}
        </div>
        <div class="span-7 last inline">
            {{ form.order|field }}
            <div class="field">
                <label>&nbsp;</label>
                <input type="submit" value="refresh" />
            </div>
        </div>
    </form>
    <div class="span-8">
        <ul id="talk-voting">
            {% for t in talks %}
            <li>
                <h2>
                    {{ forloop.counter }} -
                    {% if voting_allowed %}
                    <a href="{% url conference-talk slug=t.slug %}">{{ t.title }}</a>
                    {% else %}
                    {{ t.title }}
                    {% endif %}
                    {% if t.language == "it" %} <img src="{{ STATIC_URL }}p5/i/italian-flag.png" height="15" />{% endif %}
                </h2>
                <div class="meta">
                    {% if voting_allowed %}
                    By {% for s in t.get_all_speakers %}<a href="{% url conference-speaker slug=s.slug %}"><b>{{ s.name }}</b></a>{% if not forloop.last %}, {% endif %}{% endfor %}
                    {% else %}
                    By {% for s in t.get_all_speakers %}<b>{{ s.name }}</b>{% if not forloop.last %}, {% endif %}{% endfor %}
                    {% endif %}
                    | <b>{% if t.training_available %}Training{% else %}Talk{% endif %}</b>
                    for <b>{{ t.get_level_display }}</b>
                </div>
                <form action="{% url conference-voting %}" method="post">{% csrf_token %}
                    <input name="vote-{{ t.id }}" id="id_vote-{{ t.id }}" type="range" min="0" max="10" value="{{ t.user_vote.vote|default:"0" }}" step="0.5" />
                    <div class="rateit" data-rateit-backingfld="#id_vote-{{ t.id }}"></div>
                </form>
                {% if voting_allowed %}
                <dl>
                    <dt rel="div[data-talk={{ t.id }}]" class="toggle" data-src="{% url conference-talk-xml t.slug %}">Abstract</dt>
                    <dd>
                        <div class="cms" data-talk="{{ t.id }}"> </div>                    
                    </dd>                    
                </dl>
                {% endif %}
            </li>
            {% endfor %}        
        </ul>
        <script type="text/javascript">
            (function() {
                function rate(e, val) {
                    var field = $(e.rateit('backingfld'));
                    var form = field.parents('form');
                    if(val == undefined) 
                        field.val(e.rateit('value'))
                    else
                        field.val(val);
                    form.ajaxSubmit();
                }
                {% if voting_allowed %}
                $('#talk-voting .rateit')
                    .rateit()
                    .bind('rated', function() {
                        rate($(this));
                    })
                    .bind('reset', function() {
                        rate($(this), 0);
                    });
                {% else %}
                $('#talk-voting .rateit')
                    .rateit();
                {% endif %}
                {% if voting_allowed %}
                $('#talk-voting .toggle').click(function(e) {
                    var trigger = $(e.target);
                    var dest = $(trigger.attr('rel'));
                    if(dest.attr('load'))
                        return;
                    dest.attr('load', '1');
                    dest.html('loading...');
                    $.ajax({
                        url: trigger.attr('data-src'),
                        dataType: 'xml',
                        success: function(data, text, jqXHR) {
                            dest.html($('talk abstract', data).html());
                        },
                        error: function(jqXHR, text, error) {
                            dest.attr('load', null);
                        }
                    });
                });
                {% endif %}
            })();
        </script>
    </div>
    
    <div class="span-4 last">
        <aside>    
            <div class="cms">
                <h4>Sample h4 header</h4>

                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sit amet elit vitae arcu interdum ullamcorper. Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim, et mattis justo nibh eu elit. Quisque ultrices gravida pede. Mauris accumsan vulputate tellus. Phasellus condimentum bibendum dolor. Mauris sed ipsum. Phasellus in diam. Nam sapien ligula, consectetuer id, hendrerit in, cursus sed, leo. Nam tincidunt rhoncus urna. Aliquam id massa ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis, placerat ultrices, orci.</p>
                
                
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sit amet elit vitae arcu interdum ullamcorper. Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim, et mattis justo nibh eu elit. Quisque ultrices gravida pede. Mauris accumsan vulputate tellus. Phasellus condimentum bibendum dolor. Mauris sed ipsum. Phasellus in diam. Nam sapien ligula, consectetuer id, hendrerit in, cursus sed, leo. Nam tincidunt rhoncus urna. Aliquam id massa ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis, placerat ultrices, orci.</p>
                
            
            </div>
        
        </aside>
    </div>    
{% endblock %}
<commit_msg>mostro il numero dei commenti associati ad ogni talk<commit_after>{% extends "p3/base.html" %}
{% load comments conference assopy_tags %}

{% block EXTRA_HEAD %}
    {{ block.super }}
    <style type="text/css">
        #form-options .inline .field {
            float: left;
        }
    </style>
{% endblock %}
{% block PAGE_TITLE %}Talk voting &mdash; {% endblock %}

{% block MAIN_CONTENT %}
    {% if not voting_allowed %}
    <section class="notice">
        {% if request.user.is_authenticated %}
        <p>To join the community voting, you must buy a ticket. You can buy one <a href="{% url p3-cart %}">here</a>.</p>
        {% else %}
        <p>To join the community voting, you must buy a ticket.</p>
        <p>If you already bought a ticket please <a href="/accounts/login/">log in</a>, otherwise you can buy one <a href="{% url p3-cart %}">here</a>.</p>
        {% endif %}
    </section>
    {% endif %}
    <h1>Talk Voting</h1>
    
    <div class="page-summary">        
        <p>{Summary} Loren Ipsum</p>
    </div>
    
    <form action="{% url conference-voting %}" method="GET" id="form-options">
        <div class="span-5 inline">
            {{ form.abstracts|field }}
            {{ form.talk_type|field }}
            {{ form.language|field }}
        </div>
        <div class="span-7 last inline">
            {{ form.order|field }}
            <div class="field">
                <label>&nbsp;</label>
                <input type="submit" value="refresh" />
            </div>
        </div>
    </form>
    <div class="span-8">
        <ul id="talk-voting">
            {% for t in talks %}
            <li>
                <h2>
                    {{ forloop.counter }} -
                    {% if voting_allowed %}
                    <a href="{% url conference-talk slug=t.slug %}">{{ t.title }}</a>
                    {% else %}
                    {{ t.title }}
                    {% endif %}
                    {% if t.language == "it" %} <img src="{{ STATIC_URL }}p5/i/italian-flag.png" height="15" />{% endif %}
                </h2>
                <div class="meta">
                    {% if voting_allowed %}
                    By {% for s in t.get_all_speakers %}<a href="{% url conference-speaker slug=s.slug %}"><b>{{ s.name }}</b></a>{% if not forloop.last %}, {% endif %}{% endfor %}
                    {% else %}
                    By {% for s in t.get_all_speakers %}<b>{{ s.name }}</b>{% if not forloop.last %}, {% endif %}{% endfor %}
                    {% endif %}
                    | <b>{% if t.training_available %}Training{% else %}Talk{% endif %}</b>
                    for <b>{{ t.get_level_display }}</b>
                </div>
                <form action="{% url conference-voting %}" method="post">{% csrf_token %}
                    <input name="vote-{{ t.id }}" id="id_vote-{{ t.id }}" type="range" min="0" max="10" value="{{ t.user_vote.vote|default:"0" }}" step="0.5" />
                    <div class="rateit"{% if not voting_allowed %} data-rateit-readonly="readonly"{% endif %} data-rateit-backingfld="#id_vote-{{ t.id }}"></div>
                    {% get_comment_count for t as ccount %}
                    {% if ccount > 0 %}
                        {% if voting_allowed %}
                        <a href="{% url conference-talk slug=t.slug %}#comments">{{ ccount }} comments</a>
                        {% else %}
                        {{ ccount }} comments
                        {% endif %}
                    {% endif %}
                </form>
                {% if voting_allowed %}
                <dl>
                    <dt rel="div[data-talk={{ t.id }}]" class="toggle" data-src="{% url conference-talk-xml t.slug %}">Abstract</dt>
                    <dd>
                        <div class="cms" data-talk="{{ t.id }}"> </div>                    
                    </dd>                    
                </dl>
                {% endif %}
            </li>
            {% endfor %}        
        </ul>
        <script type="text/javascript">
            (function() {
                function rate(e, val) {
                    var field = $(e.rateit('backingfld'));
                    var form = field.parents('form');
                    if(val == undefined) 
                        field.val(e.rateit('value'))
                    else
                        field.val(val);
                    form.ajaxSubmit();
                }
                {% if voting_allowed %}
                $('#talk-voting .rateit')
                    .rateit()
                    .bind('rated', function() {
                        rate($(this));
                    })
                    .bind('reset', function() {
                        rate($(this), 0);
                    });
                {% else %}
                $('#talk-voting .rateit')
                    .rateit();
                {% endif %}
                {% if voting_allowed %}
                $('#talk-voting .toggle').click(function(e) {
                    var trigger = $(e.target);
                    var dest = $(trigger.attr('rel'));
                    if(dest.attr('load'))
                        return;
                    dest.attr('load', '1');
                    dest.html('loading...');
                    $.ajax({
                        url: trigger.attr('data-src'),
                        dataType: 'xml',
                        success: function(data, text, jqXHR) {
                            dest.html($('talk abstract', data).html());
                        },
                        error: function(jqXHR, text, error) {
                            dest.attr('load', null);
                        }
                    });
                });
                {% endif %}
            })();
        </script>
    </div>
    
    <div class="span-4 last">
        <aside>    
            <div class="cms">
                <h4>Sample h4 header</h4>

                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sit amet elit vitae arcu interdum ullamcorper. Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim, et mattis justo nibh eu elit. Quisque ultrices gravida pede. Mauris accumsan vulputate tellus. Phasellus condimentum bibendum dolor. Mauris sed ipsum. Phasellus in diam. Nam sapien ligula, consectetuer id, hendrerit in, cursus sed, leo. Nam tincidunt rhoncus urna. Aliquam id massa ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis, placerat ultrices, orci.</p>
                
                
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sit amet elit vitae arcu interdum ullamcorper. Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim, et mattis justo nibh eu elit. Quisque ultrices gravida pede. Mauris accumsan vulputate tellus. Phasellus condimentum bibendum dolor. Mauris sed ipsum. Phasellus in diam. Nam sapien ligula, consectetuer id, hendrerit in, cursus sed, leo. Nam tincidunt rhoncus urna. Aliquam id massa ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis, placerat ultrices, orci.</p>
                
            
            </div>
        
        </aside>
    </div>    
{% endblock %}

{'fraction_non_alphanumeric': 0.14361020088331672, 'fraction_numerical': 0.0036329961532981904, 'mean_word_length': 1.3734573119188505, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 0, '>': 172, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2869728', 'n_tokens_mistral': 4363, 'n_tokens_neox': 3911, 'n_words': 1031}