Skip to content

[ticket/12376] Add template events viewtopic_body_polls#2273

Merged
nickvergessen merged 3 commits intophpbb:develop-ascraeusfrom
PayBas:ticket/12376
May 4, 2014
Merged

[ticket/12376] Add template events viewtopic_body_polls#2273
nickvergessen merged 3 commits intophpbb:develop-ascraeusfrom
PayBas:ticket/12376

Conversation

@PayBas
Copy link
Copy Markdown
Contributor

@PayBas PayBas commented Apr 9, 2014

I propose 3 template events:

1: EVENT viewtopic_body_poll_question_prepend

It would be the equivalent of viewtopic_topic_title_prepend, and will allow us to use prefixes, or better yet, icons. It will allow us to use code like:
<h2><span class="<!-- IF S_CAN_VOTE and L_POLL_LENGTH -->poll-icon-timer<!-- ELSEIF S_CAN_VOTE -->poll-icon-open<!-- ELSE -->poll-icon-closed<!-- ENDIF -->">{L_VIEW_TOPIC_POLL}</span>....</h2>

2: EVENT viewtopic_body_poll_fieldset_prepend
Having control of the poll fieldset can have advantages in case we want to add extra functionality, buttons or create wrapping containers.

3: EVENT viewtopic_body_poll_fieldset_prepend
The counter-part to the previous one

PHPBB3-12376

@nickvergessen
Copy link
Copy Markdown
Contributor

please also create append for the title

@PayBas
Copy link
Copy Markdown
Contributor Author

PayBas commented Apr 9, 2014

Ok, I just assumed we weren't doing that because the other <h2> blocks don't have an append either

@nickvergessen
Copy link
Copy Markdown
Contributor

@PayBas if you prepend something, you should be able to append aswell ;)

@PayBas
Copy link
Copy Markdown
Contributor Author

PayBas commented Apr 9, 2014

@nickvergessen how true, sadly not always the case ;)

I'll update it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like fieldset in the event name, it's a bit arbitrary.
I'd suggest to move it inside the loop and call it <!-- EVENT viewtopic_body_poll_option_before -->. This also makes it more powerful

You can still use the event as you wanted to, by wrapping your own template with:
<!-- IF poll_option.S_FIRST_ROW -->

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty smart ;), although it's not exactly the same, as it will not include the poll buttons. But I guess we can work around that.

@nickvergessen
Copy link
Copy Markdown
Contributor

Please rebase onto develop-ascraeus, so the event tests are run

nickvergessen added a commit to nickvergessen/phpbb that referenced this pull request May 4, 2014
[ticket/12376] Add template events viewtopic_body_polls

* PayBas/ticket/12376:
  [ticket/12376] Changed to viewtopic_body_poll_option_before and after
  [ticket/12376] Added viewtopic_body_poll_question_append
  [ticket/12376] Add template events viewtopic_body_polls
@nickvergessen nickvergessen merged commit 36aa8ec into phpbb:develop-ascraeus May 4, 2014
@PayBas PayBas deleted the ticket/12376 branch May 4, 2014 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants