first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<div id="{{ dialog.id }}"
class="{{ dialog.class }}"
title="{{ dialog.strings.title }}"
style="display:none"
data-previous-text="{{ dialog.strings.previous_text }}"
data-cancel-text="{{ dialog.strings.cancel_text }}">
<div class="js-select-user"
data-set-languages-text="{{ dialog.strings.set_languages_text }}"
data-nonce="{{ dialog.nonce }}"
style="width: 600px">
<label class="add-new-translation-role-label" for="translator-existing-user"><input type="radio" id="translator-existing-user" name="user" value="existing"/> {{ dialog.strings.existing_user }}</label>
<div class="js-existing-user-section add-new-translation-role-form" style="display: none">
<input type="text" class="js-translation-user-select" placeholder=""/>
</div>
<label class="add-new-translation-role-label" for="translator-new-user"> <input type="radio" id="translator-new-user" name="user" value="new"/> {{ dialog.strings.new_user }}</label>
<div class="js-new-user-section add-new-translation-role-form" style="display: none">
{% include 'new-user-inputs.twig' %}
</div>
</div>
<div class="js-select-languages-section add-new-translator-languages"
data-save-translator-text="{{ dialog.strings.save_translator_text }}"
style="width: 600px;display: none">
<h4 data-text="{{ dialog.strings.set_lang }}"></h4>
<div class="js-error notice notice-error otgs-notice-icon" style="display: none"></div>
{% include 'language-pairs.twig' %}
</div>
</div>

View File

@@ -0,0 +1,10 @@
<div id="{{ dialog.id }}"
class="{{ dialog.class }}"
title="{{ dialog.strings.title }}"
style="display:none"
data-save-text="{{ dialog.strings.save_text }}"
data-cancel-text="{{ dialog.strings.cancel_text }}">
{% include 'language-pairs.twig' %}
</div>

View File

@@ -0,0 +1,28 @@
<div class="js-language-pairs" data-default-language="{{ dialog.default_language }}"></div>
<button class="button button-secondary button-small js-add-lang-pair">{{ dialog.strings.add_lang_pair_text }}</button>
<div class="js-select-languages" style="width: 600px;display: none">
<div class="wpml-form-row">
<span class="languages-from-label">{{ dialog.strings.from }}:</span>
<select name="from-language[]" class="js-from-language-select">
<option value="0">{{ dialog.strings.choose_language }}</option>
{% for lang in dialog.source_languages.get_codes() %}
{% set lang_details = dialog.source_languages.get( lang ) %}
<option value="{{ lang_details.get_code() }}">{{ lang_details.get_display_name() }}</option>
{% endfor %}
</select>
<i class="otgs-ico-close js-delete-language-pair delete-language-pair"></i>
</div>
<div class="languages-to js-to-languages" style="display: none;">
<span class="languages-to-label">{{ dialog.strings.to }}:</span>
<div>
{% for lang in dialog.languages.get_codes() %}
<label>
<input type="checkbox" name="to-language[]" value="{{ lang }}"/>
{% include 'language-with-flag.twig' with {'lang' : lang, 'languages' : dialog.languages} %}
</label>
{% endfor %}
</div>
</div>
</div>

View File

@@ -0,0 +1,2 @@
{% set lang_details = languages.get( lang ) %}
<img width="18" height="12" src="{{ lang_details.get_flag_url() }}"> {{ lang_details.get_display_name() }}

View File

@@ -0,0 +1,13 @@
{% if only_i_user %}
<div class="js-translator-only-i translator-only-i" data-user-id="{{ only_i_user.ID }}">
<div class="translator-only-i-person">
<span class="translator-only-i-avatar">{{ only_i_user.avatar|raw }}</span>
<span class="translator-only-i-name ">{{ only_i_user.user_login }}</span>
<a class="otgs-ico-close js-remove-translator translator-only-i-remove-icon js-otgs-popover-tooltip" title="{{ strings.remove_me }}"></a>
</div>
<div class="translator-only-i-info">
<span class="translator-only-i-text">{{ strings.only_i }}</span>
<a class="js-remove-translator translator-only-i-remove-action">{{ strings.remove_me }}</a>
</div>
</div>
{% endif %}

View File

@@ -0,0 +1,5 @@
<tr>
<th scope="col" class="manage-column sortable"><a><span>{{ strings.columns.name }}</span><span class="sorting-indicator"></span></a></th>
<th scope="col" class="manage-column sortable"><a><span>{{ strings.columns.email }}</span><span class="sorting-indicator"></span></a></th>
<th scope="col" class="manage-column">{{ strings.columns.language_pairs }}</th>
</tr>

View File

@@ -0,0 +1,27 @@
<tr data-user-id="{{ user.ID }}" data-language-pairs="{{ user.language_pairs|json_encode() }}">
<td class="column-title">
{{ user.display_name }}
<div class="row-actions">
<span class="edit">
<a class="js-edit-languages" title="{{ strings.edit_languages }}">{{ strings.edit_languages }}</a>
</span>
|
<span class="trash">
<a class="js-remove-translator" title="{{ strings.remove }}">{{ strings.remove }}</a>
</span>
</div>
</td>
<td class="column-email">{{ user.user_email }}</td>
<td class="column-languages">
{% for from_lang, to_langs in user.language_pairs %}
<div>
{% include 'language-with-flag.twig' with {'lang' : from_lang } %} &raquo;
{% for lang in to_langs -%}
<span>
{%- include 'language-with-flag.twig' -%}
</span>
{%- endfor %}
</div>
{% endfor %}
</td>
</tr>

View File

@@ -0,0 +1,10 @@
<table class="widefat striped js-translators-table translators-table">
<thead>
{% include 'table-header.twig' %}
</thead>
<tbody>
{% for user in users %}
{% include 'translators-row.twig' %}
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,22 @@
<div class="js-translators wpml-section" data-nonce="{{ nonce }}">
<h2>{{ strings.title }}</h2>
<div class="js-translators-list">
{% include 'only-i-translator.twig' %}
<div class="tablenav top clearfix text-center">
<button
class="button-secondary alignright js-add-translator"
{% if not can_add_translators %} disabled {% endif %}
> + {{ strings.add_translator }}</button>
</div>
{% if can_add_translators %}
{% include 'translators-table.twig' %}
{% else %}
<div class="notice notice-warning inline">
<p>{{ strings.no_capability }}</p>
</div>
{% endif %}
</div>
{% include 'add-new-translator-dialog.twig' with { 'dialog': add_translator_dialog } %}
{% include 'edit-translator-languages-dialog.twig' with { 'dialog': edit_translator_languages_dialog } %}
</div>