discourse/test/javascripts/fixtures/poll.js.es6

735 lines
24 KiB
JavaScript

export default {
"/t/13.json": {
post_stream: {
posts: [
{
id: 16,
username: "tgx",
avatar_template: "/images/avatar.png",
created_at: "2017-01-31T09:11:11.281Z",
cooked:
'<div class="poll" data-poll-status="open" data-poll-name="poll" data-poll-type="number" data-poll-min="1" data-poll-max="20" data-poll-step="1" data-poll-public="true">\n<div>\n<div class="poll-container"><ul>\n<li data-poll-option-id="4d8a15e3cc35750f016ce15a43937620">1</li>\n<li data-poll-option-id="cd314db7dfbac2b10687b6f39abfdf41">2</li>\n<li data-poll-option-id="68b434ff88aeae7054e42cd05a4d9056">3</li>\n<li data-poll-option-id="aa2393b424f2f395abb63bf785760a3b">4</li>\n<li data-poll-option-id="8b2f2930cac0574c3450f5db9a6fb7f9">5</li>\n<li data-poll-option-id="60cad69e0cfcb3fa77a68d11d3758002">6</li>\n<li data-poll-option-id="9ab1070dec27185440cdabb4948a5e9a">7</li>\n<li data-poll-option-id="99944bf07088f815a966d585daed6a7e">8</li>\n<li data-poll-option-id="345a83050400d78f5fac98d381b45e23">9</li>\n<li data-poll-option-id="46c01f638a50d86e020f47469733b8be">10</li>\n<li data-poll-option-id="07f7f85b2a3809faff68a35e81a664eb">11</li>\n<li data-poll-option-id="b3e8c14e714910cb8dd7089f097be133">12</li>\n<li data-poll-option-id="b4f15431e07443c372d521e4ed131abe">13</li>\n<li data-poll-option-id="a77bc9a30933e5af327211db2da46e17">14</li>\n<li data-poll-option-id="303d7c623da1985e94a9d27d43596934">15</li>\n<li data-poll-option-id="4e885ead68ff4456f102843df9fbbd7f">16</li>\n<li data-poll-option-id="cbf6e2b72e403b12d7ee63a138f32647">17</li>\n<li data-poll-option-id="9364fa2d67fbd62c473165441ad69571">18</li>\n<li data-poll-option-id="eb8661f072794ea57baa7827cd8ffc88">19</li>\n<li data-poll-option-id="b373436e858c0821135f994a5ff3345f">20</li>\n</ul></div>\n<div class="poll-info">\n<p><span class="info-number">0</span><span class="info-text">voters</span></p>\n<p>Votes are public.</p>\n</div>\n</div>\n<div class="poll-buttons"><a title="Display the poll results">Show results</a></div>\n</div>',
post_number: 1,
post_type: 1,
updated_at: "2017-01-31T09:11:11.281Z",
reply_count: 0,
quote_count: 0,
incoming_link_count: 0,
reads: 1,
score: 0,
yours: true,
topic_id: 13,
topic_slug: "this-is-a-topic-for-testing-number-poll",
version: 1,
can_edit: true,
can_delete: false,
can_recover: true,
can_wiki: true,
read: true,
actions_summary: [
{ id: 3, can_act: true },
{ id: 4, can_act: true },
{ id: 5, hidden: true, can_act: true },
{ id: 7, can_act: true },
{ id: 8, can_act: true }
],
moderator: false,
admin: true,
staff: true,
user_id: 1,
hidden: false,
trust_level: 4,
user_deleted: false,
can_view_edit_history: true,
wiki: false,
polls: [
{
options: [
{
id: "4d8a15e3cc35750f016ce15a43937620",
html: "1",
votes: 2
},
{
id: "cd314db7dfbac2b10687b6f39abfdf41",
html: "2",
votes: 1
},
{
id: "68b434ff88aeae7054e42cd05a4d9056",
html: "3",
votes: 1
},
{
id: "aa2393b424f2f395abb63bf785760a3b",
html: "4",
votes: 0
},
{
id: "8b2f2930cac0574c3450f5db9a6fb7f9",
html: "5",
votes: 1
},
{
id: "60cad69e0cfcb3fa77a68d11d3758002",
html: "6",
votes: 0
},
{
id: "9ab1070dec27185440cdabb4948a5e9a",
html: "7",
votes: 1
},
{
id: "99944bf07088f815a966d585daed6a7e",
html: "8",
votes: 3
},
{
id: "345a83050400d78f5fac98d381b45e23",
html: "9",
votes: 3
},
{
id: "46c01f638a50d86e020f47469733b8be",
html: "10",
votes: 3
},
{
id: "07f7f85b2a3809faff68a35e81a664eb",
html: "11",
votes: 2
},
{
id: "b3e8c14e714910cb8dd7089f097be133",
html: "12",
votes: 4
},
{
id: "b4f15431e07443c372d521e4ed131abe",
html: "13",
votes: 2
},
{
id: "a77bc9a30933e5af327211db2da46e17",
html: "14",
votes: 2
},
{
id: "303d7c623da1985e94a9d27d43596934",
html: "15",
votes: 2
},
{
id: "4e885ead68ff4456f102843df9fbbd7f",
html: "16",
votes: 1
},
{
id: "cbf6e2b72e403b12d7ee63a138f32647",
html: "17",
votes: 2
},
{
id: "9364fa2d67fbd62c473165441ad69571",
html: "18",
votes: 2
},
{
id: "eb8661f072794ea57baa7827cd8ffc88",
html: "19",
votes: 1
},
{
id: "b373436e858c0821135f994a5ff3345f",
html: "20",
votes: 2
}
],
voters: 35,
status: "open",
name: "poll",
type: "number",
min: "1",
max: "20",
step: "1",
public: "true",
preloaded_voters: Array.from(new Array(25), (_, i) => ({
id: 400 + i,
username: `bruce${400 + i}`,
avatar_template: "/images/avatar.png",
name: "Bruce Wayne"
}))
}
]
}
],
stream: [16]
},
timeline_lookup: [[1, 0]],
id: 13,
title: "This is a topic for testing number poll",
fancy_title: "This is a topic for testing number poll",
posts_count: 1,
created_at: "2017-01-31T09:11:11.161Z",
views: 1,
reply_count: 0,
participant_count: 1,
like_count: 0,
last_posted_at: "2017-01-31T09:11:11.281Z",
visible: true,
closed: false,
archived: false,
has_summary: false,
archetype: "regular",
slug: "this-is-a-topic-for-testing-number-poll",
category_id: 1,
word_count: 12,
user_id: 1,
draft_key: "topic_13",
draft_sequence: 1,
posted: true,
pinned_globally: false,
pinned: false,
details: {
auto_close_based_on_last_post: false,
created_by: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
last_poster: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
participants: [
{
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png",
post_count: 1
}
],
suggested_topics: [],
notification_level: 3,
notifications_reason_id: 1,
can_move_posts: true,
can_edit: true,
can_delete: true,
can_recover: true,
can_remove_allowed_users: true,
can_invite_to: true,
can_create_post: true,
can_reply_as_new_topic: true,
can_flag_topic: true
},
highest_post_number: 1,
last_read_post_number: 1,
last_read_post_id: 16,
has_deleted: false,
actions_summary: [
{ id: 4, count: 0, hidden: false, can_act: true },
{ id: 7, count: 0, hidden: false, can_act: true },
{ id: 8, count: 0, hidden: false, can_act: true }
],
chunk_size: 20,
bookmarked: false
},
"/t/14.json": {
post_stream: {
posts: [
{
id: 17,
username: "tgx",
avatar_template: "/images/avatar.png",
created_at: "2017-01-31T09:11:11.281Z",
cooked:
'<div class="poll" data-poll-status="open" data-poll-name="poll" data-poll-type="multiple" data-poll-min="1" data-poll-max="3" data-poll-public="true">\n<div>\n<div class="poll-container"><ul>\n<li data-poll-option-id="4d8a15e3cc35750f016ce15a43937620">1</li>\n<li data-poll-option-id="cd314db7dfbac2b10687b6f39abfdf41">2</li>\n<li data-poll-option-id="68b434ff88aeae7054e42cd05a4d9056">3</li>\n</ul></div>\n<div class="poll-info">\n<p><span class="info-number">0</span><span class="info-text">voters</span></p>\n<p>Choose up to <strong>3</strong> options</p>\n<p>Votes are public.</p>\n</div>\n</div>\n<div class="poll-buttons">\n<a title="Cast your votes">Vote now!</a><a title="Display the poll results">Show results</a>\n</div>\n</div>',
post_number: 1,
post_type: 1,
updated_at: "2017-01-31T09:11:11.281Z",
reply_count: 0,
quote_count: 0,
incoming_link_count: 0,
reads: 1,
score: 0,
yours: true,
topic_id: 14,
topic_slug: "topic-with-a-public-poll",
version: 1,
can_edit: true,
can_delete: false,
can_recover: true,
can_wiki: true,
read: true,
actions_summary: [
{ id: 3, can_act: true },
{ id: 4, can_act: true },
{ id: 5, hidden: true, can_act: true },
{ id: 7, can_act: true },
{ id: 8, can_act: true }
],
moderator: false,
admin: true,
staff: true,
user_id: 1,
hidden: false,
trust_level: 4,
user_deleted: false,
can_view_edit_history: true,
wiki: false,
polls: [
{
options: [
{
id: "4d8a15e3cc35750f016ce15a43937620",
html: "1",
votes: 29
},
{
id: "cd314db7dfbac2b10687b6f39abfdf41",
html: "2",
votes: 29
},
{
id: "68b434ff88aeae7054e42cd05a4d9056",
html: "3",
votes: 42
}
],
voters: 100,
status: "open",
name: "poll",
type: "multiple",
min: "1",
max: "3",
public: "true",
preloaded_voters: {
"68b434ff88aeae7054e42cd05a4d9056": Array.from(
new Array(25),
(_, i) => ({
id: 1000 + i,
name: "Bruce Wayne",
username: `bruce${1000 + i}`,
avatar_template: "/images/avatar.png"
})
)
}
}
]
}
],
stream: [17]
},
timeline_lookup: [[1, 0]],
id: 14,
title: "Topic with a public poll",
fancy_title: "Topic with a public poll",
posts_count: 1,
created_at: "2017-01-31T09:11:11.161Z",
views: 1,
reply_count: 0,
participant_count: 1,
like_count: 0,
last_posted_at: "2017-01-31T09:11:11.281Z",
visible: true,
closed: false,
archived: false,
has_summary: false,
archetype: "regular",
slug: "topic-with-a-public-poll",
category_id: 1,
word_count: 12,
user_id: 1,
draft_key: "topic_14",
draft_sequence: 1,
posted: true,
pinned_globally: false,
pinned: false,
details: {
auto_close_based_on_last_post: false,
created_by: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
last_poster: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
participants: [
{
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png",
post_count: 1
}
],
suggested_topics: [],
notification_level: 3,
notifications_reason_id: 1,
can_move_posts: true,
can_edit: true,
can_delete: true,
can_recover: true,
can_remove_allowed_users: true,
can_invite_to: true,
can_create_post: true,
can_reply_as_new_topic: true,
can_flag_topic: true
},
highest_post_number: 1,
last_read_post_number: 1,
last_read_post_id: 17,
has_deleted: false,
actions_summary: [
{ id: 4, count: 0, hidden: false, can_act: true },
{ id: 7, count: 0, hidden: false, can_act: true },
{ id: 8, count: 0, hidden: false, can_act: true }
],
chunk_size: 20,
bookmarked: false
},
"/t/15.json": {
post_stream: {
posts: [
{
id: 18,
username: "tgx",
avatar_template: "/images/avatar.png",
created_at: "2017-01-31T09:11:11.281Z",
cooked:
'<div class="poll" data-poll-status="open" data-poll-name="poll">\n<div>\n<div class="poll-container"><ul>\n<li data-poll-option-id="57ddd734344eb7436d64a7d68a0df444">test</li>\n<li data-poll-option-id="b5b78d79ab5b5d75d4d33d8b87f5d2aa">haha</li>\n</ul></div>\n<div class="poll-info"><p><span class="info-number">0</span><span class="info-text">voters</span></p></div>\n</div>\n<div class="poll-buttons"><a title="Display the poll results">Show results</a></div>\n</div>\n\n<div class="poll" data-poll-status="open" data-poll-name="test">\n<div>\n<div class="poll-container"><ul>\n<li data-poll-option-id="c26ad90783b0d80936e5fdb292b7963c">donkey</li>\n<li data-poll-option-id="99f2b9ac452ba73b115fcf3556e6d2d4">kong</li>\n</ul></div>\n<div class="poll-info"><p><span class="info-number">0</span><span class="info-text">voters</span></p></div>\n</div>\n<div class="poll-buttons"><a title="Display the poll results">Show results</a></div>\n</div>',
post_number: 1,
post_type: 1,
updated_at: "2017-01-31T09:11:11.281Z",
reply_count: 0,
quote_count: 0,
incoming_link_count: 0,
reads: 1,
score: 0,
yours: true,
topic_id: 15,
topic_slug: "topic-with-multiple-polls",
version: 1,
can_edit: true,
can_delete: false,
can_recover: true,
can_wiki: true,
read: true,
actions_summary: [
{ id: 3, can_act: true },
{ id: 4, can_act: true },
{ id: 5, hidden: true, can_act: true },
{ id: 7, can_act: true },
{ id: 8, can_act: true }
],
moderator: false,
admin: true,
staff: true,
user_id: 1,
hidden: false,
trust_level: 4,
user_deleted: false,
can_view_edit_history: true,
wiki: false,
polls: [
{
options: [
{
id: "57ddd734344eb7436d64a7d68a0df444",
html: "test",
votes: 0
},
{
id: "b5b78d79ab5b5d75d4d33d8b87f5d2aa",
html: "haha",
votes: 0
}
],
voters: 2,
status: "open",
name: "poll"
},
{
options: [
{
id: "c26ad90783b0d80936e5fdb292b7963c",
html: "donkey",
votes: 0
},
{
id: "99f2b9ac452ba73b115fcf3556e6d2d4",
html: "kong",
votes: 0
}
],
voters: 3,
status: "open",
name: "test"
}
]
}
],
stream: [18]
},
timeline_lookup: [[1, 0]],
id: 15,
title: "Topic with multiple polls",
fancy_title: "Topic with multiple polls",
posts_count: 1,
created_at: "2017-01-31T09:11:11.161Z",
views: 1,
reply_count: 0,
participant_count: 1,
like_count: 0,
last_posted_at: "2017-01-31T09:11:11.281Z",
visible: true,
closed: false,
archived: false,
has_summary: false,
archetype: "regular",
slug: "topic-with-multiple-polls",
category_id: 1,
word_count: 12,
user_id: 1,
draft_key: "topic_15",
draft_sequence: 1,
posted: true,
pinned_globally: false,
pinned: false,
details: {
auto_close_based_on_last_post: false,
created_by: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
last_poster: {
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png"
},
participants: [
{
id: 1,
username: "tgx",
avatar_template: "/images/avatar.png",
post_count: 1
}
],
suggested_topics: [],
notification_level: 3,
notifications_reason_id: 1,
can_move_posts: true,
can_edit: true,
can_delete: true,
can_recover: true,
can_remove_allowed_users: true,
can_invite_to: true,
can_create_post: true,
can_reply_as_new_topic: true,
can_flag_topic: true
},
highest_post_number: 1,
last_read_post_number: 1,
last_read_post_id: 16,
has_deleted: false,
actions_summary: [
{ id: 4, count: 0, hidden: false, can_act: true },
{ id: 7, count: 0, hidden: false, can_act: true },
{ id: 8, count: 0, hidden: false, can_act: true }
],
chunk_size: 20,
bookmarked: false
},
"/t/topic_with_pie_chart_poll.json": {
post_stream: {
posts: [
{
id: 294,
name: "",
username: "markvanlan",
avatar_template: "/user_avatar/localhost/markvanlan/{size}/11_2.png",
created_at: "2019-11-22T18:55:41.439Z",
cooked:
'\u003cdiv class="poll" data-poll-status="open" data-poll-max="3" data-poll-min="1" data-poll-results="always" data-poll-charttype="pie" data-poll-type="multiple" data-poll-name="poll"\u003e\n\u003cdiv\u003e\n\u003cdiv class="poll-container"\u003e\n\u003cul\u003e\n\u003cli data-poll-option-id="687a1ccf3c6a260f9aeeb7f68a1d463c"\u003eThis Is\u003c/li\u003e\n\u003cli data-poll-option-id="9377906763a1221d31d656ea0c4a4495"\u003eA test for sure\u003c/li\u003e\n\u003cli data-poll-option-id="ecf47c65a85a0bb20029072b1b721977"\u003eWhy not give it some more\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cdiv class="poll-info"\u003e\n\u003cp\u003e\n\u003cspan class="info-number"\u003e0\u003c/span\u003e\n\u003cspan class="info-label"\u003evoters\u003c/span\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e',
post_number: 1,
post_type: 1,
updated_at: "2019-11-22T18:55:41.439Z",
reply_count: 0,
reply_to_post_number: null,
quote_count: 0,
incoming_link_count: 0,
reads: 2,
readers_count: 1,
score: 0.2,
yours: false,
topic_id: 256,
topic_slug: "14-the-title-must-be-longer-i-guess",
display_username: "",
primary_group_name: "Team",
primary_group_flair_url: null,
primary_group_flair_bg_color: "",
primary_group_flair_color: "",
version: 1,
can_edit: false,
can_delete: false,
can_recover: false,
can_wiki: false,
read: true,
user_title: "You are a member of the team",
actions_summary: [
{ id: 2, can_act: true },
{ id: 3, can_act: true },
{ id: 4, can_act: true },
{ id: 8, can_act: true },
{ id: 6, can_act: true },
{ id: 7, can_act: true }
],
moderator: true,
admin: true,
staff: true,
user_id: 1,
hidden: false,
trust_level: 4,
deleted_at: null,
user_deleted: false,
edit_reason: null,
can_view_edit_history: true,
wiki: false,
user_custom_fields: { team: "Engineering", votes: [247, 251, 248] },
can_accept_answer: false,
can_unaccept_answer: false,
accepted_answer: false,
can_translate: false,
can_vote: true,
polls: [
{
name: "poll",
type: "multiple",
status: "open",
results: "always",
min: 1,
max: 3,
options: [
{
id: "687a1ccf3c6a260f9aeeb7f68a1d463c",
html: "This Is",
votes: 2
},
{
id: "9377906763a1221d31d656ea0c4a4495",
html: "A test for sure",
votes: 2
},
{
id: "ecf47c65a85a0bb20029072b1b721977",
html: "Why not give it some more",
votes: 1
}
],
voters: 2,
chart_type: "pie"
}
],
polls_votes: {
poll: [
"687a1ccf3c6a260f9aeeb7f68a1d463c",
"9377906763a1221d31d656ea0c4a4495"
]
}
}
],
stream: [294]
},
timeline_lookup: [[1, 2]],
suggested_topics: [],
tags: [],
id: 256,
title: "14 the title must be longer i guess",
fancy_title: "14 the title must be longer i guess",
posts_count: 1,
created_at: "2019-11-22T18:55:41.259Z",
views: 3,
reply_count: 0,
like_count: 0,
last_posted_at: "2019-11-22T18:55:41.439Z",
visible: true,
closed: false,
archived: false,
has_summary: false,
archetype: "regular",
slug: "14-the-title-must-be-longer-i-guess",
category_id: 1,
word_count: 24,
deleted_at: null,
user_id: 1,
featured_link: null,
pinned_globally: false,
pinned_at: null,
pinned_until: null,
image_url: null,
draft: null,
draft_key: "topic_256",
draft_sequence: 0,
posted: false,
unpinned: null,
pinned: false,
current_post_number: 1,
highest_post_number: 1,
last_read_post_number: 1,
last_read_post_id: 294,
deleted_by: null,
actions_summary: [
{ id: 4, count: 0, hidden: false, can_act: true },
{ id: 8, count: 0, hidden: false, can_act: true },
{ id: 7, count: 0, hidden: false, can_act: true }
],
chunk_size: 20,
bookmarked: false,
topic_timer: null,
private_topic_timer: null,
message_bus_last_id: 1,
participant_count: 1,
show_read_indicator: false,
can_vote: true,
vote_count: 0,
user_voted: false,
details: {
notification_level: 1,
notifications_reason_id: null,
can_create_post: true,
can_reply_as_new_topic: true,
can_flag_topic: true,
participants: [
{
id: 1,
username: "markvanlan",
name: "",
avatar_template: "/user_avatar/localhost/markvanlan/{size}/11_2.png",
post_count: 1,
primary_group_name: "Team",
primary_group_flair_url: null,
primary_group_flair_color: "",
primary_group_flair_bg_color: ""
}
],
created_by: {
id: 1,
username: "markvanlan",
name: "",
avatar_template: "/user_avatar/localhost/markvanlan/{size}/11_2.png"
},
last_poster: {
id: 1,
username: "markvanlan",
name: "",
avatar_template: "/user_avatar/localhost/markvanlan/{size}/11_2.png"
}
}
}
};