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

Andrew Chace <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <[email protected]>
FYI, the "entries.mimetype" variable is the sample code below should be
"entries.mime_type". So the corrected sample code looks like this:

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

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

Thanks,
Andrew Chace
Senior Backups Administrator
Mediacom Communications
Tel: +1-515-246-2204
[email protected]

-----Original Message-----
From: C. Michael Pilato [mailto:[email protected]] 
Sent: Friday, June 26, 2009 11:24 AM
To: Andrew Chace
Cc: [email protected]
Subject: Re: [viewvc-users] viewvc: Display icons based on MIME type?

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=65234
5]
> 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=2366427

To unsubscribe from this discussion, e-mail: [[email protected]].
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.