Changeset 1712
- Timestamp:
- 07/24/08 13:52:28 (11 months ago)
- Location:
- trunk/pylucid
- Files:
-
- 5 modified
-
media/PyLucid/internal_page/blog/display_blog.css (modified) (10 diffs)
-
media/PyLucid/internal_page/blog/display_blog.html (modified) (5 diffs)
-
PyLucid/plugins_internal/blog/blog.py (modified) (2 diffs)
-
PyLucid/plugins_internal/blog/blog_cfg.py (modified) (1 diff)
-
PyLucid/plugins_internal/blog/models.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/media/PyLucid/internal_page/blog/display_blog.css
r1705 r1712 1 /* -------------------------------------------------------------------------- */ 1 2 .blog fieldset { 3 background-color: #FFF; 2 4 padding: 0.2em 0em 0.5em 1em; 3 5 margin: 0px; … … 16 18 /* -------------------------------------------------------------------------- */ 17 19 .blog fieldset.entry { 18 background-color: #fff;19 20 margin: 1em 0 1em 0; 20 21 padding: 0; … … 29 30 border: 1px solid #888; 30 31 } 31 . content,.comment_link {32 .blog .content, .blog .comment_link { 32 33 padding: 0.1em 0.5em 0.1em 0.5em; 33 34 } … … 43 44 } 44 45 /* -------------------------------------------------------------------------- */ 45 .dateinfo, .admin_links { 46 font-size: 0.9em; 46 .blog .headline_info, .blog .date_info, .blog .admin_links { 47 font-size: 0.8em; 48 color: #666; 47 49 padding: 0px; 48 50 margin: 0px; 51 } 52 .blog .date_info, .blog .admin_links { 49 53 line-height: 0px; 50 54 text-align: right; 51 55 } 52 . admin_links {56 .blog .admin_links { 53 57 float:right; 54 58 } 55 . admin_links a {59 .blog .admin_links a { 56 60 color: #fff; 57 61 padding: 2px; … … 63 67 background-color: #eee; 64 68 } 65 .dateinfo {66 color: #666;67 }68 69 .blog .taglist { 69 70 text-decoration: none; … … 74 75 } 75 76 /* -------------------------------------------------------------------------- */ 76 . comment_link {77 .blog .comment_link { 77 78 display: block; 78 79 border: 0px; … … 81 82 } 82 83 /* -------------------------------------------------------------------------- */ 83 . comments li {84 .blog .comments li { 84 85 list-style: none; 85 86 } 86 . comments ul {87 .blog .comments ul { 87 88 padding-left: 0px; 88 89 } 89 . comment {90 .blog .comment { 90 91 border: 0px; 91 padding: 0 px;92 padding: 0.1em 1em 0.1em 1em; 92 93 margin: 0px; 93 94 margin-top: 1em; 94 95 } 95 .user_comment * { 96 background-color: #e0e0e0; 96 .blog .comment legend { 97 padding: 1px; 98 border: 1px solid #ccc; 99 margin-left: 2em; 100 padding: 0.1em 1em 0.1em 1em; 97 101 } 98 .anonymous_comment * { 99 background-color: #f5f5f5; 100 } 101 .comment legend { 102 padding: 1px; 103 border: 0px; 104 margin-left: 2em; 105 padding: 0em 2em 0em 2em; 106 } 107 .comment pre { 102 .blog .comment pre { 108 103 font-size: 1.2em; 109 104 border: 0px; … … 111 106 margin: 0px; 112 107 } 113 . comment.admin_info_line {108 .blog .admin_info_line { 114 109 color:red; 115 110 line-height: 0px; 111 } 112 .blog .user_comment, .blog .user_comment legend { 113 background-color: #e0e0e0; 114 } 115 .blog .anonymous_comment, .blog .anonymous_comment legend { 116 background-color: #f5f5f5; 116 117 } 117 118 /* -------------------------------------------------------------------------- */ … … 124 125 } 125 126 #input_fields .field_help_text { 126 font-size:0. 9em;127 font-size:0.8em; 127 128 display: block; 128 padding-left: 9em; 129 padding-left: 11em; 130 color: #888; 129 131 } 130 132 #input_fields label { … … 145 147 border: 1px solid red; 146 148 } 149 .blog input, .blog textarea { 150 border: 1px solid #ccc; 151 } 152 .blog input:hover, .blog textarea:hover { 153 border-color: #333; 154 } 147 155 /* -------------------------------------------------------------------------- */ 148 . feeds ul, .feeds *{156 .blog .feeds ul, .blog .tag_cloud ul { 149 157 list-style-type:none; 150 158 padding: 0px; 151 159 margin: 0px; 152 160 } 153 . feeds, .feedsli {154 display: inline;161 .blog .feeds li, .blog .tag_cloud li { 162 display: inline; 155 163 } 156 164 /* -------------------------------------------------------------------------- */ -
trunk/pylucid/media/PyLucid/internal_page/blog/display_blog.html
r1709 r1712 4 4 {% if not entries %}no blog entry exists{% endif %} 5 5 {% for entry in entries %} 6 <fieldset class="entry"><legend class="headline"><a href="{{ entry.detail_url }}">{{ entry.headline }}</a></legend> 6 <fieldset class="entry"> 7 <legend class="headline"> 8 <a href="{{ entry.detail_url }}">{{ entry.headline }}<br /> 9 <small class="headline_info">{% blocktrans with entry.createtime|timesince as time %}Before {{ time }} published by{% endblocktrans %} {{ entry.createby }}.</small> 10 </a> 11 </legend> 7 12 {% if not entry.is_public %} 8 13 <p class="admin_info_line">not public</p> … … 20 25 <div class="content">{{ entry.html }}</div> 21 26 22 <small><p class="dateinfo"> 23 created {{ entry.createtime }} by {{ entry.createby }} 24 {% if entry.lastupdateby %}(Last update {{ entry.lastupdatetime }} by {{ entry.lastupdateby }}){% endif %} 27 <small><p class="date_info"> 28 {% if entry.lastupdateby %}(Last update: {{ entry.lastupdatetime|date:"D d M Y H:i" }} by {{ entry.lastupdateby }}.){% endif %} 25 29 </p></small> 26 30 … … 40 44 <ul> 41 45 {% for comment in entry.all_comments %} 42 <li class="{% if comment.createby %}user{% else %}anonymous{% endif %}_comment"> 43 <fieldset class="comment"> 44 <legend> 45 {% if comment.homepage %}<a href="{{ comment.homepage }}">{% endif %} 46 {{ comment.person_name }}{% if comment.homepage %}</a>{% endif %}: 47 </legend> 48 {% if not comment.is_public %} 49 <p class="admin_info_line">not public</p> 50 {% endif %} 46 <li> 47 <fieldset class="comment {% if comment.createby %}user{% else %}anonymous{% endif %}_comment"> 48 <legend class="headline"> 49 {% if comment.homepage %}<a href="{{ comment.homepage }}" title="{{ comment.homepage }}">{% endif %} 50 {{ comment.person_name }} 51 {% if comment.homepage %}</a>{% endif %}<br /> 52 <small class="headline_info"> 53 {% blocktrans with comment.createtime|timesince as time %}Before {{ time }}{% endblocktrans %} 54 IP: {{ comment.ip_address }} 55 {% if comment.lastupdateby %}<br />(Last update {{ comment.lastupdatetime }} by {{ comment.lastupdateby }}){% endif %} 56 </small> 57 </legend> 58 59 {% if not comment.is_public %}<p class="admin_info_line">not public</p>{% endif %} 51 60 52 61 <div class="admin_links"> … … 56 65 57 66 {{ comment.html_content }} 58 59 <small><p class="dateinfo">60 created {{ comment.createtime }} by {% if comment.createby %}{{ comment.createby }}{% else %}{{ comment.ip_address }}{% endif %}61 {% if comment.lastupdateby %}(Last update {{ comment.lastupdatetime }} by {{ comment.lastupdateby }}){% endif %}62 </p></small>63 67 </fieldset> 64 68 </li> … … 96 100 {% endfor %} 97 101 102 <fieldset class="tag_cloud"><legend>{% trans 'tag cloud' %}</legend> 103 <ul> 104 {% for tag in tag_cloud %} 105 <li><a href="{{ tag.url }}" style="font-size:{{ tag.font_size }}em;">{{ tag.name }}</a></li> 106 {% endfor %} 107 </ul> 108 </fieldset> 109 110 98 111 <fieldset class="feeds"><legend>{% trans 'available syndication feeds' %}</legend> 99 112 <ul>{% trans 'normal feeds:' %} -
trunk/pylucid/PyLucid/plugins_internal/blog/blog.py
r1711 r1712 108 108 As a list of entries and as a detail view (see internal page). 109 109 """ 110 used_tags = []110 used_tags = set() 111 111 for entry in entries: 112 112 # add tag_info 113 113 tags = [] 114 114 for tag in entry.tags.all(): 115 used_tags.a ppend(tag) # Used in self._get_tag_feeds_info()115 used_tags.add(tag) # Used in self._get_tag_feeds_info() 116 116 tags.append({ 117 117 "name": tag.name, … … 717 717 Build the tag cloud context. 718 718 """ 719 720 return [] 719 tags = BlogTag.objects.all() 720 721 frequency = set() 722 # get the counter information 723 for tag in tags: 724 count = tag.blogentry_set.count() 725 tag.count = count 726 #self.page_msg(tag, count) 727 frequency.add(count) 728 729 min_frequency = float(min(frequency)) 730 max_frequency = float(max(frequency)) 731 diff_frequency = float(max_frequency - min_frequency) 732 733 max_font_size = self.preferences.get("max_cloud_size", 2.0) 734 min_font_size = self.preferences.get("min_cloud_size", 0.7) 735 736 # Calculate and add the font size 737 for tag in tags: 738 count = float(tag.count) 739 tag.font_size = ( 740 ( 741 (max_font_size-min_font_size) * (count - min_frequency) 742 ) / diff_frequency 743 ) + min_font_size 744 745 tag.url = self.URLs.methodLink("tag", tag.slug) 746 #self.page_msg(tag, count, tag.font_size) 747 748 return tags 721 749 722 750 def select_feed_format(self, raw_feed_name=None): -
trunk/pylucid/PyLucid/plugins_internal/blog/blog_cfg.py
r1705 r1712 82 82 help_text=_( 83 83 "The maximal numbers of tag feeds, displayed together." 84 ), 85 ) 86 87 max_cloud_size = forms.FloatField( 88 initial = 2.0, 89 min_value = 1, 90 help_text=_( 91 "max font size in the tag cloud (CSS 'em' unit)" 92 ), 93 ) 94 min_cloud_size = forms.FloatField( 95 initial = 0.7, 96 min_value = 0.1, 97 help_text=_( 98 "min font size in the tag cloud (CSS 'em' unit)" 84 99 ), 85 100 ) -
trunk/pylucid/PyLucid/plugins_internal/blog/models.py
r1709 r1712 82 82 class Meta: 83 83 app_label = 'PyLucidPlugins' 84 ordering = ('createtime', 'lastupdatetime') 84 85 85 86 #______________________________________________________________________________ … … 112 113 class BlogTag(models.Model): 113 114 """ 114 FIXME: How can we add ordering?115 A blog entry tag 115 116 """ 116 117 objects = BlogTagManager() … … 129 130 class Meta: 130 131 app_label = 'PyLucidPlugins' 131 132 ordering = ('name',) 132 133 133 134 #______________________________________________________________________________
