Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

better readable IBAN #824

Merged
merged 3 commits into from
Feb 20, 2021
Merged

Conversation

twothreenine
Copy link
Contributor

Display IBANs in groups of 4 digits with whitespaces in between
solves #821
I changed it in various views I could find.
Important note: I couldn't test it for finance/bank_transactions/show.html.haml
Also I'm very new to Ruby, so please check it carefully

display IBANs in groups of 4 digits with whitespaces in between
@twothreenine twothreenine marked this pull request as ready for review February 16, 2021 03:53
@paroga
Copy link
Member

paroga commented Feb 16, 2021

cool, thanks for the PR.
one problem with your change is, that it's then not possible to just double-click it to mark it for copy&paste. to solve this you could add a "Copy to clipboard"-button or use some little CSS-tricks (as described in the German Wikipedia).

if the generated HTML looks like

<span class="iban">
<span>DE07</span><span>1234</span><span>1234</span><span>1234</span><span>1234</span>12
</span>

you could format it with the following CSS to add some padding:

.iban > span {
  margin-right: 0.5em;
}

As long as there is no whitespace between the different <span> elements, it can be still double-clicked.

what do you think about that?

@fruestueck
Copy link

fruestueck commented Feb 16, 2021

You'r already working on this? Awesome!

if the generated HTML looks like

<span class="iban">
<span>DE07</span><span>1234</span><span>1234</span><span>1234</span><span>1234</span>12
</span>

Agreed. This is also preferrable as it would avoid introduction of whitespaces. Whitespaces could break insertion into banking forms (due to the character limit, and or bad support for whitespace within the iban)

note: copying the IBAN from the supplier site now adds four whitespaces in front of the number - why?
@twothreenine
Copy link
Contributor Author

twothreenine commented Feb 20, 2021

I managed to implement that and it works for the most pages, however when you copy an IBAN from the suppliers/show page, it contains four whitespaces in front of the number, regardless of how many margins there are within the number.
I don't know how to fix this.
Also again I couldn't test it for finance/bank_accounts/index and finance/bank_transactions/show.

@paroga
Copy link
Member

paroga commented Feb 20, 2021

when you copy an IBAN from the suppliers/show page, it contains four whitespaces

I looks like a wired CSS effect to me, which we could just ignore for now, since it's very uncommon that people will try to copy the IBAN there.

finance/bank_accounts/index and finance/bank_transactions/show worked for me too.

@paroga paroga merged commit 401c8f5 into foodcoops:master Feb 20, 2021
@twothreenine twothreenine deleted the feature/format-iban branch February 25, 2021 01:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants