Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Commit

Permalink
Show "latest release" and "total" counts
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottwilliams committed May 21, 2014
1 parent 9cba338 commit c8ffe4a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
10 changes: 10 additions & 0 deletions app/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
.module-detail-table td {
width: 60%;
}
.module-detail-table td .url {
word-break: break-all;
}
.module-detail-table .no-users-label {
color: #555555;
font-style: italic;
Expand All @@ -27,6 +30,13 @@
.module-detail-table .select-container {
min-width: 18em;
}
.module-detail-table .count {
white-space: nowrap;
}
.module-detail-table .count .count-description {
font-size: 85%;
margin-right: 1em;
}
header {
padding-top: 1.5em;
padding-bottom: 1.5em;
Expand Down
10 changes: 10 additions & 0 deletions app/css/showModule.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
.module-detail-table td {
width: 60%;
}
.module-detail-table td .url {
word-break: break-all;
}
.module-detail-table .no-users-label {
color: #555555;
font-style: italic;
Expand All @@ -27,3 +30,10 @@
.module-detail-table .select-container {
min-width: 18em;
}
.module-detail-table .count {
white-space: nowrap;
}
.module-detail-table .count .count-description {
font-size: 85%;
margin-right: 1em;
}
3 changes: 2 additions & 1 deletion app/js/showControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ angular.module('modulusOne.showControllers', ['ui'])
}

$scope.incrementDownload = function() {
$scope.latestRelease.downloadCount++
$scope.latestRelease.downloadCount++;
$scope.module.downloadCount++
}

// Search function that typeahead in the `owner` field calls
Expand Down
18 changes: 17 additions & 1 deletion app/less/showModule.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
}
td {
width: 60%;

// Break long URLs to prevent overflow problems on small screens.
.url {
word-break: break-all;
}
}

.no-users-label, {
Expand All @@ -25,6 +30,17 @@
}

.select-container {
min-width: 18em
min-width: 18em;
}

.count {

white-space: nowrap;

.count-description {
font-size: 85%;
margin-right: 1em;
}

}
}
12 changes: 10 additions & 2 deletions app/partials/showModule.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2 ng-if="editable">
<tr>
<th>Documentation</th>
<td ng-if="!editable">
<a ng-href="{{module.documentationURL}}">
<a class="url" ng-href="{{module.documentationURL}}">
{{module.documentationURL}}
</a>
</td>
Expand All @@ -68,7 +68,15 @@ <h2 ng-if="editable">

<tr>
<th>Downloads</th>
<td>{{latestRelease.downloadCount}}</td>
<td>
<span class="count">{{latestRelease.downloadCount}}
<span class="count-description">latest release</span>
</span>
<span class="count">
{{module.downloadCount}}
<span class="count-description">total</span>
</span>
</td>
</tr>

<tr ng-switch on="editable">
Expand Down

0 comments on commit c8ffe4a

Please sign in to comment.