-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.py
76 lines (71 loc) · 2.26 KB
/
templates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
blame_phantom_html_template = """
<body id="inline-git-blame">
<style>{css}</style>
<div class="phantom-arrow"></div>
<div class="phantom">
<span class="message">
<strong>Git Blame</strong> ({author})
{date} {time} |
<a href="prev?sha={qs_sha_val}&row_num={qs_row_num_val}&{qs_skip_keyvals}">[Prev]</a>
{sha}{sha_not_latest_indicator}
<a href="copy?sha={qs_sha_val}">[Copy]</a>
<a href="show?sha={qs_sha_val}">[Show]</a>
<a class="close" href="close">\u00D7</a>
</span>
</div>
</body>
"""
blame_phantom_css = """
div.phantom-arrow {
border-top: 0.4rem solid transparent;
border-left: 0.5rem solid color(var(--bluish) blend(var(--background) 30%));
width: 0;
height: 0;
}
div.phantom {
padding: 0.4rem 0 0.4rem 0.7rem;
margin: 0 0 0.2rem;
border-radius: 0 0.2rem 0.2rem 0.2rem;
background-color: color(var(--bluish) blend(var(--background) 30%));
}
div.phantom span.message {
padding-right: 0.7rem;
}
div.phantom a {
text-decoration: inherit;
}
div.phantom a.close {
padding: 0.35rem 0.7rem 0.45rem 0.8rem;
position: relative;
bottom: 0.05rem;
border-radius: 0 0.2rem 0.2rem 0;
font-weight: bold;
}
html.dark div.phantom a.close {
background-color: #00000018;
}
html.light div.phantom a.close {
background-color: #ffffff18;
}
"""
# ------------------------------------------------------------
blame_inline_phantom_html_template = """
<body id="inline-git-blame">
<style>{css}</style>
<div class="phantom">
<span class="message">
{author}, {date}{summary_separator}{summary} <a href="copy?sha={qs_sha_val}">[Copy]</a> <a href="show?sha={qs_sha_val}">[Show]</a>
</span>
</div>
</body>
"""
blame_inline_phantom_css = """
div.phantom {
color: color(color(var(--foreground) blend(var(--background) 90%)) min-contrast(var(--background) 2.0));
padding: 0;
margin-left: 50px;
}
div.phantom a {
text-decoration: inherit;
}
"""