Wallets: limit maximum description length to 418 characters

418 characters is the current longest description we have.
This commit is contained in:
David A. Harding 2017-05-17 06:08:12 -04:00
parent ab641d7300
commit c09a126439
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
2 changed files with 15 additions and 3 deletions

View file

@ -7,6 +7,7 @@
layout: base
id: choose-your-wallet
max_wallet_text_length: 418 ## Unicode characters
wallets:
- bitcoincore:
@ -1231,7 +1232,9 @@ wallets:
<div class="check{{ check[0] }} {% if check[1] contains "checkgood" %}checkgood{% elsif check[1] contains "checkpass" %}checkpass{% elsif check[1] contains "checkneutral" %}checkneutral{% else %}checkfail{% endif %}">{% translate {{check[1]}} %}<div><p>{% translate {{check[1]}}txt %}</p><span></span></div></div>
{% endif %}{% endfor %}
</div>
<p>{% translate {{platform.text}} %}</p>
{% capture platform_text %}{% translate {{platform.text}} %}{% endcapture %}
{% assign platform_text_length = platform_text | size %}
<p>{% if platform_text_length > page.max_wallet_text_length %}{% die Wallet text too long %}{% else %}{{platform_text}}{% endif %}</p>
<div><img src="/img/screenshots/{{ platform.screenshot }}" alt="screenshot"></div>
</div>
<a><img src="/img/wallet/{{ wallet[0] }}.png" alt="{{ wallet[1].title }}" />{{ wallet[1].titleshort }}<span></span></a>
@ -1261,7 +1264,9 @@ wallets:
<div class="check{{ check[0] }} {% if check[1] contains "checkgood" %}checkgood{% elsif check[1] contains "checkpass" %}checkpass{% elsif check[1] contains "checkneutral" %}checkneutral{% else %}checkfail{% endif %}">{% translate {{check[1]}} %}<div><p>{% translate {{check[1]}}txt %}</p><span></span></div></div>
{% endif %}{% endfor %}
</div>
<p>{% translate {{platform[1].text}} %}</p>
{% capture platform_text %}{% translate {{platform[1].text}} %}{% endcapture %}
{% assign platform_text_length = platform_text | size %}
<p>{% if platform_text_length > page.max_wallet_text_length %}{% die Wallet text too long %}{% else %}{{platform_text}}{% endif %}</p>
<div><img src="/img/screenshots/{{ platform[1].screenshot }}" alt="screenshot"></div>
</div>
<a><img src="/img/wallet/{{ wallet[0] }}.png" alt="{{ wallet[1].title }}" />{{ wallet[1].titleshort }}<span></span></a>

View file

@ -20,6 +20,13 @@ properties:
description: The page identifier to use for translations
type: string
max_wallet_text_length:
description: >
The global maximum length for a wallet text description in any
langugage (counted in Unicode characters). Ensures text doesn't
overfill its box.
type: integer
## The wallets array
wallets:
description: The array containing all wallets
@ -102,7 +109,7 @@ properties:
- desktop
properties:
desktop:
description: Wallets than run on desktop operating systems
description: Wallets that run on desktop operating systems
type: object
required: &desktop-required
- text