Re: [viewvc-users] ViewVC and Office 2007

"C. Michael Pilato" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Organization CollabNet, Inc.
Message-ID <4A5F8027.6030000__38734.4399853193$1247772727$gmane$org@collab.net>
C. Michael Pilato wrote:
> Ghassemi, Hamid wrote:
>> Thanks, using the correct Mime Types took care of the download issue as a
>> zip file.  However, there is the issue of viewing the file which would
>> open the file as text, hence seeing un-readable characters.  Is there is
>> a setting in ViewVC configuration file which will prevent this from
>> happening?
> 
> ViewVC exposes to the templates a flag that it calculates (prefer_markup)
> which effectively means, "ViewVC does/doesn't think this file's contents are
> viewable in a web browser".  If you wanted to, you could tweak your file.ezt
> template to check this flag and, if set, show only the log message for the
> file/revision and a notice saying that the file's contents are viewable,
> plus perhaps a link to the "download" URL for that file/rev.
> 
> Something like these edits to file.ezt (the plus signs indicate inserted lines:
> 
>    ...
>      [end]
>      </div>
> 
>    + [if-any prefer_markup]
> 
>      [define last_rev]0[end]
>      [define rowclass]vc_row_even[end]
>    ...
> 
> and:
> 
>    ...
>      [end]
>      [end]
> 
>    + [else]
>    + <p><strong>This file's contents are not viewable.  Please
>    +    <a href="[download_href]">download</a> this version of the
>    +    file in order to view it.</strong></p>
>    + [end]
> 
>      [include "include/props.ezt"]
>      [include "include/footer.ezt"]
> 

You know, enough people have asked this question in the past that I just
committed a solution for it to ViewVC's trunk, and backported it for release
in ViewVC 1.1.2.  Now, in the file.ezt, there's a small configuration
section in which admins can tweak a single definition value and get the
behavior I describe above.

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2371860

To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpfgCcACgkQokEGqRcG/W7KCgCfZ5jLbPFkSZWf7z/IBbyjaLov
80cAnAt0vKjJeb/yUmDuIcAOlrpOuX5l
=XyqI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.