Skip to content

Commit

Permalink
feat: mark for i18n, handle case where count = -1
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Oct 21, 2024
1 parent 7456c0a commit a895646
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
33 changes: 29 additions & 4 deletions xmodule/templates/item_bank/author_view.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
{% load i18n %}
<div style="padding: 1em">
{% if block_count > 0 %}
<p>Learners will see {{ max_count }} of the {{ block_count }} selected components:</p>
{% if max_count == -1 %}
<p>
{% blocktrans count num_selected=block_count %}
Learners will see the selected component:
{% plural %}
Learners will see all of the {{ num_selected }} selected components, in random order:
{% endblocktrans %}
</p>
{% else %}
<p>
{% blocktrans with max_count=max_count count num_selected=block_count %}
Learners will see the selected component:
{% plural %}
Learners will see {{ max_count }} of the {{ num_selected }} selected components:
{% endblocktrans %}
</p>
{% endif %}
<ol style="list-style: decimal; margin-left: 2em;">
{% for block in blocks %}
<li>{{ block.display_name }}</li>
{% endfor %}
</ol>
<p style="color: var(--gray);">Press <a href="/container/{{ item_bank_id }}">View</a> to preview, sync/update, and/or remove the selected components.</p>
<p style="color: var(--gray);">Press <a role="button" href="#" class="edit-button action-button">Edit</a> to configure how many will be shown and other settings.</p>
<p style="color: var(--gray);">
{% blocktrans with prefix="/container/" item_bank_id=item_bank_id %}
Press <a href="{{prefix}}{{item_bank_id}}">View</a> to preview, sync/update, and/or remove the selected components.
{% endblocktrans %}
</p>
<p style="color: var(--gray);">
{% blocktrans with link='role="button" href="#" class="edit-button action-button"'|safe %}
Press <a {{link}}>Edit</a> to configure how many will be shown and other settings.
{% endblocktrans %}
</p>
{% else %}
<p>You have not selected any components yet.</p>
<p>{% trans "You have not selected any components yet." %}</p>
{% endif %}
</div>
12 changes: 8 additions & 4 deletions xmodule/templates/item_bank/author_view_add.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{% load i18n %}
<div class="insert-new-lib-blocks-here"></div>
<div class="xblock-header-secondary">
{% comment %}
How does this button work? An event handler in cms/static/js/views/pages/container.js
How this button works: An event handler in cms/static/js/views/pages/container.js
will watch for clicks and then display the SelectV2LibraryContent modal and process
the list of selected blocks returned from the modal.
{% endcomment %}
<button class="btn btn-primary problem-bank-v2-add-button">
<span class="icon fa fa-plus" aria-hidden="true"></span>
Add components
</button> from a content library to this problem bank.
</div>
{# Translators: This is the button label that appears before the separate "from a content library to this problem bank." message. #}
{% trans "Add components" %}
</button>
{# Translators: This text appears immediately after the "Add components" button. If it's difficult to translate directly, replace this with an empty string to hide it. #}
{% trans "from a content library to this problem bank." %}
</div>

0 comments on commit a895646

Please sign in to comment.