Added name property to api user representer. Using this in wp overview header.

pull/1579/head
Richard 10 years ago
parent 8cd143eaed
commit 93aa00dd4d
  1. 1
      app/assets/javascripts/angular/work_packages/controllers/work-package-details-controller.js
  2. 1
      lib/api/v3/users/user_representer.rb
  3. 2
      public/templates/work_packages.list.details.html

@ -56,6 +56,7 @@ angular.module('openproject.workPackages.controllers')
$scope.activities = workPackage.embedded.activities;
$scope.latestActitivies = $scope.activities.reverse().slice(0, 3);
$scope.watchers = workPackage.embedded.watchers;
$scope.author = workPackage.embedded.author;
// work package properties
$scope.presentWorkPackageProperties = [];

@ -52,6 +52,7 @@ module API
property :login, render_nil: true
property :firstname, as: :firstName, render_nil: true
property :lastname, as: :lastName, render_nil: true
property :name, getter: -> (*) { model.try(:name) }, render_nil: true
property :mail, render_nil: true
property :avatar, getter: ->(*) { gravatar_image_url(mail) }, render_nil: true
property :created_at, getter: -> (*) { model.created_on.utc.iso8601 }, render_nil: true

@ -33,7 +33,7 @@
<i class="star icon-star1"/>
<a href>#{{ workPackage.props.id }}</a>
<span ng-bind="I18n.t('js.label_added_by')"/>
<a href ng-bind="workPackage.props.authorName"/>.
<a ng-href="/users/{{ author.props.id }}" ng-bind="author.props.name"/>.
<span ng-bind="I18n.t('js.label_last_updated_on')"/>
<span ng-bind="workPackage.props.updatedAt|date:'longDate'"/>.
</span>

Loading…
Cancel
Save