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
11300809
Commit
11300809
authored
Nov 15, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impersonate
parent
492dc574
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
225 additions
and
196 deletions
+225
-196
settings.py
GeoInt_SIDT/settings.py
+3
-0
urls.py
GeoInt_SIDT/urls.py
+1
-0
users_table.html
administration/templates/users_table.html
+4
-0
middleware.py
catalog/middleware.py
+6
-0
base_top.html
catalog/templates/base_top.html
+203
-190
minimap.js
reports/static/reports/js/minimap.js
+5
-3
views.py
reports/views.py
+3
-3
No files found.
GeoInt_SIDT/settings.py
View file @
11300809
...
@@ -45,6 +45,7 @@ INSTALLED_APPS = [
...
@@ -45,6 +45,7 @@ INSTALLED_APPS = [
'administration.apps.AdministrationConfig'
,
'administration.apps.AdministrationConfig'
,
'users.apps.UsersConfig'
,
'users.apps.UsersConfig'
,
'django_extensions'
,
'django_extensions'
,
'impersonate'
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
@@ -53,9 +54,11 @@ MIDDLEWARE = [
...
@@ -53,9 +54,11 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
'django.middleware.csrf.CsrfViewMiddleware'
,
'django.middleware.csrf.CsrfViewMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
'impersonate.middleware.ImpersonateMiddleware'
,
'django.contrib.messages.middleware.MessageMiddleware'
,
'django.contrib.messages.middleware.MessageMiddleware'
,
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
'catalog.middleware.AuthRequiredMiddleware'
,
'catalog.middleware.AuthRequiredMiddleware'
,
]
]
ROOT_URLCONF
=
'GeoInt_SIDT.urls'
ROOT_URLCONF
=
'GeoInt_SIDT.urls'
...
...
GeoInt_SIDT/urls.py
View file @
11300809
...
@@ -31,5 +31,6 @@ urlpatterns = [
...
@@ -31,5 +31,6 @@ urlpatterns = [
url
(
r'^mail/'
,
include
(
'mail.urls'
)),
url
(
r'^mail/'
,
include
(
'mail.urls'
)),
url
(
r'^administration/'
,
include
(
'administration.urls'
)),
url
(
r'^administration/'
,
include
(
'administration.urls'
)),
url
(
r'^users/'
,
include
(
'users.urls'
)),
url
(
r'^users/'
,
include
(
'users.urls'
)),
url
(
r'^impersonate/'
,
include
(
'impersonate.urls'
)),
]
]
# + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
# + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
administration/templates/users_table.html
View file @
11300809
...
@@ -164,6 +164,10 @@
...
@@ -164,6 +164,10 @@
{%
if
user
.
superuser =
=
True
%}
checked
{%
endif
%}
>
{%
if
user
.
superuser =
=
True
%}
checked
{%
endif
%}
>
</td>
</td>
<td>
<td>
{% if not user.superuser and request.user.is_superuser %}
<a
title=
"swithc user"
href=
"{% url 'impersonate-start' user.user_id %}"
class=
"btn btn-warning"
><i
class=
"fa fa-eye"
></i></a>
{% endif %}
<button
title=
"save"
type=
"submit"
class=
"btn btn-success"
><i
<button
title=
"save"
type=
"submit"
class=
"btn btn-success"
><i
class=
"fa fa-save"
></i></button>
class=
"fa fa-save"
></i></button>
{% if Viewname != "Request" %}
{% if Viewname != "Request" %}
...
...
catalog/middleware.py
View file @
11300809
...
@@ -15,6 +15,7 @@ class AuthRequiredMiddleware(object):
...
@@ -15,6 +15,7 @@ class AuthRequiredMiddleware(object):
# the view (and later middleware) are called.
# the view (and later middleware) are called.
response
=
self
.
get_response
(
request
)
response
=
self
.
get_response
(
request
)
print
(
'midleware response'
,
response
)
if
"/reports/"
in
request
.
path_info
and
not
request
.
user
.
is_authenticated
:
if
"/reports/"
in
request
.
path_info
and
not
request
.
user
.
is_authenticated
:
...
@@ -33,12 +34,17 @@ class AuthRequiredMiddleware(object):
...
@@ -33,12 +34,17 @@ class AuthRequiredMiddleware(object):
#elif not request.user.is_authenticated and request.path_info == reverse('tile') or request.path_info == reverse('tileinfo') :
#elif not request.user.is_authenticated and request.path_info == reverse('tile') or request.path_info == reverse('tileinfo') :
# return response
# return response
elif
"/impersonate/"
in
request
.
path_info
:
return
response
elif
request
.
path_info
==
reverse
(
'ipn'
):
elif
request
.
path_info
==
reverse
(
'ipn'
):
return
response
return
response
elif
not
request
.
user
.
is_authenticated
and
request
.
path_info
!=
reverse
(
'login'
)
and
not
request
.
user
.
is_active
:
elif
not
request
.
user
.
is_authenticated
and
request
.
path_info
!=
reverse
(
'login'
)
and
not
request
.
user
.
is_active
:
return
HttpResponseRedirect
(
reverse
(
'login'
))
return
HttpResponseRedirect
(
reverse
(
'login'
))
# Code to be executed for each request/response after
# Code to be executed for each request/response after
# the view is called.
# the view is called.
print
(
'user'
,
request
.
user
)
return
response
return
response
catalog/templates/base_top.html
View file @
11300809
...
@@ -32,155 +32,168 @@
...
@@ -32,155 +32,168 @@
{% block headMedia %}{% endblock %}
{% block headMedia %}{% endblock %}
<link
rel=
"stylesheet"
href=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/base_top.css' %}"
>
</head>
</head>
<body
style=
"overflow: hidden;"
class=
"hold-transition skin-yellow sidebar-mini"
>
<body
style=
"overflow: hidden;"
class=
"hold-transition skin-yellow sidebar-mini"
>
<!-- <div id="map" class="map" tabindex="0"> </div>-->
<!-- <div id="map" class="map" tabindex="0"> </div>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
<div
class=
"wrmapper"
>
<div
class=
"wrmapper"
>
<header
class=
"main-header"
>
<header
class=
"main-header"
>
<!-- Logo -->
<!-- Logo -->
<a
{%
if
request
.
user
.
is_authenticated
%}
href=
"{{ BASE_URL }}/catalog"
{%
else
%}
<a
{%
if
request
.
user
.
is_authenticated
%}
href=
"{{ BASE_URL }}/catalog"
{%
else
%}
href=
"../../../"
{%
endif
%}
class=
"logo"
>
href=
"../../../"
{%
endif
%}
class=
"logo"
>
<!-- mini logo for sidebar mini 50x50 pixels -->
<!-- mini logo for sidebar mini 50x50 pixels -->
<span
class=
"logo-mini"
><b>
G
</b>
eo
</span>
<span
class=
"logo-mini"
><b>
G
</b>
eo
</span>
<!-- logo for regular state and mobile devices -->
<!-- logo for regular state and mobile devices -->
<span
class=
"logo-lg"
><b>
Geo
</b>
int :
<b>
Rep
</b>
Sat
</span>
<span
class=
"logo-lg"
><b>
Geo
</b>
int :
<b>
Rep
</b>
Sat
</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav
class=
"navbar navbar-static-top"
>
<!-- Sidebar toggle button-->
<a
href=
"#"
class=
"sidebar-toggle"
data-toggle=
"push-menu"
role=
"button"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
</a>
</a>
<!-- Header Navbar: style can be found in header.less -->
{% if request.user.is_authenticated %}
<nav
class=
"navbar navbar-static-top"
>
<div
class=
"navbar-custom-menu"
>
<!-- Sidebar toggle button-->
<ul
class=
"nav navbar-nav"
>
<a
href=
"#"
class=
"sidebar-toggle"
data-toggle=
"push-menu"
role=
"button"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<li>
</a>
<a
id=
"changeMaps"
><i
class=
"fas fa-map"
></i></a>
{% if request.user.is_authenticated %}
</li>
<div
class=
"navbar-custom-menu"
>
<ul
class=
"nav navbar-nav"
>
{% block help %}
<li>
<li>
<a
id=
"
changeMaps"
><i
class=
"fas fa-map
"
></i></a>
<a
id=
"
initGuide"
><i
class=
"fa fa-question-circle
"
></i></a>
</li>
</li>
{% endblock %}
{% block help %}
<li>
<li>
{% if request.user.is_superuser or request.user.is_staff %}
<a
id=
"initGuide"
><i
class=
"fa fa-question-circle"
></i></a>
<a
href=
"../../../administration"
title=
"super user"
><i
</li>
class=
"fa fa-gears"
></i></a>
{% endif %}
</li>
<!-- Messages: style can be found in dropdown.less-->
<!-- <li class="dropdown messages-menu"> -->
{#% block messages %#}{#% endblock %#}
<!-- </li> -->
<!-- Notifications: style can be found in dropdown.less -->
<!-- <li class="dropdown notifications-menu"> -->
{#% block notifications %#}{#% endblock %#}
<!-- </li> -->
<!-- Tasks: style can be found in dropdown.less -->
<!-- <li class="dropdown tasks-menu"> -->
{#% block tasks %}{% endblock %#}
<!-- </li> -->
<!-- History -->
<li
class=
"dropdown user user-menu"
id=
"panelHistory"
>
{% block history %}
{% endblock %}
{% endblock %}
<li>
</li>
{% if request.user.is_superuser or request.user.is_staff %}
<!-- History -->
<a
href=
"../../../administration"
title=
"super user"
><i
<!-- User Account: style can be found in dropdown.less -->
class=
"fa fa-gears"
></i></a>
<li
class=
"dropdown user user-menu"
id=
"panelUser"
>
{% block user %}{% endblock %}
</li>
<!-- Control Sidebar Toggle Button -->
{% if request.user.username == "demo" %}
{% else %}
<li
id=
"panelShowCart"
>
{% if showcart %}
<a
id=
"product-list-toggle"
href=
"#"
data-toggle=
"control-sidebar"
>
<i
class=
"fa fa-shopping-cart"
></i></a>
{% endif %}
{% endif %}
</li>
</li>
<!-- Messages: style can be found in dropdown.less-->
{% endif %}
<!-- <li class="dropdown messages-menu"> -->
</ul>
{#% block messages %#}{#% endblock %#}
</div>
<!-- </li> -->
{% endif %}
<!-- Notifications: style can be found in dropdown.less -->
</nav>
<!-- <li class="dropdown notifications-menu"> -->
{#% block notifications %#}{#% endblock %#}
<!-- </li> -->
<!-- Tasks: style can be found in dropdown.less -->
<!-- <li class="dropdown tasks-menu"> -->
{#% block tasks %}{% endblock %#}
<!-- </li> -->
<!-- History -->
<li
class=
"dropdown user user-menu"
id=
"panelHistory"
>
{% block history %}
{% endblock %}
</li>
<!-- History -->
<!-- User Account: style can be found in dropdown.less -->
<li
class=
"dropdown user user-menu"
id=
"panelUser"
>
{% block user %}{% endblock %}
</li>
<!-- Control Sidebar Toggle Button -->
{% if request.user.username == "demo" %}
{% else %}
<li
id=
"panelShowCart"
>
{% if showcart %}
<a
id=
"product-list-toggle"
href=
"#"
data-toggle=
"control-sidebar"
>
<i
class=
"fa fa-shopping-cart"
></i></a>
{% endif %}
</li>
{% endif %}
</ul>
</div>
{% endif %}
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside
class=
"main-sidebar"
>
<!-- sidebar: style can be found in sidebar.less -->
<section
class=
"sidebar"
>
{% block sidebar %}{% endblock %}
</section>
<!-- /.sidebar -->
</aside>
</header>
<!-- Content Wrapper. Contains page content -->
<!-- Left side column. contains the logo and sidebar -->
<div
class=
"content-wrapper"
style=
"border:0px solid blue;"
>
<aside
class=
"main-sidebar"
>
{% block content %}{% endblock %}
<!-- sidebar: style can be found in sidebar.less -->
{% block templates %}{% endblock %}
<section
class=
"sidebar"
>
</div>
{% block sidebar %}{% endblock %}
<!-- /.content-wrapper -->
<!-- <footer class="main-footer">-->
<!-- <div class="pull-right hidden-xs">-->
<!-- <b>Version</b> 2.4.0-->
<!-- </div>-->
<!-- <strong>Copyright © 2014-2016 <a href="https://adminlte.io">Almsaeed Studio</a>.</strong> All rights reserved.-->
<!-- </footer>-->
<!-- Control Sidebar -->
</section>
<aside
class=
"control-sidebar control-sidebar-dark"
>
<!-- /.sidebar -->
<!-- Create the tabs -->
</aside>
<ul
class=
"nav nav-tabs nav-justified control-sidebar-tabs"
>
<li
id=
"globe"
class=
"active"
><a
href=
"#control-sidebar-home-tab"
data-toggle=
"tab"
><i
class=
"fa fa-globe"
></i></a></li>
{% if request.user.username == 'demo' %}
{% else %}
<li
id=
"cart"
><a
href=
"#control-sidebar-settings-tab"
onclick=
"updateCart()"
data-toggle=
"tab"
><i
class=
"fa fa-shopping-cart"
></i></a>
</li>
{% endif %}
</ul>
<!-- Tab panes -->
<div
class=
"tab-content"
>
<!-- Home tab content -->
<div
class=
"tab-pane active"
id=
"control-sidebar-home-tab"
>
<form
id=
'product-to-cart-form'
role=
"form"
method=
"post"
>
{% csrf_token %}
<div
class=
"container"
>
<div
class=
"sidebar-title"
>
<h3><b>
Products
</b></h3>
</div>
<div
class=
"sidebar-button"
>
<button
type=
"submit"
name=
"search"
id=
"add-cart"
class=
"btn btn-primary"
>
{% if request.user.username == 'demo' %}
Process
{% else %}
Add to cart
{% endif %}
</button>
</div>
<!-- Content Wrapper. Contains page content -->
<div
class=
"content-wrapper"
style=
"border:0px solid blue;"
>
{% if user.is_impersonate %}
<div
class=
"alert alert2 alert-dismissible "
>
<a
href=
"{% url 'impersonate-stop' %}"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
>
×
</a>
<strong>
View as:
</strong>
{{ user.get_full_name }}
</div>
{% endif %}
{% block content %}
{% endblock %}
{% block templates %}{% endblock %}
</div>
<!-- /.content-wrapper -->
<!-- <footer class="main-footer">-->
<!-- <div class="pull-right hidden-xs">-->
<!-- <b>Version</b> 2.4.0-->
<!-- </div>-->
<!-- <strong>Copyright © 2014-2016 <a href="https://adminlte.io">Almsaeed Studio</a>.</strong> All rights reserved.-->
<!-- </footer>-->
<!-- Control Sidebar -->
<aside
class=
"control-sidebar control-sidebar-dark"
>
<!-- Create the tabs -->
<ul
class=
"nav nav-tabs nav-justified control-sidebar-tabs"
>
<li
id=
"globe"
class=
"active"
><a
href=
"#control-sidebar-home-tab"
data-toggle=
"tab"
><i
class=
"fa fa-globe"
></i></a></li>
{% if request.user.username == 'demo' %}
{% else %}
<li
id=
"cart"
><a
href=
"#control-sidebar-settings-tab"
onclick=
"updateCart()"
data-toggle=
"tab"
><i
class=
"fa fa-shopping-cart"
></i></a>
</li>
{% endif %}
</ul>
<!-- Tab panes -->
<div
class=
"tab-content"
>
<!-- Home tab content -->
<div
class=
"tab-pane active"
id=
"control-sidebar-home-tab"
>
<form
id=
'product-to-cart-form'
role=
"form"
method=
"post"
>
{% csrf_token %}
<div
class=
"container"
>
<div
class=
"sidebar-title"
>
<h3><b>
Products
</b></h3>
</div>
</div>
<!-- this ul element is filled with data -->
<div
class=
"sidebar-button"
>
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
data-widget=
"tree"
></ul>
<button
type=
"submit"
name=
"search"
id=
"add-cart"
class=
"btn btn-primary"
>
<!-- /.control-sidebar-menu -->
{% if request.user.username == 'demo' %}
</form>
Process
</div>
{% else %}
<!-- /.tab-pane -->
Add to cart
<!-- Stats tab content -->
{% endif %}
<div
class=
"tab-pane"
id=
"control-sidebar-stats-tab"
>
Stats Tab Content
</div>
<!-- /.tab-pane -->
</button>
<!-- Settings tab content -->
</div>
<div
class=
"tab-pane"
id=
"control-sidebar-settings-tab"
>
</div>
{% comment %}
<form
id=
'purchased-product-form'
role=
"form"
method=
"post"
>
<!-- this ul element is filled with data -->
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
data-widget=
"tree"
></ul>
<!-- /.control-sidebar-menu -->
</form>
</div>
<!-- /.tab-pane -->
<!-- Stats tab content -->
<div
class=
"tab-pane"
id=
"control-sidebar-stats-tab"
>
Stats Tab Content
</div>
<!-- /.tab-pane -->
<!-- Settings tab content -->
<div
class=
"tab-pane"
id=
"control-sidebar-settings-tab"
>
{% comment %}
<form
id=
'purchased-product-form'
role=
"form"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"sidebar-title"
>
<div
class=
"sidebar-title"
>
...
@@ -195,81 +208,81 @@
...
@@ -195,81 +208,81 @@
<!-- this ul element is filled with data -->
<!-- this ul element is filled with data -->
<ul
id=
"product-list-cart"
class=
"sidebar-menu"
data-widget=
"tree"
></ul>
<ul
id=
"product-list-cart"
class=
"sidebar-menu"
data-widget=
"tree"
></ul>
</form>
{% endcomment %}
</form>
{% endcomment %}
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"sidebar-title"
>
<div
class=
"sidebar-title"
>
<h3><b>
My cart
</b></h3>
<h3><b>
My cart
</b></h3>
</div>
</div>
<div
class=
"sidebar-button"
>
<div
class=
"sidebar-button"
>
{% comment %}
<button
type=
"submit"
name=
"search"
id=
"purchase"
class=
"btn btn-primary"
>
{% comment %}
<button
type=
"submit"
name=
"search"
id=
"purchase"
class=
"btn btn-primary"
>
Purchase
Purchase
</button>
{% endcomment %}
</button>
{% endcomment %}
{% comment %}
<a
href=
"cart"
id=
"purchase"
class=
"btn btn-primary"
>
Purchase
</a>
{% endcomment %}
{% comment %}
<a
href=
"cart"
id=
"purchase"
class=
"btn btn-primary"
>
Purchase
</a>
{% endcomment %}
<button
onclick=
"location.href='cart'"
id=
"purchase"
class=
"btn btn-primary"
>
Purchase
</button>
<button
onclick=
"location.href='cart'"
id=
"purchase"
class=
"btn btn-primary"
>
Purchase
</button>
</div>
</div>
</div>
<!-- this ul element is filled with data -->
<ul
id=
"product-list-cart"
class=
"control-sidebar-menu"
data-widget=
"tree"
></ul>
</div>
</div>
<!-- /.tab-pane -->
<!-- this ul element is filled with data -->
</div>
<ul
id=
"product-list-cart"
class=
"control-sidebar-menu"
data-widget=
"tree"
></ul>
</aside>
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed immediately after the control sidebar -->
<div
class=
"control-sidebar-bg"
>
<!-- control de version de mapas -->
<div
id=
"idmapControl"
class=
"mapControl"
onclick=
"cambio.changeMap()"
>
<i
class=
"fas fa-layer-group fa-2x iii"
></i>
</div>
</div>
<!-- control de version de mapas -->
<!-- /.tab-pane -->
</div>
</aside>
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed immediately after the control sidebar -->
<div
class=
"control-sidebar-bg"
>
<!-- control de version de mapas -->
<div
id=
"idmapControl"
class=
"mapControl"
onclick=
"cambio.changeMap()"
>
<i
class=
"fas fa-layer-group fa-2x iii"
></i>
</div>
<!-- control de version de mapas -->
<!-- control para dibujar el poligono -->
<!-- control para dibujar el poligono -->
<div
id=
"drawControl"
class=
"drawControl"
onclick=
"osmap.changeInteraction()"
>
<div
id=
"drawControl"
class=
"drawControl"
onclick=
"osmap.changeInteraction()"
>
<i
class=
"fas fa-vector-square fa-2x iii"
></i>
<i
class=
"fas fa-vector-square fa-2x iii"
></i>
</div>
<!-- control para dibujar el poligono -->
</div>
</div>
<!-- control para dibujar el poligono -->
</div>
</div>
<!-- ./wrapper -->
</div>
<!-- ./wrapper -->
<!-- T E M P L A T E S -->
<!-- T E M P L A T E S -->
<!-- T E M P L A T E S -->
<!-- T E M P L A T E S -->
<!-- MODAL 1 -->
<!-- MODAL 1 -->
{% block modals %}{% endblock %}
{% block modals %}{% endblock %}
<!-- MODAL 1 -->
<!-- MODAL 1 -->
<!-- Bootstrap 3.3.7 -->
<!-- Bootstrap 3.3.7 -->
<script
src=
"{% static 'catalog/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"
></script>
<script
src=
"{% static 'catalog/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"
></script>
<!-- AdminLTE App -->
<!-- AdminLTE App -->
<script
src=
"{% static 'catalog/adminlte/dist/js/adminlte.min.js' %}"
></script>
<script
src=
"{% static 'catalog/adminlte/dist/js/adminlte.min.js' %}"
></script>
<!-- Data management file -->
<!-- Data management file -->
<script
src=
"{% static 'catalog/js/dataRetrieval.js' %}"
type=
"text/javascript"
></script>
<script
src=
"{% static 'catalog/js/dataRetrieval.js' %}"
type=
"text/javascript"
></script>
<!-- Chartsjs -->
<!-- Chartsjs -->
<script
src=
"{% static 'catalog/js/Chart.min.js' %}"
type=
"text/javascript"
></script>
<script
src=
"{% static 'catalog/js/Chart.min.js' %}"
type=
"text/javascript"
></script>
<!-- Fengyuan Chen's Datepicker -->
<!-- Fengyuan Chen's Datepicker -->
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.6.5/datepicker.min.js"
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.6.5/datepicker.min.js"
integrity=
"sha256-/7FLTdzP6CfC1VBAj/rsp3Rinuuu9leMRGd354hvk0k="
crossorigin=
"anonymous"
></script>
integrity=
"sha256-/7FLTdzP6CfC1VBAj/rsp3Rinuuu9leMRGd354hvk0k="
crossorigin=
"anonymous"
></script>
<script
src=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.min.js' %}"
<script
src=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.min.js' %}"
type=
"text/javascript"
></script>
type=
"text/javascript"
></script>
{% block footer %}{% endblock %}
{% block footer %}{% endblock %}
{% block scripts %}{% endblock %}
{% block scripts %}{% endblock %}
{% if messages %}
{% if messages %}
<div
class=
"container col-md-2 col-lg-2 col-xs-2 col-sm-2"
style=
"bottom: 0; right: 0;position: absolute"
>
<div
class=
"container col-md-2 col-lg-2 col-xs-2 col-sm-2"
style=
"bottom: 0; right: 0;position: absolute"
>
{% for message in messages %}
{% for message in messages %}
<div
{%
if
message
.
tags
%}
class=
"fade in alert alert-dismissible alert-{{ message.tags }}"
{%
endif
%}
>
<div
{%
if
message
.
tags
%}
class=
"fade in alert alert-dismissible alert-{{ message.tags }}"
{%
endif
%}
>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
>
×
</a>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
>
×
</a>
<strong>
{{ message.tags }}!
</strong>
{{ message }}.
<strong>
{{ message.tags }}!
</strong>
{{ message }}.
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
{% block guide %}
{% block guide %}
{% endblock %}
{% endblock %}
</body>
</body>
</html>
</html>
...
...
reports/static/reports/js/minimap.js
View file @
11300809
MAPBOX_ACCESS_TOKEN
=
'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw'
;
MAPBOX_ACCESS_TOKEN
=
'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw'
;
MAX_OPACITY
=
1
;
MAX_OPACITY
=
1
;
FIRST_IMAGE_LAYER_INDEX
=
2
;
FIRST_IMAGE_LAYER_INDEX
=
2
;
document
.
getElementById
(
"light"
).
checked
=
true
;
// create wkt polygon
// create wkt polygon
const
wktFormat
=
new
ol
.
format
.
WKT
();
const
wktFormat
=
new
ol
.
format
.
WKT
();
...
@@ -79,6 +79,8 @@ else {
...
@@ -79,6 +79,8 @@ else {
x
=
'light'
;
x
=
'light'
;
//console.log({x})
//console.log({x})
}
}
document
.
getElementById
(
x
).
checked
=
true
;
const
polygonLayer
=
new
ol
.
layer
.
Vector
({
const
polygonLayer
=
new
ol
.
layer
.
Vector
({
name
:
'polygon'
,
name
:
'polygon'
,
source
:
new
ol
.
source
.
Vector
({
source
:
new
ol
.
source
.
Vector
({
...
@@ -207,7 +209,7 @@ function changeLayers(especific_layerName) {
...
@@ -207,7 +209,7 @@ function changeLayers(especific_layerName) {
}
}
layers
.
set
(
layerName
,
xyz
);
layers
.
set
(
layerName
,
xyz
);
sessionStorage
.
setItem
(
layerName
,
layerName
);
// replace
sessionStorage
.
setItem
(
layerName
,
layerName
);
});
});
}
}
...
@@ -223,7 +225,7 @@ function removeLayer(layerName) {
...
@@ -223,7 +225,7 @@ function removeLayer(layerName) {
map
.
removeLayer
(
layers
.
get
(
layerName
));
map
.
removeLayer
(
layers
.
get
(
layerName
));
layers
.
delete
(
layerName
);
layers
.
delete
(
layerName
);
sessionStorage
.
layers
=
layers
;
sessionStorage
.
removeItem
(
layerName
)
}
}
// set opacity to layers
// set opacity to layers
...
...
reports/views.py
View file @
11300809
...
@@ -208,9 +208,9 @@ def Reports(request):
...
@@ -208,9 +208,9 @@ def Reports(request):
for
file
in
os
.
listdir
(
zip_path
):
for
file
in
os
.
listdir
(
zip_path
):
if
file
.
endswith
(
".zip"
):
if
file
.
endswith
(
".zip"
):
zip
=
zip_path
+
"/"
+
file
zip
=
zip_path
+
"/"
+
file
if
os
.
path
.
exists
(
USERS_PATH
+
producto
[
'user__email'
]
+
'/'
+
str
(
producto
[
'id'
])
+
'/scl_data.json'
):
if
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)
>
3
:
if
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)
>
3
:
Data
=
True
Data
=
True
productList
.
append
({
productList
.
append
({
"search_name"
:
producto
[
'name'
],
"search_name"
:
producto
[
'name'
],
...
...
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