nodebb-plugin-poll 2.0.5 → 2.0.6

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,59 +1,59 @@
1
- <div class="row">
2
- <div class="col-lg-9">
3
- <form class="form poll-settings">
4
- <div class="panel panel-default">
5
- <div class="panel-heading">[[poll:poll]]</div>
6
- <div class="panel-body">
7
- <div class="row">
8
- <div class="col-lg-6">
9
- <strong>[[poll:toggles]]</strong>
10
- <div class="form-group">
11
- <div class="checkbox">
12
- <label>
13
- <input type="checkbox" data-key="toggles.allowAnon" data-trim="false"> [[poll:allow_guests]]
14
- </label>
15
- </div>
16
- </div>
17
- </div>
18
- <div class="col-lg-6">
19
- <strong>[[poll:limits]]</strong>
20
- <div class="form-group">
21
- <label for="maxPollOptions">[[poll:max_options]]</label>
22
- <input type="number" class="form-control" id="maxPollOptions" placeholder="10" min="1" max="100" data-key="limits.maxOptions">
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- </div>
28
-
29
- <div class="panel panel-default">
30
- <div class="panel-heading">[[poll:defaults]]</div>
31
- <div class="panel-body">
32
- <div class="row">
33
- <div class="col-lg-6">
34
- <div class="form-group">
35
- <label for="defaultsTitle">[[poll:default_title]]</label>
36
- <input type="text" class="form-control" id="defaultsTitle" placeholder="Poll" data-key="defaults.title">
37
- </div>
38
- <div class="form-group">
39
- <label for="defaultsMaxVotes">[[poll:max_votes]]</label>
40
- <input type="number" class="form-control" id="defaultsMaxVotes" placeholder="1" min="1" max="100" data-key="defaults.maxvotes">
41
- <p class="help-block">[[poll:info_choices]]</p>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
- </form>
48
- </div>
49
-
50
- <div class="col-lg-3">
51
- <div class="panel panel-default">
52
- <div class="panel-heading">[[poll:settings]]</div>
53
- <div class="panel-body">
54
- <button id="save" class="btn btn-primary btn-block">[[poll:save]]</button>
55
- <button id="reset" class="btn btn-warning btn-block">[[poll:reset]]</button>
56
- </div>
57
- </div>
58
- </div>
1
+ <div class="row">
2
+ <div class="col-lg-9">
3
+ <form class="form poll-settings">
4
+ <div class="panel panel-default">
5
+ <div class="panel-heading">[[poll:poll]]</div>
6
+ <div class="panel-body">
7
+ <div class="row">
8
+ <div class="col-lg-6">
9
+ <strong>[[poll:toggles]]</strong>
10
+ <div class="form-group">
11
+ <div class="checkbox">
12
+ <label>
13
+ <input type="checkbox" data-key="toggles.allowAnon" data-trim="false"> [[poll:allow_guests]]
14
+ </label>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <div class="col-lg-6">
19
+ <strong>[[poll:limits]]</strong>
20
+ <div class="form-group">
21
+ <label for="maxPollOptions">[[poll:max_options]]</label>
22
+ <input type="number" class="form-control" id="maxPollOptions" placeholder="10" min="1" max="100" data-key="limits.maxOptions">
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="panel panel-default">
30
+ <div class="panel-heading">[[poll:defaults]]</div>
31
+ <div class="panel-body">
32
+ <div class="row">
33
+ <div class="col-lg-6">
34
+ <div class="form-group">
35
+ <label for="defaultsTitle">[[poll:default_title]]</label>
36
+ <input type="text" class="form-control" id="defaultsTitle" placeholder="Poll" data-key="defaults.title">
37
+ </div>
38
+ <div class="form-group">
39
+ <label for="defaultsMaxVotes">[[poll:max_votes]]</label>
40
+ <input type="number" class="form-control" id="defaultsMaxVotes" placeholder="1" min="1" max="100" data-key="defaults.maxvotes">
41
+ <p class="help-block">[[poll:info_choices]]</p>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </form>
48
+ </div>
49
+
50
+ <div class="col-lg-3">
51
+ <div class="panel panel-default">
52
+ <div class="panel-heading">[[poll:settings]]</div>
53
+ <div class="panel-body">
54
+ <button id="save" class="btn btn-primary btn-block">[[poll:save]]</button>
55
+ <button id="reset" class="btn btn-warning btn-block">[[poll:reset]]</button>
56
+ </div>
57
+ </div>
58
+ </div>
59
59
  </div>
File without changes
@@ -1,10 +1,10 @@
1
- <h2>{voteCount} [[poll:vote_count]]</h2>
2
- <!-- BEGIN votes -->
3
- <a href="{config.relative_path}/user/{votes.userslug}" class="poll-result-details">
4
- <!-- IF votes.picture -->
5
- <img class="poll-result-avatar" title="{votes.username}" src="{votes.picture}">
6
- <!-- ELSE -->
7
- <div class="poll-result-avatar user-icon" title="{votes.username}" style="background-color: {votes.icon:bgColor};">{votes.icon:text}</div>
8
- <!-- ENDIF votes.picture -->
9
- </a>
10
- <!-- END votes -->
1
+ <h2>{voteCount} [[poll:vote_count]]</h2>
2
+ <!-- BEGIN votes -->
3
+ <a href="{config.relative_path}/user/{votes.userslug}" class="poll-result-details">
4
+ <!-- IF votes.picture -->
5
+ <img class="poll-result-avatar" title="{votes.username}" src="{votes.picture}">
6
+ <!-- ELSE -->
7
+ <div class="poll-result-avatar user-icon" title="{votes.username}" style="background-color: {votes.icon:bgColor};">{votes.icon:text}</div>
8
+ <!-- ENDIF votes.picture -->
9
+ </a>
10
+ <!-- END votes -->
@@ -1,3 +1,3 @@
1
- <h3>{title}</h3>
2
- <p>{content}</p>
1
+ <h3>{title}</h3>
2
+ <p>{content}</p>
3
3
  <hr>
@@ -1,15 +1,15 @@
1
- <!-- BEGIN poll.options -->
2
- <div class="poll-result" data-poll-option-id="{poll.options.id}">
3
- <strong>{poll.options.title}</strong>
4
- <small class="pull-right">
5
- <a class="poll-result-votecount" href="#">
6
- <span>{poll.options.voteCount}</span> [[poll:votes]]
7
- </a>
8
- </small>
9
- <div class="progress">
10
- <div class="progress-bar poll-result-progressbar" role="progressbar" aria-valuenow="{poll.options.percentage}" aria-valuemin="0" aria-valuemax="100" style="width: {poll.options.percentage}%;">
11
- <span>{poll.options.percentage}</span>%
12
- </div>
13
- </div>
14
- </div>
1
+ <!-- BEGIN poll.options -->
2
+ <div class="poll-result" data-poll-option-id="{poll.options.id}">
3
+ <strong>{poll.options.title}</strong>
4
+ <small class="pull-right">
5
+ <a class="poll-result-votecount" href="#">
6
+ <span>{poll.options.voteCount}</span> [[poll:votes]]
7
+ </a>
8
+ </small>
9
+ <div class="progress">
10
+ <div class="progress-bar poll-result-progressbar" role="progressbar" aria-valuenow="{poll.options.percentage}" aria-valuemin="0" aria-valuemax="100" style="width: {poll.options.percentage}%;">
11
+ <span>{poll.options.percentage}</span>%
12
+ </div>
13
+ </div>
14
+ </div>
15
15
  <!-- END poll.options -->
@@ -1,16 +1,16 @@
1
- <form role="form" class="poll-voting-form">
2
- <!-- BEGIN poll.options -->
3
- <div class="poll-view-option {poll.optionType}" data-poll-option-id="{poll.options.id}">
4
- <label>
5
- <input type="{poll.optionType}" name="pollVoteSelection" value="{poll.options.id}">
6
- {poll.options.title}
7
- </label>
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">
2
+ <!-- BEGIN poll.options -->
3
+ <div class="poll-view-option {poll.optionType}" data-poll-option-id="{poll.options.id}">
4
+ <label>
5
+ <input type="{poll.optionType}" name="pollVoteSelection" value="{poll.options.id}">
6
+ {poll.options.title}
7
+ </label>
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,29 +1,29 @@
1
- <div class="poll-view" data-poll-id="{poll.info.pollId}">
2
- <div class="panel panel-default">
3
- <div class="panel-heading">
4
- <h3 class="panel-title">{poll.settings.title}</h3>
5
- <div class="btn-group pull-right hidden">
6
- <a href="#" class="poll-button-edit">
7
- <span class="fa fa-pencil"></span>
8
- </a>
9
- </div>
10
- </div>
11
- <div class="panel-body">
12
- <div class="poll-view-messages hidden"></div>
13
- <div class="poll-view-voting <!-- IF poll.hasVoted -->hidden<!-- ENDIF poll.hasVoted -->">
14
- <!-- IMPORT poll/view/voting.tpl -->
15
- </div>
16
- <div class="poll-view-results <!-- IF !poll.hasVoted -->hidden<!-- ENDIF !poll.hasVoted -->">
17
- <!-- IMPORT poll/view/results.tpl -->
18
- </div>
19
-
20
- <div class="poll-view-buttons">
21
- <button type="button" class="btn btn-primary poll-button-vote hidden">[[poll:vote]]</button>
22
- <button type="button" class="btn btn-primary poll-button-update-vote hidden">[[poll:update_vote]]</button>
23
- <button type="button" class="btn btn-danger poll-button-remove-vote hidden">[[poll:remove_vote]]</button>
24
- <button type="button" class="btn btn-link poll-button-results hidden">[[poll:to_results]]</button>
25
- <button type="button" class="btn btn-link poll-button-voting hidden">[[poll:to_voting]]</button>
26
- </div>
27
- </div>
28
- </div>
1
+ <div class="poll-view" data-poll-id="{poll.info.pollId}">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading">
4
+ <h3 class="panel-title">{poll.settings.title}</h3>
5
+ <div class="btn-group pull-right hidden">
6
+ <a href="#" class="poll-button-edit">
7
+ <span class="fa fa-pencil"></span>
8
+ </a>
9
+ </div>
10
+ </div>
11
+ <div class="panel-body">
12
+ <div class="poll-view-messages hidden"></div>
13
+ <div class="poll-view-voting <!-- IF poll.hasVoted -->hidden<!-- ENDIF poll.hasVoted -->">
14
+ <!-- IMPORT poll/view/voting.tpl -->
15
+ </div>
16
+ <div class="poll-view-results <!-- IF !poll.hasVoted -->hidden<!-- ENDIF !poll.hasVoted -->">
17
+ <!-- IMPORT poll/view/results.tpl -->
18
+ </div>
19
+
20
+ <div class="poll-view-buttons">
21
+ <button type="button" class="btn btn-primary poll-button-vote hidden">[[poll:vote]]</button>
22
+ <button type="button" class="btn btn-primary poll-button-update-vote hidden">[[poll:update_vote]]</button>
23
+ <button type="button" class="btn btn-danger poll-button-remove-vote hidden">[[poll:remove_vote]]</button>
24
+ <button type="button" class="btn btn-link poll-button-results hidden">[[poll:to_results]]</button>
25
+ <button type="button" class="btn btn-link poll-button-voting hidden">[[poll:to_voting]]</button>
26
+ </div>
27
+ </div>
28
+ </div>
29
29
  </div>
@@ -1,15 +1,15 @@
1
- 'use strict';
2
-
3
- const db = require.main.require('./src/database');
4
- const privileges = require.main.require('./src/privileges');
5
-
6
- module.exports = {
7
- name: 'Fix incorrectly given poll privilege',
8
- timestamp: Date.UTC(2020, 9, 29),
9
- method: async () => {
10
- const cids = await db.getSortedSetRange('categories:cid', 0, -1);
11
- await Promise.all(cids.map(async (cid) => {
12
- await privileges.categories.rescind(['poll:create'], cid, ['registered-users']);
13
- }));
14
- },
15
- };
1
+ 'use strict';
2
+
3
+ const db = require.main.require('./src/database');
4
+ const privileges = require.main.require('./src/privileges');
5
+
6
+ module.exports = {
7
+ name: 'Fix incorrectly given poll privilege',
8
+ timestamp: Date.UTC(2020, 9, 29),
9
+ method: async () => {
10
+ const cids = await db.getSortedSetRange('categories:cid', 0, -1);
11
+ await Promise.all(cids.map(async (cid) => {
12
+ await privileges.categories.rescind(['poll:create'], cid, ['registered-users']);
13
+ }));
14
+ },
15
+ };