github: shadowy octopus with the head of a robot, emblazoned with the Dreamwidth swirl (Default)
github ([personal profile] github) wrote in [site community profile] changelog2021-01-31 09:43 am

[dreamwidth/dw-free] 2900be: Reconcile icon select component with beta entry pa...

Branch: refs/heads/master Home: https://github.com/dreamwidth/dw-free Commit: 2900beb93e42f66f78522dc7e01a40ad0ea7f6e2 https://github.com/dreamwidth/dw-free/commit/2900beb93e42f66f78522dc7e01a40ad0ea7f6e2 Author: Nick Fagerlund nick.fagerlund@gmail.com Date: 2021-01-31 (Sun, 31 Jan 2021)

Changed paths: M cgi-bin/DW/Controller/Entry.pm M views/components/icon-select-dropdown.tt M views/components/icon-select-icon.tt M views/entry/module-icons.tt

Log Message:


Reconcile icon select component with beta entry page (#2859)

  • Restore name='icon' on beta entry page icon select

The Entry controller expects the icon keyword to be in $POST->{icon}, not $POST->{prop_picture_keyword} like the reply form handlers use. Looks like the field names got mixed up during a multi-step conversion to the new shared icon components.

As of this commit, editing entries is still bugged: the form always selects the default icon, regardless of what the entry had before.

  • Restore selected icon when editing an entry

The form element template helpers automatically populate the selected attribute of a select based on the formdata argument of the parent template that called the helper, if it's present and it contains a key that matches the name of the select. And the entry page took advantage of that behavior for the icons menu. Passing selected breaks that if the selected value is undef.

As of this commit, the icon preview is still bugged when editing an entry -- the select is set to the right icon and the preview gets updated if you change it, but it starts out on the default icon no matter what.

  • Fix some mildly goofy indentation in some templates

  • Make select label invisible again

This isn't necessary for sighted users -- positioning the select right next to the icon indicates its purpose.

  • Remove class=inline from select

This looks like maybe detritus from partway through the conversion.

  • Icon select component: Make random button optional

The hidden-by-default random button made this component a non-starter for the entry page (which always shows it, and wants it in a different spot). So, if we make it optional we can reduce some special-casing elsewhere in the system.

  • Make entry page use the icon select component

  • Entry controller was expecting a different name for that select element.

  • Icon preview button was expecting to be passed the previously selected icon.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org