Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 1c57184f
authored
2020-03-11 18:39:04 +0000
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Terminadas modificaciones
1 parent
e5892f4d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
16 deletions
static/src/pdf3.js
templates/anomalies.html
templates/form.html
static/src/pdf3.js
View file @
1c57184
...
...
@@ -82,7 +82,10 @@ class PDF3 {
table
(
pointer
,
title
,
data
)
{
const
table
=
this
.
A4
.
addRelativeChild
(
new
Div
(
pointer
.
addxy
(
5
,
1
),
new
Vector
(
90
,
2
*
(
data
.
length
+
1
)))
);
const
lines
=
this
.
makelines
(
data
,
55
);
title
=
this
.
partition
(
title
,
20
)
const
table
=
this
.
A4
.
addRelativeChild
(
new
Div
(
pointer
.
addxy
(
5
,
1
),
new
Vector
(
90
,
2
*
(
lines
.
length
+
1
)))
);
const
left
=
table
.
addRelativeChild
(
new
Div
(
new
Vector
(
0
,
0
),
new
Vector
(
30
,
100
))
);
const
right
=
table
.
addRelativeChild
(
new
Div
(
new
Vector
(
30
,
0
),
new
Vector
(
70
,
100
))
);
...
...
@@ -93,24 +96,46 @@ class PDF3 {
left
.
addRelativeChild
(
new
Text
(
title
,
new
Vector
(
Pos
.
middle
,
Pos
.
middle
+
10
),
new
Vector
(
Pos
.
middle
,
Pos
.
middle
-
(
title
.
length
-
1
)
*
1.1
),
this
.
subtitle
,
"center"
)
)
let
subpointer
=
right
.
position
.
addxy
(
5
,
0.025
*
this
.
A4
.
size
.
y
);
data
.
forEach
(
entry
=>
{
let
subpointer
=
right
.
position
.
addxy
(
186
,
0.025
*
this
.
A4
.
size
.
y
);
lines
.
forEach
(
text
=>
{
right
.
addAbsoluteChild
(
new
Text
(
`
${
entry
[
'description'
]}
-
${
entry
[
'severity'
]}
`
,
subpointer
,
this
.
body
,
)
new
Text
(
text
,
subpointer
,
this
.
body
,
"center"
)
);
subpointer
=
subpointer
.
addxy
(
0
,
0.02
*
this
.
A4
.
size
.
y
);
});
return
pointer
.
addxy
(
0
,
2
*
(
data
.
length
+
1
)
+
1
);
return
pointer
.
addxy
(
0
,
2
*
(
lines
.
length
+
1
)
+
1
);
}
makelines
(
data
,
linesize
)
{
/** merge all segment lists to make the actual lines that will be used **/
return
data
.
reduce
(
(
lines
,
entry
)
=>
lines
.
concat
(
this
.
partition
(
`
${
entry
[
'description'
]}
-
${
entry
[
'severity'
]}
`
,
linesize
)
),
[]
);
}
/** slice in segments of 70 characters **/
partition
(
string
,
linesize
)
{
const
result
=
[];
let
s
=
0
;
while
(
string
.
slice
(
s
,
s
+
linesize
)
!==
''
)
{
result
.
push
(
string
.
slice
(
s
,
s
+
linesize
));
s
+=
linesize
;
}
return
result
;
}
}
\ No newline at end of file
templates/anomalies.html
View file @
1c57184
...
...
@@ -37,6 +37,10 @@
tr
{
border-right
:
2px
solid
black
;
}
p
{
word-break
:
break-all
;
}
</style>
<div>
...
...
@@ -52,11 +56,11 @@
{% for a in anomalies['anomalies'] %}
<table>
<tr>
<th
rowspan=
"{{ (anomalies['anomalies'][a] | length) + 1 }}"
>
{{ a }}
</th>
<th
rowspan=
"{{ (anomalies['anomalies'][a] | length) + 1 }}"
>
<p>
{{ a }}
</p>
</th>
</tr>
{% for e in anomalies['anomalies'][a] %}
<tr>
<td>
{{ e['description'] }} - {{ e['severity'] }}
</td>
<td>
<p>
{{ e['description'] }} - {{ e['severity'] }}
</p>
</td>
</tr>
{% endfor %}
</table>
...
...
templates/form.html
View file @
1c57184
...
...
@@ -150,13 +150,13 @@
Por defecto:
<input
name=
"defecto"
type=
"text"
value=
"---"
>
<div
class=
"PDFButtonContainer"
>
<button
class=
"PDFButton"
onclick=
"collectToSearch('data')"
>
Datos
</button>
<button
class=
"PDFButton"
onclick=
"collectToSearch('anomalies')"
>
Anomalías
</button>
<button
class=
"PDFButton"
onclick=
"collectToSearch('data')"
>
Ticket Fosa
</button>
</div>
<button
class=
"PDFButton loginB"
onclick=
"location.href='/login'"
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment