Fossil SCM
In /attachlist, make deleted attachments more noticable by using strike-through.
Commit
d3747df93a5042d29894800fabc415ad1304b50d50a0629a449b3ab57e2939d1
Parent
5fcc0dd3933baae…
1 file changed
+14
-4
+14
-4
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -299,10 +299,11 @@ | ||
| 299 | 299 | const char *zUuid; |
| 300 | 300 | const char *zDispUser; |
| 301 | 301 | const int attachid = db_column_int(&q, 7); |
| 302 | 302 | int type; |
| 303 | 303 | int i; |
| 304 | + int bDeleted; | |
| 304 | 305 | char *zUrlTail = 0; |
| 305 | 306 | |
| 306 | 307 | if( moderation_pending(attachid) |
| 307 | 308 | && !moderation_user_could(attachid, 1, 0) ){ |
| 308 | 309 | /* Elide entries which are currently pending moderation unless |
| @@ -322,10 +323,11 @@ | ||
| 322 | 323 | if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ |
| 323 | 324 | zFilename = &zFilename[i+1]; |
| 324 | 325 | i = -1; |
| 325 | 326 | } |
| 326 | 327 | } |
| 328 | + bDeleted = 0==zSrc || 0==zSrc[0]; | |
| 327 | 329 | type = attachment_target_type(zTarget, 1); |
| 328 | 330 | switch( type ){ |
| 329 | 331 | case CFTYPE_TICKET: |
| 330 | 332 | zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename); |
| 331 | 333 | break; |
| @@ -338,20 +340,28 @@ | ||
| 338 | 340 | case CFTYPE_WIKI: |
| 339 | 341 | zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename); |
| 340 | 342 | break; |
| 341 | 343 | } |
| 342 | 344 | @ <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>\ | |
| 344 | 349 | 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> | |
| 347 | 357 | if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++; |
| 348 | 358 | if( zComment && zComment[0] ){ |
| 349 | 359 | @ %!W(zComment)<br> |
| 350 | 360 | } |
| 351 | 361 | if( zForumPost==0 && zPage==0 && zTkt==0 && zTechNote==0 ){ |
| 352 | - if( zSrc==0 || zSrc[0]==0 ){ | |
| 362 | + if( bDeleted ){ | |
| 353 | 363 | zSrc = "Deleted from"; |
| 354 | 364 | }else { |
| 355 | 365 | zSrc = "Added to"; |
| 356 | 366 | } |
| 357 | 367 | switch( type ){ |
| 358 | 368 |
| --- 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 |