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

Worksheets: button to print page #1948

Closed
wants to merge 1 commit into from

Conversation

Alex-Jordan
Copy link
Contributor

This adds a button to print the HTML page. Demonstrated here.

Only available on standalone worksheet pages, but could easily be extended.

The styling is uncommitted to navbar_default.css. Not sure if I should be messing with that file, so I'll await input from @davidfarmer. As well as input on the particular styling I went with (just copying the Calc button).

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 9, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Mar 9, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Mar 9, 2023 via email

@kcrisman
Copy link
Contributor

kcrisman commented Mar 9, 2023 via email

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 9, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

I hope I am not infusing my own user experience too much and projecting it onto students. But using links and navigating to new pages is essential to what a web browser is for in the first place. Printing things off is not what a web browser is for, and off radar.

In a meeting I showed a worksheet for ORCCA to colleagues. The first comment/question was "This is fine but what if I wanted to hand out copies in class?" They immediately (mis)understood the page to be a portal for students to type things into the big colored workspace fields.

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 9, 2023 via email

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 10, 2023

Nice. XSL looks good.

Sounds like you are going to replace the printer character? Will we need a beta to test styling? Or wait on changes in another repository?

Holler when this is ready. Might catch a few PRs Friday AM, but there is no rush.

@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Mar 10, 2023

I'm wrestling with some CSS for this, and potentially the need to change the HTML. The issue starts because I feel like the print button should be over on the right (but left of the tree buttons). So let me check in. Does anyone want to convince me to put the print button on the left? Like next to the Calc button, or Index button?

Placing the button where I want to place it raises issues of floating things to the right. To accomplish that in this demo I had to move the tree buttons earlier in the DOM. They do not appear to be placed differently on that page, but the tab order is not what you would expect. It goes through the tree buttons first, then back to index, calc, print.

Is that a good change? Get the tab-navigating user to the tree buttons first? I think it's considered bad practice to have the tab order misaligned with the visual order.

To do this "right", the buttons navbar should use a flex-box scheme. That would be a significant change to the CSS and make it awkward to support existing pages that float the tree buttons right, while also supporting a new flex-box scheme.

Thoughts?

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 10, 2023 via email

@oscarlevin
Copy link
Member

As a user, I think I would expect to see a "print" button or link "inside" the page, and not as a stealthy new button in the navigation. As a bonus, this wouldn't require any tweaks to the pages "frame"

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 10, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

Alright, that helps. I put the button inside the page, and CSS changes are minimal additions:

https://spot.pcc.edu/~ajordan/temp/worksheet-1-letter.html

The button itself is not styled. If anyone has suggestions, I'll try them out. Going to force push with updated XSL now.

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 10, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

Now with the updated XSLT.

There are uncommitted edits to pretext.css that only impact .print-button.

In editing the localization files, I noticed two of them had CRLF style line breaks. Must have been submitted by a Windows user. I removed the CR part in a separate commit (along with a few other places in the repository where they showed up. They are also in some MOM static content that is committed to the repo, but I opened #1949 about that.

@Alex-Jordan
Copy link
Contributor Author

Now "LightGreen". Just until David makes it better.

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 10, 2023

A project may be chunked in a manner where a worksheet is one of several divisions on the page. One such is 33.4 in sample article (screenshot). The "A4" and "US" buttons take you to a standalone version.

This suggests to me that a "Print" button maybe belongs only on the standalone page. Is that where this is going?

Am I just missing some CSS? See button placement in screenshots.

Screenshot 2023-03-10 at 10-42-48 SA Worksheets
Screenshot 2023-03-10 at 10-43-26 SA Dot products and projection

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 10, 2023

I'm always happy to clean-up whitespace. But maybe this commit doesn't belong here on top of other changes to the localization files.

If nothing more changes, I can deal with it as-is now. But if there are more changes, maybe you can cherry-pick it away and merge into some other local branch and save it for just a bit later?

@Alex-Jordan
Copy link
Contributor Author

You are missing some CSS. Refresh on the standalone page.

But the presence of the button on other pages is my mistake. I'll think that through and update.

Roger on the CR. IT was uglifying the diff on those localization files for this which is what got me going on it here.

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 10, 2023

Refresh on the standalone page.

That's better! Sorry, should have thought about that sooner.

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 10, 2023

But the presence of the button on other pages is my mistake. I'll think that through and update.

From the hip. Isn't there a template that makes the standalone version? Add the button in there, always? Without even having a separate template?

@Alex-Jordan
Copy link
Contributor Author

From the hip. Isn't there a template that makes the standalone version? Add the button in there, always? Without even having a separate template?

One thing: If we are sure the button is only for printing worksheet pages, then I considered this. I was trying to make it abstract enough that it could apply to other things easily when they come up in the future. Still thinking, but I may give up.

Other thing: for the button to literally be inside the worksheet as it is in the current sample, the styling is simpler (I think?) if it is within the "structural division content". But that led to it showing up where I didn't want it...

@Alex-Jordan
Copy link
Contributor Author

CR removal removed.

Now it builds the button outside of the actual content, but within the file wrapper. For the standalone worksheet, the context node is the "worksheet", not a section, etc. And the modal template for the print-button applied to a "worksheet" builds the button.

I don't think I can place the button on the top right corner of the worksheet this way. So it's in the top left corner, as here:
https://spot.pcc.edu/~ajordan/temp/worksheet-1-letter.html

It's not really "in" the worksheet with the border outline. It is before that, but positioned to overlay.

@davidfarmer
Copy link
Contributor

davidfarmer commented Mar 10, 2023 via email

@Alex-Jordan
Copy link
Contributor Author

David's CSS is applied.

Not sure yet if Rob is sold on the print-button template being applied inside the file-wrap template. If not, this CSS will change.

@Alex-Jordan
Copy link
Contributor Author

OK, you can take a more serious look at this now.

@rbeezer
Copy link
Collaborator

rbeezer commented Mar 11, 2023

Thanks for sticking with this one! Merged, and might rebuild tonight (check first).

I'll leave publicity (pretext-announce) to you. I may post on -dev just now, have a look first.

@rbeezer rbeezer closed this Mar 11, 2023
@Alex-Jordan
Copy link
Contributor Author

I don't think this is worth publicizing. But if we are revitalizing worksheets in other ways, then after all that is done, we could make one post to -announce.

@Alex-Jordan Alex-Jordan deleted the print-button branch September 14, 2023 03:24
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.

None yet

5 participants