From d2395e429bf5552dab24185f404a9f279465f63f Mon Sep 17 00:00:00 2001
From: Christophe Dumez <christophe@nexedi.com>
Date: Thu, 11 May 2006 11:19:55 +0000
Subject: [PATCH] Display file edit icon in diff only if the file is editable

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7192 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_svn/BusinessTemplate_doSvnDiff.xml   | 22 ++++++++++++++-----
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml
index 4ef8b5251a..a9b3a56796 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_svn/BusinessTemplate_doSvnDiff.xml
@@ -81,22 +81,31 @@ tab_Removed=removed.split(\',\')\n
 if modified != \'none\':\n
   for f in tab_Modified:\n
     f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context)    \n
-    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>  <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
-    print \'<hr></font></b>\'\n
+    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>"\n
+    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
+    if(edit_path != \'#\'):\n
+      print "<a href=\'"+edit_path+"\'><img src=\'imgs/edit.png\' border=\'0\'></a>"\n
+    print \'<br><hr></font></b>\'\n
     print context.getPortalObject()["portal_subversion"].diffHTML(f, context)\n
 \n
 if added != \'none\':\n
   for f in tab_Added:\n
     f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context) \n
-    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>  <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
-    print \'<hr></font></b>\'\n
+    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>"\n
+    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
+    if(edit_path != \'#\'):\n
+      print "<a href=\'"+edit_path+"\'><img src=\'imgs/edit.png\' border=\'0\'></a>"\n
+    print \'<br><hr></font></b>\'\n
     print "<font color=\'green\'>File Added</font><br><br>"\n
 \n
 if removed != \'none\':\n
   for f in tab_Removed:\n
     f = context.getPortalObject()["portal_subversion"].relativeToAbsolute(f, context) \n
-    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>  <a href=\'"+context.getPortalObject()["portal_subversion"].editPath(context, f)+"\'><img src=\'imgs/edit.png\' border=\'0\'></a><br>"\n
-    print \'<hr></font></b>\'\n
+    print "<b><font color=\'black\'>Index: <a href=\'BusinessTemplate_viewSvnShowFile?file="+f+"\'>"+f+"</a>"\n
+    edit_path = context.getPortalObject()["portal_subversion"].editPath(context, f)\n
+    if(edit_path != \'#\'):\n
+      print "<a href=\'"+edit_path+"\'><img src=\'imgs/edit.png\' border=\'0\'></a>"\n
+    print \'<br><hr></font></b>\'\n
     print "<font color=\'red\'>File Removed</font><br><br>"\n
 \n
 print \'</font>\'\n
@@ -156,6 +165,7 @@ return printed\n
                             <string>tab_Removed</string>
                             <string>_getiter_</string>
                             <string>f</string>
+                            <string>edit_path</string>
                           </tuple>
                         </value>
                     </item>
-- 
2.30.9