-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add history of uploads * Update page for form and history * Fix progress bar
- Loading branch information
Showing
10 changed files
with
578 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# coding=utf-8 | ||
|
||
from rest_framework.pagination import PageNumberPagination | ||
from rest_framework.response import Response | ||
|
||
|
||
class Pagination(PageNumberPagination): | ||
"""Pagination for API.""" | ||
|
||
page_size_query_param = 'page_size' | ||
|
||
def get_paginated_response_data(self, data): | ||
"""Return paginated only data.""" | ||
return { | ||
'next': self.get_next_link(), | ||
'previous': self.get_previous_link(), | ||
'count': self.page.paginator.count, | ||
'page': self.page.number, | ||
'total_page': self.page.paginator.num_pages, | ||
'page_size': self.page.paginator.per_page, | ||
'results': data, | ||
} | ||
|
||
def get_paginated_response(self, data): | ||
"""Response for pagination.""" | ||
return Response(self.get_paginated_response_data(data)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load i18n %} | ||
{% csrf_token %} | ||
{% block page_title %} | ||
<h1>Upload Excel File For Well Data.</h1> | ||
{% endblock page_title %} | ||
|
||
{% block extra_head %} | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | ||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
{% endblock %} | ||
{% block body %} | ||
<style> | ||
.page-header { | ||
font-size: 17pt; | ||
} | ||
|
||
.form-group p, .form-group .p { | ||
border: 1px solid lightgrey; | ||
padding: 15px; | ||
} | ||
|
||
.form-group p:hover { | ||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.10); | ||
} | ||
|
||
.tab-pane { | ||
padding: 40px; | ||
border-bottom: 1px solid rgb(221, 221, 221); | ||
border-left: 1px solid rgb(221, 221, 221); | ||
border-right: 1px solid rgb(221, 221, 221); | ||
} | ||
|
||
.template-indicator { | ||
margin-bottom: 20px; | ||
font-style: italic; | ||
color: grey; | ||
} | ||
|
||
.template-indicator a { | ||
font-weight: 700; | ||
} | ||
|
||
.notes span { | ||
display: inline-block; | ||
padding: 5px 10px; | ||
font-weight: 700; | ||
} | ||
|
||
.notes .added { | ||
background-color: #48b14f; | ||
color: white; | ||
} | ||
|
||
.notes .error { | ||
background-color: #ca3232; | ||
color: white; | ||
} | ||
|
||
.notes .skipped { | ||
background-color: #ffef44; | ||
} | ||
|
||
select { | ||
cursor: pointer; | ||
} | ||
|
||
select, | ||
textarea { | ||
width: 100%; | ||
} | ||
|
||
.multivalue .multivalue-selection div { | ||
float: none !important; | ||
width: fit-content; | ||
display: inline-block; | ||
} | ||
|
||
.well:hover { | ||
cursor: pointer; | ||
opacity: 0.7; | ||
} | ||
|
||
.progress { | ||
border-radius: 0 !important; | ||
height: 2rem !important; | ||
position: relative; | ||
width: 400px; | ||
margin-bottom: 0 !important; | ||
} | ||
|
||
.upload-progress { | ||
text-align: left; | ||
box-sizing: border-box; | ||
} | ||
|
||
.msgapi .progress-bar { | ||
background-color: white; | ||
color: black; | ||
box-shadow: unset; | ||
border: 1px solid #ddd; | ||
} | ||
|
||
.progress-bar-success { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
|
||
.msgapi .progress-bar-success { | ||
background-color: #398439 !important; | ||
} | ||
|
||
.upload-progress-text { | ||
padding: 8px 0; | ||
height: 100%; | ||
text-align: left; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
|
||
.upload-progress-text { | ||
color: white; | ||
} | ||
|
||
.upload-progress-text.bottom { | ||
color: var(--gn-main-color, #000); | ||
} | ||
|
||
button:disabled { | ||
color: #555; | ||
} | ||
</style> | ||
<script> | ||
function mainTabChange(url) { | ||
window.location.href = url; | ||
} | ||
</script> | ||
<div class="container"> | ||
<br> | ||
<ul class="nav nav-tabs" id="mainTab" role="tablist"> | ||
<li class="nav-item {% if 'history' not in request.path %}active{% endif %}"> | ||
<a class="nav-link active" | ||
data-toggle="tab" | ||
href="#batch-form" | ||
role="tab" | ||
aria-controls="home" | ||
aria-selected="true" | ||
onclick="mainTabChange('{% url 'well_upload_view' %}')" | ||
> | ||
{% trans "Batch Upload Form" %} | ||
</a> | ||
</li> | ||
<li class="nav-item {% if 'history' in request.path %}active{% endif %}"> | ||
<a class="nav-link" | ||
data-toggle="tab" | ||
href="#history" role="tab" | ||
aria-controls="profile" | ||
aria-selected="false" | ||
onclick="mainTabChange('{% url 'well_upload_history_view' %}')" | ||
> | ||
{% trans "Past Uploads" %} | ||
</a> | ||
</li> | ||
</ul> | ||
<br> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
{% block outside_content %} | ||
{% endblock %} | ||
{% endblock %} |
Oops, something went wrong.