Fossil SCM

In /attachlist, make deleted attachments more noticable by using strike-through.

stephan 2026-06-04 19:44 UTC attach-v2
Commit d3747df93a5042d29894800fabc415ad1304b50d50a0629a449b3ab57e2939d1
1 file changed +14 -4
+14 -4
--- src/attach.c
+++ src/attach.c
@@ -299,10 +299,11 @@
299299
const char *zUuid;
300300
const char *zDispUser;
301301
const int attachid = db_column_int(&q, 7);
302302
int type;
303303
int i;
304
+ int bDeleted;
304305
char *zUrlTail = 0;
305306
306307
if( moderation_pending(attachid)
307308
&& !moderation_user_could(attachid, 1, 0) ){
308309
/* Elide entries which are currently pending moderation unless
@@ -322,10 +323,11 @@
322323
if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
323324
zFilename = &zFilename[i+1];
324325
i = -1;
325326
}
326327
}
328
+ bDeleted = 0==zSrc || 0==zSrc[0];
327329
type = attachment_target_type(zTarget, 1);
328330
switch( type ){
329331
case CFTYPE_TICKET:
330332
zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename);
331333
break;
@@ -338,20 +340,28 @@
338340
case CFTYPE_WIKI:
339341
zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
340342
break;
341343
}
342344
@ <li><p>
343
- @ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>
345
+ if( bDeleted ){
346
+ @ <s>\
347
+ }
348
+ @ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>\
344349
moderation_pending_www(attachid);
345
- @ <br><a href="%R/attachview?%s(zUrlTail)">%h(zFilename)</a>
346
- @ [<a href="%R/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br>
350
+ @ <br>\
351
+ @ <a href="%R/attachview?%s(zUrlTail)">%h(zFilename)</a>
352
+ @ [<a href="%R/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]\
353
+ if( bDeleted ){
354
+ @ </s>
355
+ }
356
+ @ <br>
347357
if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
348358
if( zComment && zComment[0] ){
349359
@ %!W(zComment)<br>
350360
}
351361
if( zForumPost==0 && zPage==0 && zTkt==0 && zTechNote==0 ){
352
- if( zSrc==0 || zSrc[0]==0 ){
362
+ if( bDeleted ){
353363
zSrc = "Deleted from";
354364
}else {
355365
zSrc = "Added to";
356366
}
357367
switch( type ){
358368
--- src/attach.c
+++ src/attach.c
@@ -299,10 +299,11 @@
299 const char *zUuid;
300 const char *zDispUser;
301 const int attachid = db_column_int(&q, 7);
302 int type;
303 int i;
 
304 char *zUrlTail = 0;
305
306 if( moderation_pending(attachid)
307 && !moderation_user_could(attachid, 1, 0) ){
308 /* Elide entries which are currently pending moderation unless
@@ -322,10 +323,11 @@
322 if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
323 zFilename = &zFilename[i+1];
324 i = -1;
325 }
326 }
 
327 type = attachment_target_type(zTarget, 1);
328 switch( type ){
329 case CFTYPE_TICKET:
330 zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename);
331 break;
@@ -338,20 +340,28 @@
338 case CFTYPE_WIKI:
339 zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
340 break;
341 }
342 @ <li><p>
343 @ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>
 
 
 
344 moderation_pending_www(attachid);
345 @ <br><a href="%R/attachview?%s(zUrlTail)">%h(zFilename)</a>
346 @ [<a href="%R/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br>
 
 
 
 
 
347 if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
348 if( zComment && zComment[0] ){
349 @ %!W(zComment)<br>
350 }
351 if( zForumPost==0 && zPage==0 && zTkt==0 && zTechNote==0 ){
352 if( zSrc==0 || zSrc[0]==0 ){
353 zSrc = "Deleted from";
354 }else {
355 zSrc = "Added to";
356 }
357 switch( type ){
358
--- src/attach.c
+++ src/attach.c
@@ -299,10 +299,11 @@
299 const char *zUuid;
300 const char *zDispUser;
301 const int attachid = db_column_int(&q, 7);
302 int type;
303 int i;
304 int bDeleted;
305 char *zUrlTail = 0;
306
307 if( moderation_pending(attachid)
308 && !moderation_user_could(attachid, 1, 0) ){
309 /* Elide entries which are currently pending moderation unless
@@ -322,10 +323,11 @@
323 if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
324 zFilename = &zFilename[i+1];
325 i = -1;
326 }
327 }
328 bDeleted = 0==zSrc || 0==zSrc[0];
329 type = attachment_target_type(zTarget, 1);
330 switch( type ){
331 case CFTYPE_TICKET:
332 zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename);
333 break;
@@ -338,20 +340,28 @@
340 case CFTYPE_WIKI:
341 zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
342 break;
343 }
344 @ <li><p>
345 if( bDeleted ){
346 @ <s>\
347 }
348 @ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>\
349 moderation_pending_www(attachid);
350 @ <br>\
351 @ <a href="%R/attachview?%s(zUrlTail)">%h(zFilename)</a>
352 @ [<a href="%R/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]\
353 if( bDeleted ){
354 @ </s>
355 }
356 @ <br>
357 if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
358 if( zComment && zComment[0] ){
359 @ %!W(zComment)<br>
360 }
361 if( zForumPost==0 && zPage==0 && zTkt==0 && zTechNote==0 ){
362 if( bDeleted ){
363 zSrc = "Deleted from";
364 }else {
365 zSrc = "Added to";
366 }
367 switch( type ){
368

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button