Documentation updates & template cleanups for recent changes.

* lib/viewcvs.py
  (common_template_date):
    only set "rss_href" when it will be valid URL

  (build_commit):
    only set commits.rev for subversion queries

    rename some of the new RSS template variables
      commits.title -> commits.short_log
      commits.url -> commits.rss_url
      commits.date -> commits.rss_date
  
* templates/include/header.ezt
* templates/rss.ezt
    update for changed template variables

* viewvc.org/template-authoring-guide.html
* viewvc.org/upgrading.html
* CHANGES
    update documentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1214 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/tags/1.0.0-rc1
rey4 2005-12-22 16:55:26 +00:00
parent 70ffad13c1
commit 5e595215ec
6 changed files with 63 additions and 22 deletions

View File

@ -12,6 +12,7 @@ Version 1.0 (not yet released)
before actually installing ViewCVS.
- New GUI field to test paging.
* add new, better-integrated query interface (2004-Jul-17)
* add integrated RSS feeds (2005-Dec-22)
* add new "root_as_url_component" option to embed root names as
path components in ViewCVS URLs for a more natural URL scheme
in ViewCVS configurations with multiple repositories.
@ -25,6 +26,8 @@ Version 1.0 (not yet released)
sets of templates (2005-Feb-08)
* add new "sort_group_dirs" option to disable grouping of
directories in directory listings (2005-Mar-07)
* add new "port" option to connect to a MySQL database on a nonstandard
port (2005-Dec-22)
* make "default_root" option optional. When no root is specified,
show a page listing all available repositories (2005-Feb-04)
* make "checkout_magic" obsolete (but still enabled by default for
@ -41,7 +44,8 @@ Version 1.0 (not yet released)
* make View/Download links work the same for all file types
(2004-Jan-21)
* add links to tip of selected branch on log page (2005-Oct-03)
* enable enscript highlighting for more file types
* allow use of "Highlight" program for colorizing (2005-Dec-20)
* enable enscript colorizing for more file types
* add sorting arrows for directory views (2004-Jul-21)
* get rid of popup windows for checkout links (2004-Jan-21)
* obfuscate email addresses in html output by encoding @ symbol

View File

@ -1079,10 +1079,11 @@ def common_template_data(request):
data['log_href'] = request.get_url(view_func=view_log,
params={}, escape=1)
data['rss_href'] = request.get_url(view_func=view_query,
params={'date': 'month',
'format': 'rss'},
escape=1)
if is_query_supported(request):
data['rss_href'] = request.get_url(view_func=view_query,
params={'date': 'month',
'format': 'rss'},
escape=1)
return data
def nav_header_data(request, rev, orig_path):
@ -3153,21 +3154,20 @@ def prev_rev(rev):
def build_commit(request, desc, files):
commit = _item(num_files=len(files), files=[])
commit.log = htmlify(desc)
if len(desc) > 50:
title = desc[:50] + '...'
else:
title = desc
commit.title = htmlify(title)
commit.rev = files[0].GetRevision()
commit.short_log = format_log(commit.log, request.cfg)
commit.author = htmlify(files[0].GetAuthor())
commit.date = make_rss_time_string(files[0].GetTime(), request.cfg)
commit.url = None
commit.rss_date = make_rss_time_string(files[0].GetTime(), request.cfg)
if request.roottype == 'svn':
commit.url = request.get_url(view_func=view_revision,
params={'rev': commit.rev},
escape=1)
commit.url = 'http://' + request.server.getenv("HTTP_HOST") + \
string.replace(commit.url, '&', '&')
commit.rev = files[0].GetRevision()
commit.rss_url = 'http://%s%s' % \
(request.server.getenv("HTTP_HOST"),
request.get_url(view_func=view_revision,
params={'rev': commit.rev},
escape=1))
else:
commit.rev = None
commit.rss_url = None
for f in files:
commit_time = f.GetTime()
if commit_time:

View File

@ -7,7 +7,7 @@
<title>[if-any rootname][[][rootname]][else]ViewVC[end] [page_title]</title>
<meta name="generator" content="ViewVC [vsn]" />
<link rel="stylesheet" href="[docroot]/styles.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="RSS [[][rootname]][where]" HREF="[rss_href]">
[if-any rss_href]<link rel="alternate" type="application/rss+xml" title="RSS [[][rootname]][where]" HREF="[rss_href]">[end]
</head>
<body>
<div class="vc_navheader">

View File

@ -4,10 +4,10 @@
<title>CVS checkins</title>
<description>CVS checkins</description>
[for commits]<item>
<title>[commits.rev]: [[commits.author]] [commits.title]</title>
[if-any commits.url]<link>[commits.url]</link>[end]
<title>[if-any commits.rev][commits.rev]: [end][[commits.author]] [commits.short_log]</title>
[if-any commits.rss_url]<link>[commits.rss_url]</link>[end]
<author>[commits.author]</author>
<pubDate>[commits.date]</pubDate>
<pubDate>[commits.rss_date]</pubDate>
<description>[commits.log]</description>
</item>[end]
</channel>

View File

@ -291,6 +291,11 @@ th { background: rgb(60%,70%,90%); }
<td>String</td>
<td>URL of the Subversion revision view for the current revision.</td>
</tr>
<tr class="varlevel1">
<td class="varname">rss_href</td>
<td>String</td>
<td>URL of RSS feed for current location.</td>
</tr>
<tr class="varlevel1">
<td class="varname">view_href</td>
<td>String</td>
@ -1482,6 +1487,11 @@ th { background: rgb(60%,70%,90%); }
<td>List of commits to files under the current directory that meet
the query criteria.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.author</td>
<td>String</td>
<td>Author of the commit.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.files</td>
<td>List</td>
@ -1560,6 +1570,26 @@ th { background: rgb(60%,70%,90%); }
<td>String</td>
<td>Number of files in the <var>commits.files</var> list.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.rev</td>
<td>String</td>
<td>Commit revision number. Subversion only.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.rss_date</td>
<td>String</td>
<td>Date of the commit formatted for RSS.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.rss_url</td>
<td>String</td>
<td>Absolute URL of the revision page for the commit. Subversion only.</td>
</tr>
<tr class="varlevel2">
<td class="varname">commits.short_log</td>
<td>String</td>
<td>Truncated commit log message.</td>
</tr>
<tr class="varlevel1">
<td class="varname">english_query</td>
<td>String</td>

View File

@ -132,12 +132,19 @@
<li>options/use_pagesize</li>
<li>options/use_localtime</li>
<li>options/cross_copies</li>
<li>options/use_highlight</li>
<li>options/highlight_path</li>
<li>options/highlight_style</li>
<li>options/highlight_line_numbers</li>
<li>options/highlight_convert_tabs</li>
<li>options/use_php</li>
<li>options/php_path</li>
<li>options/svn_path</li>
<li>templates/error</li>
<li>templates/query_form</li>
<li>templates/query_results</li>
<li>cvsdb/port</li>
<li>cvsdb/rss_row_limit</li>
</ul>
<p>The following options have been removed:</p>