{"thread":{"id":"10408","subject":"[PATCH] gitweb: Provide title attributes for abbreviated author names.","startedAt":"2007-10-22T00:28:03Z","lastAt":"2007-10-22T00:28:03Z","messageCount":1,"participants":["David Symonds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"56795","messageId":"11930128831553-git-send-email-dsymonds@gmail.com","threadId":"10408","inReplyTo":null,"subject":"[PATCH] gitweb: Provide title attributes for abbreviated author names.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-10-22T00:28:03Z","receivedAt":"2007-10-22T00:28:03Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"Signed-off-by: David Symonds <dsymonds@gmail.com>\n---\n gitweb/gitweb.perl |   34 +++++++++++++++++++++++++++++-----\n 1 files changed, 29 insertions(+), 5 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex b2bae1b..119ad55 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3461,9 +3461,15 @@ sub git_shortlog_body {\n \t\t\tprint \"<tr class=\\\"light\\\">\\n\";\n \t\t}\n \t\t$alternate ^= 1;\n+\t\tmy $author = chop_str($co{'author_name'}, 10);\n+\t\tif ($author ne $co{'author_name'}) {\n+\t\t\t$author = \"<span title=\\\"\" . esc_html($co{'author_name'}) . \"\\\">\" . esc_html($author) . \"</span>\";\n+\t\t} else {\n+\t\t\t$author = esc_html($author);\n+\t\t}\n \t\t# git_summary() used print \"<td><i>$co{'age_string'}</i></td>\\n\" .\n \t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 10)) . \"</i></td>\\n\" .\n+\t\t      \"<td><i>\" . $author . \"</i></td>\\n\" .\n \t\t      \"<td>\";\n \t\tprint format_subject_html($co{'title'}, $co{'title_short'},\n \t\t                          href(action=>\"commit\", hash=>$commit), $ref);\n@@ -3511,9 +3517,15 @@ sub git_history_body {\n \t\t\tprint \"<tr class=\\\"light\\\">\\n\";\n \t\t}\n \t\t$alternate ^= 1;\n+\t# shortlog uses      chop_str($co{'author_name'}, 10)\n+\t\tmy $author = chop_str($co{'author_name'}, 15, 3);\n+\t\tif ($author ne $co{'author_name'}) {\n+\t\t\t\"<span title=\\\"\" . esc_html($co{'author_name'}) . \"\\\">\" . esc_html($author) . \"</span>\";\n+\t\t} else {\n+\t\t\t$author = esc_html($author);\n+\t\t}\n \t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t      # shortlog uses      chop_str($co{'author_name'}, 10)\n-\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 3)) . \"</i></td>\\n\" .\n+\t\t      \"<td><i>\" . $author . \"</i></td>\\n\" .\n \t\t      \"<td>\";\n \t\t# originally git_history used chop_str($co{'title'}, 50)\n \t\tprint format_subject_html($co{'title'}, $co{'title_short'},\n@@ -3667,8 +3679,14 @@ sub git_search_grep_body {\n \t\t\tprint \"<tr class=\\\"light\\\">\\n\";\n \t\t}\n \t\t$alternate ^= 1;\n+\t\tmy $author = chop_str($co{'author_name'}, 15, 5);\n+\t\tif ($author ne $co{'author_name'}) {\n+\t\t\t$author = \"<span title=\\\"\" . esc_html($co{'author_name'}) . \"\\\">\" . esc_html($author) . \"</span>\";\n+\t\t} else {\n+\t\t\t$author = esc_html($author);\n+\t\t}\n \t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n+\t\t      \"<td><i>\" . $author . \"</i></td>\\n\" .\n \t\t      \"<td>\" .\n \t\t      $cgi->a({-href => href(action=>\"commit\", hash=>$co{'id'}), -class => \"list subject\"},\n \t\t\t       esc_html(chop_str($co{'title'}, 50)) . \"<br/>\");\n@@ -5181,8 +5199,14 @@ sub git_search {\n \t\t\t\t\t\tprint \"<tr class=\\\"light\\\">\\n\";\n \t\t\t\t\t}\n \t\t\t\t\t$alternate ^= 1;\n+\t\t\t\t\tmy $author = chop_str($co{'author_name'}, 15, 5);\n+\t\t\t\t\tif ($author ne $co{'author_name'}) {\n+\t\t\t\t\t\t$author = \"<span title=\\\"\" . esc_html($co{'author_name'}) . \"\\\">\" . esc_html($author) . \"</span>\";\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\t$author = esc_html($author);\n+\t\t\t\t\t}\n \t\t\t\t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t\t\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n+\t\t\t\t\t      \"<td><i>\" . $author . \"</i></td>\\n\" .\n \t\t\t\t\t      \"<td>\" .\n \t\t\t\t\t      $cgi->a({-href => href(action=>\"commit\", hash=>$co{'id'}),\n \t\t\t\t\t              -class => \"list subject\"},\n-- \n1.5.3.1\n"}]}