Skip to content

Commit

Permalink
added stars and forks count from GitHub, fix #30
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbard committed Jul 20, 2014
1 parent f6be138 commit 4541355
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion extension/services/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ define(function (require, exports, module){
id = $t.find('[data-extension-id]').attr('data-extension-id'),
extension = extensionService.get(id),
registryEntry = registry.get(id),
stars = registryEntry ? registryEntry.stars : 'NA',
forks = registryEntry ? registryEntry.forks : 'NA',
totalDownloads = extension && extension.totalDownloads? extension.totalDownloads : 0,
dailyDownloads = registryEntry ? registryEntry.dailyDownloads : 0,
badgeHolder;
Expand All @@ -107,7 +109,9 @@ define(function (require, exports, module){
str_click_more: locale.get('click-more') + ' ' + registryEntry? registryEntry.title : '',
id: id,
daily: dailyDownloads ? dailyDownloads : '',
path: config.root
path: config.root,
stars: stars,
forks: forks
}));

//hide daily downloads counter for extensions without daily downloads
Expand Down
4 changes: 4 additions & 0 deletions extension/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ span.ext-daily{
.ext-badges > .ext-badge-100k{
background: linear-gradient(to bottom, #1e5799 0%,#207cca 59%,#ffea30 60%,#fceb88 100%);
}

.fa{
font-size: 14px;
}
4 changes: 3 additions & 1 deletion extension/templates/downloads.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div class="muted ext-version">
<img alt="${str_downloads}" title="${downloads} ${str_downloads}" src="${path}/images/arrow.png" />
<i title="${downloads} ${str_downloads}" class="fa fa-download"></i>
<a title="${str_click_more}" href="#">
<span data-extension-id="${id}" title="${downloads} ${str_downloads}" class="ext-link_more">${downloads}</span>
</a>
<span title="${daily} ${str_daily}" class="ext-daily">(+${daily})</span>
<i class="fa fa-star"></i> ${stars}
<i class="fa fa-code-fork"></i> ${forks}
</div>

0 comments on commit 4541355

Please sign in to comment.