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 #1022

Closed
wants to merge 1 commit into from
Closed
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">
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what standalone means. Maybe we should just pull the styles into our base CSS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a listings page, but a random page. Dunno, any advice on naming welcome.

<link rel="stylesheet" href="/media/css/view-all-tab.styl.css">

<link rel="stylesheet" href="/media/css/marketplace-elements.styl.css">
Expand Down
13 changes: 0 additions & 13 deletions src/media/css/credits.styl

This file was deleted.

17 changes: 17 additions & 0 deletions src/media/css/standalone.styl
@@ -0,0 +1,17 @@
/*
/standalone
*/
@import 'lib';

.standalone {
ul {
list-style: none;
}
li {
padding: 3px 0;
}
h3 {
text-transform: uppercase;
Copy link
Contributor

Choose a reason for hiding this comment

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

try _h3();

margin-bottom: 15px;
}
}
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
14 changes: 14 additions & 0 deletions src/media/js/views/usage.js
@@ -0,0 +1,14 @@
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.start('usage.html');
builder.z('type', 'leaf');
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i like having builder.z on top of builder.start

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k

builder.z('title', gettext('App Statistics'));
};
});

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') }}
</h1>
</div>
</section>

<section class="standalone main full">
<div>
<h3>App usage data</h3>
<p>Not enough data to show.</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding in some l10n here.

</div>
</section>