Fossil SCM

New "brief" query parameter on /file suppresses the file metadata at the top of the page.

drh 2025-03-26 13:09 trunk
Commit dfc9a73b3567171775b4139239fd71219a426cba529968945262f153f594cede
1 file changed +7 -2
+7 -2
--- src/info.c
+++ src/info.c
@@ -2676,10 +2676,11 @@
26762676
int asText;
26772677
const char *zUuid = 0;
26782678
u32 objdescFlags = OBJDESC_BASE;
26792679
int descOnly = fossil_strcmp(g.zPath,"whatis")==0;
26802680
int hashOnly = P("hash")!=0;
2681
+ int docOnly = P("brief")!=0;
26812682
int isFile = fossil_strcmp(g.zPath,"file")==0;
26822683
const char *zLn = P("ln");
26832684
const char *zName = P("name");
26842685
const char *zCI = P("ci");
26852686
HQuery url;
@@ -2802,11 +2803,13 @@
28022803
return;
28032804
}
28042805
28052806
asText = P("txt")!=0;
28062807
if( isFile ){
2807
- if( zCI==0 || fossil_strcmp(zCI,"tip")==0 ){
2808
+ if( docOnly ){
2809
+ /* No header */
2810
+ }else if( zCI==0 || fossil_strcmp(zCI,"tip")==0 ){
28082811
zCI = "tip";
28092812
@ <h2>File %z(href("%R/finfo?name=%T&m&ci=tip",zName))%h(zName)</a>
28102813
@ from the %z(href("%R/info/tip"))latest check-in</a></h2>
28112814
}else{
28122815
const char *zPath;
@@ -2940,11 +2943,13 @@
29402943
style_submenu_element("Parsed", "%R/info/%s", zUuid);
29412944
}
29422945
if( descOnly ){
29432946
style_submenu_element("Content", "%R/artifact/%s", zUuid);
29442947
}else{
2945
- @ <hr>
2948
+ if( !docOnly || !isFile ){
2949
+ @ <hr>
2950
+ }
29462951
content_get(rid, &content);
29472952
if( renderAsWiki ){
29482953
safe_html_context(DOCSRC_FILE);
29492954
wiki_render_by_mimetype(&content, zMime);
29502955
document_emit_js();
29512956
--- src/info.c
+++ src/info.c
@@ -2676,10 +2676,11 @@
2676 int asText;
2677 const char *zUuid = 0;
2678 u32 objdescFlags = OBJDESC_BASE;
2679 int descOnly = fossil_strcmp(g.zPath,"whatis")==0;
2680 int hashOnly = P("hash")!=0;
 
2681 int isFile = fossil_strcmp(g.zPath,"file")==0;
2682 const char *zLn = P("ln");
2683 const char *zName = P("name");
2684 const char *zCI = P("ci");
2685 HQuery url;
@@ -2802,11 +2803,13 @@
2802 return;
2803 }
2804
2805 asText = P("txt")!=0;
2806 if( isFile ){
2807 if( zCI==0 || fossil_strcmp(zCI,"tip")==0 ){
 
 
2808 zCI = "tip";
2809 @ <h2>File %z(href("%R/finfo?name=%T&m&ci=tip",zName))%h(zName)</a>
2810 @ from the %z(href("%R/info/tip"))latest check-in</a></h2>
2811 }else{
2812 const char *zPath;
@@ -2940,11 +2943,13 @@
2940 style_submenu_element("Parsed", "%R/info/%s", zUuid);
2941 }
2942 if( descOnly ){
2943 style_submenu_element("Content", "%R/artifact/%s", zUuid);
2944 }else{
2945 @ <hr>
 
 
2946 content_get(rid, &content);
2947 if( renderAsWiki ){
2948 safe_html_context(DOCSRC_FILE);
2949 wiki_render_by_mimetype(&content, zMime);
2950 document_emit_js();
2951
--- src/info.c
+++ src/info.c
@@ -2676,10 +2676,11 @@
2676 int asText;
2677 const char *zUuid = 0;
2678 u32 objdescFlags = OBJDESC_BASE;
2679 int descOnly = fossil_strcmp(g.zPath,"whatis")==0;
2680 int hashOnly = P("hash")!=0;
2681 int docOnly = P("brief")!=0;
2682 int isFile = fossil_strcmp(g.zPath,"file")==0;
2683 const char *zLn = P("ln");
2684 const char *zName = P("name");
2685 const char *zCI = P("ci");
2686 HQuery url;
@@ -2802,11 +2803,13 @@
2803 return;
2804 }
2805
2806 asText = P("txt")!=0;
2807 if( isFile ){
2808 if( docOnly ){
2809 /* No header */
2810 }else if( zCI==0 || fossil_strcmp(zCI,"tip")==0 ){
2811 zCI = "tip";
2812 @ <h2>File %z(href("%R/finfo?name=%T&m&ci=tip",zName))%h(zName)</a>
2813 @ from the %z(href("%R/info/tip"))latest check-in</a></h2>
2814 }else{
2815 const char *zPath;
@@ -2940,11 +2943,13 @@
2943 style_submenu_element("Parsed", "%R/info/%s", zUuid);
2944 }
2945 if( descOnly ){
2946 style_submenu_element("Content", "%R/artifact/%s", zUuid);
2947 }else{
2948 if( !docOnly || !isFile ){
2949 @ <hr>
2950 }
2951 content_get(rid, &content);
2952 if( renderAsWiki ){
2953 safe_html_context(DOCSRC_FILE);
2954 wiki_render_by_mimetype(&content, zMime);
2955 document_emit_js();
2956

Keyboard Shortcuts

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