-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postbit — For #2972 #2988
Postbit — For #2972 #2988
Conversation
[WIP]
I believe @justinsoltesz and @Eric-Jackson are talking about removing the horizontal postbit ( |
Will do. |
inc/views/base/postbit/postbit.twig
Outdated
</span> | ||
</div> | ||
<div class="author_statistics"> | ||
{{ post.user_details|raw }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth moving the content of the user details template inline, since the plan is to have one postbit template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
inc/views/base/postbit/postbit.twig
Outdated
</div> | ||
<div class="post_controls"> | ||
<div class="postbit_buttons author_buttons float_left"> | ||
{{ post.button_email|raw }}{{ post.button_pm|raw }}{{ post.button_www|raw }}{{ post.button_find|raw }}{{ post.button_rep|raw }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, lots of raws here. We should probably do the conditions in the template and include other templates for each button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's even a good reason to break out the buttons into separate templates, is there? They will only be used in this template when the postbits are combined.
Having the conditions in the template would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a WIP. I just did that to get me up and displaying correctly on the new template. The next move is to walk back through the included templates and work them out one at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Justin ninja'd me. I was thinking of passing an array of boolean values to Twig and just if
each button. What do you guys think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like the best approach to me @WildcardSearch! We also need to make it possible for plugin developers to add new buttons (eg: for likes and such), so we need to think about that. Perhaps we add the template hook functionality I was going to add to 2.0 to 1.9 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, @euantorano, that sounds like a plan.
Trust me, everything I do, I am thinking about how I am going to manipulate these templates in my plugins lol
Correct, we will only have one postbit style in the 1.9 theme. |
Updated PR with a list of templates to work through before postbit will be converted fully. |
postbit_online, postbit_away. postbit_offline
postbit_author_user, postbit_author_guest
postbit_warninglevel, postbit_warn
Just a general comment after looking at |
postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value
I'm not sure I understand what you mean, @justinsoltesz |
Take a look at how the various https://github.com/mybb/mybb/blob/develop/1.9/inc/views/base/calendar/calendar.twig |
I see what you mean, @justinsoltesz . But in the example you linked, the outputted HTML is not indented correctly, ie.: mybb/inc/views/base/calendar/calendar.twig Lines 27 to 30 in d398853
The conditional |
MyBB's output already isn't indented correctly... I think it's better for the template to be easier to read (and subsequently be easier to edit) than have the outputted page source be indented correctly. |
Gotcha. I will do a code cleanup when I get all the work done. |
postbit_posturl, postbit_inlinecheck
announcement_edit, announcement_quickdelete
postbit_iplogged_show, postbit_iplogged_hiden
postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved
@euantorano and @justinsoltesz, I have things working with the new template system for postbit and code cleaned up as best as I could. |
Nice one @WildcardSearch, thanks. I'll have a look and test of this either this week or at the weekend. |
{% if post.replink %} | ||
<br />{{ lang.postbit_reputation }} {{ post.userreputation|raw }} | ||
{% endif %} | ||
{% for field in post.profile_fields %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this result in all of the profile fields being shown in the postbit? I believe these fields are currently 'optional' -- you can add a variable to include them if you want, but they aren't included by default.
(That said, the 1.9 theme concepts don't have any fields in the postbit...)
Edit: To clarify -- it probably would make sense to break this out in a separate template that can be included if desired, similar to the way it works in 1.8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justinsoltesz the profile fields that are to be displayed are loaded before build_postbit
is called. In other words, it is a global variable $profile_fields
that the calling code would define.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you're right. I didn't realize they were automatically added based on a setting in the ACP in 1.8 (they definitely weren't in a previous version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I am getting to know this section of code much better than I ever have before. I guess that is another benefit of this conversion as well as some long overdue code cleanup and convention updates.
* Postbit — For #2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
* Postbit — For mybb#2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
* Postbit — For mybb#2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
* Postbit — For mybb#2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
* Postbit — For #2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
* Postbit — For #2972 [WIP] * removed horizontal postbit * postbit_groupimage * postbit_userstar * Online Status postbit_online, postbit_away. postbit_offline * postbit_avatar * postbit_find * postbit_pm * postbit_rep_button * postbit_www * postbit_email * User Details postbit_author_user, postbit_author_guest * postbit_reputation * Warning Info postbit_warninglevel, postbit_warn * postbit_purgespammer * Custom Profile Fields postbit_profilefield, postbit_profilefield_multiselect, postbit_profilefield_multiselect_value * Private Messages postbit_reply_pm, postbit_replyall_pm, postbit_forward_pm, * Edit Message postbit_editedby, postbit_editedby_editreason * Post Edit postbit_editreason, postbit_edit * Quick Delete/Restore postbit_quickdelete, postbit_quickrestore * Post Links/Inline Moderation postbit_posturl, postbit_inlinecheck * postbit_quote * postbit_multiquote * postbit_report * Announcements announcement_edit, announcement_quickdelete * Post IP Display postbit_iplogged_show, postbit_iplogged_hiden * postbit_status * postbit_signature * postbit_icon * postbit_deleted * postbit_ignored * postbit_deleted_member * Attachments postbit_attachments, postbit_attachments_thumbnails, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images, postbit_attachments_images_image, postbit_attachments_attachment, postbit_attachments_attachment_unapproved * Code Cleanuo * More Code Cleanup
For #2972
Main templates:
postbit/postbit.twig
Sub templates:
postbit/postbit_attached_thumbnail
postbit/postbit_attached_image
postbit/postbit_attachment
Suggestions/reviews welcome.