Skip to content
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

Merged
merged 35 commits into from
Feb 16, 2018
Merged

Postbit — For #2972 #2988

merged 35 commits into from
Feb 16, 2018

Conversation

WildcardSearch
Copy link
Contributor

@WildcardSearch WildcardSearch commented Jan 14, 2018

For #2972

Main templates:

  • postbit -> removed
  • posbit_classic -> postbit/postbit.twig

Sub templates:

  • postbit_groupimage -> removed
  • postbit_userstar -> removed
  • postbit_online -> removed
  • postbit_away -> removed
  • postbit_offline -> removed
  • postbit_avatar -> removed
  • postbit_find -> removed
  • postbit_pm -> removed
  • postbit_rep_button -> removed
  • postbit_www -> removed
  • postbit_email -> removed
  • postbit_reputation -> removed
  • postbit_warn -> removed
  • postbit_warninglevel -> removed
  • postbit_purgespammer -> removed
  • postbit_profilefield_multiselect_value -> removed
  • postbit_profilefield_multiselect -> removed
  • postbit_profilefield -> removed
  • postbit_author_user -> removed
  • postbit_author_guest -> removed
  • postbit_reply_pm -> removed
  • postbit_forward_pm -> removed
  • postbit_delete_pm -> removed
  • postbit_replyall_pm -> removed
  • postbit_editedby_editreason -> removed
  • postbit_editedby -> removed
  • postbit_editreason -> removed
  • postbit_edit -> removed
  • postbit_quickdelete -> removed
  • postbit_quickrestore -> removed
  • postbit_inlinecheck -> removed
  • postbit_posturl -> removed
  • postbit_quote -> removed
  • postbit_multiquote -> removed
  • postbit_report -> removed
  • announcement_edit -> removed
  • announcement_quickdelete -> removed
  • postbit_iplogged_show -> removed
  • postbit_iplogged_hiden -> removed
  • postbit_status -> removed
  • postbit_signature -> removed
  • postbit_icon -> removed
  • postbit_deleted -> removed
  • postbit_ignored -> removed
  • postbit_deleted_member -> removed
  • postbit_attachments_thumbnails_thumbnail -> postbit/postbit_attached_thumbnail
  • postbit_attachments_images_image -> postbit/postbit_attached_image
  • postbit_attachments_attachment -> postbit/postbit_attachment
  • postbit_attachments_attachment_unapproved -> removed
  • postbit_attachments_thumbnails -> removed
  • postbit_attachments_images -> removed
  • postbit_attachments -> removed

Suggestions/reviews welcome.

@euantorano
Copy link
Member

I believe @justinsoltesz and @Eric-Jackson are talking about removing the horizontal postbit (postbit), so it's probably not worth translating that one - just do postbit_classic, but name it as postbit and always render that template. We'll have to remove the option from the user CP options too.

@WildcardSearch
Copy link
Contributor Author

Will do.

</span>
</div>
<div class="author_statistics">
{{ post.user_details|raw }}
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

</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 }}
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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

@justinsoltesz
Copy link
Member

Correct, we will only have one postbit style in the 1.9 theme.

@WildcardSearch
Copy link
Contributor Author

WildcardSearch commented Jan 14, 2018

Updated PR with a list of templates to work through before postbit will be converted fully.

@euantorano euantorano added t:enhancement Type: Enhancement. Contains minor improvements s:in-progress Status: In Progress. Some work completed b:1.9 Branch: 1.9.x labels Jan 14, 2018
Mark Vincent added 12 commits January 14, 2018 14:13
@justinsoltesz
Copy link
Member

Just a general comment after looking at postbit.twig -- the logic should be indented to match the HTML syntax. Makes it easier to read.

postbit_profilefield, postbit_profilefield_multiselect,
postbit_profilefield_multiselect_value
@WildcardSearch
Copy link
Contributor Author

I'm not sure I understand what you mean, @justinsoltesz

@justinsoltesz
Copy link
Member

Take a look at how the various if statements are indented in this file:

https://github.com/mybb/mybb/blob/develop/1.9/inc/views/base/calendar/calendar.twig

@WildcardSearch
Copy link
Contributor Author

I see what you mean, @justinsoltesz . But in the example you linked, the outputted HTML is not indented correctly, ie.:

<td class="tcat">&nbsp;</td>
{% for weekday in weekday_headers %}
<td class="tcat" align="center" width="14%"><strong>{{ weekday }}</strong></td>
{% endfor %}

The conditional td is indented too far.

@justinsoltesz
Copy link
Member

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.

@WildcardSearch
Copy link
Contributor Author

Gotcha. I will do a code cleanup when I get all the work done.

Mark Vincent added 14 commits January 14, 2018 21:00
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
@WildcardSearch
Copy link
Contributor Author

@euantorano and @justinsoltesz, I have things working with the new template system for postbit and code cleaned up as best as I could.

@euantorano
Copy link
Member

euantorano commented Jan 17, 2018

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 %}
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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).

Copy link
Contributor Author

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.

@WildcardSearch WildcardSearch removed the s:in-progress Status: In Progress. Some work completed label Feb 3, 2018
@euantorano euantorano merged commit 7267bb2 into mybb:develop/1.9 Feb 16, 2018
euantorano pushed a commit that referenced this pull request Mar 16, 2018
* 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
Shade- pushed a commit to Shade-/mybb that referenced this pull request Mar 25, 2018
* 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
@WildcardSearch WildcardSearch deleted the fix-2972-postbit branch February 16, 2019 13:12
euantorano pushed a commit to euantorano/mybb that referenced this pull request Mar 23, 2019
* 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
euantorano pushed a commit to euantorano/mybb that referenced this pull request Mar 23, 2019
* 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
euantorano pushed a commit that referenced this pull request Jun 2, 2019
* 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
euantorano pushed a commit that referenced this pull request Jun 2, 2019
* 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
@euantorano euantorano mentioned this pull request Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.9 Branch: 1.9.x t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants