- agregado el boton de paypal en la vista "cart"

- quitado el boton de carrito en las vistas distintas a "map"
- correccion del "wait" en la vista "map"
parent 7b7c95ba
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<br> <br>
<ul class="sidebar-menu" data-widget="tree"> <ul class="sidebar-menu" data-widget="tree">
<li> <li>
<a class="treeview " href="{{ BASE_URL }}/catalog"> <a class="treeview " href="../../catalog">
<i class="fa fa-map"></i> <i class="fa fa-map"></i>
<span>Home</span> <span>Home</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -222,10 +222,10 @@ ...@@ -222,10 +222,10 @@
{% endfor %} {% endfor %}
<input type='hidden' name='cancel_return' <input type='hidden' name='cancel_return'
value='{{BASE_URL}}/reports'> value='../reports'>
<input type='hidden' name='return' <input type='hidden' name='return'
value='{{BASE_URL}}/catalog/cart'> value='../catalog/cart'>
<input type="hidden" name="notify_url" value="{{BASE_URL}}/catalog/ipn"> <input type="hidden" name="notify_url" value="../catalog/ipn">
<input type="image" <input type="image"
src="https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif" src="https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit" border="0" name="submit"
......
...@@ -483,7 +483,7 @@ def showCart(request): ...@@ -483,7 +483,7 @@ def showCart(request):
total_products += 1 total_products += 1
return render(request, 'show_cart.html', return render(request, 'show_cart.html',
{'product_list': prod_list, 'total_price': total_price, 'total_products': total_products,'BASE_URL': BASE_URL}) {'product_list': prod_list, 'total_price': total_price, 'total_products': total_products})
# ------------------------------------- # -------------------------------------
...@@ -516,7 +516,7 @@ def Pay(request): ...@@ -516,7 +516,7 @@ def Pay(request):
if not os.path.exists(userdir): if not os.path.exists(userdir):
os.makedirs(userdir) os.makedirs(userdir)
search_dir = userdir + "/" + str(values['search_id']) search_dir = userdir + "/" + str(values['id'])
if not os.path.exists(search_dir): if not os.path.exists(search_dir):
os.makedirs(search_dir) os.makedirs(search_dir)
......
{ {
"PATHS": { "PATHS": {
"PATH_GEOSENTINEL": "/home/david/centroGEO/repsat/Geosentinel", "PATH_GEOSENTINEL": "/home/ulises/centroGEO/repsat/Geosentinel",
"PATH_NAS": "/home/david/NAS/", "PATH_NAS": "/home/ulises/NAS/",
"PATH_USERS" : "/home/david/NAS/repsat_test_dev/" "PATH_USERS" : "/home/ulises/NAS/repsat_test_dev/"
}, },
"API_SENTINEL": { "API_SENTINEL": {
"SENTINEL_USER" : "emmhp", "SENTINEL_USER" : "emmhp",
......
...@@ -138,7 +138,8 @@ ...@@ -138,7 +138,8 @@
<th>Start Date</th> <th>Start Date</th>
<th>End Date</th> <th>End Date</th>
<th>Clouds %</th> <th>Clouds %</th>
<th>Size</th> <th>Progress %</th>
<th>Estimated Size</th>
<th>Actions</th> <th>Actions</th>
</thead> </thead>
<tbody> <tbody>
...@@ -149,8 +150,26 @@ ...@@ -149,8 +150,26 @@
<td>{{product.startDate}}</td> <td>{{product.startDate}}</td>
<td>{{product.endDate}}</td> <td>{{product.endDate}}</td>
<td>{{product.clouds}} %</td> <td>{{product.clouds}} %</td>
<td class="text-center">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{{product.progress}}"
aria-valuemin="0"
aria-valuemax="100" style="width:{{product.progress}}%">
<p class="text-center" style="color: #0a0a0a">{{product.progress}} % </p>
</div>
</div>
</td>
<td>{{product.size}} MB</td> <td>{{product.size}} MB</td>
<td><a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}" class="btn btn-success"><i class="fa fa-eye"></i></a></td> <td class="text-center">
<a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}"
class="btn btn-success">
<i class="fa fa-eye"></i>
</a>
<a href="{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}"
class="btn btn-info">
<i class="fa fa-file-archive-o"></i>
</a>
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
......
...@@ -32,13 +32,6 @@ USERS_PATH = config['PATHS']['PATH_USERS'] ...@@ -32,13 +32,6 @@ USERS_PATH = config['PATHS']['PATH_USERS']
def report_L2ASCL(request, report,purchase_id): def report_L2ASCL(request, report,purchase_id):
#image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/" #image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
image_path =request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/" image_path =request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
print(image_path)
# os.system(
# "L2ASCL_AreaProcessing.sh " + search_dir + "/ 1 > " + search_dir + "/L2ASCL_AreaProcessing.log") ###ejecuta el proceso
#
with open(USERS_PATH + request.user.email+"/"+purchase_id+"/" + report + ".json") as f: with open(USERS_PATH + request.user.email+"/"+purchase_id+"/" + report + ".json") as f:
json_data = OrderedDict(json.load(f)) json_data = OrderedDict(json.load(f))
graphData = dict() graphData = dict()
...@@ -51,7 +44,7 @@ def report_L2ASCL(request, report,purchase_id): ...@@ -51,7 +44,7 @@ def report_L2ASCL(request, report,purchase_id):
labels = set() labels = set()
for d in json_data: for d in json_data:
labels |= set(json_data[d].keys()) labels |= set(json_data[d].keys())
print(labels)
labels.remove('date') labels.remove('date')
labelNames = ["No Data", "Saturated", "Shadows", "Cloud Shadows", "Vegetation", "Not-Vegetated", "Whater", labelNames = ["No Data", "Saturated", "Shadows", "Cloud Shadows", "Vegetation", "Not-Vegetated", "Whater",
...@@ -83,9 +76,25 @@ def report_L2ASCL(request, report,purchase_id): ...@@ -83,9 +76,25 @@ def report_L2ASCL(request, report,purchase_id):
def Reports(request): def Reports(request):
progress = 0
productList=[] productList=[]
product_list = Purchase.objects.values('id','productList','aggreg_date','search__clouds' ,'search__startDate', 'search__endDate','search__process_id__name').filter(user_id=request.user.id, purchased=1) product_list = Purchase.objects.values('id','productList','aggreg_date','search__clouds' ,'search__startDate', 'search__endDate','search__process_id__name').filter(user_id=request.user.id, purchased=1)
for producto in product_list: for producto in product_list:
log_info = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log"
#####################################################
# progress bar #
#####################################################
if 'Linking Products...' in open(log_info).read():
progress = 20
if 'Merging Images...' in open(log_info).read():
progress = 40
if 'Deleting Images...' in open(log_info).read():
progress = 50
if 'Extracting SCL information...' in open(log_info).read():
progress = 60
size = 0 size = 0
for p in json.loads(producto['productList']): for p in json.loads(producto['productList']):
size = size + float(p['info']['size'][:-3]) size = size + float(p['info']['size'][:-3])
...@@ -97,5 +106,7 @@ def Reports(request): ...@@ -97,5 +106,7 @@ def Reports(request):
"clouds": producto['search__clouds'], "clouds": producto['search__clouds'],
"size": size, "size": size,
"purchase_id": producto['id'], "purchase_id": producto['id'],
"progress": progress,
}) })
return render(request, 'Reports.html', {"productList": productList}) return render(request, 'Reports.html', {"productList": productList})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment