diff --git a/cgi/viewcvs.conf.dist b/cgi/viewcvs.conf.dist index 9ab04947..8c5742b8 100644 --- a/cgi/viewcvs.conf.dist +++ b/cgi/viewcvs.conf.dist @@ -220,7 +220,6 @@ languages = en-us # header. # -directory = templates/directory.ezt query = templates/query.ezt footer = templates/footer.ezt diff = templates/diff.ezt @@ -228,9 +227,15 @@ graph = templates/graph.ezt annotate = templates/annotate.ezt markup = templates/annotate.ezt +directory = templates/directory.ezt +# For an alternate form, where the first column displays a revision number +# and brings you to the log view (and the filename displays the HEAD), then +# you may use this template: +# directory = templates/dir_alternate.ezt + log = templates/log.ezt -# There is also a new style table based alternative template available. -# You might want to try it out: +# For a log view where the revisions are displayed in a table, you may +# want to try this template: # log = templates/log_table.ezt #--------------------------------------------------------------------------- @@ -280,14 +285,6 @@ diff_format = h # 0 Show CVSROOT directory hide_cvsroot = 1 -# hide_non_readable: Don't show entries which cannot be read -# 1 Hide non-readable entries -# 0 Show non-readble entries -hide_non_readable = 1 - -# Show author of last change -show_author = 1 - # set to 1 to make lines break at spaces, # set to 0 to make no-break lines, # set to a positive integer to make the lines cut at that length @@ -320,14 +317,6 @@ allow_markup = 1 # [make sure to have gzip in the path] allow_compress = 1 -# Make use of javascript functions to skip the need for submitting a form. -# For example, this way you can select one of your CVS roots without -# pressing 'Go' (... if you have more than one CVSROOT defined) -use_java_script = 1 - -# open Download-Links in another window -open_extern_window = 1 - # If you have files which automatically refers to other files # (such as HTML) then this allows you to browse the checked # out files as if outside CVS. @@ -343,15 +332,6 @@ checkout_magic = 1 # Enable this if you like the feature, but don't rely on correct results. show_subdir_lastmod = 0 -# The next flag defines the meaning of clicking on either a filename or -# the revision number of that file in the directory view. if 0 then -# the traditional behavior applies: clicking on the name takes you to the -# CVS log page, where clicking on the revision number displays that revision. -# If the flag is set to 1 then both columns will be swapped and the meaning -# of clicking is also exchanged. This should be more intuitive to new users. -# The classic setting is default: -flip_links_in_dirview = 0 - # show a portion of the most recent log entry in directory listings show_logs = 1 diff --git a/lib/config.py b/lib/config.py index e67a3436..242dedcb 100644 --- a/lib/config.py +++ b/lib/config.py @@ -177,8 +177,6 @@ class Config: self.options.log_sort = 'date' self.options.diff_format = 'h' self.options.hide_cvsroot = 1 - self.options.hide_non_readable = 1 - self.options.show_author = 1 self.options.hr_breakable = 1 self.options.hr_funout = 1 self.options.hr_ignore_white = 1 @@ -188,7 +186,6 @@ class Config: self.options.allow_compress = 1 self.options.checkout_magic = 1 self.options.show_subdir_lastmod = 0 - self.options.flip_links_in_dirview = 0 self.options.show_logs = 1 self.options.show_log_in_markup = 1 self.options.py2html_path = '.' diff --git a/lib/viewcvs.py b/lib/viewcvs.py index 12e9ab0a..d202588c 100644 --- a/lib/viewcvs.py +++ b/lib/viewcvs.py @@ -1140,18 +1140,21 @@ def view_directory(request): 'current_root' : request.cvsrep, 'view_tag' : view_tag, 'sortby' : sortby, - 'headers' : [ ], 'no_match' : None, 'unreadable' : None, 'has_tags' : None, 'tarball_href' : None, 'address' : cfg.general.address, 'vsn' : __version__, - # fileinfo will be len==0 if we only have dirs and !show_subdir_lastmod - # in that case, we don't need the extra columns - 'rev_in_front' : len(fileinfo) and cfg.options.flip_links_in_dirview, 'search_re' : search_re, - } + 'have_logs' : None, + + 'sortby_file_href' : toggle_query(query_dict, 'sortby', 'file'), + 'sortby_rev_href' : toggle_query(query_dict, 'sortby', 'rev'), + 'sortby_date_href' : toggle_query(query_dict, 'sortby', 'date'), + 'sortby_author_href' : toggle_query(query_dict, 'sortby', 'author'), + 'sortby_log_href' : toggle_query(query_dict, 'sortby', 'log'), + } # add in the CVS roots for the selection if len(cfg.general.cvs_roots) < 2: @@ -1167,33 +1170,10 @@ def view_directory(request): ### a variety of schemes. data['nav_path'] = clickable_path(request, where, 0, 0, 0) - def add_header(title, which, data=data, query_dict=query_dict, colspan=1): - href = './' + toggle_query(query_dict, 'sortby', which) + '#dirlist' - data['headers'].append(_item(title=title, which=which, href=href, - colspan=colspan)) - - if cfg.options.flip_links_in_dirview and len(fileinfo): - add_header('Rev.', 'rev') - if cfg.options.use_cvsgraph: - add_header('File', 'file', colspan=2) - else: - add_header('File', 'file') - - if not cfg.options.flip_links_in_dirview and len(fileinfo): - add_header('Rev.', 'rev') - # fileinfo will be len==0 if we only have dirs and !show_subdir_lastmod + # fileinfo will be len==0 if we only have dirs and !show_subdir_lastmod. # in that case, we don't need the extra columns if len(fileinfo): - add_header('Age', 'date') - if cfg.options.show_author: - add_header('Author', 'author') - if cfg.options.show_logs: - add_header('Last log entry', 'log') - - num_cols = len(data['headers']) + cfg.options.use_cvsgraph - # remaining columns to span: - span = num_cols - 1 - cfg.options.flip_links_in_dirview - + data['have_logs'] = 'yes' def file_sort_cmp(data1, data2, sortby=sortby, fileinfo=fileinfo): if data1[2]: # is_directory @@ -1274,7 +1254,6 @@ def view_directory(request): num_displayed = num_displayed + 1 row.anchor = file row.name = file + slash - row.span = span row.type = 'unreadable' rows.append(row) @@ -1305,17 +1284,15 @@ def view_directory(request): info = fileinfo.get(file) if info == _FILE_HAD_ERROR: row.cvs = 'error' - row.span = span unreadable = 1 elif info: row.cvs = 'data' row.time = html_time(info[1]) + row.author = info[3] if cfg.options.use_cvsgraph: row.graph_href = ' ' - if cfg.options.show_author: - row.author = info[3] if cfg.options.show_logs: row.show_log = 'yes' subfile = info[4] @@ -1326,7 +1303,6 @@ def view_directory(request): row.log = format_log(info[2]) else: row.cvs = 'none' - row.cols = [ '' ] * (span) rows.append(row) @@ -1342,7 +1318,6 @@ def view_directory(request): info = fileinfo.get(file) if info == _FILE_HAD_ERROR: row.cvs = 'error' - row.span = span rows.append(row) num_displayed = num_displayed + 1 @@ -1374,6 +1349,7 @@ def view_directory(request): row.cvs = 'data' row.href = url row.rev = info[0] + row.author = info[3] ### it would be good to break this out into bits so the .ezt can ### format this info however it likes @@ -1386,9 +1362,6 @@ def view_directory(request): if cfg.options.use_cvsgraph: row.graph_href = file_url + '?graph=' + row.rev + request.amp_query - if cfg.options.show_author: - row.author = info[3] - if cfg.options.show_logs: row.show_log = 'yes' row.log = format_log(info[2]) @@ -2564,7 +2537,6 @@ def handle_config(): "logsort" : cfg.options.log_sort, "diff_format" : cfg.options.diff_format, "hidecvsroot" : cfg.options.hide_cvsroot, - "hidenonreadable" : cfg.options.hide_non_readable, "search": None, } diff --git a/templates/dir_alternate.ezt b/templates/dir_alternate.ezt new file mode 100644 index 00000000..564413ad --- /dev/null +++ b/templates/dir_alternate.ezt @@ -0,0 +1,282 @@ + + + +[if-any where][where][else][cfg.general.main_title][end] + + + + + + + + + + +

[if-any where][where][else][cfg.general.main_title][end]

(logo)

ViewCVS and CVS Help

+ +[if-any where][else] + + + [if-any roots] +

Project Root

+
+ + +
+ [end] +[end] + +

+ +[if-any where] +

Current directory: [nav_path]

+[if-any view_tag] +

Current tag: [view_tag]

+[end] +[end] + +[is num_files "0"] +[else] +
+ +
+ [is cfg.options.use_re_search "1"] +
+ + +
+ [end] + [if-any has_tags] +
+ [for params] + + [end] + + + +
+ [end] +[end] + +[is num_files "0"] +[else] +
+ [is num_files "1"] + 1 file + [else] + [num_files] files + [end] + [if-any search_re] + with contents matching regular expression: '[search_re]' + [else] + [if-any view_tag] + with tag: '[view_tag]' + [end] + [end] +[end] + +
+ +[# if you want a colored border around the table of directory + information, then add this additional table tag: + + +
+] + + + + +[if-any have_logs] + [is sortby "file"] + + [else] + + [end] + [is sortby "rev"] + + [else] + + [end] + [is sortby "date"] + + [else] + + [end] + [is sortby "author"] + + [else] + + [end] + [is sortby "log"] + + [else] + + [end] +[else] + +[end] + + +[for rows] + + [is rows.type "unreadable"] + + + [else] + - this entry is unreadable + [end] + + [else] + [is rows.type "dir"] + + [is rows.cvs "error"] + [# for an error to occur, we must have some logs. always use colspan] + + [else] + [if-any have_logs] + [# revision ] + [is rows.cvs "none"] + [# age ] + [# author ] + [# log ] + [else] + + [if-any rows.author] + + [end] + [if-any rows.show_log] + + [end] + [end] + [end] + [end] + + [else] + [is rows.cvs "error"] + + + [else] + + [if-any rows.graph_href] + + [end] + + + + [if-any rows.author] + + [end] + [if-any rows.show_log] + + [end] + [end] + [end] + [end] + +[end] + +
FileFileRev.Rev.AgeAgeAuthorAuthorLast log entryLast log entryFile
[rows.name] + [if-any have_logs] + + this entry is unreadable + + + (dir) + [rows.name] + + [if-any rows.hide_attic_href] +   [[]Don't hide] + [end] + + Last modification unavailable - could not read CVS information +      [rows.time] [rows.author] [rows.log_file]/[rows.log_rev]
+  [rows.log]
+ [rows.name] + CVS information is unreadable + (file) + [rows.name] + + [rows.attic] + (graph) +   + + [rows.rev] + +[# to display the revision in a separate window, you could use: + + {rows.rev} + + (substitute brackets for the braces) +] +  [rows.time] [rows.author] [rows.log]
+ +[# if you are using a table border (see above), then add: + +
+] + +[if-any no_match] +

NOTE: There are [num_files] files, but none match the + current tag ([view_tag]) +[end] + +[if-any unreadable] +


+ NOTE: One or more files were unreadable. The files in the CVS + repository should be readable by the web server process. Please + report this condition to the administrator of this CVS repository. +[end] + + +[# if you want to disable tarball generation remove the following: ] +[if-any tarball_href] + Download tarball +[end] + +[include "footer.ezt"] diff --git a/templates/directory.ezt b/templates/directory.ezt index fb3a3b8c..564413ad 100644 --- a/templates/directory.ezt +++ b/templates/directory.ezt @@ -90,10 +90,9 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. [end] [end] -
- [is num_files "0"] [else] +
[is num_files "1"] 1 file [else] @@ -108,7 +107,6 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. [end] [end] -
[# if you want a colored border around the table of directory @@ -121,27 +119,62 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. -[for headers] - [is headers.which sortby] - +[if-any have_logs] + [is sortby "file"] + [else] - + [end] + [is sortby "rev"] + + [else] + + [end] + [is sortby "date"] + + [else] + + [end] + [is sortby "author"] + + [else] + + [end] + [is sortby "log"] + + [else] + + [end] +[else] + [end] [for rows] [is rows.type "unreadable"] - [is rev_in_front "1"][end] - - + + + [else] + - this entry is unreadable + [end] + [else] [is rows.type "dir"] - [is rev_in_front "1"][end] - [is rows.cvs "error"] - + [# for an error to occur, we must have some logs. always use colspan] + [else] + [if-any have_logs] + [# revision ] [is rows.cvs "none"] - [for rows.cols][end] + [# age ] + [# author ] + [# log ] [else] - [if-any rows.graph_href] - - [end] - [is cfg.options.flip_links_in_dirview "0"][end] [if-any rows.author] @@ -169,30 +205,17 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. [end] [end] [end] + [end] [else] [is rows.cvs "error"] - [is rev_in_front "1"][end] - - - [else] - [is cfg.options.flip_links_in_dirview "1"] - - [end] - + [else] + [end] - [is cfg.options.flip_links_in_dirview "0"] + - [end] [if-any rows.author] diff --git a/website/upgrading.html b/website/upgrading.html index 170236b3..75955b48 100644 --- a/website/upgrading.html +++ b/website/upgrading.html @@ -53,7 +53,7 @@ 0.9 or a later version of the software.

-

Templates

+

Configuration Options

More templates were introduced in version 0.8 of the software, which made many of the configuration options obsolete. This @@ -122,9 +122,77 @@

+
show_author
+
+ Changing this option would be quite strange and rare. If you + do not want to show the author for the revisions, then you + should remove it from the various templates. + +

+
+ +
hide_non_readable
+
+ This option was never used, so it has been removed. + +

+
+ +
flip_links_in_dirview
+
+ This option is no longer available. If you want the links in + your directory view flipped, then you may use the + dir_alternate.ezt template. + +

+
+ +

Template Variables

+

+ Some template variables that were available in 0.8 have been + removed in 0.9. If you have custom templates that refer to these + variables, then you will need to modify your templates. +

+ +
+
+
directory.ezt: headers
+
+ The headers are now listed explicitly in the template, + rather than made available through a list. +

+
+ +
+ directory.ezt: + rows.cols, + and rows.span +
+
+ These variables were used in conjunction with the + headers variable to control the column + displays. This is now controlled explicitly within the + templates. +

+
+ +
directory.ezt: + rev_in_front
+
+ This was used to indicate that revision links should + be used in the first column, rather than in their + standard place in the second column. Changing the + links should now be done in the template, rather than + according to this variable. You may want to look at + the dir_alternate.ezt template, which has + the revision in front. +

+
+
+

Upgrading from ViewCVS 0.7 or earlier

@@ -138,7 +206,7 @@ for upgrading from 0.8.

-

Templates

+

Configuration Options

The largest change from 0.7 to 0.8, that you will need to deal with, is the introduction of templates. This shifted many @@ -276,7 +344,7 @@

ViewCVS Users Group
-Last modified: Mon Dec 17 00:54:43 PST 2001 +Last modified: Thu Dec 20 20:30:43 PST 2001
[headers.title]File - [headers.title] - FileRev.Rev.AgeAgeAuthorAuthorLast log entryLast log entryFile
 [rows.name]this entry is unreadable[rows.name] + [if-any have_logs] + + this entry is unreadable +   + + (dir) [rows.name] @@ -150,15 +183,18 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. [end] CVS information is unreadable + Last modification unavailable - could not read CVS information +         [rows.time] [rows.author] [rows.name]CVS information is unreadable[rows.rev] + + [rows.name] - [else] - href="[rows.rev_href]&content-type=text/vnd.viewcvs-markup"> -[# to display the revision in a separate window, you could use: - - href="{rows.rev_href}" target="cvs_checkout" - onClick="window.open('{rows.rev_href}', 'cvs_checkout', - 'resizeable=1,scrollbars=1')"> - - (substitute brackets for the braces) -] [end](file)CVS information is unreadable + (file) [rows.name] @@ -204,7 +227,7 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. alt="(graph)" width=16 height=16 border=0>   [rows.rev] @@ -218,7 +241,6 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view. (substitute brackets for the braces) ]  [rows.time] [rows.author]