Re: [viewvc-users] viewvc: Display icons based on MIME type?

"C. Michael Pilato" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Organization CollabNet, Inc.
Message-ID <[email protected]>
Andrew Chace wrote:
> Our Subversion repository contains many different types of binary files.
> It would be very helpful for our users if they were able to determine
> the type of the file by the icon viewvc displays next to it. I found an
> old feature request (507733, see this
> [http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=652345]
> page) from 2002 for the same thing. Is anyone actively working on this?

I've implemented this in the past with no changes to ViewVC itself.  Each
file in the directory listing carries its ViewVC-determined mimetype value
already (and in ViewVC 1.1+, that could be the value from the svn:mime-type
property).  All that lacks is directory.ezt template logic to choose an icon
based on that mimetype.  Something like the following, I should think:

[for entries]
...

[define file_icon]/path/to/file-icon.png[end]
[is entries.mimetype "application/ms-word"]
  [define file_icon]/path/to/word-icon.png[end]
[end]
[is entries.mimetype "application/pdf"]
  [define file_icon]/path/to/pdf-icon.png[end]
[end]
...

<img src="[icon]"/>...

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

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

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)

iEYEARECAAYFAkpE9iEACgkQokEGqRcG/W53/ACfbver9/52IGNNBo671HO1Ni47
6kIAoMw+Krv+tOulhU4TRQmAmp4y90it
=LdoV
-----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.