Changeset 70

Show
Ignore:
Timestamp:
06/28/08 01:42:01 (2 months ago)
Author:
nobu
Message:

pluggable-contents:

  • 細かい修正。
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/pluggable-contents/common/tests.py

    r35 r70  
    55from lxml import etree 
    66 
     7from django.contrib.sites.models import Site 
     8from django.conf import settings 
    79from django.test import TestCase 
    8 from django.contrib.sites.models import Site 
    910 
    1011from blog.models import Entry 
     
    1819    common's test. 
    1920    """ 
     21    def setUp(self): 
     22        settings.SUB_CONTENTS = () 
     23        settings.EXTRA_CONTENTS = () 
     24 
    2025    def test_sitemap(self): 
    2126        """ 
     
    7580        self.assertEqual(html.xpath('//head/title/text()')[0], 
    7681                         u'%s - %s' % (checked.title, CURRENT_SITE.name)) 
     82 
    7783        #   check context 
    7884        context = response.context[-1] 
  • branches/pluggable-contents/plugins/views.py

    r69 r70  
    99from django.db import connection 
    1010from django.template import loader, Context 
     11from django.utils.translation import ugettext_lazy as _ 
    1112 
    1213from blog.models import Entry, Comment, TrackBack 
     
    245246            'id': u'tag-list', 
    246247            'obj_list': obj_list, 
    247             'title': u'Categories'
     248            'title': _(u'Categories')
    248249        }) 
    249250        t = loader.get_template('blog/_tag_cloud.html') 
     251        return t.render(c) 
     252 
     253 
     254class RecentEntriesContent(Content): 
     255    """ 
     256    """ 
     257    def render(self): 
     258        # TODO: accessible this point. 
     259        obj_list = Entry.objects.filter(is_published__exact=True)\ 
     260                                .filter(is_active__exact=True)[0:10] 
     261        c = Context({ 
     262            'MEDIA_URL': settings.MEDIA_URL, 
     263            'DESIGN_THEME': settings.DESIGN_THEME, 
     264            'id': u'comment-list', 
     265            'obj_list': obj_list, 
     266            'title': _(u'Recent Comments'), 
     267        }) 
     268        t = loader.get_template('blog/_links.html') 
    250269        return t.render(c) 
    251270 
     
    262281            'id': u'comment-list', 
    263282            'obj_list': obj_list, 
    264             'title': u'Recent Comments'
     283            'title': _(u'Recent Comments')
    265284        }) 
    266285        t = loader.get_template('blog/_links.html') 
  • branches/pluggable-contents/settings.py

    r69 r70  
    119119SUB_CONTENTS = ( 
    120120    'plugins.views.TagCloudContent', 
    121     'plugins.views.RecentCommentsContent', 
     121    'plugins.views.RecentEntriesContent', 
    122122) 
    123123EXTRA_CONTENTS = ( 
     124    'plugins.views.RecentCommentsContent', 
    124125    'plugins.views.ArchiveContent', 
    125126)