add test print button in admin panel - #196
Conversation
cdad0b2 to
b5a564a
Compare
b5a564a to
d4d9685
Compare
f966666 to
f0436a8
Compare
| except Exception: | ||
| # re-raise so higher-level handlers can manage it | ||
| raise |
There was a problem hiding this comment.
What's the point of the try-except block if all exceptions are re-thrown?
| [#196]: https://github.com/KSIUJ/gutenberg/pull/196 | ||
| [#194]: https://github.com/KSIUJ/gutenberg/pull/194 |
There was a problem hiding this comment.
| [#196]: https://github.com/KSIUJ/gutenberg/pull/196 | |
| [#194]: https://github.com/KSIUJ/gutenberg/pull/194 | |
| [#194]: https://github.com/KSIUJ/gutenberg/pull/194 | |
| [#196]: https://github.com/KSIUJ/gutenberg/pull/196 |
| def test_print_controls(self, obj): | ||
| """ | ||
| Renders action buttons for test prints in different configurations (simplex/duplex, color/black and white). | ||
| """ | ||
| if not obj or not obj.pk: | ||
| return "-" | ||
|
|
||
| url = reverse('admin:control_printer_test_print', args=[obj.pk]) | ||
|
|
||
| test_variants = [ | ||
| ('B&W Simplex', False, False, 'btn-bw-simplex'), | ||
| ('Color Simplex', True, False, 'btn-color-simplex'), | ||
| ('B&W Duplex', False, True, 'btn-bw-duplex'), | ||
| ('Color Duplex', True, True, 'btn-color-duplex'), | ||
| ] |
There was a problem hiding this comment.
The term simplex is not used anywhere else in the UI or code. I would also avoid the term duplex - most of the code and the entire web UI use the terms one-sided and two-sided.
I would suggest sticking to one naming convention (both in the UI and in code) and in my opinion one-sided/two-sided is easier to understand for unfamiliar users.
There was a problem hiding this comment.
The term black and white is incorrect here.
We support two color modes:
- colored,
- grayscale (
monochromein the Internet Printing Protocol)
grayscale (monochrome) is different from black and white (IPP: bi-level) - the former can print a spectrum of colors from white to black, while the latter can only print two colors
f0436a8 to
a52c26e
Compare
a52c26e to
6513515
Compare


Description
This pull request adds a test print button for admins so they can quickly check whether a printer works correctly.
issue: #185
Changes: