Changeset 9341


Ignore:
Timestamp:
Oct 22, 2010, 9:36:50 AM (13 years ago)
Author:
osimons
Message:

FullBlogPlugin: The [[BlogList]] macro now supports meta=off to hide post metadata (timestamp, author, categories) when listing.

Location:
fullblogplugin/0.11/tracfullblog
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fullblogplugin/0.11/tracfullblog/macros.py

    r3131 r9341  
    3535     * `format=` - type of display (see below for details)
    3636     * `max_size=` - max. number of characters to render for each post
     37     * `meta=` - use `=off` to hide date, author and categories (default 'on')
    3738
    3839    Example showing some available named arguments:
     
    7273        heading = args_dict.get('heading', '')
    7374        max_size = int(args_dict.get('max_size', 0))
     75        show_meta = args_dict.get('meta', '') != 'off' and True or False
    7476
    7577        # Get blog posts
     
    99101            data = {'heading': heading,
    100102                    'posts': post_list,
     103                    'show_meta': show_meta,
    101104                    'execute_blog_macro': True}
    102105            return Chrome(self.env).render_template(formatter.req,
     
    105108        elif format == 'full':
    106109            return self._render_full_format(formatter, post_list,
    107                                             post_instances, heading, max_size)
     110                                post_instances, heading, max_size, show_meta)
    108111
    109112        elif format == 'float':
    110113            # Essentially a 'full' list - just wrapped inside a new div
    111114            return tag.div(self._render_full_format(formatter, post_list,
    112                                     post_instances, heading, max_size),
     115                                post_instances, heading, max_size, show_meta),
    113116                            class_="blogflash")
    114117
     
    117120
    118121    def _render_full_format(self, formatter, post_list, post_instances, heading,
    119                                     max_size):
     122                                    max_size, metadata):
    120123        """ Renters full blog posts. """
    121124        out = tag.div(class_="blog")
     
    124127            data = {'post': post,
    125128                    'list_mode': True,
     129                    'show_meta': show_meta,
    126130                    'execute_blog_macro': True}
    127131            if max_size:
  • fullblogplugin/0.11/tracfullblog/templates/fullblog_macro_monthlist.html

    r7225 r9341  
    88        <li py:for="name, version, time, author, title, body, categories in posts">
    99          <a href="${req.href.blog(name)}">${title}</a>
    10           <span class="metainfo">
     10          <span class="metainfo" py:if="not defined('show_meta') and True or show_meta">
    1111            &nbsp;-- Posted on ${format_datetime(time, '%Y-%m-%d %H:%M')}
    1212            <py:if test="not blog_personal_blog">
  • fullblogplugin/0.11/tracfullblog/templates/fullblog_macro_post.html

    r7225 r9341  
    1212        <p py:if="do_shorten"><a href="${href.blog(post.name)}">(Read more)</a></p>
    1313    </div>
    14     <ul class="metainfo">
     14    <ul class="metainfo" py:if="not defined('show_meta') and True or show_meta">
    1515      <li class="metadates">Posted: ${format_datetime(post.publish_time, '%Y-%m-%d %H:%M')}
    1616        <span class="metaupdated" py:if="len(post.versions) > 1">
Note: See TracChangeset for help on using the changeset viewer.