Changeset - cc032da2887a
[Not reviewed]
0 3 0
Luke Hatcher - 12 years ago 2012-10-03 22:41:35
lukeman@gmail.com
include user rating in reviews
3 files changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
symposion/reviews/views.py
Show inline comments
...
 
@@ -50,15 +50,17 @@ def proposals_generator(request, queryset, user_pk=None, check_speaker=True):
 
        if user_pk:
 
            lookup_params["user__pk"] = user_pk
 
        else:
 
            lookup_params["user"] = request.user
 
        
 
        try:
 
            obj.latest_vote = LatestVote.objects.get(**lookup_params).css_class()
 
            obj.user_vote = LatestVote.objects.get(**lookup_params).vote
 
            obj.user_vote_css = LatestVote.objects.get(**lookup_params).css_class()
 
        except LatestVote.DoesNotExist:
 
            obj.latest_vote = "no-vote"
 
            obj.user_vote = None
 
            obj.user_vote_css = "no-vote"
 
        
 
        yield obj
 

	
 

	
 
@login_required
 
def review_section(request, section_slug, assigned=False):
symposion/templates/reviews/_review_table.html
Show inline comments
...
 
@@ -7,17 +7,18 @@
 
        <th>{% trans "Category" %}</th>
 
        <th><i class="icon-comment-alt"></i></th>
 
        <th>{% trans "+1" %}</th>
 
        <th>{% trans "+0" %}</th>
 
        <th>{% trans "-0" %}</th>
 
        <th>{% trans "-1" %}</th>
 
        <th><a href="#" class="tip" title="{% trans "Your Rating" %}"><i class="icon-user"></i></a></th>
 
    </thead>
 
    
 
    <tbody>
 
        {% for proposal in proposals %}
 
            <tr>
 
            <tr class="{{ proposal.user_vote_css }}">
 
                <td>{{ proposal.number }}</td>
 
                <td>
 
                    <a href="{% url review_detail proposal.pk %}">
 
                        <small><strong>{{ proposal.speaker }}</strong></small>
 
                        <br />
 
                        {{ proposal.title }}
...
 
@@ -26,10 +27,11 @@
 
                <td>{{ proposal.track }}</td>
 
                <td>{{ proposal.comment_count }}</td>
 
                <td>{{ proposal.plus_one }}</td>
 
                <td>{{ proposal.plus_zero }}</td>
 
                <td>{{ proposal.minus_zero }}</td>
 
                <td>{{ proposal.minus_one }}</td>
 
                <td>{{ proposal.user_vote|default:"" }}</td>
 
            </tr>
 
        {% endfor %}
 
    </tbody>
 
</table>
symposion/templates/reviews/base.html
Show inline comments
...
 
@@ -94,13 +94,14 @@
 

	
 
{% block extra_script %}
 
    <script src="{{ STATIC_URL }}datatables/js/jquery.dataTables.min.js" type="text/javascript"></script>
 
    <script src="{{ STATIC_URL }}tabletools/js/TableTools.min.js" type="text/javascript"></script>
 
    <script src="{{ STATIC_URL }}datatables/js/dataTables.bootstrap.js" type="text/javascript"></script>
 
    <script type="text/javascript">
 
        $(function() {            
 
        $(function() {
 
            $(".tip").tooltip();
 
            $("table.table-reviews").dataTable({
 
                "sDom": "<'row'<'span3'l><'span3'T><'span4'f>r>t<'row'<'span3'i><'span5'p>>",
 
                "sPaginationType": "bootstrap",
 
                "bStateSave": true,
 
                "oTableTools": {
 
                    "aButtons": [
0 comments (0 inline, 0 general)