Issue Stats: default to short form

Use the long form with prefix 'long'.
An example of that is added.

Part of #656.
This commit is contained in:
Thaddee Tyl 2016-07-24 00:00:01 +02:00
parent 08b2989756
commit f41ee2d0f8
2 changed files with 11 additions and 3 deletions

View File

@ -5319,10 +5319,10 @@ cache(function(data, match, sendBadge, request) {
}));
// Issue Stats integration.
camp.route(/^\/issuestats\/([^\/]+)(\/concise)?\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/issuestats\/([^\/]+)(\/long)?\/([^\/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var type = match[1]; // e.g. `i` for Issue or `p` for PR
var options = match[2]; // `concise`
var longForm = !!match[2];
var host = match[3]; // e.g. `github`
var userRepo = match[4]; // e.g. `ruby/rails`
var format = match[5];
@ -5343,7 +5343,7 @@ cache(function(data, match, sendBadge, request) {
var url = 'http://issuestats.com/' + host + '/' + userRepo;
var qs = {format: 'json'};
if (options === '/concise') {
if (!longForm) {
qs.concise = true;
}
var options = {

View File

@ -917,9 +917,17 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable
<td><img src='/issuestats/i/github/strongloop/express.svg' alt=''/></td>
<td><code>https://img.shields.io/issuestats/i/github/strongloop/express.svg</code></td>
</tr>
<tr><th> (long form): </th>
<td>&nbsp;</td>
<td><code>https://img.shields.io/issuestats/i/long/github/strongloop/express.svg</code></td>
</tr>
<tr><th> Issue Stats: </th>
<td><img src='/issuestats/p/github/strongloop/express.svg' alt=''/></td>
<td><code>https://img.shields.io/issuestats/p/github/strongloop/express.svg</code></td>
<tr><th> (long form): </th>
<td>&nbsp;</td>
<td><code>https://img.shields.io/issuestats/p/long/github/strongloop/express.svg</code></td>
</tr>
</tr>
</tbody></table>