Skip to content

Commit

Permalink
refactor: Add subtitle field to PollForm component
Browse files Browse the repository at this point in the history
  • Loading branch information
novacuum committed Feb 19, 2024
1 parent 72d4dc0 commit f0b9f88
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
25 changes: 23 additions & 2 deletions js/dist/forum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions js/src/forum/components/PollForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default class PollForm extends Component {
this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));

this.question = Stream(poll.question());
this.subtitle = Stream(poll.subtitle());
this.endDate = Stream(this.formatDate(poll.endDate()));
this.publicPoll = Stream(poll.publicPoll());
this.allowMultipleVotes = Stream(poll.allowMultipleVotes());
Expand Down Expand Up @@ -63,6 +64,16 @@ export default class PollForm extends Component {
100
);

items.add(
'subtitle',
<div className="Form-group">
<label className="label">{app.translator.trans('fof-polls.forum.modal.subtitle_placeholder')}</label>

<input type="text" name="subtitle" className="FormControl" bidi={this.subtitle} />
</div>,
95
);

items.add(
'answers',
<div className="PollModal--answers Form-group">
Expand Down Expand Up @@ -266,6 +277,7 @@ export default class PollForm extends Component {

return {
question: this.question(),
subtitle: this.subtitle(),
endDate: this.dateToTimestamp(this.endDate()),
publicPoll: this.publicPoll(),
hideVotes: this.hideVotes(),
Expand Down

0 comments on commit f0b9f88

Please sign in to comment.