diff --git a/frontend/app/services/index.js b/frontend/app/services/index.js index 70a9db4fce..b7df494470 100644 --- a/frontend/app/services/index.js +++ b/frontend/app/services/index.js @@ -34,6 +34,7 @@ angular.module('openproject.services') .service('AuthorisationService', require('./authorisation-service')) .service('GroupService', ['$http', 'PathHelper', require('./group-service')]) .service('HookService', require('./hook-service')) + .service('OverviewService', require('./overview-service')) .service('PaginationService', ['DEFAULT_PAGINATION_OPTIONS', require( './pagination-service')]) .service('PriorityService', ['$http', 'PathHelper', require( diff --git a/frontend/app/services/overview-service.js b/frontend/app/services/overview-service.js new file mode 100644 index 0000000000..a7cabc22b9 --- /dev/null +++ b/frontend/app/services/overview-service.js @@ -0,0 +1,57 @@ +//-- copyright +// OpenProject is a project management system. +// Copyright (C) 2012-2014 the OpenProject Foundation (OPF) +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See doc/COPYRIGHT.rdoc for more details. +//++ + +module.exports = function() { + + var OverviewService = { + getInplaceProperties: function() { + return { + assignee: { + type: 'select2', + attribute: 'assignee', + embedded: false, + placeholder: '-' + }, + responsible: { + type: 'select2', + attribute: 'responsible', + embedded: false, + placeholder: '-' + }, + status: { + type: 'select', + attribute: 'status.name', + embedded: true, + placeholder: '-' + } + }; + } + }; + + return OverviewService; +}; diff --git a/frontend/app/work_packages/controllers/details-tab-overview-controller.js b/frontend/app/work_packages/controllers/details-tab-overview-controller.js index 9bf6119e05..7991cba676 100644 --- a/frontend/app/work_packages/controllers/details-tab-overview-controller.js +++ b/frontend/app/work_packages/controllers/details-tab-overview-controller.js @@ -43,9 +43,10 @@ module.exports = function($scope, UserService, VersionService, HookService, + OverviewService, $q) { - // work package properties + $scope.inplaceProperties = OverviewService.getInplaceProperties(); $scope.userPath = PathHelper.staticUserPath; AuthorisationService.initModelAuth('work_package' + $scope.workPackage.id, diff --git a/frontend/app/work_packages/controllers/index.js b/frontend/app/work_packages/controllers/index.js index 432ddfd232..c6e8f9f442 100644 --- a/frontend/app/work_packages/controllers/index.js +++ b/frontend/app/work_packages/controllers/index.js @@ -52,6 +52,7 @@ angular.module('openproject.workPackages.controllers') 'UserService', 'VersionService', 'HookService', + 'OverviewService', '$q', require('./details-tab-overview-controller') ]) diff --git a/frontend/public/templates/work_packages/tabs/overview.html b/frontend/public/templates/work_packages/tabs/overview.html index 285081adcf..a1e4e6079c 100644 --- a/frontend/public/templates/work_packages/tabs/overview.html +++ b/frontend/public/templates/work_packages/tabs/overview.html @@ -27,64 +27,41 @@