X-Git-Url: http://git.subgeniuskitty.com/gitweb-sgk/.git/blobdiff_plain/d3382d5dca2c0073972f81117c2f8e33cc918a3c..39ef91a31081cdafceea3da6bedcc76db52599fb:/gitweb.cgi
diff --git a/gitweb.cgi b/gitweb.cgi
index f7536d2..a3b31ce 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -3846,6 +3846,37 @@ sub insert_file {
close $fd;
}
+sub insert_html_file {
+ my $file_name = shift;
+ insert_file($file_name);
+}
+
+sub insert_text_file {
+ my $file_name = shift;
+
+ open my $fd, $file_name or die_error(500, "Couldn't open $file_name");
+
+ print "
";
+ my $pretty_project = $project;
+ $pretty_project =~ s/\/\.git$//;
print $cgi->a({-href => href(action=>"tree", hash_base=>$hb),
- -title => 'tree root'}, to_utf8("[$project]"));
+ -title => 'tree root'}, to_utf8("[$pretty_project]"));
print " / ";
if (defined $name) {
my @dirname = split '/', $name;
@@ -5727,9 +5760,11 @@ sub git_project_list_rows {
}
print "\n";
}
+ my $pretty_path = $pr->{'path'};
+ $pretty_path =~ s/\/\.git$//;
print "
" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
-class => "list"},
- esc_html_match_hl($pr->{'path'}, $search_regexp)) .
+ esc_html_match_hl($pretty_path, $search_regexp)) .
" | \n" .
"
" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
-class => "list",
@@ -7192,7 +7227,7 @@ sub git_tree {
}
git_print_page_nav('tree','', $hash_base, undef, undef,
join(' | ', @views_nav));
- git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);
+ #git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);
} else {
undef $hash_base;
print " \n";
@@ -7251,6 +7286,30 @@ sub git_tree {
}
print "\n" .
" ";
+
+ # If present, print one of the following, in order:
+ # README.md, README.txt, README, README.html.
+ my $cwd_path = "$projectroot/$project";
+ $cwd_path =~ s/\.git$//;
+ $cwd_path = $cwd_path . $basedir;
+ if (!$prevent_xss && -s $cwd_path . "README.md") {
+ print "\n";
+ insert_markdown_file($cwd_path . "README.md");
+ print "\n \n"; # class="readme"
+ } elsif (!$prevent_xss && -s $cwd_path . "README.txt") {
+ print "\n";
+ insert_text_file($cwd_path . "README.txt");
+ print "\n \n"; # class="readme"
+ } elsif (!$prevent_xss && -s $cwd_path . "README") {
+ print "\n";
+ insert_text_file($cwd_path . "README");
+ print "\n \n"; # class="readme"
+ } elsif (!$prevent_xss && -s $cwd_path . "README.html") {
+ print "\n";
+ insert_html_file($cwd_path . "README.html");
+ print "\n \n"; # class="readme"
+ }
+
git_footer_html();
}
|