Changeset 188:19a8aff81d32


Ignore:
Timestamp:
Nov 29, 2009 5:41:26 PM (3 years ago)
Author:
slav0nic <slav0nic0@…>
Branch:
default
Message:

fixed #54: Default reputation must be 0

Location:
djangobb/apps/forum
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • djangobb/apps/forum/models.py

    r177 r188  
    22import os 
    33import os.path 
    4  
     4from markdown import Markdown 
    55 
    66from django.db import models 
     
    1111from django.utils.translation import ugettext_lazy as _ 
    1212from django.utils.hashcompat import sha_constructor 
    13 #from django.contrib.markup.templatetags.markup import markdown 
    14 from markdown import Markdown 
    1513 
    1614from forum.markups import mypostmarkup  
  • djangobb/apps/forum/templates/forum/topic.html

    r186 r188  
    5656                                                {% if "REPUTATION_SUPPORT"|forum_setting %} 
    5757                                                        {% ifnotequal request.user post.user.username %} 
    58                                                                 <dd><a href="{% url reputation post.user %}">{% trans "Reputation" %}</a> :  <a href="{% url reputation post.user %}?action=plus&topic_id={{ post.topic.id }}"><img src="{{ MEDIA_URL }}forum/img/reputation/warn_add.gif" alt="+" border="0"></a>&nbsp;&nbsp;<strong>{{ post.user.forum_profile.reply_total }}&nbsp;&nbsp;</strong><a href="{% url reputation post.user %}?action=minus&topic_id={{ post.topic.id }}"><img src="{{ MEDIA_URL }}forum/img/reputation/warn_minus.gif" alt="-" border="0"></a></dd> 
     58                                                                <dd><a href="{% url reputation post.user %}">{% trans "Reputation" %}</a> : <a href="{% url reputation post.user %}?action=plus&topic_id={{ post.topic.id }}"><img src="{{ MEDIA_URL }}forum/img/reputation/warn_add.gif" alt="+" border="0"></a>&nbsp;&nbsp;<strong>{{ post.user.forum_profile.reply_total }}&nbsp;&nbsp;</strong><a href="{% url reputation post.user %}?action=minus&topic_id={{ post.topic.id }}"><img src="{{ MEDIA_URL }}forum/img/reputation/warn_minus.gif" alt="-" border="0"></a></dd> 
    5959                                                        {% endifnotequal %} 
    6060                                                {% endif %} 
    6161                                                <dd class="usercontacts"><a href="{% url forum_profile post.user %}">{% trans "Profile" %}</a>&nbsp;&nbsp; 
    6262                                                {% ifequal post.user.forum_profile.privacy_permission 0 %} 
    63                                                                 <a href="mailto:{{ post.user.email }}">{% trans "E-mail" %}</a>&nbsp;&nbsp; 
    64                                                         {% else %} 
    65                                                                 {% ifequal post.user.forum_profile.privacy_permission 1 %} 
     63                                                        <a href="mailto:{{ post.user.email }}">{% trans "E-mail" %}</a>&nbsp;&nbsp; 
     64                                                {% else %} 
     65                                                        {% ifequal post.user.forum_profile.privacy_permission 1 %} 
    6666                                                                        <a href="{% url misc %}?mail_to={{ post.user }}">{% trans "Send e-mail" %}</a>&nbsp;&nbsp; 
    67                                                                 {% endifequal %} 
     67                                                        {% endifequal %} 
    6868                                                {% endifequal %} 
    6969                                                {% if "PM_SUPPORT"|forum_setting %} 
  • djangobb/apps/forum/views.py

    r187 r188  
    292292        replies_list = Reputation.objects.filter(to_user__pk__in=users).values('to_user_id').annotate(sign=Sum('sign')) #values_list buggy? 
    293293 
    294         if replies_list: 
    295             replies = {} 
    296             for r in replies_list: 
    297                 replies[r['to_user_id']] = r['sign'] 
    298  
    299             for post in posts: 
    300                 post.user.forum_profile.reply_total = replies.get(post.user.id, 0) 
     294        replies = {} 
     295        for r in replies_list: 
     296            replies[r['to_user_id']] = r['sign'] 
     297 
     298        for post in posts: 
     299            post.user.forum_profile.reply_total = replies.get(post.user.id, 0) 
    301300 
    302301    initial = {} 
Note: See TracChangeset for help on using the changeset viewer.