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

Proposed by Stephen Stewart
Status: Superseded
Proposed branch: lp:~stephen-stewart/snapweb/repent-harlequin-said-the-ticktockman
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 860 lines (+386/-142)
26 files modified
gulpfile.js (+16/-2)
package.json (+2/-0)
www/src/css/animations.css (+4/-0)
www/src/css/banner.css (+5/-3)
www/src/css/base.css (+1/-1)
www/src/css/headline.css (+10/-0)
www/src/css/icon.css (+23/-0)
www/src/css/layout.css (+65/-4)
www/src/css/snap.css (+13/-12)
www/src/css/snaplist.css (+64/-15)
www/src/images/cof.svg (+14/-25)
www/src/images/default-package-icon.svg (+34/-12)
www/src/js/models/snap.js (+31/-6)
www/src/js/templates/home.hbs (+5/-1)
www/src/js/templates/layout-banner.hbs (+34/-32)
www/src/js/templates/snap-detail.hbs (+9/-3)
www/src/js/templates/snap-layout.hbs (+15/-10)
www/src/js/templates/snap-menu.hbs (+11/-9)
www/src/js/templates/snaplist-item.hbs (+4/-3)
www/src/js/templates/store.hbs (+0/-1)
www/src/js/views/home.js (+2/-0)
www/src/js/views/snap-detail.js (+1/-0)
www/src/js/views/snap-reviews.js (+1/-1)
www/src/js/views/snap-settings.js (+1/-0)
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
Snappy Developers Pending
Review via email: mp+260119@code.launchpad.net
To post a comment you must log in.
154. By Stephen Stewart

merge lp:~stephen-stewart/webdm/icons-icons-icons

155. By Stephen Stewart

wrap snap tab content

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gulpfile.js'
--- gulpfile.js 2015-05-09 09:33:57 +0000
+++ gulpfile.js 2015-05-26 10:09:09 +0000
@@ -6,6 +6,7 @@
6var buffer = require('vinyl-buffer');6var buffer = require('vinyl-buffer');
7var concat = require('gulp-concat');7var concat = require('gulp-concat');
8var csso = require('gulp-csso');8var csso = require('gulp-csso');
9var customMedia = require("postcss-custom-media");
9var del = require('del');10var del = require('del');
10var gulp = require('gulp');11var gulp = require('gulp');
11var gutil = require('gulp-util');12var gutil = require('gulp-util');
@@ -47,7 +48,7 @@
47 }48 }
4849
49 return bundleShared(bundler);50 return bundleShared(bundler);
50} 51}
5152
52function bundleShared(bundler) {53function bundleShared(bundler) {
53 return bundler.bundle()54 return bundler.bundle()
@@ -75,7 +76,20 @@
75gulp.task('styles', ['styles:clean'], function() {76gulp.task('styles', ['styles:clean'], function() {
76 var processors = [77 var processors = [
77 autoprefixer({browsers: ['last 1 version']}),78 autoprefixer({browsers: ['last 1 version']}),
78 bemlinter('bem')79 bemlinter('bem'),
80 customMedia({
81 extensions: {
82 /** multiples of icon width in grid form **/
83 '--xxs': '(min-width: 424px)',
84 '--xs': '(min-width: 540px)',
85 '--s': '(min-width: 660px)',
86 '--m': '(min-width: 770px)',
87 '--l': '(min-width: 880px)',
88 '--xl': '(min-width: 1100px)',
89 '--xxl': '(min-width: 1430px)',
90 '--xxxl': '(min-width: 1870px)'
91 }
92 })
79 ];93 ];
80 return gulp.src([94 return gulp.src([
81 'node_modules/normalize.css/normalize.css',95 'node_modules/normalize.css/normalize.css',
8296
=== modified file 'package.json'
--- package.json 2015-05-08 22:41:11 +0000
+++ package.json 2015-05-26 10:09:09 +0000
@@ -37,6 +37,8 @@
37 "lodash": "~3.3.1",37 "lodash": "~3.3.1",
38 "normalize.css": "^3.0.3",38 "normalize.css": "^3.0.3",
39 "postcss-bem-linter": "git://github.com/necolas/postcss-bem-linter",39 "postcss-bem-linter": "git://github.com/necolas/postcss-bem-linter",
40 "postcss-custom-media": "^3.0.0",
41 "pretty-bytes": "^2.0.1",
40 "vinyl-buffer": "~1.0.0",42 "vinyl-buffer": "~1.0.0",
41 "vinyl-source-stream": "~1.1.0",43 "vinyl-source-stream": "~1.1.0",
42 "watchify": "~3.1.2"44 "watchify": "~3.1.2"
4345
=== added file 'www/src/css/animations.css'
--- www/src/css/animations.css 1970-01-01 00:00:00 +0000
+++ www/src/css/animations.css 2015-05-26 10:09:09 +0000
@@ -0,0 +1,4 @@
1@keyframes rotate {
2 from { transform: rotate(0deg) }
3 to { transform: rotate(360deg) }
4}
05
=== modified file 'www/src/css/banner.css'
--- www/src/css/banner.css 2015-05-08 20:03:48 +0000
+++ www/src/css/banner.css 2015-05-26 10:09:09 +0000
@@ -1,12 +1,14 @@
1/** @define b-banner; weak */1/** @define b-banner; weak */
22
3.b-banner {3.b-banner {
4 display:flex;4 background-color:#2f2f2f;
5 align-items:center;
6 background-color:#202020;
7 color:#efefef;5 color:#efefef;
8 line-height:20px;6 line-height:20px;
9}7}
8.b-banner .b-layout__container {
9 display:flex;
10 align-items:center;
11}
1012
11.b-banner img {13.b-banner img {
12 display:block;14 display:block;
1315
=== modified file 'www/src/css/base.css'
--- www/src/css/base.css 2015-04-30 14:38:12 +0000
+++ www/src/css/base.css 2015-05-26 10:09:09 +0000
@@ -13,7 +13,7 @@
13}13}
1414
15body {15body {
16 background: url('../images/image-background-paper.png') repeat-y fixed 50% 0 #f7f7f7;16 background-color:#f7f7f7;
17}17}
1818
19a {19a {
2020
=== added file 'www/src/css/headline.css'
--- www/src/css/headline.css 1970-01-01 00:00:00 +0000
+++ www/src/css/headline.css 2015-05-26 10:09:09 +0000
@@ -0,0 +1,10 @@
1/** @define b-headline; weak */
2
3.b-headline {
4}
5
6.b-headline__h1 {
7 font-size:18px;
8 font-weight:400;
9 margin:20px 15px 5px 15px;
10}
011
=== added file 'www/src/css/icon.css'
--- www/src/css/icon.css 1970-01-01 00:00:00 +0000
+++ www/src/css/icon.css 2015-05-26 10:09:09 +0000
@@ -0,0 +1,23 @@
1.b-icon {
2 position:relative;
3 display:inline-block;
4}
5
6.b-icon::before {
7 content: "";
8 position:absolute;
9 top:0;
10 left:0;
11 right:0;
12 bottom:0;
13 background-color:transparent;
14 background-image:url(/public/images/icon-mask.png);
15 background-repeat:no-repeat;
16 background-position:50% 50%;
17 background-size:100% 100%;
18 z-index:10;
19}
20
21.b-icon img {
22 display:block;
23}
024
=== modified file 'www/src/css/layout.css'
--- www/src/css/layout.css 2015-05-08 20:03:48 +0000
+++ www/src/css/layout.css 2015-05-26 10:09:09 +0000
@@ -11,12 +11,20 @@
1111
12.b-layout__main {12.b-layout__main {
13 flex: 1;13 flex: 1;
14 padding:0 3em;14 position:relative;
15}15}
1616
17.b-layout__main:empty {17.b-layout__main:empty::before {
18 opacity:0.5;18 content:"";
19 background:transparent url("/public/images/default-package-icon.svg") 50% 50% no-repeat;19 position:absolute;
20 top:50%;
21 left:50%;
22 width:128px;
23 height:128px;
24 margin:-64px 0 0 -64px;
25 background:transparent url("/public/images/cof.svg") 50% 50% no-repeat;
26 background-size: 100% 100%;
27 animation: rotate 3s linear infinite;
20}28}
2129
22.b-layout__main:empty + .b-layout__footer {30.b-layout__main:empty + .b-layout__footer {
@@ -36,3 +44,56 @@
36 width: 100%;44 width: 100%;
37 z-index: 10000;45 z-index: 10000;
38}46}
47
48.b-layout__container {
49 width:312px;
50 margin:0 auto;
51}
52
53@media (--xxs) {
54.b-layout__container {
55 width: 424px;
56 }
57}
58
59@media (--xs) {
60.b-layout__container {
61 width: 540px;
62 }
63}
64
65@media (--s) {
66.b-layout__container {
67 width: 660px;
68 }
69}
70
71@media (--m) {
72.b-layout__container {
73 width: 770px;
74 }
75}
76
77@media (--l) {
78.b-layout__container {
79 width: 880px;
80 }
81}
82
83@media (--xl) {
84.b-layout__container {
85 width: 1100px;
86 }
87}
88
89@media (--xxl) {
90.b-layout__container {
91 width: 1430px;
92 }
93}
94
95@media (--xxxl) {
96.b-layout__container {
97 width: 1870px;
98 }
99}
39100
=== modified file 'www/src/css/snap.css'
--- www/src/css/snap.css 2015-05-08 20:03:48 +0000
+++ www/src/css/snap.css 2015-05-26 10:09:09 +0000
@@ -3,23 +3,19 @@
3.b-snap {3.b-snap {
4}4}
55
6.b-snap__icon {6.b-snap .b-icon {
7}
8.b-snap__icon img {
9 display:block;
10}7}
118
12.b-snap__banner {9.b-snap__banner {
13 display: flex;10 display: flex;
14 line-height:1.3;11 line-height:1.3;
15 margin:0 -3em;12 padding:1.3em 0;
16 padding:1.3em 3em 1.3em;
17 align-items: flex-start;13 align-items: flex-start;
18 background-color:rgba(255,255,255,0.7);
19}14}
2015
21.b-snap__meta {16.b-snap__meta {
22 flex: 2;17 flex: 2;
18 margin-left:15px;
23}19}
2420
25.b-snap__meta > * {21.b-snap__meta > * {
@@ -36,13 +32,14 @@
3632
37.b-snap__navigation {33.b-snap__navigation {
38 background-color:rgba(255,255,255,0.5);34 background-color:rgba(255,255,255,0.5);
39 display: flex;
40 align-items: center;
41 margin:0 0 1em 0;
42 border-top:1px solid #efefef;35 border-top:1px solid #efefef;
43 border-bottom:1px solid #ddd;36 border-bottom:1px solid #ddd;
44 margin:0 -3em 1em -3em;37 margin:0 0 1em 0;
45 padding:0 3em;38}
39
40.b-snap__navigation .b-layout__container {
41 display: flex;
42 align-items: center;
46}43}
4744
48.b-snap__nav-item {45.b-snap__nav-item {
@@ -64,3 +61,7 @@
64 right:0;61 right:0;
65 height:3px;62 height:3px;
66}63}
64
65.b-snap__tab-content {
66 padding:1.3em 3em 1.3em;
67}
6768
=== modified file 'www/src/css/snaplist.css'
--- www/src/css/snaplist.css 2015-05-08 20:03:48 +0000
+++ www/src/css/snaplist.css 2015-05-26 10:09:09 +0000
@@ -15,16 +15,15 @@
15}15}
1616
17.b-snaplist_grid .b-snaplist__item {17.b-snaplist_grid .b-snaplist__item {
18 flex: 0 1 20%;18 flex: 0 1 auto;
19 padding:10px;19 padding:7px;
20}20 font-size:0;
2121}
22.b-snaplist_grid .b-snaplist__icon {22
23}23.b-snaplist_grid .b-snaplist__item * {
2424 font-size: 12px;
25.b-snaplist_grid .b-snaplist__icon img {25 color:#999;
26 border-radius:15%;26 text-align: center;
27 width:100%;
28}27}
2928
30.b-snaplist_grid .b-snaplist__name {29.b-snaplist_grid .b-snaplist__name {
@@ -32,14 +31,57 @@
32 white-space: nowrap;31 white-space: nowrap;
33 overflow: hidden;32 overflow: hidden;
34 text-overflow: ellipsis;33 text-overflow: ellipsis;
35}34 margin-top:4px;
3635}
37.b-snaplist_grid .b-snaplist__name ~ * {36
37.b-snaplist_grid .b-snaplist__name,
38.b-snaplist_grid .b-icon img {
39 width:90px;
40}
41
42.b-snaplist_grid :not(.b-snaplist__item-app) .b-icon::after {
43 content: attr(data-type);
44 position:absolute;
45 width:100%;
46 bottom:0;
47 left:0;
48 right:0;
49 background: rgba(221,72,20,0.8);
50 color:#fff;
51 z-index:0;
52 padding:3px 0 5px;
53 text-transform:uppercase;
54 font-size:10px;
55}
56
57.b-snaplist_grid .b-snaplist__size ~ * {
38 display:none;58 display:none;
39}59}
4060
61@media (--xxs) {
62 .b-snaplist_grid .b-snaplist__item {
63 padding:8px;
64 }
65}
66
67@media (--xs) {
68 .b-snaplist_grid .b-snaplist__item {
69 padding:9px;
70 }
71}
72
73@media (--s) {
74 .b-snaplist_grid .b-snaplist__item {
75 padding:10px;
76 }
77}
78
41/** row style **/79/** row style **/
4280
81.b-snaplist_row {
82 margin:3em;
83}
84
43.b-snaplist_row .b-snaplist__item {85.b-snaplist_row .b-snaplist__item {
44 width:100%;86 width:100%;
45 display:flex;87 display:flex;
@@ -48,17 +90,24 @@
48 border-radius:4px;90 border-radius:4px;
49 margin-bottom:0.6em;91 margin-bottom:0.6em;
50 background-color:#fff;92 background-color:#fff;
93 font-size:13px;
51}94}
5295
53.b-snaplist_row .b-snaplist__item:last-child {96.b-snaplist_row .b-snaplist__item:last-child {
54 margin-bottom:0;97 margin-bottom:0;
55}98}
5699
57.b-snaplist_row .b-snaplist__icon {100
101.b-snaplist_row .b-icon {
58 flex:0 0 40px;102 flex:0 0 40px;
59}103}
60104
61.b-snaplist_row .b-snaplist__icon img {105.b-snaplist_row .b-icon::before {
106 background-image: url(/public/images/icon-mask-on-white.png);
107}
108
109
110.b-snaplist_row .b-icon img {
62 display:block;111 display:block;
63 width: 40px;112 width: 40px;
64 height: 40px;113 height: 40px;
65114
=== modified file 'www/src/images/cof.svg'
--- www/src/images/cof.svg 2015-04-24 23:05:53 +0000
+++ www/src/images/cof.svg 2015-05-26 10:09:09 +0000
@@ -1,27 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->2<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4 <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">4<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5]>5 width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
6<svg version="1.1"6<path fill="#FFFFFF" d="M128,0C57.4,0,0,57.4,0,128s57.4,128,128,128s128-57.4,128-128S198.6,0,128,0z M152.4,52.4
7 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"7 C156.6,45,166,42.6,173.4,46.8s9.799,13.601,5.6,21c-4.199,7.4-13.6,9.8-21,5.601C150.6,69.2,148,59.8,152.4,52.4z M48.2,143.4
8 x="0px" y="0px" width="285px" height="285px" viewBox="-0.866 -0.866 285 285" enable-background="new -0.866 -0.866 285 285"8 c-8.4,0-15.4-7-15.4-15.4s6.8-15.4,15.4-15.4c8.6,0,15.399,6.801,15.399,15.4C63.6,136.4,56.6,143.4,48.2,143.4z M61.8,144.801
9 xml:space="preserve">9 c4.8-4,8-10,8-16.801c0-6.8-3-12.8-8-16.8C66,95,76,81.4,89.4,72.4L100.6,91.2c-11.6,8.2-19,21.6-19,36.8
10<defs>10 c0,15.199,7.601,28.6,19,36.801L89.4,183.6C76,174.6,66,160.801,61.8,144.801z M173.4,209.199c-7.4,4.201-16.801,1.801-21-5.6
11</defs>11 c-4.201-7.4-1.801-16.799,5.6-21c7.4-4.199,16.801-1.799,21,5.6C183.199,195.6,180.801,205,173.4,209.199z M173.4,175.6
12<path fill="#FFFFFF" d="M283.465,141.734c0,78.273-63.457,141.73-141.734,141.73S0,220.008,0,141.734C0,63.455,63.453,0,141.73,012 c-5.801-2.199-12.6-2-18.4,1.4s-9.6,9-10.4,15.199c-5.6,1.602-11.6,2.4-17.8,2.4c-10.6,0-20.6-2.4-29.6-7l10.6-19.199
13 S283.465,63.455,283.465,141.734z"/>13 c5.8,2.799,12.2,4.199,19,4.199c23.399,0,42.8-18,44.8-40.799l22,0.398C192,149.199,184.6,164.4,173.4,175.6z M171.199,124
14<path d="M45.356,122.812c-10.453,0-18.923,8.47-18.923,18.923c0,10.449,8.47,18.92,18.923,18.92c10.449,0,18.92-8.471,18.92-18.9214 c-2-23-21.199-41-44.799-41c-6.801,0-13.2,1.4-19,4.2L96.8,68c9-4.4,19-7,29.601-7c6.199,0,12.199,0.8,17.799,2.4
15 C64.276,131.281,55.806,122.812,45.356,122.812z M180.463,208.814c-9.051,5.225-12.149,16.793-6.926,25.8415 c1,6.199,4.602,11.8,10.4,15.199C160.4,82,167.199,82.4,173,80c11.4,11.2,18.801,26.4,19.801,43.4L171.199,124z"/>
16 c5.226,9.051,16.793,12.151,25.844,6.926c9.048-5.224,12.148-16.792,6.923-25.842C201.08,206.691,189.511,203.59,180.463,208.814z
17 M86.458,141.732c0-18.701,9.293-35.219,23.504-45.221L96.128,73.338c-16.56,11.064-28.878,27.978-33.995,47.788
18 c5.977,4.872,9.796,12.291,9.796,20.608c0,8.315-3.819,15.734-9.797,20.605c5.116,19.812,17.435,36.726,33.995,47.789l13.835-23.175
19 C95.751,176.953,86.458,160.436,86.458,141.732z M141.733,86.457c28.877,0,52.564,22.141,55.047,50.373l26.968-0.394
20 c-1.327-20.844-10.432-39.562-24.425-53.319c-7.194,2.718-15.505,2.306-22.688-1.842c-7.192-4.152-11.705-11.156-12.941-18.757
21 c-6.992-1.935-14.351-2.99-21.96-2.99c-13.086,0-25.449,3.072-36.431,8.512l13.146,23.56
22 C125.526,88.307,133.412,86.457,141.733,86.457z M141.733,197.008c-8.322,0-16.207-1.85-23.285-5.143L105.3,215.427
23 c10.983,5.438,23.347,8.511,36.433,8.511c7.609,0,14.968-1.055,21.961-2.99c1.236-7.601,5.75-14.605,12.943-18.76
24 c7.183-4.146,15.494-4.558,22.688-1.839c13.992-13.758,23.097-32.476,24.422-53.32l-26.968-0.394
25 C194.298,174.871,170.61,197.008,141.733,197.008z M180.46,74.649c9.05,5.227,20.619,2.126,25.842-6.921
26 c5.226-9.051,2.128-20.619-6.923-25.845c-9.049-5.224-20.617-2.124-25.843,6.927C168.312,57.857,171.412,69.426,180.46,74.649z"/>
27</svg>16</svg>
2817
=== modified file 'www/src/images/default-package-icon.svg'
--- www/src/images/default-package-icon.svg 2015-04-30 13:42:46 +0000
+++ www/src/images/default-package-icon.svg 2015-05-26 10:09:09 +0000
@@ -1,16 +1,38 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->2<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"4<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="256px"
5 width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">5 height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
6<path fill="#FFFFFF" d="M128,64c-35.3,0-64,28.7-64,64c0,35.3,28.7,64,64,64c35.3,0,64-28.7,64-64C192,92.7,163.3,64,128,64z6<g id="Layer_1">
7 M140.2,90.2c2.1-3.7,6.8-4.9,10.5-2.8c3.7,2.1,4.9,6.8,2.8,10.5c-2.1,3.7-6.8,4.9-10.5,2.8C139.3,98.6,138,93.9,140.2,90.2z7 <rect fill="#EFEFEF" width="256" height="256"/>
8 M88.1,135.7c-4.2,0-7.7-3.5-7.7-7.7c0-4.2,3.4-7.7,7.7-7.7c4.3,0,7.7,3.4,7.7,7.7C95.8,132.2,92.3,135.7,88.1,135.7z M94.9,136.48</g>
9 c2.4-2,4-5,4-8.4c0-3.4-1.5-6.4-4-8.4c2.1-8.1,7.1-14.9,13.8-19.4l5.6,9.4c-5.8,4.1-9.5,10.8-9.5,18.4c0,7.6,3.8,14.3,9.5,18.49<g id="Layer_2">
10 l-5.6,9.4C102,151.3,97,144.4,94.9,136.4z M150.7,168.6c-3.7,2.1-8.4,0.9-10.5-2.8c-2.1-3.7-0.9-8.4,2.8-10.510 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="32" y1="0" x2="32" y2="256"/>
11 c3.7-2.1,8.4-0.9,10.5,2.8C155.6,161.8,154.4,166.5,150.7,168.6z M150.7,151.8c-2.9-1.1-6.3-1-9.2,0.7c-2.9,1.7-4.8,4.5-5.2,7.611 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="96" y1="0" x2="96" y2="256"/>
12 c-2.8,0.8-5.8,1.2-8.9,1.2c-5.3,0-10.3-1.2-14.8-3.5l5.3-9.6c2.9,1.4,6.1,2.1,9.5,2.1c11.7,0,21.4-9,22.4-20.4l11,0.212 <line fill="none" stroke="#C1C1C1" stroke-miterlimit="10" x1="64" y1="0" x2="64" y2="256"/>
13 C160,138.6,156.3,146.2,150.7,151.8z M149.6,126c-1-11.5-10.6-20.5-22.4-20.5c-3.4,0-6.6,0.7-9.5,2.1l-5.3-9.613 <line fill="#EFEFEF" stroke="#AAAAAA" stroke-miterlimit="10" x1="128" y1="0" x2="128" y2="256"/>
14 c4.5-2.2,9.5-3.5,14.8-3.5c3.1,0,6.1,0.4,8.9,1.2c0.5,3.1,2.3,5.9,5.2,7.6c2.9,1.7,6.3,1.9,9.2,0.7c5.7,5.6,9.4,13.2,9.9,21.714 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="160" y1="0" x2="160" y2="256"/>
15 L149.6,126z"/>15 <line fill="none" stroke="#C1C1C1" stroke-miterlimit="10" x1="192" y1="0" x2="192" y2="256"/>
16 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="224" y1="0" x2="224" y2="256"/>
17 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="0" y1="224" x2="256" y2="224"/>
18 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="0" y1="160" x2="256" y2="160"/>
19 <line fill="none" stroke="#C1C1C1" stroke-miterlimit="10" x1="0" y1="192" x2="256" y2="192"/>
20 <line fill="#EFEFEF" stroke="#AAAAAA" stroke-miterlimit="10" x1="0" y1="128" x2="256" y2="128"/>
21 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="0" y1="96" x2="256" y2="96"/>
22 <line fill="none" stroke="#C1C1C1" stroke-miterlimit="10" x1="0" y1="64" x2="256" y2="64"/>
23 <line fill="none" stroke="#DBDBDB" stroke-miterlimit="10" x1="0" y1="32" x2="256" y2="32"/>
24</g>
25<g id="Layer_3">
26 <circle fill="#EFEFEF" cx="128" cy="128" r="64"/>
27 <path fill="#EFEFEF" stroke="#AAAAAA" stroke-miterlimit="10" d="M128,64c-35.3,0-64,28.7-64,64s28.7,64,64,64s64-28.7,64-64
28 S163.3,64,128,64z M140.2,90.2c2.1-3.7,6.8-4.9,10.5-2.8s4.899,6.8,2.8,10.5c-2.1,3.7-6.8,4.9-10.5,2.8
29 C139.3,98.6,138,93.9,140.2,90.2z M88.1,135.7c-4.2,0-7.7-3.5-7.7-7.7s3.4-7.7,7.7-7.7c4.3,0,7.7,3.4,7.7,7.7
30 C95.8,132.2,92.3,135.7,88.1,135.7z M94.9,136.4c2.4-2,4-5,4-8.4c0-3.4-1.5-6.4-4-8.4c2.1-8.1,7.1-14.9,13.8-19.4l5.6,9.4
31 c-5.8,4.1-9.5,10.8-9.5,18.4c0,7.6,3.8,14.3,9.5,18.4l-5.6,9.399C102,151.3,97,144.4,94.9,136.4z M150.7,168.6
32 c-3.7,2.101-8.4,0.9-10.5-2.8c-2.101-3.7-0.9-8.399,2.8-10.5c3.7-2.1,8.4-0.899,10.5,2.8C155.6,161.8,154.4,166.5,150.7,168.6z
33 M150.7,151.8c-2.9-1.1-6.3-1-9.2,0.7s-4.8,4.5-5.2,7.6c-2.8,0.801-5.8,1.2-8.9,1.2c-5.3,0-10.3-1.2-14.8-3.5l5.3-9.6
34 c2.9,1.399,6.1,2.1,9.5,2.1c11.7,0,21.4-9,22.4-20.399l11,0.199C160,138.6,156.3,146.2,150.7,151.8z M149.6,126
35 c-1-11.5-10.6-20.5-22.399-20.5c-3.4,0-6.6,0.7-9.5,2.1l-5.3-9.6c4.5-2.2,9.5-3.5,14.8-3.5c3.1,0,6.1,0.4,8.899,1.2
36 c0.5,3.1,2.301,5.9,5.2,7.6c2.9,1.7,6.3,1.9,9.2,0.7c5.7,5.6,9.4,13.2,9.9,21.7L149.6,126z"/>
37</g>
16</svg>38</svg>
1739
=== added file 'www/src/images/icon-mask-on-white.png'
18Binary files www/src/images/icon-mask-on-white.png 1970-01-01 00:00:00 +0000 and www/src/images/icon-mask-on-white.png 2015-05-26 10:09:09 +0000 differ40Binary files www/src/images/icon-mask-on-white.png 1970-01-01 00:00:00 +0000 and www/src/images/icon-mask-on-white.png 2015-05-26 10:09:09 +0000 differ
=== added file 'www/src/images/icon-mask.png'
19Binary files www/src/images/icon-mask.png 1970-01-01 00:00:00 +0000 and www/src/images/icon-mask.png 2015-05-26 10:09:09 +0000 differ41Binary files www/src/images/icon-mask.png 1970-01-01 00:00:00 +0000 and www/src/images/icon-mask.png 2015-05-26 10:09:09 +0000 differ
=== modified file 'www/src/js/models/snap.js'
--- www/src/js/models/snap.js 2015-05-11 10:30:57 +0000
+++ www/src/js/models/snap.js 2015-05-26 10:09:09 +0000
@@ -3,6 +3,7 @@
3var _ = require('lodash');3var _ = require('lodash');
4var Backbone = require('backbone');4var Backbone = require('backbone');
5var Radio = require('backbone.radio');5var Radio = require('backbone.radio');
6var prettyBytes = require('pretty-bytes');
6var CONF = require('../config.js');7var CONF = require('../config.js');
7var chan = Radio.channel('root');8var chan = Radio.channel('root');
89
@@ -57,12 +58,34 @@
57 chan.command('alert:error', model);58 chan.command('alert:error', model);
58 });59 });
5960
60 this.on('add change:message', this.onMessageChange);61 this.on('add change:status', this.onStatusChange);
6162 this.on('add change:installed_size', this.onInstalledSizeChange);
62 this.on('add change:status', this.handleStatusChange);63 this.on('add change:download_size', this.onDownloadSizeChange);
63 },64 },
6465
65 handleStatusChange: function(model) {66 onDownloadSizeChange: function(model) {
67 var bytes = model.get('download_size');
68 model.set(
69 'prettyDownloadSize', this._prettyBytes(model.get('download_size'))
70 );
71 },
72
73 onInstalledSizeChange: function(model) {
74 var bytes = model.get('installed_size');
75 model.set(
76 'prettyInstalledSize', this._prettyBytes(model.get('installed_size'))
77 );
78 },
79
80 _prettyBytes: function(bytes) {
81 if (_.isNumber(bytes) && bytes >= 0) {
82 return prettyBytes(bytes);
83 } else {
84 return false;
85 }
86 },
87
88 onStatusChange: function(model) {
66 this.setInstallActionString(model);89 this.setInstallActionString(model);
67 this.setInstallHTMLClass(model);90 this.setInstallHTMLClass(model);
68 },91 },
@@ -164,6 +187,8 @@
164 icon: '/public/images/default-package-icon.svg',187 icon: '/public/images/default-package-icon.svg',
165 installActionString: false,188 installActionString: false,
166 origin: '-',189 origin: '-',
190 installed_size: 'n/a',
191 download_size: 'n/a',
167 isInstallable: true192 isInstallable: true
168 }193 }
169194
170195
=== modified file 'www/src/js/templates/home.hbs'
--- www/src/js/templates/home.hbs 2015-05-02 19:00:37 +0000
+++ www/src/js/templates/home.hbs 2015-05-26 10:09:09 +0000
@@ -1,2 +1,6 @@
1<h1>Installed apps</h1>1<div class="b-headline">
2 <div class="b-layout__container">
3 <h1 class="b-headline__h1">Installed snaps</h1>
4 </div>
5</div>
2<div class="region-installed"></div>6<div class="region-installed"></div>
37
=== modified file 'www/src/js/templates/layout-banner.hbs'
--- www/src/js/templates/layout-banner.hbs 2015-05-08 20:03:48 +0000
+++ www/src/js/templates/layout-banner.hbs 2015-05-26 10:09:09 +0000
@@ -1,32 +1,34 @@
1<div class="b-banner__brand">1<div class="b-layout__container">
2 <div class="b-banner__nav-item{{#if isHomeActive }} b-banner__nav-item_active{{/if}}">2 <div class="b-banner__brand">
3 <a href="/">3 <div class="b-banner__nav-item{{#if isHomeActive }} b-banner__nav-item_active{{/if}}">
4 <img src="/public/images/cof.svg" height="30" width="30">4 <a href="/">
5 <span>{{ name }} {{ subname }}</span>5 <img src="/public/images/cof.svg" height="30" width="30">
6 </a>6 <span>{{ name }} {{ subname }}</span>
7 </div>7 </a>
8</div>8 </div>
9<div class="b-banner__primary-nav">9 </div>
10 <div class="b-banner__nav-item{{#if isStoreActive }} b-banner__nav-item_active{{/if}}">10 <div class="b-banner__primary-nav">
11 <a href="/store">11 <div class="b-banner__nav-item{{#if isStoreActive }} b-banner__nav-item_active{{/if}}">
12 Snappy store12 <a href="/store">
13 </a>13 Snappy store
14 </div>14 </a>
15</div>15 </div>
16<!--16 </div>
17<div class="b-banner__search">17 <!--
18 <form class="b-banner__form" action="/search" method="GET">18 <div class="b-banner__search">
19 <input class="b-banner__input" type="search" name="q" placeholder="Search for snaps" value="{{ query }}">19 <form class="b-banner__form" action="/search" method="GET">
20 <div class="b-banner__nav-item{{#if isSearchActive }} b-banner__nav-item_active{{/if}}">20 <input class="b-banner__input" type="search" name="q" placeholder="Search for snaps" value="{{ query }}">
21 <button type="submit" class="b-banner__submit"></button>21 <div class="b-banner__nav-item{{#if isSearchActive }} b-banner__nav-item_active{{/if}}">
22 </div>22 <button type="submit" class="b-banner__submit"></button>
23 </form>23 </div>
24</div>24 </form>
25<div class="b-banner__secondary-nav">25 </div>
26 <div class="b-banner__nav-item{{#if isSystemActive }} b-banner__nav-item_active{{/if}}">26 <div class="b-banner__secondary-nav">
27 <a href="/system-settings">27 <div class="b-banner__nav-item{{#if isSystemActive }} b-banner__nav-item_active{{/if}}">
28 <img src="/public/images/settings.svg" height="30" width="30">28 <a href="/system-settings">
29 </a>29 <img src="/public/images/settings.svg" height="30" width="30">
30 </div>30 </a>
31</div>31 </div>
32-->32 </div>
33 -->
34</div>
3335
=== modified file 'www/src/js/templates/snap-detail.hbs'
--- www/src/js/templates/snap-detail.hbs 2015-05-04 16:44:28 +0000
+++ www/src/js/templates/snap-detail.hbs 2015-05-26 10:09:09 +0000
@@ -1,3 +1,9 @@
1<div class="b-snap__icon">1{{#if description}}
2 <img src="{{ icon }}" width="256" height="256">2<p>{{ description }}</p>
3</div>3{{/if}}
4{{#if prettyInstalledSize}}
5<p>Installed size: {{prettyInstalledSize}}</p>
6{{/if}}
7{{#if prettyDownloadSize}}
8<p>Download size: {{prettyDownloadSize}}</p>
9{{/if}}
410
=== modified file 'www/src/js/templates/snap-layout.hbs'
--- www/src/js/templates/snap-layout.hbs 2015-05-08 13:11:16 +0000
+++ www/src/js/templates/snap-layout.hbs 2015-05-26 10:09:09 +0000
@@ -1,13 +1,18 @@
1<div class="b-snap__banner">1<div class="b-layout__container">
2 <div class="b-snap__meta">2 <div class="b-snap__banner">
3 <h1 class="b-snap__title">{{ name }} {{ version }} {{ binary_filesize }}</h1>3 <div class="b-icon">
4 <p>4 <img src="{{ icon }}" width="70" height="70">
5 <span class="b-snap__origin" title="Origin">{{ origin }}</span>5 </div>
6 <span class="b-snap__filesize" title="Package filesize">{{ binary_filesize}}</span>6 <div class="b-snap__meta">
7 </p>7 <h1 class="b-snap__title">{{ name }} {{ version }} {{ binary_filesize }}</h1>
8 </div>8 <p>
9 <div class="b-snap__actions">9 <span title="Vendor">{{ vendor }}</span>
10 {{> installer}}10 <span>{{ binary_filesize}}</span>
11 </p>
12 </div>
13 <div class="b-snap__actions">
14 {{> installer}}
15 </div>
11 </div>16 </div>
12</div>17</div>
13<div class="region-menu"></div>18<div class="region-menu"></div>
1419
=== modified file 'www/src/js/templates/snap-menu.hbs'
--- www/src/js/templates/snap-menu.hbs 2015-05-02 09:56:14 +0000
+++ www/src/js/templates/snap-menu.hbs 2015-05-26 10:09:09 +0000
@@ -1,9 +1,11 @@
1<a class="b-snap__nav-item" href="details">1<div class="b-layout__container">
2 Details2 <a class="b-snap__nav-item" href="details">
3</a>3 Details
4<a class="b-snap__nav-item" href="reviews">4 </a>
5 Reviews5 <a class="b-snap__nav-item" href="reviews">
6</a>6 Reviews
7<a class="b-snap__nav-item" href="settings">7 </a>
8 Settings8 <a class="b-snap__nav-item" href="settings">
9</a>9 Settings
10 </a>
11</div>
1012
=== modified file 'www/src/js/templates/snaplist-item.hbs'
--- www/src/js/templates/snaplist-item.hbs 2015-05-08 13:11:16 +0000
+++ www/src/js/templates/snaplist-item.hbs 2015-05-26 10:09:09 +0000
@@ -1,11 +1,12 @@
1<div class="b-snaplist__icon">1<div class="b-icon" data-type="{{type}}">
2 <img src="{{ icon }}" alt="{{ name }} icon">2 <img src="{{ icon }}" width="90" height="90">
3</div>3</div>
4<div class="b-snaplist__name">{{ name }}</div>4<div class="b-snaplist__name">{{ name }}</div>
5{{!-- only name is shown in grid view, everything after is hidden --}}5{{!-- only name is shown in grid view, everything after is hidden --}}
6<div class="b-snaplist__size" title="Installed file size">{{ prettyInstalledSize }}</div>
6<div class="b-snaplist__version">{{ version }}</div>7<div class="b-snaplist__version">{{ version }}</div>
8<div class="b-snaplist__type">{{ type }}</div>
7<div class="b-snaplist__origin">{{ origin }}</div>9<div class="b-snaplist__origin">{{ origin }}</div>
8<div class="b-snaplist__type">{{ type }}</div>
9<div class="b-snaplist__actions">10<div class="b-snaplist__actions">
10 {{> installer}}11 {{> installer}}
11</div>12</div>
1213
=== modified file 'www/src/js/templates/store.hbs'
--- www/src/js/templates/store.hbs 2015-05-02 19:00:37 +0000
+++ www/src/js/templates/store.hbs 2015-05-26 10:09:09 +0000
@@ -1,2 +1,1 @@
1<h1>Store Snaps</h1>
2<div class="region-product"></div>1<div class="region-product"></div>
32
=== modified file 'www/src/js/views/home.js'
--- www/src/js/views/home.js 2015-04-24 20:47:44 +0000
+++ www/src/js/views/home.js 2015-05-26 10:09:09 +0000
@@ -6,6 +6,8 @@
66
7module.exports = Backbone.Marionette.LayoutView.extend({7module.exports = Backbone.Marionette.LayoutView.extend({
88
9 className: 'b-layout__container',
10
9 template : function() {11 template : function() {
10 return template();12 return template();
11 },13 },
1214
=== modified file 'www/src/js/views/snap-detail.js'
--- www/src/js/views/snap-detail.js 2015-04-11 15:14:07 +0000
+++ www/src/js/views/snap-detail.js 2015-05-26 10:09:09 +0000
@@ -4,6 +4,7 @@
4var template = require('../templates/snap-detail.hbs');4var template = require('../templates/snap-detail.hbs');
55
6module.exports = Backbone.Marionette.ItemView.extend({6module.exports = Backbone.Marionette.ItemView.extend({
7 className: 'b-snap__tab-content',
7 template: function(model) {8 template: function(model) {
8 return template(model);9 return template(model);
9 },10 },
1011
=== modified file 'www/src/js/views/snap-reviews.js'
--- www/src/js/views/snap-reviews.js 2015-04-24 23:05:53 +0000
+++ www/src/js/views/snap-reviews.js 2015-05-26 10:09:09 +0000
@@ -4,7 +4,7 @@
4var template = require('../templates/snap-reviews.hbs');4var template = require('../templates/snap-reviews.hbs');
55
6module.exports = Backbone.Marionette.ItemView.extend({6module.exports = Backbone.Marionette.ItemView.extend({
77 className: 'b-snap__tab-content',
8 template: function() {8 template: function() {
9 return template();9 return template();
10 }10 }
1111
=== modified file 'www/src/js/views/snap-settings.js'
--- www/src/js/views/snap-settings.js 2015-04-11 15:14:07 +0000
+++ www/src/js/views/snap-settings.js 2015-05-26 10:09:09 +0000
@@ -4,6 +4,7 @@
4var template = require('../templates/snap-settings.hbs');4var template = require('../templates/snap-settings.hbs');
55
6module.exports = Backbone.Marionette.ItemView.extend({6module.exports = Backbone.Marionette.ItemView.extend({
7 className: 'b-snap__tab-content',
7 template: function() {8 template: function() {
8 return template();9 return template();
9 },10 },
1011
=== modified file 'www/src/js/views/snaplist-item.js'
--- www/src/js/views/snaplist-item.js 2015-05-08 14:53:07 +0000
+++ www/src/js/views/snaplist-item.js 2015-05-26 10:09:09 +0000
@@ -13,7 +13,14 @@
1313
14module.exports = Marionette.ItemView.extend({14module.exports = Marionette.ItemView.extend({
1515
16 className: 'b-snaplist__item',16 className: function() {
17 var type = this.model.get('type');
18 var className = 'b-snaplist__item';
19 if (type) {
20 className += ' b-snaplist__item-' + type;
21 }
22 return className;
23 },
1724
18 template: function(model) {25 template: function(model) {
19 return template(model);26 return template(model);
2027
=== modified file 'www/tests/snapItemViewSpec.js'
--- www/tests/snapItemViewSpec.js 2015-05-05 14:40:14 +0000
+++ www/tests/snapItemViewSpec.js 2015-05-26 10:09:09 +0000
@@ -1,10 +1,15 @@
1var Backbone = require('backbone');1var Backbone = require('backbone');
2var Snap = require('../src/js/models/snap.js');
2var SnapItemView = require('../src/js/views/snaplist-item.js');3var SnapItemView = require('../src/js/views/snaplist-item.js');
34
4describe('SnapItemView', function() {5describe('SnapItemView', function() {
56
6 beforeEach(function() {7 beforeEach(function() {
7 this.view = new SnapItemView();8 this.view = new SnapItemView({
9 model: new Snap({
10 id: 'foo'
11 })
12 });
8 });13 });
914
10 afterEach(function() {15 afterEach(function() {
@@ -16,4 +21,11 @@
16 expect(this.view).toEqual(jasmine.any(Backbone.View));21 expect(this.view).toEqual(jasmine.any(Backbone.View));
17 });22 });
1823
24 it('should have a b-snaplist className with type modifier when present in model', function() {
25 this.view.model.unset('type');
26 expect(this.view.className()).toBe('b-snaplist__item');
27 this.view.model.set('type', 'foo');
28 expect(this.view.className()).toBe('b-snaplist__item b-snaplist__item-foo');
29 });
30
19});31});

Subscribers

People subscribed via source and target branches