Merge pull request #1666 from normanjaeckel/Mediafile
Fixed serializer and template. Fixed #1650.
This commit is contained in:
commit
08c31a6b09
@ -25,6 +25,6 @@
|
|||||||
"font-awesome-bower": "4.3.0",
|
"font-awesome-bower": "4.3.0",
|
||||||
"js-data": "~2.3.0",
|
"js-data": "~2.3.0",
|
||||||
"js-data-angular": "~3.0.0",
|
"js-data-angular": "~3.0.0",
|
||||||
"ng-file-upload": "~7.0.17"
|
"ng-file-upload": "~9.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ class MediafileSerializer(ModelSerializer):
|
|||||||
'mediafile',
|
'mediafile',
|
||||||
'uploader',
|
'uploader',
|
||||||
'filesize',
|
'filesize',
|
||||||
'filetype',
|
|
||||||
'timestamp',)
|
'timestamp',)
|
||||||
|
|
||||||
def get_filesize(self, mediafile):
|
def get_filesize(self, mediafile):
|
||||||
|
@ -96,9 +96,7 @@ function uploadFile($timeout, $scope, $state, Upload, mediafile) {
|
|||||||
file.upload = Upload.upload({
|
file.upload = Upload.upload({
|
||||||
url: '/rest/mediafiles/mediafile/' + (mediafile ? mediafile.id : ''),
|
url: '/rest/mediafiles/mediafile/' + (mediafile ? mediafile.id : ''),
|
||||||
method: mediafile ? 'PUT' : 'POST',
|
method: mediafile ? 'PUT' : 'POST',
|
||||||
fields: {title: file.title},
|
data: {mediafile: file.newFile, title: file.title}
|
||||||
file: file.mediafile,
|
|
||||||
fileFormDataName: 'mediafile'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
file.upload.then(function (response) {
|
file.upload.then(function (response) {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<div ng-if="mediafile.id">
|
<div ng-if="mediafile.id">
|
||||||
<span translate>Current value: </span>{{ mediafile.filename }}
|
<span translate>Current value: </span>{{ mediafile.filename }}
|
||||||
</div>
|
</div>
|
||||||
<input type="file" ngf-select ng-model="mediafile.mediafile" required/>
|
<input type="file" ngf-select ng-model="mediafile.newFile" required/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -50,8 +50,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="mediafile in mediafiles | filter: filter.search |
|
<tr ng-repeat="mediafile in mediafiles | filter: filter.search |
|
||||||
orderBy: sortColumn:reverse">
|
orderBy: sortColumn:reverse">
|
||||||
<td><a ng-href="{{ mediafile.mediafile }}" target="_self">{{ mediafile.title_or_filename }}</a>
|
<td><a ng-href="/media/{{ mediafile.mediafile.name }}" target="_self">{{ mediafile.title_or_filename }}</a>
|
||||||
<td class="optional">{{ mediafile.filetype }}
|
<td class="optional">{{ mediafile.mediafile.type }}
|
||||||
<td>{{ mediafile.filesize }}
|
<td>{{ mediafile.filesize }}
|
||||||
<td>{{ mediafile.timestamp }}
|
<td>{{ mediafile.timestamp }}
|
||||||
<td>{{ mediafile.uploader }}
|
<td>{{ mediafile.uploader }}
|
||||||
|
Loading…
Reference in New Issue
Block a user