cab53f0434
Renamed model to Topic. Added migrations file. Fixed #2402.
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
(function () {
|
|
|
|
'use strict';
|
|
|
|
angular.module('OpenSlidesApp.topics', [])
|
|
|
|
.factory('Topic', [
|
|
'DS',
|
|
'jsDataModel',
|
|
'gettext',
|
|
function(DS, jsDataModel, gettext) {
|
|
var name = 'topics/topic';
|
|
return DS.defineResource({
|
|
name: name,
|
|
useClass: jsDataModel,
|
|
verboseName: gettext('Topic'),
|
|
methods: {
|
|
getResourceName: function () {
|
|
return name;
|
|
},
|
|
getAgendaTitle: function () {
|
|
return this.title;
|
|
},
|
|
// link name which is shown in search result
|
|
getSearchResultName: function () {
|
|
return this.getAgendaTitle();
|
|
},
|
|
// subtitle of search result
|
|
getSearchResultSubtitle: function () {
|
|
return 'Topic';
|
|
},
|
|
},
|
|
relations: {
|
|
belongsTo: {
|
|
'agenda/item': {
|
|
localKey: 'agenda_item_id',
|
|
localField: 'agenda_item',
|
|
}
|
|
},
|
|
hasMany: {
|
|
'mediafiles/mediafile': {
|
|
localField: 'attachments',
|
|
localKeys: 'attachments_id',
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
])
|
|
|
|
.run(['Topic', function(Topic) {}]);
|
|
|
|
}());
|