Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Add in an app usage page (bug 1129065) #1024

Merged
merged 2 commits into from Feb 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dev.html
Expand Up @@ -39,7 +39,6 @@
<link rel="stylesheet" href="/media/css/categories.styl.css">
<link rel="stylesheet" href="/media/css/category-dropdown-desktop.styl.css">
<link rel="stylesheet" href="/media/css/compat-filtering.styl.css">
<link rel="stylesheet" href="/media/css/credits.styl.css">
<link rel="stylesheet" href="/media/css/desktop-promo.styl.css">
<link rel="stylesheet" href="/media/css/detail/base.styl.css">
<link rel="stylesheet" href="/media/css/detail/content-ratings.styl.css">
Expand Down Expand Up @@ -71,6 +70,7 @@
<link rel="stylesheet" href="/media/css/reviews.styl.css">
<link rel="stylesheet" href="/media/css/search.styl.css">
<link rel="stylesheet" href="/media/css/settings-hover-desktop.styl.css">
<link rel="stylesheet" href="/media/css/standalone.styl.css">
<link rel="stylesheet" href="/media/css/view-all-tab.styl.css">

<link rel="stylesheet" href="/media/css/marketplace-elements.styl.css">
Expand Down
7 changes: 5 additions & 2 deletions src/media/css/credits.styl → src/media/css/standalone.styl
@@ -1,13 +1,16 @@
/*
/credits
/standalone
*/
@import 'lib';

.credits {
.standalone {
ul {
list-style: none;
}
li {
padding: 3px 0;
}
h3 {
_h3();
}
}
6 changes: 4 additions & 2 deletions src/media/js/routes.js
Expand Up @@ -32,7 +32,8 @@ var routes = window.routes = [
{'pattern': '^/search/?$', 'view_name': 'search'},
{'pattern': '^/settings$', 'view_name': 'settings'},
{'pattern': '^/terms-of-use$', 'view_name': 'terms'},
{'pattern': '^/tests$', 'view_name': 'tests'}
{'pattern': '^/tests$', 'view_name': 'tests'},
{'pattern': '^/usage$', 'view_name': 'usage'}
];

define('routes', [
Expand Down Expand Up @@ -66,7 +67,8 @@ define('routes', [
'views/search',
'views/settings',
'views/terms',
'views/tests'
'views/tests',
'views/usage'
], function() {
for (var i = 0; i < routes.length; i++) {
var route = routes[i];
Expand Down
13 changes: 13 additions & 0 deletions src/media/js/views/usage.js
@@ -0,0 +1,13 @@
define('views/usage',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

['l10n'],
function(l10n) {
'use strict';
var gettext = l10n.gettext;

return function(builder, args, params) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'params' is defined but never used.
'args' is defined but never used.

builder.z('type', 'leaf');
builder.z('title', gettext('App Statistics'));
builder.start('usage.html');
};
}
);
4 changes: 4 additions & 0 deletions src/media/js/webactivities.js
Expand Up @@ -55,6 +55,10 @@ define('webactivities', ['capabilities', 'log', 'login', 'urls', 'utils', 'z'],
z.page.trigger('navigate', [utils.urlparams(url, {src: src})]);
break;
case 'marketplace-search':
if (data.type === 'firefox-os-app-stats') {
z.page.trigger('navigate', urls.reverse('usage'));
break;
}
// Load up a search.
z.page.trigger('search', {q: data.query, src: src});
break;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/credits.html
Expand Up @@ -6,7 +6,7 @@ <h1>
</div>
</section>

<section class="credits main full">
<section class="standalone main full">
<div>
<ul>
<li><a href="https://github.com/21echoes">21echoes</a> (David Kettler)</li>
Expand Down
14 changes: 14 additions & 0 deletions src/templates/usage.html
@@ -0,0 +1,14 @@
<section class="main">
<div class="subheader">
<h1>
{{ _('App Statistics') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which app is this for? Marketplace? Or what's the bug #

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</h1>
</div>
</section>

<section class="standalone main full">
<div>
<h3>{{ _('App usage statistics') }}</h3>
<p>{{ _('Not enough statistics to show.') }}</p>
</div>
</section>