Skip to content

Commit

Permalink
Start fixing tab titles
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Duplyakin committed Feb 20, 2024
1 parent 26855c4 commit 0d13d2d
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 5 deletions.
1 change: 1 addition & 0 deletions templates/12x24_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: 12x24</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
1 change: 1 addition & 0 deletions templates/bc_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: bias correction</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">

Expand Down
3 changes: 2 additions & 1 deletion templates/by_address.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: address</title>
<meta charset="UTF-8">

<style>
Expand Down Expand Up @@ -378,7 +379,7 @@
<tr class="spaceUnder">
<form>
<td>
<label for="fname">Years (2007,...,2013):</label>
<label for="fname">Years (supported: 2007-2013):</label>
</td>
<td>
<input type="text" class="text_field" id="years" value="2013"><br>
Expand Down
1 change: 1 addition & 0 deletions templates/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: info</title>
<meta charset="UTF-8">

<style>
Expand Down
1 change: 1 addition & 0 deletions templates/monthly_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: monthly</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
3 changes: 2 additions & 1 deletion templates/on_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: map</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/maps.css">
<style>
Expand Down Expand Up @@ -386,7 +387,7 @@
<tr class="spaceUnder">
<form>
<td>
<label for="fname">Years (2007,...,2013):</label>
<label for="fname">Years (supported: 2007-2013):</label>
</td>
<td>
<input type="text" class="text_field" id="years" value="2013"><br>
Expand Down
1 change: 1 addition & 0 deletions templates/ts_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: timeseries</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/save_button.css">
<link rel="stylesheet" href="static/styles/info_button.css">
Expand Down
1 change: 1 addition & 0 deletions templates/universal_12x24_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: 12x24</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
1 change: 1 addition & 0 deletions templates/universal_bc_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: bias correction</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">

Expand Down
3 changes: 2 additions & 1 deletion templates/universal_by_address.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: address</title>
<meta charset="UTF-8">

<style>
Expand Down Expand Up @@ -378,7 +379,7 @@
<tr class="spaceUnder">
<form>
<td>
<label for="fname">Years (2007,...,2013):</label>
<label for="fname">Years (supported: 2007-2013):</label>
</td>
<td>
<input type="text" class="text_field" id="years" value="2013"><br>
Expand Down
1 change: 1 addition & 0 deletions templates/universal_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: info</title>
<meta charset="UTF-8">

<style>
Expand Down
1 change: 1 addition & 0 deletions templates/universal_monthly_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: monthly</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
3 changes: 2 additions & 1 deletion templates/universal_on_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: map</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/maps.css">
<style>
Expand Down Expand Up @@ -386,7 +387,7 @@
<tr class="spaceUnder">
<form>
<td>
<label for="fname">Years (2007,...,2013):</label>
<label for="fname">Years (supported: 2007-2013):</label>
</td>
<td>
<input type="text" class="text_field" id="years" value="2013"><br>
Expand Down
1 change: 1 addition & 0 deletions templates/universal_ts_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: timeseries</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/save_button.css">
<link rel="stylesheet" href="static/styles/info_button.css">
Expand Down
1 change: 1 addition & 0 deletions templates/universal_windrose_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: windrose</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
1 change: 1 addition & 0 deletions templates/windrose_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>TAP API: windrose</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/styles/info_button.css">
<link rel="stylesheet" href="static/styles/maps.css">
Expand Down
17 changes: 16 additions & 1 deletion v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,24 @@ def validated_params_v2_w_year(request):

if 'year' in args:
year_raw = args['year']
# Remove spaces
year_raw = year_raw.replace(" ","")
try:
year_list_full = []
# Works for a list of years and also for a single year
year_list = [int(yr) for yr in year_raw.split(",")]
year_list = year_raw.split(",")
print("year_list:", year_list)
for el in year_list:
if "-" in el:
# Year range with a dash
year_start, year_end = int(el.split("-")[0]), int(el.split("-")[1])
for x in range(year_start, year_end + 1):
year_list_full.append(x)
else:
# Single year
year_list_full.append(int(el))
year_list = year_list_full

except ValueError:
raise InvalidUsage(("Year needs to be an integer or a comma-separated list of integers."))
else:
Expand Down

0 comments on commit 0d13d2d

Please sign in to comment.