Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #452 from huwshimi/uncommitted-circles
Browse files Browse the repository at this point in the history
Uncommitted circles

Replace the uncommitted background with circles.
  • Loading branch information
jujugui committed Jul 24, 2014
2 parents 7a91bcb + 9ab5e36 commit 0e6058a
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 16 deletions.
5 changes: 4 additions & 1 deletion app/templates/container-token-units.handlebars
@@ -1,6 +1,9 @@
{{#units}}
<li class="unit {{#unless agent_state }}uncommitted{{/unless}}">
<img src="{{icon}}" alt="{{service}}"/>
<span class="name">{{displayName}}</span>
<span class="name">
{{displayName}}
<span class="unit-uncommitted">&deg;</span>
</span>
</li>
{{/units}}
5 changes: 4 additions & 1 deletion app/templates/container-token.handlebars
@@ -1,6 +1,9 @@
<div class="token">
<div class="top">
<span class="title">{{ displayName }}</span>
<span class="title">
{{ displayName }}
<span class="token-uncommitted">&deg;</span>
</span>
<ul class="service-icons"></ul>
</div>
{{#if displayDelete}}
Expand Down
5 changes: 4 additions & 1 deletion app/templates/machine-token.handlebars
@@ -1,6 +1,9 @@
<div class="token">
<div class="top">
<span class="title">{{ displayName }}</span>
<span class="title">
{{ displayName }}
<span class="token-uncommitted">&deg;</span>
</span>
<span class="service-icons">
{{#units}}
<img src="{{icon}}" alt="{{service}}" class="unit">
Expand Down
7 changes: 5 additions & 2 deletions lib/views/machine-view/container-token.less
Expand Up @@ -13,12 +13,15 @@
margin: 0 -20px;
padding: 5px 20px;

&.uncommitted {
background-color: #ddf4fc;
&.uncommitted .unit-uncommitted {
display: inline-block;
}
&:last-child {
margin-bottom: 0;
}
.unit-uncommitted {
display: none;
}
img {
vertical-align: middle;
margin: 0 7px 0 0;
Expand Down
16 changes: 9 additions & 7 deletions lib/views/machine-view/machine-view-token-base.less
Expand Up @@ -33,17 +33,19 @@
display: block;
}
}
&.uncommitted {
background-color: #ddf4fc;

&:hover,
&.active {
background-color: #c5edfb;
}
&.uncommitted .token-uncommitted {
display: inline-block;
}
span {
display: block;
}
.unit-uncommitted,
.token-uncommitted {
.uncommitted-circle;
}
.token-uncommitted {
display: none;
}
.top {
.display-flex;
overflow: hidden;
Expand Down
7 changes: 7 additions & 0 deletions lib/views/mixins.less
Expand Up @@ -133,3 +133,10 @@
-ms-flex: @grow;
flex: @grow;
}
.uncommitted-circle {
vertical-align: bottom;
margin-left: 1px;
color: @uncommitted-colour;
font-size: 32px;
line-height: 0px;
}
1 change: 1 addition & 0 deletions lib/views/stylesheet.less
Expand Up @@ -59,6 +59,7 @@ This is a general guide on how to structure your classes.
@navbar-border-light: #2d2928;
@text-colour: #505050;
@border-radius: 2px;
@uncommitted-colour: #19b6ee;

// Imports need to be after vars.
@import "typography.less";
Expand Down
10 changes: 6 additions & 4 deletions test/test_machine_view_panel.js
Expand Up @@ -798,8 +798,8 @@ describe('machine view panel view', function() {
'models are out of sync with displayed list');
list.each(function(item, index) {
var m = machines.item(index);
assert.equal(item.one('.title').get('text'), m.displayName,
'displayed item does not match model');
assert.equal(item.one('.title').get('text').replace(/\s+/g, ' ').trim(),
m.displayName + ' °', 'displayed item does not match model');
});
});

Expand Down Expand Up @@ -867,13 +867,15 @@ describe('machine view panel view', function() {
selector + '[data-id="' + machineModel.get('id') + '"]');
assert.notEqual(item, null, 'machine was not initially displayed');
assert.equal(
item.one('.title').get('text'), machineModel.get('displayName'),
item.one('.title').get('text').replace(/\s+/g, ' ').trim(),
machineModel.get('displayName') + ' °',
'initial machine names do not match');
machineModel.set('id', id);
item = container.one(selector + '[data-id="' + id + '"]');
assert.notEqual(item, null, 'machine was not displayed post-update');
assert.equal(
item.one('.title').get('text'), machineModel.get('displayName'),
item.one('.title').get('text').replace(/\s+/g, ' ').trim(),
machineModel.get('displayName') + ' °',
'machine names do not match post-update');
});

Expand Down

0 comments on commit 0e6058a

Please sign in to comment.