Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/bcgov-nr/action-pr…
Browse files Browse the repository at this point in the history
…-description-add-1.1.1
  • Loading branch information
tobiasmllr authored Feb 14, 2024
2 parents fe4cb84 + 6b5220f commit f789efb
Show file tree
Hide file tree
Showing 29 changed files with 431 additions and 205 deletions.
5 changes: 3 additions & 2 deletions frontend/rctool/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ class DatePickerInput(forms.DateInput):
input_type = 'date'

class import_rc_data(forms.Form):
csv_upload = forms.FileField(label="csv file")
header_row = forms.IntegerField(label="header row number", widget=forms.NumberInput(attrs={'class': 'form-control', 'min':1, 'value':1, 'id':'form-header-row'}))
# csv_upload = forms.FileField(label="csv file", widget=forms.FileInput(attrs={'class': 'form-control form-control-sm'}))
csv_upload = forms.FileField(label="csv file", widget=forms.FileInput(attrs={'class': 'form-control form-control-sm', 'style': 'font-size: 11.5px;'}))
header_row = forms.IntegerField(label="header row number", widget=forms.NumberInput(attrs={'class': 'form-control form-control-sm', 'min':1, 'value':1, 'id':'form-header-row'}))
csv_upload.required = False
header_row.required = False

Expand Down
2 changes: 1 addition & 1 deletion frontend/rctool/templates/rctool/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="{% static '/css/main.css' %}">
<link rel="stylesheet" type="text/css" href="{% static '/css/header.css' %}">
<link rel="stylesheet" type="text/css" href="{% static '/css/rctool_main.css' %}">
<link rel="stylesheet" type="text/css" href="{% static '/css/rctool_intro.css' %}">
<link rel="stylesheet" type="text/css" href="{% static '/css/rctool_tour.css' %}">
<link rel="stylesheet" type="text/css" href="{% static '/css/rctool_develop.css' %}">

<!-- Boottrap Tour -->
Expand Down
6 changes: 3 additions & 3 deletions frontend/rctool/templates/rctool/components/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #003466">
<div class="header-title-div"></div>
<a class="navbar-brand" href="{% url 'home' %}"><img src="{% static 'images/gov_logo.JPG' %}" class="logo"></a>
<p class="header-title-text">HydRA - Rating Curve Tool</p>
<p class="header-title-text">HydRA</p>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto w-100 justify-content-end">
<li class="nav-item">
<a class="nav-link" href="{% url 'home' %}">home</a>
<a class="nav-link" href="{% url 'home' %}"><small>home</small></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'rctool_import' 0 %}">rctool</a>
<a class="nav-link" href="{% url 'rctool_import' 0 %}"><small>develop</small></a>
</li>
</ul>
</div>
Expand Down
30 changes: 18 additions & 12 deletions frontend/rctool/templates/rctool/components/table.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<table class="table">
<tr class="table-header">
{% for header in headings %}
<th class="table-cell">{{ header }}</th>
{% endfor %}
</tr>
<div class="table-container">
<table class="table">
<thead>
<tr class="table-header">
{% for header in headings %}
<th class="table-cell">{{ header }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in table_data %}
<tr class="table-row">
{% for cell in row %}
<td class="table-cell">{{ cell }}</td>
<tr class="table-row">
{% for cell in row %}
<td class="table-cell">{{ cell }}</td>
{% endfor %}
</tr>
{% endfor %}
</tr>
{% endfor %}
</table>
</tbody>
</table>
</div>
26 changes: 11 additions & 15 deletions frontend/rctool/templates/rctool/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,31 @@


{% block content %}

<div class="container">
<div class="row justify-content-md-center" style="padding: 40px;">
<div class="col-11 col-lg-10 col-xl-10">
<div class="col-8 col-lg-8 col-xl-8">
<div class="card">

<div class="card-body py-4" style="width: 65%; margin: auto;">
<H2 style="color:#003466; font-family:sans-serif; font-weight:bold; margin: 20px; text-align: center;">Welcome</H2>
<div style="margin-bottom: 25px;">
<p style="color:grey;">
A hydrometric rating curve describes the mathematical relationship between stage and discharge. This platform
allows users to upload any stage and discharge datasets, develop and optimize rating models as well as
save and compare results from previous sessions. Please follow the links below to get started.
<div class="card-body py-4" style="width: 80%; margin: auto;">
<h3 style="color:#003466; font-family:sans-serif; font-weight:bold; margin: 5px 0px 10px 0px; text-align: center;">Welcome</h3>
<div style="margin-bottom: 20px;">
<p class="text-description-intro">
A hydrometric rating curve describes the mathematical relationship between stage and discharge. <b>HydRA</b> is a platform that
allows users to upload any stage and discharge datasets, then develop and optimize rating models. Hop into a guided tour below for an overview of rating curve development
and HydRA features, or jump straight into a session.
</p>
</div>
<div class='import-button-container' style="display: flex; margin-bottom:30px;">
<div class='import-button-container' style="display: flex; margin-bottom:15px;">
<div style="flex:1; margin-right:10px;">
<a class='btn btn-primary btn-block' style="background-color: #758fa8 !important; border-color: #FFFFFF;" href="{% url 'rctool_import' 1 %}">take a tour</a>
<a class='btn btn-secondary btn-block custom-button' style="background-color: #758fa8 !important; border-color: #FFFFFF;" href="{% url 'rctool_tour_intro' 1 %}"><small>Guided Tour</small></a>
</div>
<div style='flex:1; margin-left:10px;'>
<a class="btn btn-primary btn-block" style="background-color: #6c747e !important; border-color: #FFFFFF;" href="{% url 'rctool_import' 0 %}">new session</a>
<a class="btn btn-secondary btn-block custom-button" style="background-color: #6c747e !important; border-color: #FFFFFF;" href="{% url 'rctool_import' 0 %}"><small>Start Session</small></a>
</div>
</div>

</div>
</div>
</div>
</div>
</div>


{% endblock %}
23 changes: 12 additions & 11 deletions frontend/rctool/templates/rctool/rctool/develop/rctool_develop.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ <h6 class="card-header text-center" style="background-color: #758fa8; color: #FF
<div style="display: none;"></div>
<form method="POST" action="../export/initialize" id="pass-develop-to-export-form">
{% csrf_token %}
<input type="hidden" id="n-seg_out" name="n-seg" value="{{ n_seg }}">
<input type="hidden" id="fieldData_stage_out" name="fieldData_stage" value="">
<input type="hidden" id="fieldData_discharge_out" name="fieldData_discharge" value="">
<input type="hidden" id="fieldData_active_out" name="fieldData_active" value="">
<input type="hidden" id="fieldData_datetime_out" name="fieldData_datetime" value="">
<input type="hidden" id="fieldData_comments_out" name="fieldData_comments" value="">
<input type="hidden" id="fieldData_uncertainty_out" name="fieldData_uncertainty" value="">
<input type="hidden" id="rc_out" name="rc_out" value="{{ rc }}">
<input type="hidden" id="filename_out" name="filename_out" value="{{ filename }}">
<button type="submit" onclick="location.href='{% url 'rctool_export_initialize' %}'" name='to-export-btn' id='to-export-btn' onkeydown="return event.key != 'Enter';" hidden></button>
<input type="hidden" id="tour_request_status_id" name="tour_request_status_id" value="{{ tour_request_status_id }}">
<input type="hidden" id="n-seg_out" name="n-seg" value="{{ n_seg }}">
<input type="hidden" id="fieldData_stage_out" name="fieldData_stage" value="">
<input type="hidden" id="fieldData_discharge_out" name="fieldData_discharge" value="">
<input type="hidden" id="fieldData_active_out" name="fieldData_active" value="">
<input type="hidden" id="fieldData_datetime_out" name="fieldData_datetime" value="">
<input type="hidden" id="fieldData_comments_out" name="fieldData_comments" value="">
<input type="hidden" id="fieldData_uncertainty_out" name="fieldData_uncertainty" value="">
<input type="hidden" id="rc_out" name="rc_out" value="{{ rc }}">
<input type="hidden" id="filename_out" name="filename_out" value="{{ filename }}">
<button type="submit" onclick="location.href='{% url 'rctool_export_initialize' %}'" name='to-export-btn' id='to-export-btn' onkeydown="return event.key != 'Enter';" hidden></button>
</form>
</div>

Expand All @@ -160,7 +161,7 @@ <h6 class="card-header text-center" style="background-color: #758fa8; color: #FF
// Initialize

try {
var developTourStatusID = {{ develop_tour_request_status_id|safe }};
var developTourStatusID = {{ tour_request_status_id|safe }};
}
catch(err) {
var developTourStatusID = 0;
Expand Down
Loading

0 comments on commit f789efb

Please sign in to comment.