2
0
mirror of https://git.zx2c4.com/cgit synced 2025-08-22 01:50:26 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Christian Hesse
e3519ef68c ui-tree: add about link in tree view list
Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-05 00:40:15 +02:00
Christian Hesse
1d7d66e5ef ui-tree: provide link to about page for pretty formatting
We have an ongoing discussion about display filters and pretty
formatting in tree view. How about providing a link to about page
for pretty formatting?

Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-05 00:40:15 +02:00
Christian Hesse
96156baf8d ui-log: show commit message in tooltip
... now that we have the ellipsis to indicate it is available.

Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-05 00:40:15 +02:00
Christian Hesse
e3060bbb14 ui-log: show ellipsis if detailed commit message is available
The existence of a detailed commit message may be of interst even
if only the subject is shown by default.

Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-04 23:37:57 +02:00
Christian Hesse
a030759d3f css: round border edges for deco
Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-04 23:37:57 +02:00
Loïc
f450324526 css: highlight line in diff...
... specified in the URL, with a curved arrow ahead of the line number.

Signed-off-by: Loïc <lagiraudiere+cgit@free.fr>
Signed-off-by: Christian Hesse <mail@eworm.de>
2024-08-04 23:37:57 +02:00
5 changed files with 54 additions and 0 deletions

View File

@ -330,6 +330,11 @@ div#cgit table.ssdiff td.lineno a:hover {
color: black;
}
div#cgit table.blob td.linenumbers a:target:before {
color: red;
content: "\2BA9";
}
div#cgit table.blame td.hashes,
div#cgit table.blame td.lines,
div#cgit table.blame td.linenumbers {
@ -673,12 +678,39 @@ div#cgit div.footer a:hover {
text-decoration: underline;
}
div#cgit span.msg-avail {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #f0f0f0;
border: solid 1px #777777;
border-radius: 5px;
}
div#cgit span.msg-avail span.msg-tooltip {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #f0f0f0;
border: solid 1px #777777;
border-radius: 5px;
visibility: hidden;
position: absolute;
white-space: pre;
z-index: 1;
}
div#cgit span.msg-avail:hover span.msg-tooltip {
visibility: visible;
}
div#cgit a.branch-deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #88ff88;
border: solid 1px #007700;
border-radius: 2px;
}
div#cgit a.tag-deco {
@ -687,6 +719,7 @@ div#cgit a.tag-deco {
padding: 0px 0.25em;
background-color: #ffff88;
border: solid 1px #777700;
border-radius: 2px;
}
div#cgit a.tag-annotated-deco {
@ -695,6 +728,7 @@ div#cgit a.tag-annotated-deco {
padding: 0px 0.25em;
background-color: #ffcc88;
border: solid 1px #777700;
border-radius: 2px;
}
div#cgit a.remote-deco {
@ -703,6 +737,7 @@ div#cgit a.remote-deco {
padding: 0px 0.25em;
background-color: #ccccff;
border: solid 1px #000077;
border-radius: 2px;
}
div#cgit a.deco {
@ -711,6 +746,7 @@ div#cgit a.deco {
padding: 0px 0.25em;
background-color: #ff8888;
border: solid 1px #770000;
border-radius: 2px;
}
div#cgit div.commit-subject a.branch-deco,

View File

@ -243,6 +243,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
}
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
oid_to_hex(&commit->object.oid), ctx.qry.vpath);
if (!ctx.qry.showmsg && strlen(info->msg) > 0)
htmlf("<span class='msg-avail'>...<span class='msg-tooltip'>%s</span></span>",
info->msg);
show_commit_decorations(commit);
html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");

View File

@ -348,6 +348,12 @@ void cgit_tree_link(const char *name, const char *title, const char *class,
reporevlink("tree", name, title, class, head, rev, path);
}
void cgit_about_link(const char *name, const char *title, const char *class,
const char *head, const char *rev, const char *path)
{
reporevlink("about", name, title, class, head, rev, path);
}
void cgit_plain_link(const char *name, const char *title, const char *class,
const char *head, const char *rev, const char *path)
{

View File

@ -24,6 +24,9 @@ extern void cgit_tag_link(const char *name, const char *title,
extern void cgit_tree_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);
extern void cgit_about_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);
extern void cgit_plain_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);

View File

@ -112,6 +112,9 @@ static void print_object(const struct object_id *oid, const char *path, const ch
cgit_print_layout_start();
htmlf("blob: %s (", oid_to_hex(oid));
cgit_about_link("about", NULL, NULL, ctx.qry.head,
rev, path);
html(") (");
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
rev, path);
if (ctx.repo->enable_blame && !is_binary) {
@ -269,6 +272,9 @@ static int ls_item(const struct object_id *oid, struct strbuf *base,
if (!S_ISGITLINK(mode))
cgit_plain_link("plain", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);
if (!S_ISDIR(mode))
cgit_about_link("about", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);
if (!S_ISDIR(mode) && ctx.repo->enable_blame)
cgit_blame_link("blame", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);