mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 03:51:26 +01:00
closes #4668
This commit is contained in:
@@ -50,6 +50,13 @@
|
||||
|
||||
"topic-locked": "Topic Locked",
|
||||
"post-edit-duration-expired": "You are only allowed to edit posts for %1 second(s) after posting",
|
||||
"post-edit-duration-expired-minutes": "You are only allowed to edit posts for %1 minute(s) after posting",
|
||||
"post-edit-duration-expired-minutes-seconds": "You are only allowed to edit posts for %1 minute(s) %2 second(s) after posting",
|
||||
"post-edit-duration-expired-hours": "You are only allowed to edit posts for %1 hour(s) after posting",
|
||||
"post-edit-duration-expired-hours-minutes": "You are only allowed to edit posts for %1 hour(s) %2 minute(s) after posting",
|
||||
"post-edit-duration-expired-days": "You are only allowed to edit posts for %1 day(s) after posting",
|
||||
"post-edit-duration-expired-days-hours": "You are only allowed to edit posts for %1 day(s) %2 hour(s) after posting",
|
||||
|
||||
|
||||
"content-too-short": "Please enter a longer post. Posts should contain at least %1 character(s).",
|
||||
"content-too-long": "Please enter a shorter post. Posts can't be longer than %1 character(s).",
|
||||
|
||||
@@ -168,6 +168,37 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
|
||||
postContainer.on('click', '[component="post/edit"]', function() {
|
||||
var btn = $(this);
|
||||
|
||||
var timestamp = parseInt(getData(btn, 'data-timestamp'), 10);
|
||||
var postEditDuration = parseInt(ajaxify.data.postEditDuration, 10);
|
||||
if (postEditDuration && Date.now() - timestamp > postEditDuration * 1000) {
|
||||
var numDays = Math.floor(postEditDuration / 86400);
|
||||
var numHours = Math.floor((postEditDuration % 86400) / 3600);
|
||||
var numMinutes = Math.floor(((postEditDuration % 86400) % 3600) / 60);
|
||||
var numSeconds = ((postEditDuration % 86400) % 3600) % 60;
|
||||
var msg = '[[error:post-edit-duration-expired, ' + postEditDuration + ']]';
|
||||
if (numDays) {
|
||||
if (numHours) {
|
||||
msg = '[[error:post-edit-duration-expired-days-hours, ' + numDays + ', ' + numHours + ']]';
|
||||
} else {
|
||||
msg = '[[error:post-edit-duration-expired-days, ' + numDays + ']]';
|
||||
}
|
||||
} else if (numHours) {
|
||||
if (numMinutes) {
|
||||
msg = '[[error:post-edit-duration-expired-hours-minutes, ' + numHours + ', ' + numMinutes + ']]';
|
||||
} else {
|
||||
msg = '[[error:post-edit-duration-expired-hours, ' + numHours + ']]';
|
||||
}
|
||||
} else if (numMinutes) {
|
||||
if (numSeconds) {
|
||||
msg = '[[error:post-edit-duration-expired-minutes-seconds, ' + numMinutes + ', ' + numSeconds + ']]';
|
||||
} else {
|
||||
msg = '[[error:post-edit-duration-expired-minutes, ' + numMinutes + ']]';
|
||||
}
|
||||
}
|
||||
return app.alertError(msg);
|
||||
}
|
||||
|
||||
$(window).trigger('action:composer.post.edit', {
|
||||
pid: getData(btn, 'data-pid')
|
||||
});
|
||||
|
||||
@@ -264,6 +264,7 @@ topicsController.get = function(req, res, callback) {
|
||||
data['downvote:disabled'] = parseInt(meta.config['downvote:disabled'], 10) === 1;
|
||||
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
||||
data.bookmarkThreshold = parseInt(meta.config.bookmarkThreshold, 10) || 5;
|
||||
data.postEditDuration = parseInt(meta.config.postEditDuration, 10);
|
||||
data.scrollToMyPost = settings.scrollToMyPost;
|
||||
data.rssFeedUrl = nconf.get('relative_path') + '/topic/' + data.tid + '.rss';
|
||||
data.pagination = pagination.create(currentPage, pageCount);
|
||||
|
||||
@@ -1 +1 @@
|
||||
data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}" itemscope itemtype="http://schema.org/Comment"
|
||||
data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}" itemscope itemtype="http://schema.org/Comment"
|
||||
Reference in New Issue
Block a user