Skip to content

Commit

Permalink
chor: add string for poll_page.title and allow backwards date change …
Browse files Browse the repository at this point in the history
…for global polls
  • Loading branch information
novacuum committed Apr 4, 2024
1 parent 906dd34 commit 2ecda05
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 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.

2 changes: 1 addition & 1 deletion js/src/forum/components/PollPageHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PollPageHeroAttrs extends ComponentAttrs {
title?: string;
}

export default class IndexPageHero extends Component<PollPageHeroAttrs> {
export default class PollPageHero extends Component<PollPageHeroAttrs> {
oninit(vnode: Mithril.Vnode) {
super.oninit(vnode);
}
Expand Down
3 changes: 3 additions & 0 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ fof-polls:
delete: Delete Poll
error: There was an error saving the poll, please contact any administrator.

polls_page:
title: Polls

polls_list:
empty_text: It looks as though there are no community wide polls here.
load_more_button: Load More
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/EditPollHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function handle(EditPoll $command)
if (is_string($endDate)) {
$date = Carbon::parse($endDate);

if (!$poll->hasEnded() && $date->isFuture() && ($poll->end_date === null || $poll->end_date->lessThanOrEqualTo($date))) {
if (!$poll->hasEnded() && $date->isFuture() && ($poll->isGlobal() || $poll->end_date === null || $poll->end_date->lessThanOrEqualTo($date))) {
$poll->end_date = $date->utc();
}
} elseif (is_bool($endDate) && !$endDate) {
Expand Down

0 comments on commit 2ecda05

Please sign in to comment.