Permalink
Browse files

Add CircleCI widget

  • Loading branch information...
1 parent d0ce53f commit eebb83f4c11a16de781def4cf9d494891bec6dcf @mtchavez committed Oct 4, 2013
Showing with 192 additions and 0 deletions.
  1. +18 −0 widgets/circle_ci/circle_ci.coffee
  2. +20 −0 widgets/circle_ci/circle_ci.html
  3. +154 −0 widgets/circle_ci/circle_ci.scss
@@ -0,0 +1,18 @@
+class Dashing.CircleCi extends Dashing.Widget
+ ready: ->
+ @get('unordered')
+ if @get('unordered')
+ $(@node).find('ol').remove()
+ else
+ $(@node).find('ul').remove()
+
+ if @items and @items.length > 0
+ @_checkStatus(@items[0].state)
+
+ onData: (data) ->
+ if data.items and data.items.length > 0
+ @_checkStatus(data.items[0].state)
+
+ _checkStatus: (status) ->
+ $(@node).removeClass('failed passed running started broken timedout no_tests fixed success canceled')
+ $(@node).addClass(status)
@@ -0,0 +1,20 @@
+<h1 class="title" data-bind="title"></h1>
+
+<ol>
+ <li data-foreach-item="items">
+ <span class="label" data-bind="item.label"></span>
+ <span class="value" data-bind="item.value"></span>
+ </li>
+</ol>
+
+<ul class="list-nostyle">
+ <li data-foreach-item="items">
+ <span class="label" data-bind="item.label"></span>
+ <span class="value" data-bind="item.value"></span>
+ <span class="committer" data-bind="item.committer"></span>
+ <div class="climate" data-bind="item.climate"></div>
+ </li>
+</ul>
+
+<!-- <p class="more-info" data-bind="moreinfo"></p> -->
+<p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,154 @@
+// ----------------------------------------------------------------------------
+// Sass declarations
+// ----------------------------------------------------------------------------
+$value-color: rgba(255, 255, 255, 0.8);
+$background-color: #78A300;
+$background-default-color: #e5e5e5;
+$background-error-color: #903d3d;
+$background-passed-color: #6fb269;
+$background-started-color: #84c0d7;
+$background-queued-color: #84c0d7;
+$background-broken-color: #222426;
+$background-no-test-color: #d2ab59;
+
+$title-color: rgba(255, 255, 255, 0.8);
+$label-color: rgba(255, 255, 255, 0.8);
+$moreinfo-color: rgba(255, 255, 255, 0.8);
+
+
+// ----------------------------------------------------------------------------
+// Font
+// ----------------------------------------------------------------------------
+@font-face {
+ font-family: 'ClimaconsRegular';
+ src: url('/assets/weather.eot');
+ src: url('/assets/weather.eot') format('embedded-opentype'),
+ url('/assets/weather.woff') format('woff'),
+ url('/assets/weather.ttf') format('truetype'),
+ url('/assets/weather.svg#ClimaconsRegular') format('svg');
+}
+
+// ----------------------------------------------------------------------------
+// Widget-list styles
+// ----------------------------------------------------------------------------
+.widget-circle-ci {
+
+ background-color: $background-default-color;
+ vertical-align: top;
+
+ img {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+ opacity: 0.05;
+ }
+
+ .title {
+ color: $title-color;
+ font-size: 2.0em;
+ font-weight: bolder;
+ }
+
+ ol, ul {
+ margin: 0 15px;
+ text-align: left;
+ color: $label-color;
+ }
+
+ ul::-webkit-scrollbar {
+ display: none;
+ }
+
+ ol {
+ list-style-position: inside;
+ }
+
+ li {
+ margin-bottom: 5px;
+ }
+
+ .list-nostyle {
+ list-style: none;
+ }
+
+ .label {
+ text-align: center;
+ display: block;
+ color: $label-color;
+ font-size: 24px;
+ word-wrap: break-word;
+ }
+
+ .value {
+ text-align: center;
+ display: block;
+ font-weight: 600;
+ color: $value-color;
+ font-size: 24px;
+ word-wrap: break-word;
+ width: 400px;
+ margin: 0 auto;
+ font-size: 1.0em;
+ }
+
+.committer {
+ text-align: center;
+ display: block;
+ color: $value-color;
+ font-size: 24px;
+ word-wrap: break-word;
+ width: 300px;
+ margin: 0 auto;
+ font-size: 1.3em;
+ }
+
+ .updated-at {
+ color: rgba(0, 0, 0, 0.3);
+ }
+
+ .more-info {
+ color: $moreinfo-color;
+ }
+
+ div.climate {
+ font-family: 'ClimaconsRegular';
+ position: absolute;
+ left: 30px;
+ bottom: 14px;
+ font-size: 3.5em;
+ color: rgba(255, 255, 255, 0.9)
+ }
+
+ &.failed,
+ &.errored,
+ &.timedout {
+ background-color: $background-error-color;
+ }
+
+ &.started,
+ &.running {
+ background-color: $background-started-color;
+ }
+
+ &.queued {
+ background-color: $background-queued-color;
+ }
+
+ &.passed,
+ &.success,
+ &.fixed {
+ background-color: $background-passed-color;
+ }
+
+ &.canceled,
+ &.no_tests,
+ &.broken {
+ background-color: $background-default-color;
+ color: $background-broken-color;
+
+ ul, li, div, .title, .committer, .value, .label, .climate {
+ color: $background-broken-color;
+ }
+ }
+
+}

0 comments on commit eebb83f

Please sign in to comment.