Skip to content

Commit eb18a64

Browse files
committed
Added new license and started making home page
1 parent b3ab6d2 commit eb18a64

File tree

8 files changed

+61
-23
lines changed

8 files changed

+61
-23
lines changed

LICENSE

+22-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
BSD 2-Clause License
1+
Copyright 2018 United Kingdom Research and Innovation
22

3-
Copyright (c) 2018, Centre for Environmental Data Analysis Developers
4-
All rights reserved.
3+
Authors: Tommy Godfrey
54

6-
Redistribution and use in source and binary forms, with or without
5+
Redistribution and use in source and binary forms, with or without
76
modification, are permitted provided that the following conditions are met:
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
3. Neither the name of the copyright holder nor the names of its contributors
13+
may be used to endorse or promote products derived from this software
14+
without specific prior written permission.
815

9-
* Redistributions of source code must retain the above copyright notice, this
10-
list of conditions and the following disclaimer.
11-
12-
* Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
16-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
POSSIBILITY OF SUCH DAMAGE.

download_stats/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
TEMPLATES = [
3434
{
3535
'BACKEND': 'django.template.backends.django.DjangoTemplates',
36-
'DIRS': [],
36+
'DIRS': [os.path.join(BASE_DIR, 'download_stats/templates')],
3737
'APP_DIRS': True,
3838
'OPTIONS': {
3939
'context_processors': [

download_stats/templates/index.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% extends "fwtheme_django/layout.html" %}
2+
3+
{% load staticfiles %}
4+
5+
{% block stylesheets_extra %}
6+
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
7+
{% endblock %}
8+
9+
{% block head_title %}
10+
Access stats
11+
{% endblock %}
12+
13+
{% block page_title %}
14+
{% endblock %}
15+
16+
{% block content %}
17+
<a href="downloads">Downloads</a>
18+
<a href="deposits">Deposits</a>
19+
{% endblock %}
20+
21+
{% block tail_js_extra %}
22+
{% endblock %}

download_stats/urls.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from django.urls import path, include
22

3+
from .views import IndexView
4+
35
urlpatterns = [
6+
path('', IndexView.as_view(), name='index'),
47
path('downloads/', include('downloads.urls')),
58
]

download_stats/views.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.shortcuts import render
2+
from django.http import HttpResponse, JsonResponse, HttpResponseNotFound
3+
from django.views.generic import TemplateView
4+
5+
class IndexView(TemplateView):
6+
template_name = "index.html"
7+
8+
def get(self, request):
9+
10+
return render(request, self.template_name, {})

downloads/static/downloads/js/downloads.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// On default page load, get values in filters and add them to query in url
2+
console.log(window.location.search)
23
if (!window.location.search)
34
{
45
var start = $("#id_start").val()

downloads/templates/downloads/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
<tr>
330330
<th scope="col">User</th>
331331
<th scope="col">Country</th>
332-
<th scope="col">Institiute type</th>
332+
<th scope="col">Institute type</th>
333333
<th scope="col">Field</th>
334334
<th scope="col">Methods</th>
335335
<th scope="col">Datasets</th>

downloads/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.shortcuts import render
55
from django.http import HttpResponse, JsonResponse, HttpResponseNotFound
66
from django.views.generic import TemplateView
7+
78
from xlsxwriter.workbook import Workbook
89

910
from .forms import FilterForm

0 commit comments

Comments
 (0)