Merge lp:~stephen-stewart/snapweb/repent-harlequin-said-the-ticktockman into lp:~snappy-dev/snapweb/trunk

Proposed by Stephen Stewart on 2015-05-26
Status: Merged
Approved by: Sergio Schvezov on 2015-05-29
Approved revision: 155
Merged at revision: 149
Proposed branch: lp:~stephen-stewart/snapweb/repent-harlequin-said-the-ticktockman
Merge into: lp:~snappy-dev/snapweb/trunk
Prerequisite: lp:~stephen-stewart/snapweb/icons-icons-icons
Diff against target: 203 lines (+63/-12)
9 files modified
package.json (+1/-1)
www/src/css/icon.css (+1/-0)
www/src/css/snap.css (+1/-1)
www/src/css/snaplist.css (+24/-5)
www/src/js/templates/snap-detail.hbs (+9/-0)
www/src/js/templates/snap-layout.hbs (+3/-1)
www/src/js/templates/snaplist-item.hbs (+3/-2)
www/src/js/views/snaplist-item.js (+8/-1)
www/tests/snapItemViewSpec.js (+13/-1)
To merge this branch: bzr merge lp:~stephen-stewart/snapweb/repent-harlequin-said-the-ticktockman
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-05-26 Approve on 2015-05-29
Review via email: mp+260120@code.launchpad.net

Commit Message

* give oem, core, and framework (but not app) type snaps a clear label
* add a pretty downloaded file size to snap lists
* fix some position issues with lists

Description of the Change

* give oem, core, and framework (but not app) type snaps a clear label
* add a pretty downloaded file size to snap lists
* fix some position issues with lists

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'package.json'
2--- package.json 2015-05-27 15:32:21 +0000
3+++ package.json 2015-05-27 15:32:22 +0000
4@@ -38,7 +38,7 @@
5 "normalize.css": "^3.0.3",
6 "postcss-bem-linter": "git://github.com/necolas/postcss-bem-linter",
7 "postcss-custom-media": "^3.0.0",
8- "pretty-bytes": "^1.0.4",
9+ "pretty-bytes": "^2.0.1",
10 "vinyl-buffer": "~1.0.0",
11 "vinyl-source-stream": "~1.1.0",
12 "watchify": "~3.1.2"
13
14=== modified file 'www/src/css/icon.css'
15--- www/src/css/icon.css 2015-05-27 15:32:21 +0000
16+++ www/src/css/icon.css 2015-05-27 15:32:22 +0000
17@@ -15,6 +15,7 @@
18 background-repeat:no-repeat;
19 background-position:50% 50%;
20 background-size:100% 100%;
21+ z-index:10;
22 }
23
24 .b-icon img {
25
26=== modified file 'www/src/css/snap.css'
27--- www/src/css/snap.css 2015-05-27 15:32:21 +0000
28+++ www/src/css/snap.css 2015-05-27 15:32:22 +0000
29@@ -63,5 +63,5 @@
30 }
31
32 .b-snap__tab-content {
33- padding:1.3em 3em 1.3em;
34+ padding:1.3em 0;
35 }
36
37=== modified file 'www/src/css/snaplist.css'
38--- www/src/css/snaplist.css 2015-05-27 15:32:21 +0000
39+++ www/src/css/snaplist.css 2015-05-27 15:32:22 +0000
40@@ -5,10 +5,8 @@
41
42 .b-snaplist__item {
43 cursor: pointer;
44- font-size:0;
45 }
46
47-
48 /** grid style **/
49
50 .b-snaplist_grid {
51@@ -19,6 +17,13 @@
52 .b-snaplist_grid .b-snaplist__item {
53 flex: 0 1 auto;
54 padding:7px;
55+ font-size:0;
56+}
57+
58+.b-snaplist_grid .b-snaplist__item * {
59+ font-size: 12px;
60+ color:#999;
61+ text-align: center;
62 }
63
64 .b-snaplist_grid .b-snaplist__name {
65@@ -26,8 +31,6 @@
66 white-space: nowrap;
67 overflow: hidden;
68 text-overflow: ellipsis;
69- font-size:12px;
70- color:#999;
71 margin-top:4px;
72 }
73
74@@ -36,7 +39,22 @@
75 width:90px;
76 }
77
78-.b-snaplist_grid .b-snaplist__name ~ * {
79+.b-snaplist_grid :not(.b-snaplist__item-app) .b-icon::after {
80+ content: attr(data-type);
81+ position:absolute;
82+ width:100%;
83+ bottom:0;
84+ left:0;
85+ right:0;
86+ background: rgba(221,72,20,0.8);
87+ color:#fff;
88+ z-index:0;
89+ padding:3px 0 5px;
90+ text-transform:uppercase;
91+ font-size:10px;
92+}
93+
94+.b-snaplist_grid .b-snaplist__size ~ * {
95 display:none;
96 }
97
98@@ -88,6 +106,7 @@
99 background-image: url(/public/images/icon-mask-on-white.png);
100 }
101
102+
103 .b-snaplist_row .b-icon img {
104 display:block;
105 width: 40px;
106
107=== modified file 'www/src/js/templates/snap-detail.hbs'
108--- www/src/js/templates/snap-detail.hbs 2015-05-27 15:32:21 +0000
109+++ www/src/js/templates/snap-detail.hbs 2015-05-27 15:32:22 +0000
110@@ -0,0 +1,9 @@
111+{{#if description}}
112+<p>{{ description }}</p>
113+{{/if}}
114+{{#if prettyInstalledSize}}
115+<p>Installed size: {{prettyInstalledSize}}</p>
116+{{/if}}
117+{{#if prettyDownloadSize}}
118+<p>Download size: {{prettyDownloadSize}}</p>
119+{{/if}}
120
121=== modified file 'www/src/js/templates/snap-layout.hbs'
122--- www/src/js/templates/snap-layout.hbs 2015-05-27 15:32:21 +0000
123+++ www/src/js/templates/snap-layout.hbs 2015-05-27 15:32:22 +0000
124@@ -16,4 +16,6 @@
125 </div>
126 </div>
127 <div class="region-menu"></div>
128-<div class="region-tab"></div>
129+<div class="b-layout__container">
130+ <div class="region-tab"></div>
131+</div>
132
133=== modified file 'www/src/js/templates/snaplist-item.hbs'
134--- www/src/js/templates/snaplist-item.hbs 2015-05-27 15:32:21 +0000
135+++ www/src/js/templates/snaplist-item.hbs 2015-05-27 15:32:22 +0000
136@@ -1,11 +1,12 @@
137-<div class="b-icon">
138+<div class="b-icon" data-type="{{type}}">
139 <img src="{{ icon }}" width="90" height="90">
140 </div>
141 <div class="b-snaplist__name">{{ name }}</div>
142 {{!-- only name is shown in grid view, everything after is hidden --}}
143+<div class="b-snaplist__size" title="Installed file size">{{ prettyInstalledSize }}</div>
144 <div class="b-snaplist__version">{{ version }}</div>
145+<div class="b-snaplist__type">{{ type }}</div>
146 <div class="b-snaplist__origin">{{ origin }}</div>
147-<div class="b-snaplist__type">{{ type }}</div>
148 <div class="b-snaplist__actions">
149 {{> installer}}
150 </div>
151
152=== modified file 'www/src/js/views/snaplist-item.js'
153--- www/src/js/views/snaplist-item.js 2015-05-08 14:53:07 +0000
154+++ www/src/js/views/snaplist-item.js 2015-05-27 15:32:22 +0000
155@@ -13,7 +13,14 @@
156
157 module.exports = Marionette.ItemView.extend({
158
159- className: 'b-snaplist__item',
160+ className: function() {
161+ var type = this.model.get('type');
162+ var className = 'b-snaplist__item';
163+ if (type) {
164+ className += ' b-snaplist__item-' + type;
165+ }
166+ return className;
167+ },
168
169 template: function(model) {
170 return template(model);
171
172=== modified file 'www/tests/snapItemViewSpec.js'
173--- www/tests/snapItemViewSpec.js 2015-05-05 14:40:14 +0000
174+++ www/tests/snapItemViewSpec.js 2015-05-27 15:32:22 +0000
175@@ -1,10 +1,15 @@
176 var Backbone = require('backbone');
177+var Snap = require('../src/js/models/snap.js');
178 var SnapItemView = require('../src/js/views/snaplist-item.js');
179
180 describe('SnapItemView', function() {
181
182 beforeEach(function() {
183- this.view = new SnapItemView();
184+ this.view = new SnapItemView({
185+ model: new Snap({
186+ id: 'foo'
187+ })
188+ });
189 });
190
191 afterEach(function() {
192@@ -16,4 +21,11 @@
193 expect(this.view).toEqual(jasmine.any(Backbone.View));
194 });
195
196+ it('should have a b-snaplist className with type modifier when present in model', function() {
197+ this.view.model.unset('type');
198+ expect(this.view.className()).toBe('b-snaplist__item');
199+ this.view.model.set('type', 'foo');
200+ expect(this.view.className()).toBe('b-snaplist__item b-snaplist__item-foo');
201+ });
202+
203 });

Subscribers

People subscribed via source and target branches