Fossil SCM
New "brief" query parameter on /file suppresses the file metadata at the top of the page.
Commit
dfc9a73b3567171775b4139239fd71219a426cba529968945262f153f594cede
Parent
655d6130b3ad90f…
1 file changed
+7
-2
+7
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2676,10 +2676,11 @@ | ||
| 2676 | 2676 | int asText; |
| 2677 | 2677 | const char *zUuid = 0; |
| 2678 | 2678 | u32 objdescFlags = OBJDESC_BASE; |
| 2679 | 2679 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| 2680 | 2680 | int hashOnly = P("hash")!=0; |
| 2681 | + int docOnly = P("brief")!=0; | |
| 2681 | 2682 | int isFile = fossil_strcmp(g.zPath,"file")==0; |
| 2682 | 2683 | const char *zLn = P("ln"); |
| 2683 | 2684 | const char *zName = P("name"); |
| 2684 | 2685 | const char *zCI = P("ci"); |
| 2685 | 2686 | HQuery url; |
| @@ -2802,11 +2803,13 @@ | ||
| 2802 | 2803 | return; |
| 2803 | 2804 | } |
| 2804 | 2805 | |
| 2805 | 2806 | asText = P("txt")!=0; |
| 2806 | 2807 | 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 ){ | |
| 2808 | 2811 | zCI = "tip"; |
| 2809 | 2812 | @ <h2>File %z(href("%R/finfo?name=%T&m&ci=tip",zName))%h(zName)</a> |
| 2810 | 2813 | @ from the %z(href("%R/info/tip"))latest check-in</a></h2> |
| 2811 | 2814 | }else{ |
| 2812 | 2815 | const char *zPath; |
| @@ -2940,11 +2943,13 @@ | ||
| 2940 | 2943 | style_submenu_element("Parsed", "%R/info/%s", zUuid); |
| 2941 | 2944 | } |
| 2942 | 2945 | if( descOnly ){ |
| 2943 | 2946 | style_submenu_element("Content", "%R/artifact/%s", zUuid); |
| 2944 | 2947 | }else{ |
| 2945 | - @ <hr> | |
| 2948 | + if( !docOnly || !isFile ){ | |
| 2949 | + @ <hr> | |
| 2950 | + } | |
| 2946 | 2951 | content_get(rid, &content); |
| 2947 | 2952 | if( renderAsWiki ){ |
| 2948 | 2953 | safe_html_context(DOCSRC_FILE); |
| 2949 | 2954 | wiki_render_by_mimetype(&content, zMime); |
| 2950 | 2955 | document_emit_js(); |
| 2951 | 2956 |
| --- 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 |