summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-09-29 10:03:58 +0200
committervarac <varacanero@zeromail.org>2016-09-30 22:00:34 +0200
commitbc95708fe005cd36a49946db22e35ae82da4584b (patch)
treee4dc5ddeb718d1a8911da0dcc0664a2d73bffe7f /widgets
parentad19d7f11b10092cdcb1f6be638072ef8d8b9867 (diff)
[wip] gitlab-builds
Diffstat (limited to 'widgets')
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.coffee11
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.html15
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.scss56
-rw-r--r--widgets/gitlab_merge_requests/gitlab_merge_requests.coffee9
-rw-r--r--widgets/gitlab_merge_requests/gitlab_merge_requests.html18
-rw-r--r--widgets/gitlab_merge_requests/gitlab_merge_requests.scss67
6 files changed, 82 insertions, 94 deletions
diff --git a/widgets/gitlab_build_status/gitlab_build_status.coffee b/widgets/gitlab_build_status/gitlab_build_status.coffee
new file mode 100644
index 0000000..e501aed
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.coffee
@@ -0,0 +1,11 @@
+class Dashing.GitlabBuildStatus extends Dashing.Widget
+
+ onData: (data) ->
+ if data.failed
+ $(@node).find('div.gitlab-build-failed').show()
+ $(@node).find('div.gitlab-build-succeeded').hide()
+ $(@node).css("background-color", "red")
+ else
+ $(@node).find('div.gitlab-build-failed').hide()
+ $(@node).find('div.gitlab-build-succeeded').show()
+ $(@node).css("background-color", "#50BA5B")
diff --git a/widgets/gitlab_build_status/gitlab_build_status.html b/widgets/gitlab_build_status/gitlab_build_status.html
new file mode 100644
index 0000000..b71d8a6
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.html
@@ -0,0 +1,15 @@
+<div class="build-failed">
+ <h1 class="gitlab-status"><span data-bind="title"></span> FAILED</h1>
+ <ul class="list-nostyle list-failed">
+ <li data-foreach-item="broken_builds">
+ <div class="label" data-bind="item.name"></div>
+ <div class="value" data-bind="item.status"></div>
+ </li>
+ </ul>
+</div>
+
+<div class="gitlab-build-succeeded">
+ <h1 class="gitlab-status">All Gitlab builds are successful</h1>
+</div>
+
+<p class="updated-at" data-bind="updatedAtMessage"></p>
diff --git a/widgets/gitlab_build_status/gitlab_build_status.scss b/widgets/gitlab_build_status/gitlab_build_status.scss
new file mode 100644
index 0000000..46e867d
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.scss
@@ -0,0 +1,56 @@
+// ----------------------------------------------------------------------------
+// Sass declarations
+// ----------------------------------------------------------------------------
+$background-color: #ec663c;
+$title-color: rgba(255, 255, 255, 0.7);
+$label-color: rgba(255, 255, 255, 0.7);
+$value-color: #fff;
+
+// ----------------------------------------------------------------------------
+// Widget-text styles
+// ----------------------------------------------------------------------------
+.widget-gitlab-build-status {
+
+ background-color: $background-color;
+
+ .title {
+ color: $title-color;
+ }
+ .updated-at {
+ color: rgba(255, 255, 255, 0.7);
+ }
+
+ ol, ul {
+ margin: 0 15px;
+ text-align: left;
+ color: $label-color;
+ }
+
+ li {
+ margin-bottom: 5px;
+ font-size: 20px;
+ }
+
+ .label {
+ color: $label-color;
+ }
+
+ .value {
+ margin-left: 12px;
+ font-weight: 600;
+ color: $value-color;
+ }
+
+ .updated-at {
+ color: rgba(0, 0, 0, 0.3);
+ }
+
+ .build-failed {
+ display: none;
+ }
+
+ .fa {
+ font-size: 10em;
+ color: $label-color;
+ }
+}
diff --git a/widgets/gitlab_merge_requests/gitlab_merge_requests.coffee b/widgets/gitlab_merge_requests/gitlab_merge_requests.coffee
deleted file mode 100644
index e68c3f6..0000000
--- a/widgets/gitlab_merge_requests/gitlab_merge_requests.coffee
+++ /dev/null
@@ -1,9 +0,0 @@
-class Dashing.GitlabMergeRequests extends Dashing.Widget
-
- ready: ->
- # This is fired when the widget is done being rendered
-
- onData: (data) ->
- # Handle incoming data
- # You can access the html node of this widget with `@node`
- # Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in. \ No newline at end of file
diff --git a/widgets/gitlab_merge_requests/gitlab_merge_requests.html b/widgets/gitlab_merge_requests/gitlab_merge_requests.html
deleted file mode 100644
index 396da97..0000000
--- a/widgets/gitlab_merge_requests/gitlab_merge_requests.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<h1 class="header">GitLab</h1>
-<h2 class="sub-header" data-bind="header"></h2>
-
-<ul class="list">
- <li data-foreach-merge="merges" class="merge">
- <div class="merge-title" data-bind="merge.title"></div>
- <div class="merge-info">
- <div data-bind="merge.creator"></div>
- <div>&nbsp;&middot;&nbsp;</div>
- <div data-bind="merge.repo"></div>
- <div>&nbsp;&middot;&nbsp;</div>
- <div data-bind="merge.updated_at"></div>
- </div>
- <div style="clear: both;"></div>
- </li>
-</ul>
-
-<p class="updated-at" data-bind="updatedAtMessage"></p>
diff --git a/widgets/gitlab_merge_requests/gitlab_merge_requests.scss b/widgets/gitlab_merge_requests/gitlab_merge_requests.scss
deleted file mode 100644
index d3c51f5..0000000
--- a/widgets/gitlab_merge_requests/gitlab_merge_requests.scss
+++ /dev/null
@@ -1,67 +0,0 @@
-// ----------------------------------------------------------------------------
-// Sass declarations
-// ----------------------------------------------------------------------------
-$background-color: teal;
-
-$heading-color: rgba(255, 255, 255, 0.7);
-$merge-title-color: rgba(255, 255, 255, 1.0);
-$merge-info-color: rgba(255, 255, 255, 1.0);
-
-// ----------------------------------------------------------------------------
-// Widget-gitlab-merge-requests styles
-// ----------------------------------------------------------------------------
-.widget-gitlab-merge-requests {
-
- background-color: $background-color;
- vertical-align: top !important;
-
- .header {
- margin-bottom: 0;
- font-size: xx-large;
- color: $heading-color;
- }
-
- .sub-header {
- color: $heading-color;
- font-size: large;
- margin-bottom: 1vh;
- }
-
- .merge {
- margin-bottom: 2vh;
- }
-
- .merge-title {
- font-size: medium;
- font-weight: bold;
- color: $merge-title-color;
- }
-
- .merge-info {
- font-size: small;
- font-style: italic;
- color: $merge-info-color;
- }
-
- .merge-info div {
- float:left;
- }
-
- .list {
- list-style: none;
- }
-
- .updated-at {
- color: rgba(0, 0, 0, 0.3);
- }
-
- ol, ul {
- margin: 0 15px;
- text-align: left;
- }
-
- ol {
- list-style-position: inside;
- }
-
-}