Changeset 2551
- Timestamp:
- 02/26/10 17:10:55 (5 months ago)
- Location:
- branches/0.9/pylucid_project
- Files:
-
- 2 added
- 9 modified
-
apps/pylucid/context_processors.py (modified) (1 diff)
-
apps/pylucid/system/permalink.py (added)
-
apps/pylucid/views.py (modified) (2 diffs)
-
middlewares/headline_anchor.py (modified) (1 diff)
-
pylucid_plugins/blog/models.py (modified) (2 diffs)
-
pylucid_plugins/blog/templates/blog/detail_view.html (modified) (1 diff)
-
pylucid_plugins/blog/templates/blog/includes/blog_entry.html (added)
-
pylucid_plugins/blog/templates/blog/summary.html (modified) (1 diff)
-
pylucid_plugins/blog/views.py (modified) (3 diffs)
-
pylucid_plugins/lexicon/models.py (modified) (2 diffs)
-
pylucid_plugins/lexicon/views.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/pylucid_project/apps/pylucid/context_processors.py
r2539 r2551 1 # coding: utf-8 1 2 2 3 """ -
branches/0.9/pylucid_project/apps/pylucid/views.py
r2549 r2551 11 11 from pylucid_project.system.pylucid_plugins import PYLUCID_PLUGINS 12 12 13 from pylucid .markup.converter import apply_markup14 from pylucid .signals import pre_render_global_template15 from pylucid .system import pylucid_plugin, i18n, pylucid_objects16 from pylucid .models import PageTree, PageMeta, PageContent, PluginPage, ColorScheme, \13 from pylucid_project.apps.pylucid.markup.converter import apply_markup 14 from pylucid_project.apps.pylucid.signals import pre_render_global_template 15 from pylucid_project.apps.pylucid.system import pylucid_plugin, i18n, pylucid_objects 16 from pylucid_project.apps.pylucid.models import PageTree, PageMeta, PageContent, PluginPage, ColorScheme, \ 17 17 EditableHtmlHeadFile, Language 18 18 … … 339 339 url = pagemeta.get_absolute_url() 340 340 341 if pagetree.page_type == pagetree.PLUGIN_TYPE and url_rest and "/" in url_rest: 342 # pass a permalink additional to the plugin, e.g.: blog entry detail view 343 additional_url = url_rest.split("/", 1)[1] 344 url += additional_url 345 341 346 return http.HttpResponseRedirect(url) 342 347 -
branches/0.9/pylucid_project/middlewares/headline_anchor.py
r2549 r2551 117 117 118 118 # Get the permalink to the current page 119 permalink = pagemeta.get_permalink() 119 permalink = request.PYLUCID.context["page_permalink"] 120 # permalink = pagemeta.get_permalink() 120 121 121 122 # insert the Headline links -
branches/0.9/pylucid_project/pylucid_plugins/blog/models.py
r2527 r2551 30 30 31 31 from pylucid_project.apps.pylucid.shortcuts import failsafe_message 32 from pylucid_project.apps.pylucid.markup.converter import apply_markup 33 from pylucid_project.apps.pylucid.cache import clean_complete_pagecache 34 from pylucid_project.apps.pylucid.system.permalink import plugin_permalink 32 35 from pylucid_project.apps.pylucid.models import PageContent, Language, PluginPage 33 from pylucid_project.apps.pylucid.markup.converter import apply_markup34 36 from pylucid_project.apps.pylucid.models.base_models import AutoSiteM2M, UpdateInfoBaseModel 35 from pylucid_project.apps.pylucid.cache import clean_complete_pagecache36 37 37 38 from pylucid_project.pylucid_plugins import update_journal … … 164 165 return "#No-Blog-PagePlugin-exists" 165 166 167 def get_permalink(self, request): 168 """ permalink to this entry detail view """ 169 absolute_url = self.get_absolute_url() # Absolute url to this entry 170 permalink = plugin_permalink(request, absolute_url) 171 return permalink 172 166 173 def get_html(self): 167 174 """ -
branches/0.9/pylucid_project/pylucid_plugins/blog/templates/blog/detail_view.html
r2538 r2551 7 7 8 8 <fieldset class="entry"> 9 <legend class="headline"> 10 <a href="{{ entry.get_absolute_url }}">{{ entry.headline }}<br /> 11 <small class="headline_info">{% blocktrans with entry.createtime|timesince as time %}Before {{ time }} published by{% endblocktrans %} {{ entry.createby }}.</small> 12 </a> 13 </legend> 14 15 {% if not entry.is_public %} 16 <p class="admin_info_line">not public</p> 17 {% endif %} 18 19 {% include "blog/includes/admin_links.html" %} 20 21 <div class="content">{{ entry.get_html }}</div> 22 23 {% if entry.lastupdateby %} 24 <small><p class="date_info"> 25 (Last update: {{ entry.lastupdatetime|date:_("DATETIME_FORMAT") }} by {{ entry.lastupdateby }}.) 26 </p></small> 27 {% endif %} 28 29 {% include "blog/includes/taglist.html" %} 30 9 {% include "blog/includes/blog_entry.html" %} 31 10 {% include "pylucid_comments/includes/comments_list.html" %} 32 11 </fieldset> -
branches/0.9/pylucid_project/pylucid_plugins/blog/templates/blog/summary.html
r2538 r2551 9 9 {% for entry in entries.object_list %} 10 10 <fieldset class="entry"> 11 <legend class="headline"> 12 <a href="{{ entry.get_absolute_url }}">{{ entry.headline }}<br /> 13 <small class="headline_info">{% blocktrans with entry.createtime|timesince as time %}Before {{ time }} published by{% endblocktrans %} {{ entry.createby }}.</small> 14 </a> 15 </legend> 16 {% if not entry.is_public %} 17 <p class="admin_info_line">not public</p> 18 {% endif %} 19 20 {% include "blog/includes/admin_links.html" %} 21 22 <div class="content">{{ entry.get_html }}</div> 23 24 {% if entry.lastupdateby %} 25 <small><p class="date_info"> 26 (Last update: {{ entry.lastupdatetime|date:_("DATETIME_FORMAT") }} by {{ entry.lastupdateby }}.) 27 </p></small> 28 {% endif %} 29 30 {% include "blog/includes/taglist.html" %} 31 32 {% get_comment_count for entry as comment_count %} 33 <a href="{{ entry.get_absolute_url }}" class="comment_link" title="Display all comments | Leave a comment">{{ comment_count }} comment{{ comment_count|pluralize:"s" }}...</a> 34 11 {% include "blog/includes/blog_entry.html" %} 12 {% get_comment_count for entry as comment_count %} 13 <a href="{{ entry.get_absolute_url }}" class="comment_link" title="Display all comments | Leave a comment">{{ comment_count }} comment{{ comment_count|pluralize:"s" }}...</a> 35 14 </fieldset> 36 15 {% endfor %} -
branches/0.9/pylucid_project/pylucid_plugins/blog/views.py
r2546 r2551 141 141 142 142 tag_cloud = BlogEntry.objects.get_tag_cloud(request) 143 144 # request.context["page_permalink"] = "YYYY" 143 145 144 146 context = { … … 224 226 tag_cloud = BlogEntry.objects.get_tag_cloud(request) 225 227 228 # Change permalink from the blog root page to this entry detail view 229 permalink = entry.get_permalink(request) 230 request.PYLUCID.context["page_permalink"] = permalink # for e.g. the HeadlineAnchor 231 226 232 context = { 227 233 "page_title": entry.headline, # Change the global title with blog headline … … 229 235 "tag_cloud": tag_cloud, 230 236 "CSS_PLUGIN_CLASS_NAME": settings.PYLUCID.CSS_PLUGIN_CLASS_NAME, 237 "page_permalink": permalink, # Change the permalink in the global page template 231 238 } 232 239 return context -
branches/0.9/pylucid_project/pylucid_plugins/lexicon/models.py
r2330 r2551 27 27 from pylucid_project.pylucid_plugins import update_journal 28 28 29 from pylucid.shortcuts import failsafe_message 30 from pylucid.markup.converter import apply_markup 31 from pylucid.models import PageContent, Language 32 from pylucid.models.base_models import AutoSiteM2M, UpdateInfoBaseModel 29 from pylucid_project.apps.pylucid.shortcuts import failsafe_message 30 from pylucid_project.apps.pylucid.markup.converter import apply_markup 31 from pylucid_project.apps.pylucid.models import PageContent, Language 32 from pylucid_project.apps.pylucid.system.permalink import plugin_permalink 33 from pylucid_project.apps.pylucid.models.base_models import AutoSiteM2M, UpdateInfoBaseModel 33 34 #from PyLucid.tools.content_processors import apply_markup, fallback_markup 34 35 #from PyLucid.models import Page … … 112 113 return "?lexicon=%s" % self.term 113 114 115 def get_permalink(self, request): 116 """ permalink to this entry detail view """ 117 absolute_url = self.get_absolute_url() # Absolute url to this entry 118 permalink = plugin_permalink(request, absolute_url) 119 return permalink 120 114 121 def get_html(self): 115 122 """ -
branches/0.9/pylucid_project/pylucid_plugins/lexicon/views.py
r2391 r2551 88 88 _add_breadcrumb(request, title="%s: %s" % (entry.term, entry.short_definition), url=request.path) 89 89 90 context = {"entry": entry} 90 # Change permalink from the blog root page to this entry detail view 91 permalink = entry.get_permalink(request) 92 request.PYLUCID.context["page_permalink"] = permalink # for e.g. the HeadlineAnchor 93 94 context = { 95 "entry": entry, 96 "page_permalink": permalink, # Change the permalink in the global page template 97 } 91 98 return context 92 99