Changeset 963

Show
Ignore:
Timestamp:
Wed Mar 22 13:57:44 2006
Author:
anonymous
Message:

修改

Files:

Legend:

Unmodified
Added
Removed
Modified
  • zqlib/tangle/limodou/blog/trunk/blog/media/woodlog.css

    r962 r963  
    47 47     float: right;  
    48 48     width: 250px;  
      49     margin-right: 20px;  
    49 50 }  
    50 51  
    56 57     }  
    57 58 #side-b h4 {  
    58       margin: 0 0 10px 0;  
    59       padding: 5px 20px 5px 20px;  
      59     margin-bottom: 15px;  
      60     padding: 3px 10px 3px 10px;  
    60 61     font-size: 14px;  
    61 62     border-top: 1px solid #aaa;  
  • zqlib/tangle/limodou/blog/trunk/blog/media/blog.css

    r894 r963  
    336 336     padding: 0 0 0 14px;  
    337 337     }  
      338  
      339 #sidebar .box li.comment {  
      340     margin: 0 0 2px 0;  
      341     padding: 0 0 0 2px;  
      342     list-style: none;  
      343     }  
    338 344      
    339 345 /* Del.icio.us box */  
  • zqlib/tangle/limodou/blog/trunk/blog/apps/woodlog/templatetags/blogtags.py

    r962 r963  
    4 4 from apps.woodlog.models import Entry  
    5 5 from apps.links.models import LinkCategory  
      6 from public.apps.comment.models import Comment  
    6 7 from django.conf import settings  
    7 8 from django import template  
     
    34 35 register.inclusion_tag('woodlog/links', takes_context=True)(get_links)  
    35 36  
      37 def get_lastestcomments(context):  
      38     username = context['blog_id']  
      39     user = User.objects.get(username=username)  
      40     return {'blog_id':context['blog_id'], 'comments': Comment.objects.filter(targetuser=user.id)}  
      41 register.inclusion_tag('woodlog/lastestcomments', takes_context=True)(get_lastestcomments)  
      42  
    36 43 def get_base():  
    37 44     return settings.HOSTURL  
    79 86  
    80 87 def truncatestr(value, length=100):  
    81       text = unicode(value, settings.DEFAULT_CHARSET, 'ignore')[:length].encode(settings.DEFAULT_CHARSET)  
    82       return text + '...'  
      88     text = unicode(value, settings.DEFAULT_CHARSET, 'ignore')  
      89     t = text[:length].encode(settings.DEFAULT_CHARSET)  
      90     if len(text) <= length:  
      91         suffix = ''  
      92     else:  
      93         suffix = '...'  
      94     return t + suffix  
    83 95 register.filter(truncatestr)  
    84 96      
  • zqlib/tangle/limodou/blog/trunk/blog/apps/woodlog/templates/woodlog/base.html

    r962 r963  
    40 40         <div id="links" align="center">{% get_links %}</div>  
    41 41         <br />  
      42         <div id="links" align="center">{% get_lastestcomments %}</div>  
      43         <br />  
    42 44         <div id="poweredby" align="center"><a href="http://www.djangoproject.com/"><img src="/medias/djangopowered.gif" alt="django"></a></div>  
    43 45     </div>  
  • zqlib/tangle/limodou/blog/trunk/blog/public/apps/comment/models.py

    r894 r963  
    1 1 from django.db import models  
    2 2 from django.contrib.auth.models import User  
      3 from public.apps.config import get_model  
    3 4  
    4 5 class Comment(models.Model):  
    17 18      
    18 19     def url(self):  
    19           post = self.post_set.all()[0]  
    20           return 'comments/' + post.get_slug()  
      20         model_name, obj_id = self.object_id.split('/')  
      21         model = get_model(model_name)  
      22         obj = model.objects.get(pk=int(obj_id))  
      23         return obj.url()  
    21 24      
    22 25     def get_id(self):  
  • zqlib/tangle/limodou/blog/trunk/blog/templates/home/index.html

    r953 r963  
    1 1 {% extends "home/base_2col" %}  
    2   {% load i18n markup %}  
      2 {% load i18n markup config %}  
    2 2  
    3 3 {% block content-main %}  
    6 6     <div class="entry" id="entry_{{ object.id }}">  
    7 7         {% include "woodlog/entry" %}  
    8           <p class="post-date">({{ object.comments|length }} {% trans "comments" %})</p>  
      8         <p class="post-date">(<a href="{% get_app_root "blog" %}/{{ object.url }}">{{ object.comments|length }} {% trans "comments" %}</a>)</p>  
    8 8     </div>  
    9 9     {% endfor %}  
  • zqlib/tangle/limodou/blog/trunk/blog/templates/home/base_2col.html

    r931 r963  
    3 3  
    4 4 {% block content %}  
    5       <div id="content">  
    6           <div id="side-a">  
    7               {% block content-main %}  
    8               {% endblock %}  
    9           </div>  
    10           <div id="side-b">  
    11               {% block content-related %}  
    12               {% endblock %}  
    13           </div>  
    14       </div>  
      5     <div id="side-a">  
      6         {% block content-main %}  
      7         {% endblock %}  
      8     </div>  
      9     <div id="side-b">  
      10         {% block content-related %}  
      11         {% endblock %}  
      12     </div>  
    15 13 {% endblock %}  
  • zqlib/tangle/limodou/blog/trunk/blog/templates/home/base.html

    r962 r963  
    55 55 </div>  
    56 56 <div id="footer">  
    57       <p>&copy;2006 <a href="http://www.djangoproject.com">Powered by Django</a> Author: limodou & 唐晓平 <b>Woodlog</b> 0.1</p>  
      57     <p>&copy;2006 <a href="http://www.djangoproject.com">Powered by Django</a> <b>|</b> Author: limodou & 唐晓平 <b>|</b> <b>Woodlog</b> 0.1</p>  
    57 57 </div>  
    58 58 </body>