Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
c6a9dc1f
Commit
c6a9dc1f
authored
Mar 29, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf v2
parent
b44620bd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
21 deletions
+92
-21
middleware.py
catalog/middleware.py
+1
-1
models.py
catalog/models.py
+2
-3
views.py
catalog/views.py
+1
-1
Reports_scripts.js
reports/static/reports/js/Reports_scripts.js
+17
-1
Reports.html
reports/templates/Reports.html
+57
-2
views.py
reports/views.py
+14
-13
No files found.
catalog/middleware.py
View file @
c6a9dc1f
...
...
@@ -3,7 +3,7 @@ from django.shortcuts import HttpResponseRedirect
from
django.urls
import
reverse
# from django.core.urlresolvers import reverse
from
catalog.models
import
Pu
blics
,
Pu
rchase
from
catalog.models
import
Purchase
class
AuthRequiredMiddleware
(
object
):
...
...
catalog/models.py
View file @
c6a9dc1f
...
...
@@ -71,11 +71,10 @@ class Purchase(models.Model):
user
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
CASCADE
)
search
=
models
.
ForeignKey
(
Search
,
on_delete
=
models
.
CASCADE
)
productList
=
models
.
TextField
(
verbose_name
=
"JSON Product List"
)
name
=
models
.
TextField
(
default
=
"Drawn polygon "
)
description
=
models
.
TextField
(
default
=
""
)
purchased
=
models
.
BooleanField
(
default
=
False
)
price
=
models
.
FloatField
(
default
=
0.0
)
progress
=
models
.
IntegerField
(
default
=
0
)
is_public
=
models
.
BooleanField
(
default
=
False
)
class
Publics
(
models
.
Model
):
url
=
models
.
TextField
()
Purchase
=
models
.
ForeignKey
(
Purchase
,
on_delete
=
models
.
CASCADE
)
\ No newline at end of file
catalog/views.py
View file @
c6a9dc1f
reports/static/reports/js/Reports_scripts.js
View file @
c6a9dc1f
...
...
@@ -153,3 +153,19 @@ function is_public(purchase_id, status) {
}
});
};
function
showEditModal
(
zone
,
description
,
id
)
{
$
(
'#edit_id'
).
empty
();
$
(
'#zone'
).
empty
();
$
(
'#description'
).
empty
();
$
(
'#zone'
).
val
(
zone
);
$
(
'#description'
).
val
(
description
);
$
(
'#edit_id'
).
val
(
id
);
//$('#myModalTitle').append(name);
$
(
"#editmodal"
).
modal
();
}
$
(
document
).
ready
(
function
()
{
$
(
'[data-toggle="popover"]'
).
popover
();
});
\ No newline at end of file
reports/templates/Reports.html
View file @
c6a9dc1f
...
...
@@ -144,6 +144,10 @@
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section
class=
"content"
>
<!--div id="popover-content-logout" class="hide"-->
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
Reports
</div>
<div
class=
"panel-body"
id=
"mytable"
>
...
...
@@ -163,8 +167,14 @@
<tbody
id=
"table_body"
>
{% for product in productList %}
<tr>
<td><a
href=
"#"
<td>
<a
href=
"#"
data-toggle=
"popover"
data-trigger=
"hover"
data-content=
"{{ product.search_name }}"
onclick=
"showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"
>
{{ product.search_name }}
</a>
<a
href=
"#"
onclick=
"showEditModal('{{ product.search_name }}','Descripcion ekiz','{{ product.purchase_id }}')"
><span
class=
"fas fa-pencil-alt"
style=
"margin:3px 0 0 0"
></span></a>
</td>
<td>
{{ product.process }}
</td>
<td>
{{ product.purchase_date }}
</td>
...
...
@@ -174,7 +184,9 @@
<td>
{{ product.size }}
</td>
<td>
<label
class=
"switch"
>
<input
id=
"{{ product.purchase_id }}"
type=
"checkbox"
onclick=
"change_public({{ product.purchase_id }})"
{%
if
product
.
is_public
%}
checked
{%
endif
%}
>
<input
id=
"{{ product.purchase_id }}"
type=
"checkbox"
onclick=
"change_public({{ product.purchase_id }})"
{%
if
product
.
is_public
%}
checked
{%
endif
%}
>
<span
class=
"slider round"
></span>
</label>
</td>
...
...
@@ -236,6 +248,7 @@
<!-- Copyright -->
</footer>
<!-- /.Footer -->
<!-- Modals -->
<div
id=
"myModal"
class=
"modal fade"
role=
"dialog"
>
<div
class=
"modal-dialog"
>
...
...
@@ -276,9 +289,51 @@
</div>
</div>
<div
id=
"editmodal"
class=
"modal fade"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog modal-sm"
>
<div
class=
"modal-content "
>
<div
class=
"modal-body text-center"
>
<form
role=
"form"
>
<input
type=
"text"
class=
"form-group-lg"
id=
"edit_id"
name=
"edit_id"
>
<label>
Description:
</label>
<br>
<div
class=
"form-group"
>
<label
for=
"usr"
>
Zone:
</label>
<input
type=
"text"
class=
"form-control"
id=
"zone"
name=
"zone"
style=
"text-align:center;"
>
</div>
<div
class=
"form-group"
>
<label
for=
"pwd"
>
Description:
</label>
<textarea
class=
"form-control"
id=
"description"
name=
"description"
style=
"text-align:center; resize: none"
></textarea>
</div>
</div>
<div
class=
"modal-footer"
>
<input
class=
"btn btn-primary pull-left "
id=
"phSearchButton"
type=
"submit"
value=
"Save"
/>
<button
type=
"button"
class=
"btn btn-danger"
data-dismiss=
"modal"
>
Close
</button>
</form>
</div>
</div>
</div>
</div>
<!-- /.modals -->
{% endblock %}
{% block modals %}
{% endblock %}
{% block scripts %}
<script
src=
"{% static 'reports/js/Reports_scripts.js' %}"
></script>
{% endblock %}
reports/views.py
View file @
c6a9dc1f
...
...
@@ -447,9 +447,12 @@ def myBarLegend(drawing, labels):
def
PDFGenerator
(
request
,
ruta
,
reporteDir
,
datasets
):
thumbs
=
ruta
+
'out/'
+
reporteDir
+
'/TCI/thumbnails/'
SCL
=
ruta
+
'out/'
+
reporteDir
+
'/SCL/split/'
story
=
[]
# define the style for our paragraph text
styles
=
getSampleStyleSheet
()
styleN
=
styles
[
'Normal'
]
...
...
@@ -459,6 +462,16 @@ def PDFGenerator(request, ruta, reporteDir, datasets):
im
.
hAlign
=
'CENTER'
story
.
append
(
im
)
# add the title
# story.append(Paragraph("<strong>Results for Vizard Experiment</strong>", styleN))
# story.append(Spacer(1, .25 * inch))
# convert data to paragraph form and then add paragraphs
# story.append(Paragraph(dataToParagraph(subject1, results1), styleN))
# story.append(Spacer(1, .25 * inch))
# story.append(Paragraph(dataToParagraph(subject2, results2), styleN))
# story.append(Spacer(1, .5 * inch))
story
.
append
(
PageBreak
())
path
,
dirs
,
files
=
next
(
os
.
walk
(
thumbs
))
...
...
@@ -491,18 +504,6 @@ def PDFGenerator(request, ruta, reporteDir, datasets):
story
.
append
(
Spacer
(
1
,
.5
*
inch
))
# add the title
# story.append(Paragraph("<strong>Results for Vizard Experiment</strong>", styleN))
# story.append(Spacer(1, .25 * inch))
# convert data to paragraph form and then add paragraphs
# story.append(Paragraph(dataToParagraph(subject1, results1), styleN))
# story.append(Spacer(1, .25 * inch))
# story.append(Paragraph(dataToParagraph(subject2, results2), styleN))
# story.append(Spacer(1, .5 * inch))
# table with images
story
.
append
(
myTable
(
path1
,
SCL
,
file
))
story
.
append
(
Spacer
(
1
,
.5
*
inch
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment