fix file modal + fix file link in audit log + high quality thumbs

This commit is contained in:
Benjamin Gamard 2017-11-23 01:16:54 +01:00
parent 6596eba6ca
commit dc28ebfa50
6 changed files with 8 additions and 8 deletions

View File

@ -171,7 +171,7 @@ public class File implements Loggable {
@Override
public String toMessage() {
// Attached document ID and name concatenated
return documentId + name;
return (documentId == null ? Strings.repeat(" ", 36) : documentId) + name;
}
/**

View File

@ -129,8 +129,8 @@ public class FileUtil {
if (image != null) {
// Generate thumbnails from image
BufferedImage web = Scalr.resize(image, Scalr.Method.AUTOMATIC, Scalr.Mode.AUTOMATIC, 1280, Scalr.OP_ANTIALIAS);
BufferedImage thumbnail = Scalr.resize(image, Scalr.Method.AUTOMATIC, Scalr.Mode.AUTOMATIC, 256, Scalr.OP_ANTIALIAS);
BufferedImage web = Scalr.resize(image, Scalr.Method.ULTRA_QUALITY, Scalr.Mode.AUTOMATIC, 1280);
BufferedImage thumbnail = Scalr.resize(image, Scalr.Method.ULTRA_QUALITY, Scalr.Mode.AUTOMATIC, 256);
image.flush();
// Write "web" encrypted image

View File

@ -20,7 +20,7 @@ angular.module('docs').controller('FileView', function($uibModal, $state, $state
$timeout(function () {
// After all router transitions are passed,
// if we are still on the file route, go back to the document
if ($state.current.name === 'document.view.content.file') {
if ($state.current.name === 'document.view.content.file' || $state.current.name === 'document.default.file') {
$state.go('^', {id: $stateParams.id});
}
});

View File

@ -20,8 +20,8 @@
<span ng-switch-when="Document">
<a ng-href="#/document/view/{{ log.target }}">{{ log.message }}</a>
</span>
<span ng-switch-when="File">
<a ng-if="log.message" ng-href="#/document/view/{{ log.message | limitTo: 36 }}/content/file/{{ log.target }}">
<span ng-switch-when="File" ng-init="hasDocument = log.message.substring(0, 36).trim().length > 0">
<a ng-if="log.message" ng-href="#/document/{{ hasDocument ? 'view/' + log.message.substring(0, 36) + '/content/' : '' }}file/{{ log.target }}">
<span ng-if="log.message.length > 36">{{ log.message | limitTo: 1000 : 36 }}</span>
<span ng-if="log.message.length == 36">{{ 'open' | translate }}</span>
</a>

View File

@ -159,7 +159,7 @@
next-text="{{ 'pagination.next' | translate }}"
first-text="{{ 'pagination.first' | translate }}"
last-text="{{ 'pagination.last' | translate }}"
total-items="totalDocuments" items-per-page="limit" max-size="5" ng-model="$parent.currentPage"></ul>
total-items="totalDocuments" items-per-page="$parent.limit" max-size="5" ng-model="$parent.currentPage"></ul>
<label class="sr-only" for="pagesizeSelect">{{ 'document.page_size' | translate }}</label>
<select ng-model="limit" id="pagesizeSelect" class="form-control">
<option value="10">{{ 'document.page_size_10' | translate }}</option>