diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee new file mode 100644 index 00000000..11e43d25 --- /dev/null +++ b/app/components/status-icon.coffee @@ -0,0 +1,49 @@ +`import Ember from 'ember'` + +StatusIconComponent = Ember.Component.extend + + tagName: 'span' + classNames: ['status-icon', 'icon'] + classNameBindings: ['status'] + attributeBindings: ['label:aria-label','label:title'] + + label: (-> + "Job #{@get('status')}" + ).property('status') + + hasPassed: (-> + @get('status') == 'passed' || @get('status') == 'accepted' + ).property('status') + + hasFailed: (-> + @get('status') == 'failed' || @get('status') == 'rejected' + ).property('status') + + hasErrored: (-> + @get('status') == 'errored' + ).property('status') + + wasCanceled: (-> + @get('status') == 'canceled' + ).property('status') + + isRunning: (-> + @get('status') == 'started' || + @get('status') == 'queued' || + @get('status') == 'booting' || + @get('status') == 'received' || + @get('status') == 'created' + ).property('status') + + isEmpty: (-> + unless @get('status') + true + else + if @get('status') == '' + true + else + false + + ).property('status') + +`export default StatusIconComponent` diff --git a/app/components/status-icon.js b/app/components/status-icon.js index 6fee56d5..ea01d9d6 100644 --- a/app/components/status-icon.js +++ b/app/components/status-icon.js @@ -4,6 +4,11 @@ export default Ember.Component.extend({ tagName: 'span', classNames: ['status-icon', 'icon'], classNameBindings: ['status'], + attributeBindings: ['label:aria-label', 'label:title'] + + label: function() { + return 'Job ' + this.get('status') + }.property('status'), hasPassed: function() { return this.get('status') === 'passed' || this.get('status') === 'accepted'; diff --git a/app/templates/components/jobs-item.hbs b/app/templates/components/jobs-item.hbs index b7d364bb..f36325a4 100644 --- a/app/templates/components/jobs-item.hbs +++ b/app/templates/components/jobs-item.hbs @@ -4,36 +4,36 @@
- - {{job.number}} + + {{job.number}}
{{#if job.config.os}} - {{job.config.os}} + {{job.config.os}} {{/if}}
- - {{#if languages}}{{languages}}{{else}}no language set{{/if}} + + {{#if languages}}{{languages}}{{else}}no language set{{/if}}
{{#if environment}}
- - {{environment}} + + {{environment}}
{{else}}
- - no environment variables set + + no environment variables set
{{/if}}
- - {{format-duration job.duration}} + + {{format-duration job.duration}}
{{/link-to}}