[PATCH 3 of 4 V5] hgweb: add link to parents of annotated revision in annotate view

Denis Laxalde denis.laxalde at logilab.fr
Tue Jun 14 10:31:46 EDT 2016


Anton Shestakov a écrit :
> 14.06.2016, 20:53, "Denis Laxalde" <denis.laxalde at logilab.fr>:
>>   # HG changeset patch
>>   # User Denis Laxalde <denis.laxalde at logilab.fr>
>>   # Date 1465894453 -7200
>>   # Tue Jun 14 10:54:13 2016 +0200
>>   # Node ID ad269193c2590946f31d7f86fbd85f06f6baacb4
>>   # Parent 9e807bdf1626b228399c219e66c027233fa3b0d5
>>   hgweb: add link to parents of annotated revision in annotate view
>>
>>   The link is embedded into a div with class="annotate-info" that only shows up
>>   upon hover of the annotate column.
>
> Since this patch is not obvious, I have some questions before seeing it in action (since it depends on the previous patches, and I hope we can accept them soon).

hg pull https://bitbucket.org/dlax/hg-work -r 961683779514 if you want 
to see the series "in action".

>>   diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
>>   --- a/mercurial/templates/static/style-paper.css
>>   +++ b/mercurial/templates/static/style-paper.css
>>   @@ -210,6 +210,16 @@ h3 {
>>    .bigtable td.source { font-size: inherit; }
>>    tr.thisrev a { color:#999999; text-decoration: none; }
>>    tr.thisrev td.source { color:#009900; }
>>   +div.annotate-info {
>>   + display: none;
>>   + position: absolute;
>
> It's absolutely positioned relative to what? And where will it appear, since it doesn't specify any coordinates?

It'd positioned relative to the parent "td" element containing the link 
to annotated revision. Being absolutely positioned, it will not 
interfere with other elements position (otherwise, other elements would 
move around when that element is shown).

>>   + background-color: #FFFFFF;
>>   + border-color: #000000;
>>   + border: 1px solid;
>
> Nit: a shortcut is "border: 1px solid #000000;"
>
>>   +}
>>   +.annotate-info p {margin-top: 0; margin-bottom: 0;}
>
> Nit: if it's a <p> that needs removing margins, can it just be a <div> instead?

Very true.

>>   +td.annotate:hover div.annotate-info { display: inline; text-align: left; color: #000000;}
>>   +td.annotate:hover .annotate-info a { color: #0000FF; text-decoration: underline; }
>
> I don't get these two. Setting display on hover is obvious, but why set things like color, text-align and text-decoration on hover only?

True as well, will move these in the generic case.


-- 
Denis Laxalde
Logilab         http://www.logilab.fr


More information about the Mercurial-devel mailing list