Navigation Menu

Skip to content

Commit

Permalink
Homepage|Build Repository: Display the secondary commit tags
Browse files Browse the repository at this point in the history
The secondary commit tags are now output as small tag-like objects
like the 'Build Repository' tag displayed next to this one.

These secondary tags can be a useful visual guide as to the purpose
and/or context of a commit without needing to read the message body.
  • Loading branch information
danij-deng committed Feb 28, 2012
1 parent 08bfd97 commit faaa9fd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
17 changes: 10 additions & 7 deletions web/plugins/buildrepository/buildrepository.php
Expand Up @@ -232,26 +232,29 @@ function outputCommitHTML(&$commit)
$haveMessage = (bool)(strlen($message) > 0);

// Compose the supplementary tag list.
$tagList = "";
$tagList = '<div class="tag_list">';
if(is_array($commit['tags']))
{
$n = (integer)0;
foreach($commit['tags'] as $key => $value)
foreach($commit['tags'] as $tag => $value)
{
// Skip the first tag (its used for grouping).
if($n === 0) continue;
if($n++ === 0) continue;

// Do not output guessed tags (mainly used for grouping).
if(is_array($value) && isset($value['guessed']) && $value['guessed'] !== 0) continue;

$tagList .= '<span class="tag">'.$key.'</span>';
$tagList .= '<div class="tag"><label title="Tagged \''.$tag.'\'">'.$tag.'</label></div>';
}
}
$tagList .= '</div>';

$repoLinkTitle = 'Show changes in the repository for this commit submitted on '. date(DATE_RFC2822, $commit['submitDate']) .'.';

// Ouput HTML for the commit.
?><span class="metadata"><a href="<?php echo $commit['repositoryUri']; ?>" class="link-external" title="<?php echo $repoLinkTitle; ?>"><?php echo date('Y-m-d', $commit['submitDate']); ?></a></span><p class="heading <?php if($haveMessage) echo 'collapsible'; ?>" <?php if($haveMessage) echo 'title="Toggle commit message display"'; ?>><strong><?php echo $tagList; ?><span class="title"><?php echo $commit['title']; ?></span></strong> by <em><?php echo $commit['author']; ?></em></p><?php
?><span class="metadata"><a href="<?php echo $commit['repositoryUri']; ?>" class="link-external" title="<?php echo $repoLinkTitle; ?>"><?php echo date('Y-m-d', $commit['submitDate']); ?></a></span><?php

?><p class="heading <?php if($haveMessage) echo 'collapsible'; ?>" <?php if($haveMessage) echo 'title="Toggle commit message display"'; ?>><strong><span class="title"><?php echo $commit['title']; ?></span></strong> by <em><?php echo $commit['author']; ?></em></p><?php echo $tagList;

if($haveMessage)
{
Expand Down Expand Up @@ -337,7 +340,7 @@ function outputCommitLogHTML(&$build)

if($groupCount > 1)
{
?><strong><span class="tag"><?php echo htmlspecialchars($groupName); ?></span></strong><a name="<?php echo $groupName; ?>"></a><a class="jump" href="#commitindex" title="Back to Commits index">index</a><br /><ol><?php
?><strong><label title="<?php echo ("Commits with primary tag '$groupName'"); ?>"><span class="tag"><?php echo htmlspecialchars($groupName); ?></span></label></strong><a name="<?php echo $groupName; ?>"></a><a class="jump" href="#commitindex" title="Back to Commits index">index</a><br /><ol><?php
}

foreach($group as &$commit)
Expand Down Expand Up @@ -1202,7 +1205,7 @@ public function execute($args=NULL)
jQuery(".commit").hide();
jQuery(".collapsible").click(function()
{
jQuery(this).next(".commit").slideToggle(300);
jQuery(this).next().next(".commit").slideToggle(300);
});
});
</script><?php
Expand Down
26 changes: 23 additions & 3 deletions web/style.css
Expand Up @@ -804,9 +804,12 @@ p.legal a {
color: #ff8a00;
}

.commit_list span.tag {
.commit_list .tag {
color:#558866;
font-family:Verdana, Arial, Helvetica, sans-serif;
}

.commit_list span.tag {
margin-right:.8em;
}

Expand All @@ -832,8 +835,6 @@ p.legal a {
margin-left:2em;
}

/*.commit span.title { }*/

span.metadata {
font-size:smaller;
margin-right:1em;
Expand All @@ -843,6 +844,25 @@ span.metadata {
display:inline-block;
}

.tag_list {
display:inline;
margin: 0;
padding: 0;
}

.tag_list .tag {
display:inline-block;
font-size: xx-small;
border: 1px solid;
border-radius: 3px;
-moz-border-radius: 3px;
padding: .25em .4em;
margin-left: 1em;
margin-right: 0;
background-color: #F9FFF9;
border-color: #BBDDBB;
}

/*----------*/

.buildevent table {
Expand Down

0 comments on commit faaa9fd

Please sign in to comment.