Conversation
|
Hi Erik: Thanks for your contribution. I assume the problem you are solving is that there is no indication that the "submit" button has been clicked. While investigating your change, I realized that the submit button isn't disabled after clicking and the text If that was part of the default trackers, would you still want/need the overlay? If the overlay is still needed, I agree adding at the bottom of page.html (or equivalent in the jinja2 template) and adding css to style.css is the way to go. Also I usually center text these days using Thanks again for your interest in Roundup and making it better. -- rouilj |
|
Hi John, I hadn't looked too deep into the templating system you have, it is daunting at first - thanks for the pointers! After testing, display:flex only placed the content horizontally centered, but block did only vertical.
|
|
Hello Erik: I haven't yet had a chance to look at your latest PR and won't till this weekend.
Got it. If you're interested, I would like to email/chat off ticket about your setup/use
Sure. This https://www.roundup-tracker.org/docs/reference.html#id69 provides an overview of the templates and might help. I assume your tracker is based on the classic (TAL templating) based tracker. The layout for the jinja2 based tracker is different. Also the customizing
I'll take a look.
That is true. You can add a standard where
One thing to note is that onX html attributes are being removed from Roundup -- rouilj |
| submitted_restore = ""; | ||
|
|
||
| function submit_reset() { | ||
| $("#submit_overlay").hide(); |
There was a problem hiding this comment.
Is this $(...) jquery? If so please replace it with vanilla javascript.
Going forward I hope to remove jquery entirely from all templates (issue2551423 as it is a maintainance issue: https://issues.roundup-tracker.org/issue2551422 https://issues.roundup-tracker.org/issue2551424. So I really don't want to add more.
There was a problem hiding this comment.
Yes, and no problem! (the original commit used vanilla JS, I just noticed that jQuery was used and firgured that was more the direction you were using)
There was a problem hiding this comment.
jquery has some specific uses for some interactions and was added back
in 2009 when IE was a thing. At that point I don't think querySelector() existed.
| <script nonce="%s" type="text/javascript"> | ||
| submitted = false; | ||
| function submit_once() { | ||
| submitted_restore = ""; |
There was a problem hiding this comment.
Might I suggest a different way to do this. Your current code gives the submitted variable two different meanings:
- a true/false flag if the button has submitted a request.
- the button DOM object.
While that is hacky (so lives up to the title 9-)), it ook me a bit to figure out what the (type(submitted) == type(true) was doing.
I suggest keeping submitted as a simple boolean value.
Since you added the variable: submitted_restore, make it have one of two values:
- an unset value of
null(which can be tested withsubmitted_restore !== null(which should test type as well as value) - a plain object set (at line 3465 in this diff) using:
submitted_restore = { "target": e, "text": e.textContent, "value": e.value }
Doing it this way, you restore the value if it is not the same as the text string. This happens in the SubmitSilentChange example.
| width: 100%; | ||
| } | ||
|
|
||
| td.date, th.date { |
There was a problem hiding this comment.
Can you restore the trailing whitespace in the css and html files across all your changes. Looks like there are 3 of them. The whitespace fixups in the javascript in templating.py are fine. That's not something that has to be applied manually as part of the upgrade.
When I add updates like this to upgrading.txt, I sometimes include references to the commit. This lets
admins download the commit as a patch and apply it to their trackers. Having a clean patch
that only changes the one thing needed for the additional function is better.
There was a problem hiding this comment.
My IDE removes all trailing spaces automatically upon save, I'll see what I can do to exempt your remo
There was a problem hiding this comment.
Thanks. I can't apply your PR directly in github (our VCS of record is mercurial), so I can fix it before I commit. But having it fixed in the pull request would be best.
|
|
||
| const transfer = new DataTransfer(); | ||
| file_list = document.querySelectorAll('pre[data-mimetype]'); | ||
| file_list.forEach( file => |
There was a problem hiding this comment.
This change is fine since it is in the Python file that is not meant to be customized on a per tracker basis.
| function submit_reset() { | ||
| $("#submit_overlay").hide(); | ||
| if (typeof(submitted)!=typeof(true)) { | ||
| submitted.value = submitted.textContent = submitted_restore; |
There was a problem hiding this comment.
value and text content might not be the same specially if the text content is multiple words.
There was a problem hiding this comment.
Our implementation uses href= links for some submits, this was a way to cover both buttons/inputs and anchors - I did not see a conflict in my testing when both were modified but I can instead put a check in for html element vs form element to use value or text accordingly
There was a problem hiding this comment.
I assume the href link id executing a (long running) read only operation (like a search)?
I just want to make sure that your link is not updating the database using a GET (rather than POST) method (which was something that was done with earlier Roundup implementations and does have one remnant in current Roundup).
It would be wonderful if when clicking submit the screens would indicate that it is working/waiting. This is a very hacky but working implementation.
Ideally the overlay would be predefined and available in the base HTML, and the styles in a global css file.