mirror of
https://github.com/writefreely/writefreely
synced 2024-11-24 01:23:04 +00:00
Link title directly to post page
This commit is contained in:
parent
ec7d336bc2
commit
82de4558de
1 changed files with 2 additions and 2 deletions
|
@ -193,7 +193,7 @@ var createPostEl = function(post, owned, singleUser) {
|
||||||
let p = H.createPost(post.id, "", post.body)
|
let p = H.createPost(post.id, "", post.body)
|
||||||
var title = (post.title || p.title || post.id);
|
var title = (post.title || p.title || post.id);
|
||||||
title = title.replace(/</g, "<");
|
title = title.replace(/</g, "<");
|
||||||
var postLink = (singleUser ? '/d/' : '/') + post.id + '/edit'
|
var postLink = (singleUser ? '/d/' : '/') + post.id
|
||||||
$post.id = 'post-' + post.id;
|
$post.id = 'post-' + post.id;
|
||||||
$post.className = 'post';
|
$post.className = 'post';
|
||||||
$post.innerHTML = '<h3><a href="' + postLink + '">' + title + '</a></h3>';
|
$post.innerHTML = '<h3><a href="' + postLink + '">' + title + '</a></h3>';
|
||||||
|
@ -203,7 +203,7 @@ var createPostEl = function(post, owned, singleUser) {
|
||||||
posted = getFormattedDate(new Date(post.created))
|
posted = getFormattedDate(new Date(post.created))
|
||||||
}
|
}
|
||||||
var hasDraft = H.exists('draft' + post.id);
|
var hasDraft = H.exists('draft' + post.id);
|
||||||
$post.innerHTML += '<h4><date>' + posted + '</date> <a class="action" href="' + postLink + '">edit' + (hasDraft ? 'ed' : '') + '</a> <a class="delete action" href="/' + post.id + '" onclick="delPost(event, \'' + post.id + '\'' + (owned === true ? ', true' : '') + ')">delete</a> '+movePostHTML(post.id)+'</h4>';
|
$post.innerHTML += '<h4><date>' + posted + '</date> <a class="action" href="' + postLink + '/edit">edit' + (hasDraft ? 'ed' : '') + '</a> <a class="delete action" href="/' + post.id + '" onclick="delPost(event, \'' + post.id + '\'' + (owned === true ? ', true' : '') + ')">delete</a> '+movePostHTML(post.id)+'</h4>';
|
||||||
|
|
||||||
if (post.error) {
|
if (post.error) {
|
||||||
$post.innerHTML += '<p class="error"><strong>Sync error:</strong> ' + post.error + ' <nav><a href="#" onclick="localPosts.dismissError(event, this)">dismiss</a> <a href="#" onclick="localPosts.deletePost(event, this, \''+post.id+'\')">remove post</a></nav></p>';
|
$post.innerHTML += '<p class="error"><strong>Sync error:</strong> ' + post.error + ' <nav><a href="#" onclick="localPosts.dismissError(event, this)">dismiss</a> <a href="#" onclick="localPosts.deletePost(event, this, \''+post.id+'\')">remove post</a></nav></p>';
|
||||||
|
|
Loading…
Reference in a new issue