Created
May 12, 2015 17:20
-
-
Save jonstorer/dbc01c25055a6ca7538c to your computer and use it in GitHub Desktop.
angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='audit-event-{{ audit_event.id }}' | |
tooltip-html-unsafe='{{ message }}' | |
tooltip-trigger='mouseenter' | |
tooltip-placement='right' | |
sd-auto-tooltip | |
sd-auto-tooltip-if='{{ !audit_event.viewed_at }}' | |
sd-auto-tooltip-delay='{{ $index * 2000 }}' | |
sd-auto-tooltip-duration='{{ 1500 }}' | |
> | |
<i class='icon icon-icon-circle-{{ audit_event.icon }}'></i> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShakeWeb.controller('AuditEventShowController', [ | |
'$scope', '$compile', 'dataservice', '$templateCache' function( | |
$scope, $compile, dataservice, $templateCache ) { | |
var map = { | |
DraftCreatedAuditEvent: | |
'<div>' + | |
'<p>Draft Created by {{ audit_event.created_by_email }}</p>' + | |
'<p>{{ audit_event.created_at }}</p>' + | |
'</div>', | |
AuthenticatedESignAuditEvent: | |
'<div>' + | |
'<p>ESigned by {{ audit_event.signed_by_email }}</p>' + | |
'<p>while logged in as {{ audit_event.authorized_as_email }}</p>' + | |
'<p>{{ audit_event.created_at }}</p>' + | |
'</div>', | |
RequestedESignAuditEvent: | |
'<div>' + | |
'<p>ESigned by {{ audit_event.signed_by_email }}</p>' + | |
'<p>while logged in as {{ audit_event.authorized_as_email }}</p>' + | |
'<p>{{ audit_event.created_at }}</p>' + | |
'</div>', | |
AgreementAcceptedAuditEvent: | |
'<div>' + | |
'<p>Agreement Completed</p>' + | |
'<p>{{ audit_event.created_at }}</p>' + | |
'</div>', | |
NotificationSentAuditEvent: | |
'<div>' + | |
'<p>Agreement copy emailed by Shake to {{ audit_event.recipient_email }}</p>' + | |
'<p>{{ audit_event.created_at }}</p>' + | |
'</div>' | |
}; | |
var compiledElement = $compile(angular.element(map[$scope.audit_event.type]))($scope); | |
$scope.$apply(); | |
$scope.message = compiledElement.html(); | |
if (!!$scope.viewed_at) { | |
var auditEventService = new dataservice.audit_events(); | |
auditEventService.$patch({ | |
agreementId: $scope.audit_event.agreement_id, | |
id: $scope.audit_event.id | |
}).then(function(audit_event){ | |
$scope.audit_event = audit_event; | |
}); | |
} | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment