Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibreTranslate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Riße, Matthias
LibreTranslate
Commits
aaa3c83d
Unverified
Commit
aaa3c83d
authored
3 years ago
by
Sébastien Thuret
Browse files
Options
Downloads
Patches
Plain Diff
add file and translate button display
parent
50ce3720
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/static/css/main.css
+1
-1
1 addition, 1 deletion
app/static/css/main.css
app/static/js/app.js
+12
-1
12 additions, 1 deletion
app/static/js/app.js
app/templates/index.html
+19
-2
19 additions, 2 deletions
app/templates/index.html
with
32 additions
and
4 deletions
app/static/css/main.css
+
1
−
1
View file @
aaa3c83d
...
@@ -142,7 +142,7 @@ h3.header {
...
@@ -142,7 +142,7 @@ h3.header {
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
background
:
#f3f3f3
;
background
:
#f3f3f3
;
padding
:
1rem
2rem
1rem
1.5rem
;
padding
:
1rem
2rem
1rem
1.5rem
;
height
:
220px
;
min-
height
:
220px
;
position
:
relative
;
position
:
relative
;
}
}
...
...
This diff is collapsed.
Click to expand it.
app/static/js/app.js
+
12
−
1
View file @
aaa3c83d
...
@@ -32,7 +32,8 @@ document.addEventListener('DOMContentLoaded', function(){
...
@@ -32,7 +32,8 @@ document.addEventListener('DOMContentLoaded', function(){
isSuggesting
:
false
,
isSuggesting
:
false
,
supportedFilesFormat
:
[],
supportedFilesFormat
:
[],
translationType
:
"
text
"
translationType
:
"
text
"
,
inputFile
:
false
},
},
mounted
:
function
(){
mounted
:
function
(){
var
self
=
this
;
var
self
=
this
;
...
@@ -308,6 +309,16 @@ document.addEventListener('DOMContentLoaded', function(){
...
@@ -308,6 +309,16 @@ document.addEventListener('DOMContentLoaded', function(){
},
},
switchType
:
function
(
type
)
{
switchType
:
function
(
type
)
{
this
.
translationType
=
type
;
this
.
translationType
=
type
;
},
handleInputFile
:
function
(
e
)
{
this
.
inputFile
=
e
.
target
.
files
[
0
];
},
removeFile
:
function
(
e
)
{
e
.
preventDefault
()
this
.
inputFile
=
false
;
},
translateFile
:
function
(
e
)
{
e
.
preventDefault
();
}
}
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
app/templates/index.html
+
19
−
2
View file @
aaa3c83d
...
@@ -174,13 +174,13 @@
...
@@ -174,13 +174,13 @@
</div>
</div>
<div
class=
"row"
v-if=
"translationType === 'files'"
>
<div
class=
"row"
v-if=
"translationType === 'files'"
>
<div
class=
"file-dropzone"
>
<div
class=
"file-dropzone"
>
<div
class=
"dropzone-content"
>
<div
v-if=
"inputFile === false"
class=
"dropzone-content"
>
<span>
Supported file format: [[ supportedFilesFormatFormatted ]]
</span>
<span>
Supported file format: [[ supportedFilesFormatFormatted ]]
</span>
<form
action=
"#"
>
<form
action=
"#"
>
<div
class=
"file-field input-field"
>
<div
class=
"file-field input-field"
>
<div
class=
"btn"
>
<div
class=
"btn"
>
<span>
File
</span>
<span>
File
</span>
<input
type=
"file"
>
<input
type=
"file"
@
change=
"handleInputFile"
ref=
"fileInputRef"
>
</div>
</div>
<div
class=
"file-path-wrapper hidden"
>
<div
class=
"file-path-wrapper hidden"
>
<input
class=
"file-path validate"
type=
"text"
>
<input
class=
"file-path validate"
type=
"text"
>
...
@@ -188,6 +188,23 @@
...
@@ -188,6 +188,23 @@
</div>
</div>
</form>
</form>
</div>
</div>
<div
v-if=
"inputFile !== false"
class=
"dropzone-content"
>
<div
class=
"card"
>
<div
class=
"card-content"
>
<div
class=
"row"
>
<div
class=
"col s10"
>
<p>
[[ inputFile.name ]]
</p>
</div>
<div
class=
"col s2"
>
<button
@
click=
"removeFile"
class=
"btn-flat"
>
<i
class=
"material-icons"
>
close
</i>
</button>
</div>
</div>
</div>
</div>
<button
@
click=
"translateFile"
class=
"btn"
>
Translate
</button>
</div>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment