summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-05-08 23:52:56 +0200
committerLars Hjemli <hjemli@gmail.com>2007-05-08 23:52:56 +0200
commit7250a154678477a1e8260efbc9810ec389754ef9 (patch)
tree519559a2f9238fc386b7715c55bc3e2326be8d54
parent61c3ca978c586c673aec618cb94210657278dda8 (diff)
downloadcgit-7250a154678477a1e8260efbc9810ec389754ef9.tar.gz
cgit-7250a154678477a1e8260efbc9810ec389754ef9.tar.bz2
cgit-7250a154678477a1e8260efbc9810ec389754ef9.zip
ui-view: show pathname if specified in querystring
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r--cgit.c2
-rw-r--r--cgit.h2
-rw-r--r--ui-view.c11
3 files changed, 10 insertions, 5 deletions
diff --git a/cgit.c b/cgit.c
index fedf355..6dddcbb 100644
--- a/cgit.c
+++ b/cgit.c
@@ -109,7 +109,7 @@ static void cgit_print_repo_page(struct cacheitem *item)
} else if (!strcmp(cgit_query_page, "commit")) {
cgit_print_commit(cgit_query_sha1);
} else if (!strcmp(cgit_query_page, "view")) {
- cgit_print_view(cgit_query_sha1);
+ cgit_print_view(cgit_query_sha1, cgit_query_path);
} else if (!strcmp(cgit_query_page, "diff")) {
cgit_print_diff(cgit_query_sha1, cgit_query_sha2);
} else {
diff --git a/cgit.h b/cgit.h
index 222c9c2..2615231 100644
--- a/cgit.h
+++ b/cgit.h
@@ -155,7 +155,7 @@ extern void cgit_print_snapshot_start(const char *mimetype,
extern void cgit_print_repolist(struct cacheitem *item);
extern void cgit_print_summary();
extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep);
-extern void cgit_print_view(const char *hex);
+extern void cgit_print_view(const char *hex, char *path);
extern void cgit_print_tree(const char *hex, char *path);
extern void cgit_print_commit(const char *hex);
extern void cgit_print_diff(const char *old_hex, const char *new_hex);
diff --git a/ui-view.c b/ui-view.c
index 9d23c45..7d022fd 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -8,7 +8,7 @@
#include "cgit.h"
-void cgit_print_view(const char *hex)
+void cgit_print_view(const char *hex, char *path)
{
unsigned char sha1[20];
enum object_type type;
@@ -34,8 +34,13 @@ void cgit_print_view(const char *hex)
buf[size] = '\0';
html("<table class='list'>\n");
- htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n",
- typename(type), hex, size);
+ html("<tr class='nohover'><th class='left'>");
+ if (path)
+ htmlf("%s (", path);
+ htmlf("%s %s, %li bytes", typename(type), hex, size);
+ if (path)
+ html(")");
+ html("</th></tr>\n");
html("<tr><td class='blob'>\n");
html_txt(buf);
html("\n</td></tr>\n");
=v0.6.0'>v0.6.0René 'Necoro' Neumann3-3/+8 2021-02-16Fix CRLF endingRené 'Necoro' Neumann1-57/+57 2021-02-16Increment go-version to 1.16René 'Necoro' Neumann3-5/+5 2021-02-16Use go-embed for templates instead of inline strings.René 'Necoro' Neumann6-74/+79 2021-02-16Issue #46: Fix semantics of `n` resultRené 'Necoro' Neumann2-9/+15 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. This...René 'Necoro' Neumann2-2/+66 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0