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
Add value attribute to RTL checkbox #106
Conversation
@@ -255,7 +255,7 @@ | |||
</select> | |||
</dd> | |||
<dt><label for="rtl">Direction</label></dt> | |||
<dd><input type="checkbox" id="rtl" name="rtl" {{if .Post.IsRTL.Bool}}checked="checked"{{end}} /><label for="rtl"> right-to-left</label></dd> | |||
<dd><input type="checkbox" id="rtl" name="rtl" value="true" {{if .Post.IsRTL.Bool}}checked="checked"{{end}} /><label for="rtl"> right-to-left</label></dd> |
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.
should this be false and unchecked by default?
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.
The value doesn't need to be false
; if it's unchecked the element simply won't be included in POST, and we have code on the server side to handle that. The default value should reflect whatever's in the database, which this does. (It's only ever visible when a post has already been stored.)
(There is an argument to be made that we should allow these settings to be changed at the beginning of a post rather than after its first save, but that's not the state of the code at the moment.)
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.
There's also an argument to be made that this should be a select dropdown or a set of radio buttons, especially since the server-side code supports an "auto" setting (that changes RTL status based on the post language) that isn't available here. But I'm not sure if the "auto" code has been written, so I'm leaving that alone for now.
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.
ok, I'm just thinking out loud with your help 😄
So if the value doesn't get sent if the box is not checked, how do we change the stored value when unchecking the box and submitting?
edit: nm, I got it now. thanks for clearing my confusion
A quick side note, I think this PR should be branched off the |
Oop, probably true. |
Hey, and be sure to check out my comments in #104 |
As described in the comments of #103.