1
0

project_details.controller.js 789 B

12345678910111213141516171819202122232425262728293031323334
  1. Template.deploymentsList.helpers({
  2. deployments: function () {
  3. return DeploymentService.list();
  4. }
  5. });
  6. Template.deploymentDetails.helpers({
  7. format: function() {
  8. return this.data.replace(/\n/g, '<br />');
  9. },
  10. running: function() {
  11. var string = this.status;
  12. if( !string ) {
  13. return '';
  14. }
  15. return string.charAt(0).toUpperCase() + string.slice(1);
  16. },
  17. deployment_status: function() {
  18. switch( this.status ) {
  19. case 'closed' :
  20. return this.output[this.output.length - 1].error ? 'bg-danger' : 'bg-success';
  21. case 'pending' :
  22. return 'bg-info';
  23. default :
  24. return 'bg-default';
  25. }
  26. }
  27. });
  28. Template.deploymentBtn.helpers({
  29. running: function() {
  30. return this.status === 'pending' ? 'visible' : 'hidden';
  31. }
  32. })