Changeset 2553

Show
Ignore:
Timestamp:
03/01/10 16:16:23 (5 months ago)
Author:
JensDiemer
Message:
  • Add SVN Reversion number to package_info page, if exist.
  • Activate HeadlineAnchor? on the admin page, too.
  • Use lucidTag TOC in package_info admin view.
Location:
branches/0.9/pylucid_project
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • branches/0.9/pylucid_project/apps/pylucid/templates/admin/base_site.html

    r2516 r2553  
    2828 
    2929 
    30 {% block branding %}<h1>PyLucid</h1> 
     30{% block branding %}<a name="top" \><h1 class="admin_headline">PyLucid</h1> 
    3131<!-- page_messages --> 
    3232{% endblock %} 
  • branches/0.9/pylucid_project/apps/pylucid_admin/templates/pylucid_admin/base_site.html

    r2162 r2553  
    22{% load i18n %} 
    33 
    4 {% block branding %}<h1>PyLucid admin</h1> 
     4{% block branding %}<a name="top" \><h1 class="admin_headline">PyLucid admin</h1> 
    55<!-- page_messages --> 
    66{% endblock %} 
  • branches/0.9/pylucid_project/apps/pylucid_update/templates/pylucid_update/base_site.html

    r2356 r2553  
    22{% load i18n %} 
    33 
    4 {% block branding %}<h1>PyLucid Update 
     4{% block branding %}<a name="top" \><h1 class="admin_headline">PyLucid Update 
    55{% if not sites|length_is:"1" %} 
    6     (site: <strong title="Update on site '{{ site.domain }}'">{{ site.name }}</strong>) 
     6    <small>(site: <strong title="Update on site '{{ site.domain }}'">{{ site.name }}</strong>)</small> 
    77{% endif %} 
    88</h1> 
  • branches/0.9/pylucid_project/media/PyLucid/pylucid_admin.css

    r2476 r2553  
    9191    font-weight:bold 
    9292} 
     93/* ---------------------------------------------------------------------------- 
     94   Headline Anchor 
     95------------------------------------------------------------------------------- */ 
     96.top_link { 
     97  color: #000000; 
     98} 
     99.uarr { 
     100  color: #eeeeee; 
     101} 
     102.top_link:hover .uarr { 
     103  color: #000000; 
     104} 
     105.section_anchor { 
     106  text-shadow: 0px 0px #ffffff; 
     107  text-decoration:none; 
     108  color: #eeeeee!important; 
     109  padding-right: 1em; 
     110} 
     111.headline_anchor:hover .section_anchor { 
     112  color: #999999; 
     113} 
     114.section_anchor:hover { 
     115  color:#000000!important; 
     116  text-decoration:underline; 
     117  text-shadow: 2px 2px 2px #999999; 
     118} 
     119/* ---------------------------------------------------------------------------- 
     120   TOC Plugin 
     121------------------------------------------------------------------------------- */ 
     122.PyLucidPlugins.TOC { 
     123  border: 1px solid #eeeeee; 
     124  background-color: #fefefe; 
     125  margin: 3em; 
     126  padding: 1em 0em 1em 0em; 
     127} 
     128.PyLucidPlugins.TOC h3 { 
     129  margin: 0em; 
     130  color: #333333; 
     131} 
     132.PyLucidPlugins.TOC * { 
     133  margin: 0em; 
     134  color: #dddddd; 
     135} 
     136.PyLucidPlugins.TOC a { 
     137  color: #777777; 
     138} 
     139.PyLucidPlugins.TOC a:hover { 
     140  color: #286ea0; 
     141} 
  • branches/0.9/pylucid_project/middlewares/headline_anchor.py

    r2551 r2553  
    105105 
    106106        try: 
    107             pagemeta = request.PYLUCID.pagemeta 
    108             context = request.PYLUCID.context 
    109         except AttributeError: 
     107            # Get the permalink to the current page 
     108            permalink = request.PYLUCID.context["page_permalink"] 
     109        except AttributeError, KeyError: 
     110            # We are not on a cms page -> e.g.: in the admin pandel 
    110111            # No cms page request -> do nothing 
    111112            #print "*** No request.PYLUCID.pagemeta!", response._headers["content-type"] 
    112             return response 
     113            permalink = request.path 
    113114 
    114115        # response is a HttpResponse object. Get the content via response.content will 
    115116        # encode it to byte string, but we need unicode. 
    116117        content = force_unicode(response.content, encoding=response._charset) 
    117  
    118         # Get the permalink to the current page 
    119         permalink = request.PYLUCID.context["page_permalink"] 
    120 #        permalink = pagemeta.get_permalink() 
    121118 
    122119        # insert the Headline links 
     
    126123        if settings.PYLUCID.TOC_PLACEHOLDER in content: 
    127124            # lucidTag TOC is in the content -> insert a table of contents 
    128             toc_min_count = request.PYLUCID.context["toc_min_count"] 
     125            toc_min_count = request.PYLUCID._toc_min_count # Added in lucidTag TOC 
    129126            toc_html = headline_anchor.build_toc(toc_min_count) 
    130127            content = content.replace(settings.PYLUCID.TOC_PLACEHOLDER, toc_html) 
  • branches/0.9/pylucid_project/pylucid_plugins/package_info/templates/package_info/admin_package_info.html

    r2540 r2553  
    22 
    33{% block content %} 
    4 {% comment %} 
    5         {% lucidTag TOC %} <- FIXME: TOC doesn't work in admin panel 
    6 {% endcomment %} 
     4{% lucidTag TOC %} 
    75{% lucidTag package_info all_packages=True display_version=True display_location=True %} 
    86{% endblock %} 
  • branches/0.9/pylucid_project/pylucid_plugins/package_info/templates/package_info/packages_table.html

    r2542 r2553  
    1616        <dl> 
    1717                {% if display_version %} 
    18             <dt>version:</dt><dd>{{ entry.version }}</dd> 
     18            <dt>{% trans "version" %}:</dt><dd>{{ entry.version }}</dd> 
    1919            {% endif %} 
    2020         
    2121            {% if display_location or user.is_superuser %} 
    22             <dt>filesystem location:</dt> 
     22            <dt>{% trans "filesystem location" %}:</dt> 
    2323            <dd>{{ entry.location }}</dd> 
    2424            {% endif %} 
    2525         
    2626            {% if entry.author %} 
    27             <dt>author:</dt><dd>{{ entry.author }}</dd> 
     27            <dt>{% trans "author" %}:</dt><dd>{{ entry.author }}</dd> 
    2828            {%  endif %} 
    2929         
    3030            {% if entry.home_page %} 
    31             <dt>homepage:</dt> 
     31            <dt>{% trans "homepage" %}:</dt> 
    3232            <dd><a href="{{ entry.home_page }}">{{ entry.home_page }}</a></dd> 
    3333            {%  endif %} 
    3434         
    3535            {% if entry.license and entry.license != "UNKNOWN" %} 
    36             <dt>license:</dt> 
     36            <dt>{% trans "license" %}:</dt> 
    3737            <dd> 
    3838                {% if entry.license_url %}<a href="{{ entry.license_url }}">{% endif %} 
  • branches/0.9/pylucid_project/pylucid_plugins/package_info/views.py

    r2545 r2553  
    2020__version__ = "$Rev:$" 
    2121 
     22import os 
     23 
    2224if __name__ == "__main__": 
    23     import os 
    2425    os.environ['DJANGO_SETTINGS_MODULE'] = "pylucid_project.settings" 
    2526    virtualenv_file = "../../../../../bin/activate_this.py" 
     
    3132from django.conf import settings 
    3233from django.template import mark_safe 
     34from django.utils.version import get_svn_revision 
    3335 
    3436from pylucid_project import PYLUCID_VERSION_STRING 
     
    3638 
    3739# print (!) some debug info. Values can be: False, 1, 2 
    38 DEBUG = 1 
     40DEBUG = False 
    3941 
    4042# Collect only information about these packages: 
     
    105107 
    106108 
     109 
    107110class PackageInfo(dict): 
    108111    " Holds all package information for *one* package " 
     
    113116        self._fill_with_dist_attr() 
    114117        self._fill_with_pkg_info() 
     118        self._add_svn_reversion() 
    115119 
    116120    def _fill_with_dist_attr(self): 
     
    174178 
    175179            dict.__setitem__(self, dict_key, pkg_info_value) 
     180 
     181    def _add_svn_reversion(self): 
     182        """ Add Subverion reversion number to version string, if exist """ 
     183        location = dict.get(self, "location") 
     184        svn_revision = get_svn_revision(location) 
     185        if svn_revision == "SVN-unknown": 
     186            return 
     187 
     188        if svn_revision not in self["version"]: 
     189            self["version"] += " %s" % svn_revision 
    176190 
    177191 
  • branches/0.9/pylucid_project/pylucid_plugins/TOC/views.py

    r2549 r2553  
    4848    # The real work would be done in: 
    4949    # pylucid_project.middlewares.headline_anchor.HeadlineAnchorMiddleware 
    50     request.PYLUCID.context["toc_min_count"] = min 
     50    request.PYLUCID._toc_min_count = min 
    5151    return settings.PYLUCID.TOC_PLACEHOLDER 
    5252 
  • branches/0.9/pylucid_project/__init__.py

    r2411 r2553  
    1414    $Author$ 
    1515 
    16     :copyleft: 2009 by the PyLucid team, see AUTHORS for more details. 
     16    :copyleft: 2009-2010 by the PyLucid team, see AUTHORS for more details. 
    1717    :license: GNU GPL v3 or above, see LICENSE for more details. 
    1818""" 
     19 
     20import os 
    1921 
    2022try: 
     
    2325    svn_revision = "" 
    2426else: 
    25     svn_revision = get_svn_revision(".") 
    26     if svn_revision == u'SVN-unknown': 
    27         svn_revision = "" 
    28     else: 
    29         # Add a space between the normal version number 
    30         # and the SVN revision number. 
    31         svn_revision = " (%s)" % svn_revision 
     27    path = os.path.split(os.path.abspath(__file__))[0] 
     28    svn_revision = get_svn_revision(path) 
    3229 
    3330__version__ = (0, 9, 0, 'beta', svn_revision) 
     
    3835# - No spaces: "0.8.0 RC2" -> "0.8.0RC2" 
    3936# http://peak.telecommunity.com/DevCenter/setuptools#specifying-your-project-s-version 
    40 PYLUCID_VERSION_STRING = "%s.%s.%s%s%s" % __version__ 
     37PYLUCID_VERSION_STRING = "%s.%s.%s%s.%s" % __version__ 
    4138 
    4239 
     40if __name__ == "__main__": 
     41    print PYLUCID_VERSION_STRING