<template id="commitdate">
<div class="commit-group-heading">
</div>
<ul class="list-unstyled commits-list">
<li>
<div class="commit-main-info">
<a href="#" target="_blank"></a>
</div>
<span class="text-muted">by</span> <span class="author"></span>
</li>
</ul>
</li>
</template>
<template id="commit">
<li>
<div class="commit-main-info">
<a href="#" target="_blank"></a>
</div>
<span class="text-muted">by</span> <span class="author"></span>
</li>
</template>
And i am using it like this in my javascript code : if (lastDate == commitDate) {
var commitTemplate = $("#commit");
var commitNode = commitTemplate.prop("content");
$(commitNode).find(".commit-main-info").append(commit.message);
$(commitNode).find(".author").text(commit.login);
$(commitNode).find("a").attr("href", commit.html_url);
$(commitNode).find("a").text("# "+commit.sha.substring(0,6));
var clonedCommitNode = document.importNode(commitNode, true);
$("ul").last().append(clonedCommitNode);
} else {
var commitDateTemplate = $("#commitdate");
var commitDateNode = commitDateTemplate.prop("content");
$(commitDateNode).find(".commit-group-heading").text("Commits on " + commit.date);
$(commitDateNode).find("a").attr("href", commit.html_url);
$(commitDateNode).find("a").text("# "+commit.sha.substring(0,6));
$(commitDateNode).find(".commit-main-info").append(commit.message);
$(commitDateNode).find(".author").text(commit.login);
var clonedCommitDateNode = document.importNode(commitDateNode, true);
$("body").append(clonedCommitDateNode);
}
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.