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

Add value attribute to RTL checkbox #106

Closed
wants to merge 1 commit into from
Closed

Conversation

joyeusenoelle
Copy link
Contributor

As described in the comments of #103.


  • I have signed the CLA

@@ -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>
Copy link

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link

@ghost ghost May 17, 2019

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

@ghost
Copy link

ghost commented May 17, 2019

A quick side note, I think this PR should be branched off thedevelop branch and target the same instead of master.

@joyeusenoelle
Copy link
Contributor Author

Oop, probably true.

@thebaer
Copy link
Member

thebaer commented May 18, 2019

Hey, and be sure to check out my comments in #104

@joyeusenoelle joyeusenoelle deleted the rtl-post branch May 29, 2019 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants