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 option to let the user check/uncheck the checkboxes #249

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

g0rk4
Copy link
Contributor

@g0rk4 g0rk4 commented Feb 27, 2018

No description provided.

@facelessuser
Copy link
Owner

I'm not sure I follow what this pull is trying to solve, can you explain?

@facelessuser
Copy link
Owner

facelessuser commented Feb 27, 2018

  1. Okay, let me just give some feedback. In general, this is used to create static pages, but I get the feeling you want to do something more dynamic. Why not use JavaScript? Can you elaborate why you think this is needed?

  2. Tests are currently failing, so that would need to be fixed assuming I decide to accept this.

  3. Documentation would need to be updated to describe the new feature (again assuming I decide to accept this).

  4. Add test(s) to test new feature when enabled.

@g0rk4
Copy link
Contributor Author

g0rk4 commented Feb 27, 2018

Hi @facelessuser,

First of all thank you for your quick reply !

Indeed I need this functionnality in order to be able to check dynamicaly some checkboxes. For exemple, I write some documentations of installation tools and I want to let the final user to follow the procedure by checking the steps already done.

If you will accept this pull request, I'll fix all the things you mentioned :
1 - Fix tests failure;
2 - Update documentation;
3 - Add new test(s) case;

@facelessuser
Copy link
Owner

I guess I'm okay with this, but all the mentioned things will have to be addressed first. New feature should be tested, all tests must pass, and there needs to be documentation.

@g0rk4
Copy link
Contributor Author

g0rk4 commented Feb 28, 2018

Hi @facelessuser , i made changes on PR :

  • Add option to let the user check/uncheck the checkboxes;
  • Test cases added;
  • Update documentation;

And now i'll try to understand why the tests are falling on your CI

Copy link
Owner

@facelessuser facelessuser left a comment

Choose a reason for hiding this comment

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

Please fix all noted comments.

@@ -85,7 +99,7 @@ Classes | Description
}
```

??? settings "Custom Tasklist CSS"
Copy link
Owner

Choose a reason for hiding this comment

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

This is a details object, not a header. Please change the syntax back to how it was.

| `task-list-control` | This is attached to the `label` tag and represents the control object. |
| `task-list-indicator` | This is attached to the `span` directly following the input and is used to style the visual indicator. |

### settings "Basic Tasklist CSS"
Copy link
Owner

Choose a reason for hiding this comment

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

This should be a details object, not a header. Please change the syntax to how it was.

Option | Type | Default | Description
----------------- | ---- | ------------ | ------------
`custom_checkbox` | bool | `#!py3 False` | Generate task lists in such a way as to allow for styling the check box with CSS.
| Option | Type | Default | Description |
Copy link
Owner

Choose a reason for hiding this comment

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

Please don't rewrite table syntax that I am using. Please remove leading and trailing pipes (|). I understand some may prefer to have tables flanked by those, but I do not.

"""Get checkbox tag."""

if custom_checkbox:
return (
'<label class="task-list-control">' +
'<input type="checkbox" disabled%s/>' % (' checked' if state.lower() == 'x' else '') +
'<input type="checkbox"%s%s/>' % (' disabled' if clickable_checkbox == False else '',
Copy link
Owner

Choose a reason for hiding this comment

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

Tests are failing because you added a trailing self closing / in the input tag. This is probably better so that when people insert this into xhtml (but who is doing this these days). So I'm fine with the change, but you need to regenerate changed, failing tasklist tests.

@facelessuser
Copy link
Owner

I've noted in the review why CI is failing. Also, I've noted additional changes that need to fixed.

@g0rk4 g0rk4 force-pushed the add-clickable-checkbox branch 3 times, most recently from 813c170 to 9a07c5c Compare February 28, 2018 15:29
@g0rk4
Copy link
Contributor Author

g0rk4 commented Feb 28, 2018

Sounds good, thank you @facelessuser.

Tell me if something else is needed

@@ -0,0 +1,5 @@
{
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove .vscode/settings.json file. Feel free to exclude it from the repo via .gitignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, i'll push changes when we wil be ok with the /

@facelessuser
Copy link
Owner

There was actually no need to remove the / in tags. As I mentioned it is better for xhtml. I was more mentioning we needed to regen existing tests not new tests. But maybe we can just do that as a separate issue.

@g0rk4
Copy link
Contributor Author

g0rk4 commented Mar 1, 2018

Hi @facelessuser,

I don't understand about the / because I do not removed any one in tags.

@facelessuser
Copy link
Owner

facelessuser commented Mar 1, 2018

I was referring to the fact that you changed to '<input type="checkbox"%s%s/> ', and then back to '<input type="checkbox"%s%s> '. /> is more appropriate as this could be used in xhtml. I cannot look at the history because you force pushed, which rewrote the history, but that was originally why it was failing.

For custom tasklists it is still setting />, but for normal tasklists, it is not. It should be the same for both. I would prefer it to be the same for both. That is what I was saying. Technically, this is a bug on master, but you fixed it, and then reverted it. I was mentioning earlier that it was good that you fixed it, and you just needed to regenerate the failing tests to fix the CI failures.

@g0rk4
Copy link
Contributor Author

g0rk4 commented Mar 1, 2018

All right, now I get it !

I'll fix it this evenning

@g0rk4 g0rk4 force-pushed the add-clickable-checkbox branch from 9a07c5c to 806c82e Compare March 1, 2018 15:14
@g0rk4 g0rk4 force-pushed the add-clickable-checkbox branch from 806c82e to 00f503d Compare March 1, 2018 15:27
@g0rk4
Copy link
Contributor Author

g0rk4 commented Mar 1, 2018

Ok, it's done

@facelessuser
Copy link
Owner

Thanks, I'll try this out some time soon, but so far, everything looks good.

@g0rk4
Copy link
Contributor Author

g0rk4 commented Mar 1, 2018

My pleasure

@facelessuser facelessuser added this to the 4.9.0 milestone Mar 1, 2018
@facelessuser
Copy link
Owner

Went ahead and downloaded it. Everything looks in order. This will be in 4.9.0.

@facelessuser facelessuser merged commit 1b5d8e5 into facelessuser:master Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants