fix: [ocr] UI correlation, fix language bloc

This commit is contained in:
terrtia 2024-04-16 22:56:03 +02:00
parent 4cb47e8af3
commit 56fae107bf
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -75,48 +75,49 @@
{% if not is_correlation %}
<div class="my-1">
<div class="my-1"> {% set mess_id_escape= meta['id'] | replace("/", "_") %}
<span class="btn btn-outline-dark p-0 px-1" type="button" data-toggle="collapse" data-target="#collapseTrans{{ mess_id_escape }}" aria-expanded="false" aria-controls="collapseTrans{{ mess_id_escape }}">
{% set mess_id_escape= meta['id'] | replace("/", "_") %} <i class="fas fa-language"></i> {% if meta['language'] %}{{ meta['language'] }}{% endif %}
<span class="btn btn-outline-dark p-0 px-1" type="button" data-toggle="collapse" data-target="#collapseTrans{{ mess_id_escape }}" aria-expanded="false" aria-controls="collapseTrans{{ mess_id_escape }}"> </span>
<i class="fas fa-language"></i> {% if meta['language'] %}{{ meta['language'] }}{% endif %} <div class="collapse" id="collapseTrans{{ mess_id_escape }}">
</span> <div class="card card-body">
<div class="collapse" id="collapseTrans{{ mess_id_escape }}"> <form method="post" action="{{ url_for('languages_ui.translate_object') }}">
<div class="card card-body"> <input type="text" id="type" name="type" value="{{meta['type']}}" hidden>
<form method="post" action="{{ url_for('languages_ui.translate_object') }}"> <input type="text" id="id" name="id" value="{{meta['id']}}" hidden>
<input type="text" id="type" name="type" value="{{meta['type']}}" hidden> <span class="badge badge-primary">Source:</span>
<input type="text" id="id" name="id" value="{{meta['id']}}" hidden> <span class="">
<span class="badge badge-primary">Source:</span> <select id="language_target" name="language_target" class="form-select" aria-label="Message Language" onchange="$('#translation').val('');">
<span class=""> <option selected value="{{ meta['language'] }}">{{ meta['language'] }}</option>
<select id="language_target" name="language_target" class="form-select" aria-label="Message Language" onchange="$('#translation').val('');"> {% for language in translation_languages %}
<option selected value="{{ meta['language'] }}">{{ meta['language'] }}</option> <option value="{{ language }}">{{ translation_languages[language] }}</option>
{% for language in translation_languages %} {% endfor %}
<option value="{{ language }}">{{ translation_languages[language] }}</option> </select>
{% endfor %} </span>
</select> {% if translation_target %}
</span> <input type="text" id="target" name="target" value="{{translation_target}}" hidden>
{% if translation_target %} &nbsp;&nbsp;&nbsp;&nbsp;<span class="badge badge-primary">Target:</span><span>{{translation_target}}</span>
<input type="text" id="target" name="target" value="{{translation_target}}" hidden> <textarea class="form-control" id="translation" name="translation">{{ meta['translation'] }}</textarea>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="badge badge-primary">Target:</span><span>{{translation_target}}</span> <button class="btn btn-dark" type="submit">
<textarea class="form-control" id="translation" name="translation">{{ meta['translation'] }}</textarea> <i class="fas fa-pen-alt"> Update Language or Translation</i>
<button class="btn btn-dark" type="submit"> </button>
<i class="fas fa-pen-alt"> Update Language or Translation</i> {% else %}
</button> <button class="btn btn-dark" type="submit">
{% else %} <i class="fas fa-pen-alt"> Update Language</i>
<button class="btn btn-dark" type="submit"> </button>
<i class="fas fa-pen-alt"> Update Language</i> {% endif %}
</button> </form>
{% endif %} <div>
</form> <a class="btn btn-primary" href="{{ url_for('languages_ui.detect_object_language')}}?type={{ meta['type'] }}&id={{ meta['id'] }}">
<div> <i class="fas fa-redo"></i> Detect Language
<a class="btn btn-primary" href="{{ url_for('languages_ui.detect_object_language')}}?type={{ meta['type'] }}&id={{ meta['id'] }}"> </a>
<i class="fas fa-redo"></i> Detect Language </div>
</a>
</div> </div>
</div> </div>
</div> </div>
</div> {% endif %}