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

New snippets for Spanish lesson index #625

Merged
merged 10 commits into from
Feb 19, 2018
Merged

Conversation

mdlincoln
Copy link
Contributor

@mdlincoln mdlincoln commented Oct 15, 2017

While waiting to figure out the JS problems on #623, we can at least translate these snippets.

Closes #623

@mdlincoln
Copy link
Contributor Author

@vgayolrs can you please push commits here: https://github.com/programminghistorian/jekyll/blob/lesson-filter-es-fix/_data/snippets.yml#L135-L140

Please add your commits to the lesson-filter-es-fix branch

@vgayolrs
Copy link
Contributor

Thanks @mdlincoln . I'm on it. Let me review carefully some details. I'll let you know when I'm done.

@vgayolrs
Copy link
Contributor

vgayolrs commented Oct 15, 2017

ok @mdlincoln , I think it's ready to merge.

vgayolrs
vgayolrs previously approved these changes Oct 15, 2017
@mdlincoln
Copy link
Contributor Author

Thank you @vgayolrs. We still need to fix the Javascript issue before these snippets can be displayed, unfortunately. I'll keep working on it.

@vgayolrs
Copy link
Contributor

You're welcome @mdlincoln . Let me know if there's anything else I can do. Unfortunately, no javascripts at the moment.

@mdlincoln
Copy link
Contributor Author

So @walshbr I know no javascript whatsoever but I think I hacked my way through this. As described in the original issue, the problem is that we can't use liquid includes within lessonfilter.js, so we need to find another way to pass the proper text labels through to javascript. I think I've done that here.

One question: do you know how to properly set $('#date-sort-text').attr('label') and $('#difficulty-sort-text').attr('label') into variables so they properly render in that text() function? I feel like this could be DRY-er - right now I call each of those queries twice, which is awkward.

@walshbr
Copy link
Contributor

walshbr commented Feb 19, 2018

That what you had in mind @mdlincoln? Check out the last commit where I set the variables at the bottom of the js file. One issue with how I did this, I think, is that it sets the labels on each page load. So if the file gets loaded on a page where those labels don't exist we'd get some unexpected behavior. But it appears that this js file is only getting included on the lessons page anyway, so that problem never arises.

And great job figuring it out! I couldn't quite wrap my head around what you meant in the original note on this issue, so I'm glad that you figured it out.

@mdlincoln
Copy link
Contributor Author

Ah I see - I'd tried saving them to variables somewhere else in the JS and it wasn't working.

I think this is ready for merging if you agree @walshbr

Copy link
Contributor

@walshbr walshbr left a comment

Choose a reason for hiding this comment

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

Looks good to me! We can open separate tickets if anything arises. But seems like the functionality is working as expected, and I'm not seeing errors in the console anywhere.

@walshbr walshbr merged commit 836b5bc into gh-pages Feb 19, 2018
@mdlincoln mdlincoln deleted the lesson-filter-es-fix branch February 19, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants