The previous excerpt was a simple truncated raw message. Starting with this commit, the raw content of the draft is cooked and an excerpt is extracted from it. The logic for extracting the excerpt mimics the the `ExcerptParser` class, but does not implement all functionality, being a much simpler implementation. The two draft controllers have been merged into one and the /draft.json route has been changed to /drafts.json to be consistent with the other route names.
77 lines
3.1 KiB
JavaScript
77 lines
3.1 KiB
JavaScript
export default {
|
|
"/drafts.json": {
|
|
drafts: [
|
|
{
|
|
excerpt: "A fun new topic for testing drafts. ",
|
|
truncated: true,
|
|
created_at: "2018-07-22T22:20:14.608Z",
|
|
draft_key: "new_topic",
|
|
sequence: 26,
|
|
draft_username: "eviltrout",
|
|
avatar_template: "/user_avatar/localhost/eviltrout/{size}/2_1.png",
|
|
data:
|
|
'{"reply":"A fun new topic for testing drafts. \\n","action":"createTopic","title":"This here is a new topic, friend","categoryId":3,"archetypeId":"regular","metaData":null,"composerTime":24532,"typingTime":2500}',
|
|
topic_id: null,
|
|
username: "eviltrout",
|
|
name: null,
|
|
user_id: 1,
|
|
title: null,
|
|
category_id: 3,
|
|
archetype: null
|
|
},
|
|
{
|
|
excerpt:
|
|
"The last reply to this topic was 6 months ago. Your reply will bump the topic to the top of its list",
|
|
truncated: true,
|
|
created_at: "2018-07-20T19:04:32.023Z",
|
|
draft_key: "topic_280",
|
|
sequence: 0,
|
|
draft_username: "eviltrout",
|
|
avatar_template: "/letter_avatar_proxy/v2/letter/p/a87d85/{size}.png",
|
|
data:
|
|
'{"reply":"The last reply to this topic was 6 months ago. Your reply will bump the topic to the top of its list.","action":"reply","categoryId":8,"archetypeId":"regular","metaData":null,"composerTime":139499,"typingTime":6100}',
|
|
topic_id: 280,
|
|
username: "zogstrip",
|
|
name: "zogstrip",
|
|
user_id: 6,
|
|
title: "Django hangs if I write gibberish",
|
|
slug: "django-hangs-if-i-write-gibberish",
|
|
category_id: 8,
|
|
archetype: "regular"
|
|
},
|
|
{
|
|
excerpt: "here goes a reply to a PM.",
|
|
created_at: "2018-07-20T16:58:47.433Z",
|
|
draft_key: "topic_93",
|
|
sequence: 0,
|
|
draft_username: "eviltrout",
|
|
avatar_template: "/user_avatar/localhost/eviltrout/{size}/2_1.png",
|
|
data:
|
|
'{"reply":"here goes a reply to a PM :slight_smile:","action":"reply","categoryId":3,"postId":212,"archetypeId":"regular","whisper":false,"metaData":null,"composerTime":455711,"typingTime":5400}',
|
|
topic_id: 93,
|
|
username: "eviltrout",
|
|
name: null,
|
|
user_id: 1,
|
|
title: "Hello dear friend, good to see you again",
|
|
slug: "hello-dear-friend-good-to-see-you-again",
|
|
archetype: "private_message"
|
|
}
|
|
]
|
|
},
|
|
"/drafts/topic_280.json": {
|
|
draft:
|
|
'{"reply":"This is a draft of the first post","action":"reply","categoryId":1,"archetypeId":"regular","metaData":null,"composerTime":2863,"typingTime":200}',
|
|
draft_sequence: 42
|
|
},
|
|
"/drafts/topic_281.json": {
|
|
draft:
|
|
'{"reply":"dum de dum da ba.","action":"createTopic","title":"dum da ba dum dum","categoryId":null,"archetypeId":"regular","metaData":null,"composerTime":540879,"typingTime":3400}',
|
|
draft_sequence: 0
|
|
},
|
|
"/drafts/topic_9.json": {
|
|
draft:
|
|
'{"reply":"This is a draft of the first post","action":"reply","categoryId":1,"archetypeId":"regular","metaData":null,"composerTime":2863,"typingTime":200}',
|
|
draft_sequence: 42
|
|
}
|
|
};
|