Starting to add Timeline notifications.

This commit is contained in:
Gunther Brunner
2014-05-12 17:47:19 +09:00
parent 7f94b0beef
commit e4e5109533
14 changed files with 253 additions and 37 deletions

View File

@@ -1,3 +1,39 @@
module.exports = function ActivityCtrl($scope) {
module.exports = function ActivityCtrl($scope, gettext, TimelineService) {
$scope.timeline = TimelineService
$scope.$watch('device.state', function (newValue, oldValue) {
if (newValue !== oldValue) {
var title = ''
var message = ''
if (oldValue === 'using') {
title = newValue
message = 'Device is now ' + newValue
} else {
title = newValue
message = '!Device is now ' + newValue
}
$scope.timeline.info({
title: title,
message: message,
serial: $scope.device.serial
})
// $scope.timeline.push({
// title: title,
// message: message,
// serial: angular.copy($scope.device.serial),
// time: Date.now()
// })
}
}, true)
}

View File

@@ -4,41 +4,47 @@
span(translate) Activity
.widget-content.padded
ul.timeline.activity-list
li.active
.timeline-time
strong Oct 3
span 4:53 PM
.timeline-icon
.bg-primary
i.fa.fa-exclamation-circle.fa-1x
.timeline-content
h2 WebSocket Disconnected
p Socket connection was lost, try again reloading the page.
div
refresh-page
ul(ng-repeat='line in timeline.lines')
li
h3 {{line.title}}
p {{line.message}}
//a(href='/')
.status.unread
//i.fa.fa-exclamation-triangle.fa-2x.activity-icon
h2.activity-title WebSocket Disconnected
span.activity-date 2014/04/30 18:33:22
p.pull-left Socket connection was lost, try again reloading the page.
.activity-buttons.pull-right
refresh-page
.clearfix
//li.list-group-item
.reviewer-info
i.fa.fa-mobile.fa-2x.activity-icon
h5.activity-title 'Nexus 5' Disconnected
em.activity-date.pull-right 2014/04/30 15:33:22
.review-text
p.pull-left Device was disconnected because it timed out.
.activity-buttons.pull-right
button.btn.btn-sm.btn-primary-outline(ng-click='')
i.fa.fa-refresh
span(translate) Reconnect device
ul.timeline.activity-list
li.active
.timeline-time
strong Oct 3
span 4:53 PM
.timeline-icon
.bg-primary
i.fa.fa-exclamation-circle.fa-1x
.timeline-content
h2 WebSocket Disconnected
p Socket connection was lost, try again reloading the page.
div
refresh-page
//a(href='/')
.status.unread
//i.fa.fa-exclamation-triangle.fa-2x.activity-icon
h2.activity-title WebSocket Disconnected
span.activity-date 2014/04/30 18:33:22
p.pull-left Socket connection was lost, try again reloading the page.
.activity-buttons.pull-right
refresh-page
.clearfix
//li.list-group-item
.reviewer-info
i.fa.fa-mobile.fa-2x.activity-icon
h5.activity-title 'Nexus 5' Disconnected
em.activity-date.pull-right 2014/04/30 15:33:22
.review-text
p.pull-left Device was disconnected because it timed out.
.activity-buttons.pull-right
button.btn.btn-sm.btn-primary-outline(ng-click='')
i.fa.fa-refresh
span(translate) Reconnect device

View File

@@ -1,7 +1,8 @@
require('./activity.css')
module.exports = angular.module('stf.activity', [
require('stf/common-ui').name
require('stf/common-ui').name,
require('stf/timeline').name
])
.run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/activity/activity.jade',