Skip to content

Commit

Permalink
add translation keys + format
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingphilippe committed Dec 20, 2024
1 parent c9f31d1 commit eceb2cb
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 89 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/index.css

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions app/assets/stylesheets/tailwind/components/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
table th,
table td {
padding: 0.632em 1.05em 0.4743em 0;
@apply leading-tight text-smaller text-left border-solid border-0 border-b-1 border-gray-300;
@apply leading-tight text-smaller text-left border-solid border-0 border-b-1 border-gray-300 align-baseline;
}
thead th {
@apply font-bold;
Expand Down Expand Up @@ -95,10 +95,6 @@
.settings-table .table-heading {
@apply mb-8;
}

.table-field {
@apply align-top;
}
.table-field-index {
width: 15px;
@apply relative text-smaller leading-tight font-bold;
Expand Down Expand Up @@ -134,7 +130,7 @@
}
.table-field-headings th,
.table-field-headings-visible th {
@apply text-smaller leading-tight font-bold;
@apply text-smaller leading-tight font-bold align-baseline;
}
.dashboard-table .table-field-heading-first,
.dashboard-table .table-field-headings-first,
Expand Down
17 changes: 11 additions & 6 deletions app/templates/components/empty-list.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{% macro empty_list(heading, message, img="emptyFlower", link=None, linkText="", attributes="") %}
<div class="flex items-center border-dashed border-1 border-gray-400 p-8 sm:bg-{{img}} sm:bg-right bg-empty-state" data-testid='empty-list'>
<div class="w-full sm:w-2/3" tabindex="0">
<div class="text-title text-gray-700 mb-6">{{ heading }}</div>
<p class="mb-0 text-base text-gray-800">{{ message }}</p>
{% macro empty_list(heading, message=None, img="emptyFlower", link=None, linkText="", attributes="") %}
<div
class="flex items-center border-dashed border-1 border-gray-400 p-8 sm:bg-{{img}} sm:bg-right bg-empty-state min-h-emptyState"
data-testid='empty-list'>
<div class="w-full sm:w-2/3 space-y-gutterHalf" tabindex="0">
<div class="text-title text-gray-700">{{ heading }}</div>
{% if message %}
<p class="mb-0 text-base text-gray-800">{{ message }}</p>
{% endif %}
{% if link %}
<a class="inline-block mt-6 text-base font-bold" {% if attributes %} {{ attributes }} {% endif %} href="{{ link }}">{{ linkText }}</a>
<a class="inline-block text-base font-bold" {% if attributes %} {{ attributes }} {% endif %} href="{{ link }}">{{
linkText }}</a>
{% endif %}
</div>
</div>
Expand Down
9 changes: 5 additions & 4 deletions app/templates/components/table.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% from "components/big-number.html" import big_number %}
{% from "components/empty-list.html" import empty_list %}

{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False, font_size="table-font-xsmall", testid=None) -%}
<section class="scrollable-table" tabindex="0">
Expand Down Expand Up @@ -43,8 +44,8 @@
{% endfor %}
{% if not items %}
{% call row() %}
<td class="table-empty-message p-6" colspan="10">
{{ empty_message }}
<td class="table-empty-message h-10" colspan="10">
{{ empty_list(heading=empty_message) }}
</td>
{% endcall %}
{% endif %}
Expand Down Expand Up @@ -87,8 +88,8 @@
</td>
{%- endmacro %}

{% macro row_heading(cell_width=None) -%}
<th class="table-field {{ cell_width if cell_width}}" scope="row">
{% macro row_heading(cell_width=None, rowspan="1") -%}
<th class="table-field {{ cell_width if cell_width}}" scope="row" rowspan="{{ rowspan }}">
{{ caller() }}
</th>
{%- endmacro %}
Expand Down
30 changes: 20 additions & 10 deletions app/templates/org_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,29 @@
<div class="w-1/4 float-left py-0 px-0 px-gutterHalf box-border">
<nav class="navigation">
<ul>
<li><a
href="{{ url_for('.organisation_dashboard', org_id=current_org.id) }}" {{ org_navigation.is_selected('dashboard') }}>Usage</a>
<li>
<a href="{{ url_for('.organisation_dashboard', org_id=current_org.id) }}" {{ org_navigation.is_selected('dashboard')
}}>
{{ _("Usage") }}
</a>
</li>
<li>
<a href="{{ url_for('.manage_org_users', org_id=current_org.id) }}" {{ org_navigation.is_selected('team-members') }}>
{{ _("Team members")}}
</a>
</li>
<li><a
href="{{ url_for('.manage_org_users', org_id=current_org.id) }}" {{ org_navigation.is_selected('team-members') }}>Team
members</a></li>
{% if current_user.platform_admin %}
<li><a
href="{{ url_for('.organisation_settings', org_id=current_org.id) }}" {{ org_navigation.is_selected('settings') }}>Settings</a>
<li>
<a href="{{ url_for('.organisation_settings', org_id=current_org.id) }}" {{ org_navigation.is_selected('settings') }}>
{{ _("Settings") }}
</a>
</li>
<li>
<a href="{{ url_for('.organisation_trial_mode_services', org_id=current_org.id) }}" {{
org_navigation.is_selected('trial-services') }}>
{{ _("Trial services") }}
</a>
</li>
<li><a
href="{{ url_for('.organisation_trial_mode_services', org_id=current_org.id) }}" {{ org_navigation.is_selected('trial-services') }}>Trial
services</a></li>
{% endif %}
</ul>
</nav>
Expand Down
7 changes: 4 additions & 3 deletions app/templates/partials/nav/gc_header_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{{ nav_menu_item(url=url_for('main.contact', service_id=current_service.id),localised_txt=_('Contact us'), is_active=header_navigation.is_selected('contact')) }}
{% endif %}
{% else %} {# current_user.platform_admin #}
{% if not platform_admin_view_ind %}

{% if current_user.has_permissions() %}
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id), localised_txt=_('Admin panel'), css_classes='pl-0') }}
{{ nav_menu_item(url=url_for('main.service_dashboard', service_id=current_service.id),localised_txt=_('Dashboard'), is_active=header_navigation.is_selected('dashboard')) }}
Expand All @@ -113,9 +113,10 @@
{{ nav_menu_item(url=url_for('main.service_settings', service_id=current_service.id),localised_txt=_('Settings'), is_active=header_navigation.is_selected('settings')) }}
{% else %} {# not current_user.has_permissions, i.e. services not in context #}
{{ nav_menu_item(url=url_for('main.choose_account'),localised_txt=_('Your services'),css_classes='pl-0',id_key='choose_account', is_active=header_navigation.is_selected('choose_account')) }}
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel')) }}
{{ nav_menu_item(url=url_for('main.live_services', service_id=current_service.id),localised_txt=_('Admin panel'),
is_active=header_navigation) }}
{% endif %}
{% endif %}

{% endif %}
{% endif %}
<a
Expand Down
3 changes: 2 additions & 1 deletion app/templates/views/organisations/organisation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ <h1 class="heading-medium">
<ul>
{% for service in current_org.live_services %}
<li class="browse-list-item">
<a href="{{ url_for('main.usage', service_id=service.id) }}" class="browse-list-link">{{ service['name'] }}</a>
<a href="{{ url_for('main.service_dashboard', service_id=service.id) }}" class="browse-list-link">{{ service['name']
}}</a>
</li>
{% endfor %}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
<div class="grid-row contain-floats">
<div class="md:w-5/6 float-left py-0 px-0 px-gutterHalf box-border">
<p>
{{ _('When you turn a service live please log which services have been turned live and why you approved the
change.') }}
{{ _('When you turn a service live please log which services have been turned live and why you approved the change.') }}
</p>
{% call form_wrapper() %} {{ textbox(form.request_to_go_live_notes,
width='w-full', rows=3) }} {{ page_footer(_('Save')) }} {% endcall %}
Expand Down
17 changes: 10 additions & 7 deletions app/templates/views/organisations/organisation/users/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{% from "components/live-search.html" import live_search %}

{% block org_page_title %}
Team members
{{ _("Team members") }}
{% endblock %}

{% block org_content %}

<h1 class="heading-medium">
Team members
{{ _("Team members") }}
</h1>

{% if show_search_box %}
Expand All @@ -24,13 +24,13 @@ <h1 class="heading-medium">
<div class="user-list">
{% for user in users %}
<div class="user-list-item">
<h3>
<h3 class="flex justify-between">
{%- if user.name -%}
<span class="heading-small">{{ user.name }}</span>&ensp;
<span class="heading-small m-0">{{ user.name }}</span>&ensp;
{%- endif -%}
<span class="hint">
{%- if user.status == 'pending' -%}
{{ user.email_address }} (invited)
{{ user.email_address }} ({{ _("invited") }})
{%- elif user.status == 'cancelled' -%}
{{ user.email_address }} ({{ _('cancelled invite') }})
{%- elif user.id == current_user.id -%}
Expand All @@ -43,7 +43,9 @@ <h3>
<ul class="tick-cross-list grid-row contain-floats relative">
<li class="tick-cross-list-edit-link">
{% if user.status == 'pending' %}
<a href="{{ url_for('.cancel_invited_org_user', org_id=current_org.id, invited_user_id=user.id)}}">Cancel invitation</a>
<a href="{{ url_for('.cancel_invited_org_user', org_id=current_org.id, invited_user_id=user.id)}}">
{{ _("Cancel invitation")}}
</a>
{% endif %}
</li>
</ul>
Expand All @@ -52,7 +54,8 @@ <h3>
</div>

<div class="js-stick-at-bottom-when-scrolling">
<a href="{{ url_for('.invite_org_user', org_id=current_org.id) }}" class="button button-secondary">Invite team member</a>
<a href="{{ url_for('.invite_org_user', org_id=current_org.id) }}" class="button button-secondary">{{ ("Invite team
member") }}</a>
</div>

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% from "components/form.html" import form_wrapper %}

{% block service_page_title %}
Invite a team member
{{ _("Invite a team member") }}
{% endblock %}

{% block org_content %}
Expand All @@ -20,11 +20,11 @@

<div class="mb-12 clear-both contain-floats">
<p class="form-label">
{{ current_org.name }} team members can:
{{ _("{} team members can:").format(current_org.name)}}
</p>
<ul class="list list-bullet">
<li>see usage for and team members for each service</li>
<li>invite other team members</li>
<li>{{ _("see usage for and team members for each service") }}</li>
<li>{{ _("invite other team members") }}</li>
</ul>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/templates/views/platform-admin/clear-cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{% from "components/page-footer.html" import page_footer %}

{% block per_page_title %}
Clear Cache
{{ _("Clear Cache") }}
{% endblock %}

{% block platform_admin_content %}

<h1 class="heading-large">
Clear Cache
{{ _("Clear Cache") }}
</h1>

{% call form_wrapper() %}
Expand Down
8 changes: 4 additions & 4 deletions app/templates/views/platform-admin/complaints.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
{% block platform_admin_content %}

<h1 class="heading-large">
Email complaints
{{ _("Email complaints") }}
</h1>


{% call(item, row_number) list_table(
complaints,
caption="Complaints",
caption=_("Complaints"),
caption_visible=False,
empty_message='No complaints',
field_headings=['Notification Id', 'Service', 'Complaint type', 'Complaint Date'],
empty_message=_('No complaints'),
field_headings=[_('Notification Id'), _('Service'), _('Complaint type'), _('Complaint Date')],
field_headings_visible=True
) %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
{% from "components/form.html" import form_wrapper %}

{% block per_page_title %}
Monthly notification statuses for live services
{{ _("Monthly notification statuses for live services") }}
{% endblock %}

{% block platform_admin_content %}

<h1 class="heading-large">
Monthly notification statuses for live services
{{ _("Monthly notification statuses for live services") }}
</h1>

{% call form_wrapper() %}
{{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }}
{{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }}
{{ textbox(form.start_date, hint=_("Enter start date in format YYYY-MM-DD")) }}
{{ textbox(form.end_date, hint=_("Enter end date in format YYYY-MM-DD")) }}
{{ page_footer(_('Download report')) }}
{% endcall %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ <h1 class="heading-large">
</h1>

{% call form_wrapper() %}
{{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }}
{{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }}
{{ textbox(form.start_date, hint=_("Enter start date in format YYYY-MM-DD")) }}
{{ textbox(form.end_date, hint=_("Enter end date in format YYYY-MM-DD")) }}
{{ page_footer(_('Download report')) }}
{% endcall %}

Expand Down
Loading

0 comments on commit eceb2cb

Please sign in to comment.