File data cache header, alert with file count on document added

This commit is contained in:
jendib 2013-08-02 23:03:31 +02:00
parent f25faad262
commit 210f0dcc27
5 changed files with 13 additions and 6 deletions

View File

@ -1,7 +1,6 @@
- Reordering files (server)
- Autocomplete on document title (client/server)
- Cache headers on /file/:id/data (server)
- List opened sessions and ability to close them (client/server)
- Display logs (client)
- Users administration (client)
- Reordering files and add new files to the end (server)
- Tag stats (client/server)
- List opened sessions and ability to close them (client/server)
- Users administration (client)

View File

@ -4,7 +4,9 @@ import java.io.BufferedInputStream;
import java.io.InputStream;
import java.nio.file.Paths;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.NoResultException;
@ -252,6 +254,7 @@ public class FileResource extends BaseResource {
return Response.ok(storedfile)
.header("Content-Type", file.getMimeType())
.header("Expires", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z").format(new Date().getTime() + 3600000 * 24 * 7))
.build();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -3,7 +3,8 @@
<head>
<title>Sismics Docs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="style/bootstrap.css" type="text/css" />
<link rel="stylesheet/less" href="style/main.less" type="text/css" />
<script>

View File

@ -66,10 +66,14 @@ App.controller('DocumentEdit', function($scope, $q, $http, $state, $stateParams,
$scope.pageDocuments();
$state.transitionTo('document.view', { id: $stateParams.id });
} else {
var fileUploadCount = _.size($scope.newFiles);
$scope.alerts.unshift({
type: 'success',
msg: 'Document successfully added (with ' + fileUploadCount + ' file' + (fileUploadCount > 1 ? 's' : '') + ')'
});
$scope.document = { tags: [] };
$scope.newFiles = [];
$scope.loadDocuments();
$scope.alerts.push({ type: 'success', msg: 'Document successfully added' });
}
}