nodebb-plugin-poll 4.0.8 → 4.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,53 +1,61 @@
1
1
  {
2
2
  "poll": "投票",
3
+ "poll-id-x": "投票 ID: %1",
3
4
  "toggles": "开关",
4
5
  "allow_guests": "允许游客查看投票结果",
5
6
  "limits": "限制",
6
7
  "max_options": "每次投票的最大候选项数目",
7
8
  "defaults": "默认设置",
8
9
  "default_title": "默认投票标题",
9
- "max_votes": "每个用户最多选几项",
10
+ "max_votes": "每个用户可投票的最大数目",
10
11
  "disallow_vote_update": "不允许用户更改投票",
11
12
  "allow_anon_voting": "允许匿名投票",
12
- "info_choices": "如果数字大于1,那么就是多选投票",
13
+ "info_choices": "如果数字大于 1,那么就是多选投票",
13
14
  "settings": "设置",
14
15
  "save": "保存",
15
16
  "reset": "重置",
16
-
17
+ "manage-polls": "管理投票",
18
+ "add-poll": "添加投票",
19
+ "no-polls": "未找到投票",
20
+ "confirm-remove": "您确定要删除此投票吗?",
17
21
  "creator_title": "创建投票",
18
- "poll_title": "标题",
22
+ "edit-a-poll-title": "编辑投票",
23
+ "poll_title": "投票标题",
19
24
  "poll_title_placeholder": "输入投票标题",
20
25
  "options_title": "候选项",
21
26
  "options_add": "添加候选项",
22
27
  "max_votes_placeholder": "输入数目",
23
- "auto_end_title": "截止日期",
24
- "auto_end_placeholder": "点此输入投票截止的日期和时间",
25
- "auto_end_help": "把这里留空则不限制投票的截止时间",
28
+ "auto_end_title": "自动结束投票",
29
+ "auto_end_placeholder": "点击输入日期和时间",
30
+ "auto_end_help": "若留空,投票将永不结束。",
26
31
 
27
- "error.max_options": "你只能创建 %d 个候选项。",
32
+ "error.max_options": "你只能创建 %1 个候选项。",
28
33
  "error.no_options": "请创建至少一个候选项。",
29
- "error.valid_date": "请输入有效的截止日期。",
34
+ "error.valid_date": "请输入有效的日期。",
30
35
 
31
- "error.not_main": "只能在帖子主体中添加投票",
32
- "error.privilege.create": "你不被允许创建投票",
33
- "error.anon-voting-not-allowed": "不允许匿名投票",
36
+ "error.not_main": "只能在主帖中添加投票。",
37
+ "error.invalid-post": "帖子无效。",
38
+ "error.privilege.create": "你无权创建投票。",
39
+ "error.anon-voting-not-allowed": "此投票不允许匿名投票。",
34
40
 
35
- "warning.redactor": "你正在使用编辑器。<strong>请不要</strong>手动编辑投票模块。 可以重新使用投票创建工具。",
41
+ "warning.redactor": "你正在使用 Redactor 编辑器。<strong>请不要</strong>手动编辑标记。可以重新打开投票创建工具。",
36
42
 
37
43
  "vote": "投票",
38
44
  "vote_anonymously": "匿名投票",
39
45
  "update_vote": "更改投票",
40
46
  "remove_vote": "删除投票",
41
- "to_voting": "去投票",
47
+ "to_voting": "前往投票",
42
48
  "to_results": "结果",
43
- "voting_unavailable_title": "投票无效",
44
- "voting_unavailable_message": "此投票已结束或已删除。 你还可以查看投票结果。",
49
+ "voting_unavailable_title": "投票不可用",
50
+ "voting_unavailable_message": "此投票已结束或标记为已删除。你仍然可以查看结果。",
45
51
  "voting_update_disallowed_message": "你已经投过票,不允许再更改。",
46
- "vote_is_final": "投票已结束,无法更改",
52
+ "vote_is_final": "此投票不允许更改投票结果,因此您的投票即为最终结果",
47
53
 
48
- "vote_count": "名用户投了此票",
54
+ "x-users-voted-for-this-option": "%1 位用户投票支持此选项",
49
55
  "votes": "票",
50
56
  "x-votes": "%1 票",
51
57
  "total-votes-x": "总票数: %1",
52
- "admin.create-poll": "创建投票"
58
+ "admin.create-poll": "创建投票",
59
+ "created-time": "创建时间",
60
+ "end-time": "结束时间"
53
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-poll",
3
- "version": "4.0.8",
3
+ "version": "4.0.10",
4
4
  "description": "NodeBB Poll Plugin",
5
5
  "main": "library.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div class="mb-3">
7
7
  <label class="form-label" for="pollInputTitle">[[poll:poll_title]]</label>
8
- <input type="text" name="title" id="pollInputTitle" value="{escape(poll.title)}" placeholder="[[poll:poll_title_placeholder]]" class="form-control">
8
+ <input type="text" name="title" id="pollInputTitle" value="{poll.title}" placeholder="[[poll:poll_title_placeholder]]" class="form-control">
9
9
  </div>
10
10
 
11
11
  <div class="mb-3 d-flex flex-column gap-1">
@@ -6,7 +6,7 @@
6
6
  <div component="post/poll/item" data-poll-id="{./pollId}" class="bg-body d-flex align-items-center justify-content-between mb-3 p-1 border rounded-1">
7
7
  <div class="d-flex align-items-center gap-1">
8
8
  <a href="#" component="sort/handle" class="btn btn-ghost btn-sm align-self-start" style="cursor:grab;"><i class="fa fa-arrows-up-down text-muted"></i></a>
9
- <div class="text-nowrap flex-grow-1">{escape(./title)}</div>
9
+ <div class="text-nowrap flex-grow-1">{./title}</div>
10
10
  </div>
11
11
 
12
12
  <div class="d-flex align-items-center gap-1">
@@ -1,6 +1,6 @@
1
1
  <div component="post/poll/option/item" data-option-id="{./id}" class="bg-body d-flex align-items-center justify-content-between gap-2 p-1 rounded-1">
2
2
  <a href="#" component="sort/handle" class="btn btn-ghost btn-sm" style="cursor:grab;"><i class="fa fa-arrows-up-down text-muted"></i></a>
3
- <input type="text" name="options" id="pollInputOptions" value="{escape(./title)}" class="form-control"/>
3
+ <input type="text" name="options" id="pollInputOptions" value="{./title}" class="form-control"/>
4
4
  <input type="hidden" name="id" value="{./id}"/>
5
5
  <button class="btn btn-ghost btn-sm" data-action="remove-option" data-option-id="{./id}"><i class="fa fa-trash text-danger"></i></button>
6
6
  </div>
@@ -1,7 +1,7 @@
1
1
  <!-- BEGIN poll.options -->
2
2
  <div class="poll-result" data-poll-option-id="{poll.options.id}">
3
3
  <div class="d-flex justify-content-between mb-1">
4
- <strong>{escape(poll.options.title)}</strong>
4
+ <strong>{poll.options.title}</strong>
5
5
  <a class="poll-result-votecount small" href="#">
6
6
  <span>[[poll:x-votes, {poll.options.voteCount}]]</span>
7
7
  </a>
@@ -1,16 +1,16 @@
1
- <form role="form" class="poll-voting-form mb-3 d-flex flex-column gap-3">
2
- <!-- BEGIN poll.options -->
3
- <div class="poll-view-option {poll.optionType}" data-poll-option-id="{poll.options.id}">
4
- <div class="form-check">
5
- <input class="form-check-input" type="{poll.optionType}" name="pollVoteSelection" value="{poll.options.id}" id="poll-{poll.info.pollId}-option-id-{poll.options.id}">
6
- <label class="form-check-label" for="poll-{poll.info.pollId}-option-id-{poll.options.id}">{escape(poll.options.title)}</label>
7
- </div>
8
- </div>
9
- <!-- END poll.options -->
10
- </form>
11
-
12
- <!-- IF poll.settings.disallowVoteUpdate -->
13
- <div class="alert alert-warning" role="alert">
14
- [[poll:vote_is_final]]
15
- </div>
16
- <!-- ENDIF poll.settings.disallowVoteUpdate -->
1
+ <form role="form" class="poll-voting-form mb-3 d-flex flex-column gap-3">
2
+ <!-- BEGIN poll.options -->
3
+ <div class="poll-view-option {poll.optionType}" data-poll-option-id="{poll.options.id}">
4
+ <div class="form-check">
5
+ <input class="form-check-input" type="{poll.optionType}" name="pollVoteSelection" value="{poll.options.id}" id="poll-{poll.info.pollId}-option-id-{poll.options.id}">
6
+ <label class="form-check-label" for="poll-{poll.info.pollId}-option-id-{poll.options.id}">{poll.options.title}</label>
7
+ </div>
8
+ </div>
9
+ <!-- END poll.options -->
10
+ </form>
11
+
12
+ <!-- IF poll.settings.disallowVoteUpdate -->
13
+ <div class="alert alert-warning" role="alert">
14
+ [[poll:vote_is_final]]
15
+ </div>
16
+ <!-- ENDIF poll.settings.disallowVoteUpdate -->
@@ -3,9 +3,9 @@
3
3
  <div class="card-header border-0 d-flex justify-content-between align-items-center flex-wrap">
4
4
  <h5 class="card-title mb-0 {{{ if poll.isWidget }}}fs-6{{{ end }}}">
5
5
  {{{ if poll.isWidget }}}
6
- <a class="text-reset text-break" href="{config.relative_path}/post/{poll.info.pid}">{escape(poll.info.title)}</a>
6
+ <a class="text-reset text-break" href="{config.relative_path}/post/{poll.info.pid}">{poll.info.title}</a>
7
7
  {{{ else }}}
8
- {escape(poll.info.title)}
8
+ {poll.info.title}
9
9
  {{{ end }}}
10
10
  </h5>
11
11
  {{{ if (isAdmin && !poll.isWidget) }}}