parent
1a7de4c2d6
commit
2e7345f4f0
@ -4,6 +4,7 @@ use Activity;
|
||||
use BookStack\Exceptions\NotFoundException;
|
||||
use BookStack\Repos\UserRepo;
|
||||
use BookStack\Services\ExportService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use BookStack\Http\Requests;
|
||||
use BookStack\Repos\BookRepo;
|
||||
@ -214,8 +215,14 @@ class PageController extends Controller
|
||||
} else {
|
||||
$draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown']));
|
||||
}
|
||||
$updateTime = $draft->updated_at->format('H:i');
|
||||
return response()->json(['status' => 'success', 'message' => 'Draft saved at ' . $updateTime]);
|
||||
|
||||
$updateTime = $draft->updated_at->timestamp;
|
||||
$utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset;
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Draft saved at ',
|
||||
'timestamp' => $utcUpdateTimestamp
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@
|
||||
"dropzone": "^4.0.1",
|
||||
"laravel-elixir": "^3.4.0",
|
||||
"marked": "^0.3.5",
|
||||
"moment": "^2.12.0",
|
||||
"zeroclipboard": "^2.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var moment = require('moment');
|
||||
|
||||
module.exports = function (ngApp, events) {
|
||||
|
||||
ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService',
|
||||
@ -367,7 +369,8 @@ module.exports = function (ngApp, events) {
|
||||
if (isMarkdown) data.markdown = $scope.editContent;
|
||||
|
||||
$http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => {
|
||||
$scope.draftText = responseData.data.message;
|
||||
var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate();
|
||||
$scope.draftText = responseData.data.message + moment(updateTime).format('H:m');
|
||||
if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true;
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user