1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-12-18 08:27:03 +02:00

Merge pull request #194 from SethFalco/translate-type-buttons

bug: fix translate text/file buttons
This commit is contained in:
Piero Toffanin 2022-01-04 14:36:04 -05:00 committed by GitHub
commit 5176c18625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 16 deletions

View File

@ -56,6 +56,7 @@ h3.header {
outline: none;
position: relative;
}
@-moz-document url-prefix() {
.language-select select {
-moz-appearance: none;
@ -121,6 +122,9 @@ h3.header {
.btn-switch-type {
background-color: #fff;
color: #42A5F5;
display: flex;
align-items: center;
margin: .5rem;
}
.btn-switch-type:focus {
@ -179,6 +183,22 @@ h3.header {
font-size: 1.35rem;
}
#translation-type-btns {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: -.5rem;
}
.btn-text {
display: none;
margin-left: 1em;
}
#translation-form {
padding-top: 1em;
}
.progress {
background-color: #f3f3f3;
}
@ -236,6 +256,12 @@ h3.header {
height: 32px;
}
@media (min-width: 280px) {
.btn-text {
display: inline;
}
}
@media (max-width: 760px) {
.language-select select {
text-align: center;

View File

@ -37,8 +37,10 @@
<header>
<nav class="blue lighten-1" role="navigation">
<div class="nav-wrapper container">
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<a id="logo-container" href="/" class="brand-logo">
<img src="{{ url_for('static', filename='icon.svg') }}" class="logo"> LibreTranslate
<img src="{{ url_for('static', filename='icon.svg') }}" alt="Logo for LibreTranslate" class="logo">
<span>LibreTranslate</span>
</a>
<ul class="right hide-on-med-and-down">
<li><a href="/docs">API Docs</a></li>
@ -55,7 +57,6 @@
<li><a href="javascript:setApiKey()" title="Set API Key"><i class="material-icons">vpn_key</i></a></li>
{% endif %}
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
</div>
</nav>
</header>
@ -105,11 +106,17 @@
<div class="container">
<div class="row">
<h3 class="header center">Translation API</h3>
<div class="col s12 mb-1 center" v-if="filesTranslation === true">
<button type="button" class="btn btn-switch-type" @click="switchType('text')" :class="{'active': translationType === 'text'}"><i class="material-icons left">title</i>Translate text</button>
<button type="button" class="btn btn-switch-type" @click="switchType('files')" :class="{'active': translationType === 'files'}"><i class="material-icons left">description</i>Translate files</button>
<div id="translation-type-btns" class="s12 center" v-if="filesTranslation === true">
<button type="button" class="btn btn-switch-type" @click="switchType('text')" :class="{'active': translationType === 'text'}">
<i class="material-icons">title</i>
<span class="btn-text">Translate Text</span>
</button>
<button type="button" class="btn btn-switch-type" @click="switchType('files')" :class="{'active': translationType === 'files'}">
<i class="material-icons">description</i>
<span class="btn-text">Translate Files</span>
</button>
</div>
<form class="col s12">
<form id="translation-form" class="col s12">
<div class="row mb-0">
<div class="col s6 language-select">
<span>Translate from</span>