SCM status dialog changes. Title is now project name. Added created on date with formatting.

This commit is contained in:
chouseknecht
2013-09-04 09:05:49 -04:00
parent a2d36a0c3f
commit 12a4b2346c
4 changed files with 17 additions and 7 deletions

View File

@@ -11,13 +11,13 @@ angular.module('ProjectStatusDefinition', [])
'ProjectStatusForm', {
name: 'project_update',
editTitle: 'Latest SCM Update',
editTitle: 'SCM Status',
well: false,
'class': 'horizontal-narrow',
fields: {
name: {
label: 'Name',
created: {
label: 'Created',
type: 'text',
readonly: true
},

View File

@@ -11,9 +11,9 @@
angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDefinition'])
.factory('ProjectStatus', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GenerateForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'ProjectStatusForm',
'Prompt', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'ProjectStatusForm', 'FormatDate',
function($rootScope, $location, $log, $routeParams, Rest, Alert, GenerateForm, Prompt, ProcessErrors, GetBasePath,
FormatDate, ProjectStatusForm) {
FormatDate, ProjectStatusForm, FormatDate) {
return function(params) {
var project_id = params.project_id;
@@ -33,7 +33,12 @@ angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDef
var results = data.results[data.results.length - 1]; //get the latest
for (var fld in form.fields) {
if (results[fld]) {
scope[fld] = results[fld];
if (fld == 'created') {
scope[fld] = FormatDate(new Date(results[fld]));
}
else {
scope[fld] = results[fld];
}
}
else {
if (results.summary_fields.project[fld]) {
@@ -47,6 +52,7 @@ angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDef
scope.formModalActionLabel = 'OK';
scope.formModalCancelShow = false;
scope.formModalInfo = false;
scope.formModalHeader = results.summary_fields.project.name + '<span class="subtitle"> - SCM Status</span>';
$('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none');
$('#form-modal').addClass('skinny-modal');
if (!scope.$$phase) {

View File

@@ -45,6 +45,10 @@ body {
}
}
.subtitle {
font-size: 16px;
}
.overlay {
display: none;
position: absolute;

View File

@@ -220,7 +220,7 @@
<div class="modal-header">
<button type="button" class="close" data-target="#form-modal"
data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 ng-bind="formModalHeader"></h3>
<h3 ng-bind-html-unsafe="formModalHeader"></h3>
</div>
<div class="modal-body" id="form-modal-body"></div>
<div class="modal-footer">