##// END OF EJS Templates
Add modules for interactive plots and upload data
jespinoza -
r2:98d277d09dd7
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

1 NO CONTENT: new file 100755
1 NO CONTENT: new file 100755
@@ -0,0 +1,17
1 {% extends "base.html" %}
2
3 {% block title %}Login{% endblock %}
4
5 {% block content %}
6 <center>
7 <h4>Please login</h4>
8
9 <div style="margin-top: 30px;">
10 <form method="POST">
11 {{ form.as_p }}
12 {% csrf_token %}
13 <button type="submit">Login</button>
14 </form>
15 </div>
16 </center>
17 {% endblock %}
@@ -0,0 +1,9
1 from django.conf.urls import url
2 from . import views
3
4 urlpatterns = [
5 url(r'^login/$', views.login_view, name='login'),
6 url(r'^logout/$', views.logout_view, name='logout'),
7 ]
8
9 app_name = 'login' No newline at end of file
@@ -0,0 +1,38
1 from django.contrib.auth import authenticate
2 from django.contrib.auth import login, logout
3 from django.contrib.auth.forms import AuthenticationForm
4 from django.shortcuts import render, redirect
5
6 ''' Login to updata app for ROJ staff'''
7
8 def login_view(request):
9
10 form = AuthenticationForm()
11 if request.method == "POST":
12 form = AuthenticationForm(data=request.POST)
13
14 if form.is_valid():
15
16 username = form.cleaned_data['username']
17 password = form.cleaned_data['password']
18
19 user = authenticate(username=username, password=password)
20
21 if user is not None:
22
23 if user.is_active:
24 login(request, user)
25
26 return redirect('/updata')
27 else:
28 return render(request, "login/login.html" )
29 else:
30 context = {'error_login': "error"}
31 return render(request, "login/login.html", context )
32
33 return render(request, "login/login.html", {'form': form})
34
35 def logout_view(request):
36
37 logout(request)
38 return redirect('/') No newline at end of file
1 NO CONTENT: new file 100755
@@ -0,0 +1,108
1 from django import forms
2 import django.utils.html
3 import django.utils.safestring
4 import django.template.defaulttags
5
6 # third party imports
7 import numpy
8
9 # Madrigal imports
10 import madrigal.metadata
11 import madrigal.ui.web
12
13 # madrigal imports
14 import madrigal._derive
15 import madrigal.metadata
16 import madrigal.ui.web
17 import madrigal.cedar
18 import madrigal.isprint
19 import madweb.forms
20
21 import datetime, time
22
23 def getSelection(keyword, args, kwargs):
24 """getSelection returns '0' if keyword not a key in either args[0] or kwargs,
25 otherwise the value
26
27 args, kwargs - arguments as passed into SingleExpDefaultForm __init__
28 """
29 if len(args) == 0 and len(list(kwargs.keys())) == 0:
30 return('0') # default case when no data passed in
31 elif len(args) > 0:
32 # args[0] is data dict argument to bind data
33 if keyword in args[0]:
34 return(args[0][keyword])
35 else:
36 return('0')
37 elif keyword in kwargs:
38 return(kwargs[keyword])
39 elif 'data' in kwargs:
40 if keyword in kwargs['data']:
41 return(kwargs['data'][keyword])
42 else:
43 return('0')
44 else:
45 return('0')
46
47 def getExperimentList(args, kwargs, madWeb, header='Select experiment: '):
48
49 instrumentsId= int(getSelection('instruments', args, kwargs))
50
51 kinstList = [int(instrumentsId)]
52 startDate = datetime.datetime(1950,1,1)
53 startDT = datetime.datetime(startDate.year, startDate.month, startDate.day, 0, 0, 0)
54 now = datetime.datetime.now()
55 endDate = datetime.datetime(now.year, 12, 31, 23, 59, 59)
56 endDT = datetime.datetime(endDate.year, endDate.month, endDate.day, 23, 59, 59)
57 experiments = madWeb.getExperimentList(kinstList,startDT, endDT, True)
58 expListin = [('0', header),]
59 for exp in experiments:
60 expListin.append((exp[0], exp[2]))
61
62 # Using set
63 seen = set()
64
65 # using list comprehension
66 expList = [(a, b) for a, b in expListin
67 if not (b in seen or seen.add(b))]
68
69 return(expList)
70
71 class UpdataForm(forms.Form):
72 def __init__(self, *args, **kwargs):
73 super(UpdataForm, self).__init__(*args, **kwargs)
74 madDB = madrigal.metadata.MadrigalDB()
75 madInstData = madrigal.metadata.MadrigalInstrumentData(madDB)
76 instruments = madInstData.getInstruments(0, True)
77 instList = [('0', "Select Instrument"), ]
78 for kinst, instDesc, siteID in instruments:
79 instList.append((str(kinst), instDesc))
80
81 instrumentSelection = getSelection('instruments', args, kwargs)
82 self.fields['instruments'] = django.forms.ChoiceField(widget = django.forms.Select(attrs={"onChange":'populateExp(this)'}),
83 choices=instList,
84 initial=instrumentSelection,
85 label='Instrument:')
86
87 madWebObj = madrigal.ui.web.MadrigalWeb(madDB)
88 experimentSelection = getSelection('experiments', args, kwargs)
89 self.fields['experiments'] = django.forms.ChoiceField(choices=getExperimentList(args, kwargs, madWebObj),
90 initial=experimentSelection,
91 required=False, label='Experiment:')
92
93 description = forms.CharField(widget=forms.Textarea(attrs={'cols': 40,'rows': 3, 'style': 'resize:none'}), label='Description')
94 type = forms.ChoiceField(choices=[('0', 'Public'),('1', 'Private')], initial=0,widget=forms.RadioSelect(attrs={'class': 'custom-radio'}))
95 file = forms.FileField(label='Select Files', widget=forms.ClearableFileInput(attrs={'multiple': True}))
96
97 class ExpForm(forms.Form):
98 """SingleExpInstForm is a Form class for the instrument select field in the Single Experiment interface.
99 Use this because its faster to create than the full SingleExpDefaultForm
100 """
101 def __init__(self, *args, **kwargs):
102 super(ExpForm, self).__init__(*args, **kwargs)
103 madDB = madrigal.metadata.MadrigalDB()
104 madWebObj = madrigal.ui.web.MadrigalWeb(madDB)
105 experimentSelection = getSelection('experiments', args, kwargs)
106 self.fields['experiments'] = django.forms.ChoiceField(choices=getExperimentList(args, kwargs, madWebObj),
107 initial=experimentSelection,
108 required=False, label='Experiment')
1 NO CONTENT: new file 100755
@@ -0,0 +1,9
1 <div class="row">
2 {{ form.experiments.label }}
3 </div>
4 <!-- Instrument select is its own row in selections column -->
5 <div class="row">
6 <div class="col-md-12">
7 {{ form.experiments }}
8 </div> <!-- end span -->
9 </div> <!-- end row --> No newline at end of file
@@ -0,0 +1,102
1 {% extends "base.html" %}
2 {% block title %}Upload Data{% endblock %}
3
4 {% block extra_head %}
5 <script type="text/javascript">
6 function populateExp(select) {
7
8 var kinst = select.options[select.selectedIndex].value;
9 var url = "{% url 'updata:get_experiments' %}" + '?instruments=' + kinst;
10 // first delete all forms that are now out of date
11 divIndex = $(".single_form").index($("#experiments"))
12 $(".single_form").slice(divIndex).empty()
13 // second populate the categories html
14 $(".single_form").slice(divIndex, divIndex + 1).load(url);
15 }
16
17 </script>
18
19 <style>
20 .custom-radio {
21 list-style: none;
22 margin: 0;
23 padding: 0;
24 }
25 </style>
26 {% endblock %}
27
28 {% block content %}
29
30 <center><h4>Upload Data</h4></center>
31 <form method="post" enctype="multipart/form-data">
32
33 {% csrf_token %}
34
35 {% block description %}
36 <!-- subdivide selection column for instruments to be possibly filled in by ajax - single_form 0 -->
37 <div class="col-md-12 single_form" id="description">
38 <div class="row">
39 {{ form.description.label }}
40 </div>
41 <!-- Instrument select is its own row in selections column -->
42 <div class="row">
43 <div class="col-md-12">
44 {{ form.description }}
45 </div> <!-- end span -->
46 </div> <!-- end row -->
47 </div> <!-- end subdivide -->
48
49 {% endblock %}
50
51 {% block file %}
52 <div class="col-md-12 single_form" style="margin-top: 15px;" id="description">
53 <div class="row">
54 {{ form.file.label }}
55 </div>
56 <!-- Instrument select is its own row in selections column -->
57 <div class="row">
58 <div class="col-md-12">
59 {{ form.file }}
60 </div> <!-- end span -->
61 </div> <!-- end row -->
62 </div> <!-- end subdivide -->
63
64 {% endblock %}
65
66 {% block type %}
67 <div class="col-md-12 single_form" style="margin-top: 15px;" id="description">
68 <!-- Instrument select is its own row in selections column -->
69 <div class="row">
70 <div class="col-md-12">
71 {{ form.type }}
72 </div> <!-- end span -->
73 </div> <!-- end row -->
74 </div> <!-- end subdivide -->
75
76 {% endblock %}
77
78 {% block instruments %}
79 <!-- subdivide selection column for instruments to be possibly filled in by ajax - single_form 0 -->
80 <div class="col-md-12 single_form" style="margin-top: 15px;" id="instruments">
81
82 {% if form.instruments %}
83 {% include "madweb/instruments.html" %}
84 {% endif %}
85
86 </div> <!-- end subdivide -->
87 {% endblock %}
88
89 {% block experiments %}
90 <!-- subdivide selection column for experiments to be possibly filled in by ajax - single_form 0 -->
91 <div class="col-md-12 single_form" style="margin-top: 15px;" id="experiments">
92
93 {% if form.experiments %}
94 {% include "updata/experiments.html" %}
95 {% endif %}
96
97 </div> <!-- end subdivide -->
98 {% endblock %}
99 <button style="margin-top: 15px;" type="submit">Load</button>
100
101 </form>
102 {% endblock %} No newline at end of file
@@ -0,0 +1,9
1 from django.conf.urls import url
2 from . import views
3
4 urlpatterns = [
5 url(r'^$',views.index, name='updata_index'),
6 url(r'^getExperiments/?$', views.get_experiments, name='get_experiments'),
7 ]
8
9 app_name = 'updata' No newline at end of file
@@ -0,0 +1,83
1
2 from django.contrib.auth.decorators import login_required
3 from django.shortcuts import render
4 from .forms import UpdataForm, ExpForm
5 from django.core.files.storage import FileSystemStorage
6 from django.contrib import messages
7
8 import os
9
10 # madrigal imports
11 import madrigal.metadata
12 import madrigal.ui.web
13 import madrigal.admin
14
15 @login_required
16 def index(request):
17 '''
18 Uploading experiments data view. Allows user to upload experiment files
19
20 '''
21 dbAdminObj = madrigal.admin.MadrigalDBAdmin()
22 madDB = madrigal.metadata.MadrigalDB()
23 madWebObj = madrigal.ui.web.MadrigalWeb(madDB)
24 siteName, siteList = madWebObj.getSiteInfo()
25
26 if request.method == 'POST':
27 form = UpdataForm(request.POST, request.FILES)
28 files = request.FILES.getlist('file')
29
30 if form.is_valid():
31 try:
32 description = form.cleaned_data['description']
33 instCode = int(form.cleaned_data['instruments'])
34 expId = form.cleaned_data['experiments']
35 perm = int(form.cleaned_data['type'])
36
37 #saving file
38 for f in files:
39 fs = FileSystemStorage(location='/tmp')
40 fs.save(f.name, f)
41 madExp = madrigal.metadata.MadrigalExperiment()
42 filepath = os.path.join('/tmp', f.name)
43 expTitle = madExp.getExpNameByExpId(expId)
44
45 dbAdminObj.createMadrigalExperiment(filepath,expTitle, perm, description, instCode)
46
47
48 madInstParams = madrigal.metadata.MadrigalInstrumentParameters()
49 madInstKindats = madrigal.metadata.MadrigalInstrumentKindats()
50
51 print('*** Updating local metadata ***')
52 dbAdminObj.__updateLocalMetadata__()
53 print('*** Rebuilding instParmTab.txt ***')
54 madInstParams.rebuildInstParmTable()
55 print('*** Rebuilding instKindatTab.txt ***')
56 madInstKindats.rebuildInstKindatTable()
57 messages.success(
58 request, 'Experimento(s) creado(s) exitosamente')
59 form = UpdataForm()
60
61 except Exception as e:
62 messages.error(
63 request, str(e))
64 else:
65 form = UpdataForm()
66
67 return render(request, 'updata/index.html', {
68 'form': form,
69 'site_name': siteName,
70 'site_list': siteList,
71 })
72
73
74 def get_experiments(request):
75 """get_experiments is a Ajax call that returns the experiments select html to support the
76 updata UI. Called when a user modifies the intruments select field.
77
78 Inputs:
79 request
80 """
81 form = ExpForm(request.GET)
82
83 return render(request, 'updata/experiments.html', {'form': form})
1 NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,50
1 <div class="row" style="margin-bottom: 20px">
2 Select parameter: <br>
3 {{ form.param_list1d.label }}
4 {{ form.param_list1d }}
5 {% if form.param_list2d %}
6 {{ form.param_list2d.label }}
7 {{ form.param_list2d }}
8 {% endif %}
9
10 </div>
11
12 <script>
13 $('#id_param_list2d').bind('change', function (e) {
14 var expID = '{{ expID }}';
15 var param = $(this).val();
16 var url = '{% url 'plot' %}' + '?expID=' + expID + '&param2d=' + param;
17 console.log(url)
18 // first delete all forms that are now out of date
19 divIndex = $(".single_form").index($( "#file_plot" ))
20 $(".single_form").slice(divIndex).empty()
21 // second populate the file_plot html if '0' not selected
22 if (param != '0') {
23 $(".single_form").slice(divIndex,divIndex+1).html("<img src=\"static/loader.gif\" class=\"load_center\"/>").load(url);
24 }
25 })
26 $('#id_param_list1d').bind('change', function (e) {
27 var expID = '{{ expID }}';
28 var param = $(this).val();
29 var url = '{% url 'plot' %}' + '?expID=' + expID + '&param1d=' + param;
30 console.log(url)
31 // first delete all forms that are now out of date
32 divIndex = $(".single_form").index($( "#file_plot" ))
33 $(".single_form").slice(divIndex).empty()
34 // second populate the file_plot html if '0' not selected
35 if (param != '0') {
36 $(".single_form").slice(divIndex,divIndex+1).html("<img src=\"static/loader.gif\" class =\"load_center\"/>").load(url);
37 }
38 })
39 </script>
40 <style>
41 .load_center {
42 display: block;
43 margin-left: auto;
44 margin-right: auto;
45 margin-top: 100px;
46 margin-bottom: 100px;
47 width: 4%;
48 align-items: center;
49 }
50 </style> No newline at end of file
@@ -1,132 +1,138
1 1 """
2 2 Django settings for djangoMad project.
3 3
4 4 For more information on this file, see
5 5 https://docs.djangoproject.com/en/1.7/topics/settings/
6 6
7 7 For the full list of settings and their values, see
8 8 https://docs.djangoproject.com/en/1.7/ref/settings/
9 9 """
10 10
11 11 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12 12 import os
13 13 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
14 14
15
16
17 15 # Quick-start development settings - unsuitable for production
18 16 # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
19 17
20 18 # SECURITY WARNING: keep the secret key used in production secret!
21 SECRET_KEY = '!wa!749ow0!%7t7tr6fr^fvkqyd7yc#mmvpfedr+f2pb!4r)wd'
19 SECRET_KEY = '^c1l3d35+q28^66d2pc1qlu(k$wmw^*gg3rfitz^s)t=9eu1ui'
22 20
23 21 # SECURITY WARNING: don't run with debug turned on in production!
24 22 DEBUG = True
25 23
26 24
27 25 ALLOWED_HOSTS = ['localhost:8000', '127.0.0.1', 'localhost']
28 26
29 27 ADMINS = (('Bill Rideout', 'brideout@haystack.mit.edu'),)
30 28
31 29 EMAIL_HOST = 'hyperion.haystack.mit.edu'
32 30
33 31 SEND_BROKEN_LINK_EMAILS = True
34 32
35 33 MANAGERS = (('Bill Rideout', 'brideout@haystack.mit.edu'),)
36 34
37 35
38 36 # Application definition
39 37
40 38 INSTALLED_APPS = (
41 #'django.contrib.admin',
39 'django.contrib.admin',
42 40 'django.contrib.auth',
43 41 'django.contrib.contenttypes',
44 42 'django.contrib.sessions',
45 43 'django.contrib.messages',
46 44 'django.contrib.staticfiles',
47 45 'madweb',
48 46 'django_bootstrap_calendar',
49 'bootstrap3'
47 'bootstrap3',
48 'apps.login',
49 'apps.updata',
50 50 )
51 51
52 MIDDLEWARE_CLASSES = (
53 'django.contrib.auth.middleware.AuthenticationMiddleware',
54 'django.contrib.messages.middleware.MessageMiddleware',
52 MIDDLEWARE = [
53 'django.middleware.security.SecurityMiddleware',
55 54 'django.contrib.sessions.middleware.SessionMiddleware',
56 55 'django.middleware.common.CommonMiddleware',
57 56 'django.middleware.csrf.CsrfViewMiddleware',
58 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
57 'django.contrib.auth.middleware.AuthenticationMiddleware',
58 'django.contrib.messages.middleware.MessageMiddleware',
59 59 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60 )
60 ]
61 61
62 62 ROOT_URLCONF = 'djangoMad.urls'
63 63
64 64 WSGI_APPLICATION = 'djangoMad.wsgi.application'
65 65
66 66
67 67 TEMPLATES = [
68 68 {
69 69 'BACKEND': 'django.template.backends.django.DjangoTemplates',
70 70 'DIRS': [
71 71 os.path.join(BASE_DIR, "templates"),
72 72 ],
73 73 'APP_DIRS': True,
74 74 'OPTIONS': {
75 75 'context_processors': [
76 76 'django.contrib.auth.context_processors.auth',
77 77 'django.template.context_processors.debug',
78 78 'django.template.context_processors.i18n',
79 79 'django.template.context_processors.media',
80 80 'django.template.context_processors.static',
81 81 'django.template.context_processors.tz',
82 82 'django.contrib.messages.context_processors.messages',
83 'django.template.context_processors.request',
83 84 ],
84 85 },
85 86 },
86 87 ]
87 88
88 89
89 90 # Database
90 91 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
91 92
92 93 DATABASES = {
94 'default': {
95 'ENGINE': 'django.db.backends.sqlite3',
96 'NAME': 'madrigal.sqlite',
93 97 }
98 }
99
94 100
95 101 # Internationalization
96 102 # https://docs.djangoproject.com/en/1.7/topics/i18n/
97 103
98 104 LANGUAGE_CODE = 'en-us'
99 105
100 106 TIME_ZONE = 'UTC'
101 107
102 108 USE_I18N = True
103 109
104 110 USE_L10N = True
105 111
106 112 USE_TZ = True
107 113
108 114
109 115 # Absolute filesystem path to the directory that will hold user-uploaded files.
110 116 # Example: "/home/media/media.lawrence.com/media/"
111 117 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
112 118
113 119 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
114 120 # trailing slash.
115 121 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
116 122 MEDIA_URL = '/media/'
117 123
118 124 # Absolute path to the directory static files should be collected to.
119 125 # Don't put anything in this directory yourself; store your static files
120 126 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
121 127 # Example: "/home/media/media.lawrence.com/static/"
122 128 # STATIC_ROOT = os.path.join(BASE_DIR, 'static')
123 129
124 130 # URL prefix for static files.
125 131 # Example: "http://media.lawrence.com/static/"
126 132 STATIC_URL = '/static/'
127 133
128 134 BOOTSTRAP3 = {
129 135 # Include jQuery with Bootstrap JavaScript (affects django-bootstrap3 template tags)
130 136 'jquery_url': '/static/jquery.min.js',
131 137 'include_jquery': True,
132 138 }
@@ -1,8 +1,11
1 1 from django.conf.urls import include, url
2 2 from django.contrib import admin
3 3 import madweb.views
4 4
5 5 urlpatterns = [
6 6 url(r'^', include('madweb.urls')),
7 7 url(r'^$', madweb.views.index),
8 url(r'^updata/', include('apps.updata.urls', namespace="updata")),
9 url(r'^accounts/', include('apps.login.urls', namespace="login")),
10 url(r'^admin/', admin.site.urls),
8 11 ]
@@ -1,18 +1,18
1 1 """
2 2 WSGI config for djangoMad project.
3 3
4 4 It exposes the WSGI callable as a module-level variable named ``application``.
5 5
6 6 For more information on this file, see
7 7 https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
8 8 """
9 9
10 10 import os, os.path
11 11 import madrigal.metadata
12 12
13 13 madDB = madrigal.metadata.MadrigalDB()
14 14 os.environ['PYTHON_EGG_CACHE'] = os.path.join(madDB.getMadroot(), 'eggs')
15 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoMad.settings_production")
15 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoMad.settings")
16 16
17 17 from django.core.wsgi import get_wsgi_application
18 18 application = get_wsgi_application()
1 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,59 +1,67
1 1 {% extends "base.html" %}
2 2
3 3 {% comment %}
4 4 Written by Bill Rideout brideout@haystack.mit.edu
5 5
6 6 Base template for Madrigal show experiment web interface
7 7
8 8 $Id: show_experiment.html 7310 2021-03-02 14:31:06Z brideout $
9 9 {% endcomment %}
10 10
11 11 {% block title %}Show Madrigal experiment{% endblock %}
12 12
13 13 {% block extra_head %}
14 14 <script>
15 15
16 16 function changeFile (select) {
17 17 var basename = select.options[select.selectedIndex].value;
18 18 {% if form.exp_id %}
19 19 var url = '{% url 'change_files' %}' + '?experiment_list={{ form.exp_id.label }}&file_list=' + basename;
20 20 {% else %}
21 21 var exp_id = $("#id_experiment_list")[0].options[$("#id_experiment_list")[0].selectedIndex].value;
22 22 var url = '{% url 'change_files' %}' + '?experiment_list=' + exp_id + '&file_list=' + basename;
23 23 {% endif %}
24 24 // first delete all forms that are now out of date
25 25 divIndex = $(".single_form").index($( "#file_buttons" ))
26 26 $(".single_form").slice(divIndex).empty()
27 27 // second populate the file_list html if '0' not selected
28 28 if (basename != '0') {
29 29 $(".single_form").slice(divIndex,divIndex+1).load(url);
30 30 }
31 31 }
32 32
33 33 {% include "madweb/fileDownload.js" %}
34 34
35 35 </script>
36 36 {% endblock %}
37 37
38 38 {% block content %}
39 39 <center><h4> {{ form.exp_desc.label }} </h4></center>
40 40
41 41 {% include "madweb/file_list.html" %}
42 42
43 43 <!-- file select div -->
44 44 <div class="col-md-12 single_form" id="file_buttons">
45 45 {% if form.file_buttons %}
46 46 {% include "madweb/file_buttons.html" %}
47 47 {% endif %}
48 48 </div> <!-- end subdivide -->
49 49 <div>&nbsp;</div>
50 50
51 51 <!-- file select div -->
52 52 <div class="col-md-12 single_form" id="file_data">
53 53 {% if form.show_plots %}
54 54 {% include "madweb/show_plots.html" %}
55 55 {% elif form.plot_list %}
56 56 {% include "madweb/show_plots.html" %}
57 57 {% endif %}
58 58 </div> <!-- end subdivide -->
59
60 <!-- file select div -->
61 <div class="col-md-12 single_form" id="file_plot">
62 {% if form.show_plots %}
63 {% include "madweb/parameter_selection.html" %}
64 {% endif %}
65 </div> <!-- end subdivide -->
66
59 67 {% endblock %} No newline at end of file
@@ -1,259 +1,268
1 1 {% extends "base_single.html" %}
2 2
3 3 {% comment %}
4 4 Written by Bill Rideout brideout@haystack.mit.edu
5 5
6 6 Final template for Madrigal single experiment web interface
7 7
8 8 $Id: single.html 7290 2021-01-13 21:07:21Z brideout $
9 9 {% endcomment %}
10 10
11 11
12 12 {% block ajax_js %}
13 13 <script type="text/javascript">
14 14
15 15
16 16 {% if years %}
17 17 $( document ).ready(function() {
18 18 createCalendar();
19 19 });
20 20 {% endif %}
21 21
22 22 var redirectLookup = {
23 23 "0": function() { return ""; },
24 24 {% for redirect in redirect_list %}
25 25 "{{ redirect.0 }}": function() { return "{{ redirect.1|safe }}"; },
26 26 {% endfor %}
27 27 };
28 28
29 29 function populateCat (checkbox) {
30 30 var is_global = 0;
31 31 if (checkbox.checked) {
32 32 is_global = 1;
33 33 }
34 34 var url = '{% url 'get_categories' %}' + '?isGlobal=' + is_global;
35 35 // first delete all forms that are now out of date
36 36 divIndex = $(".single_form").index($( "#categories" ))
37 37 $(".single_form").slice(divIndex).empty()
38 38 // second populate the categories html
39 39 $(".single_form").slice(divIndex,divIndex+1).load(url);
40 40 }
41 41
42 42 function populateInst (select) {
43 43 var is_global = 0;
44 44 if ($("#id_isGlobal")[0].checked) {
45 45 is_global = 1;
46 46 }
47 47 var category = select.options[select.selectedIndex].value;
48 48 var url = '{% url 'get_instruments' %}' + '?isGlobal=' + is_global + '&categories=' + category;
49 49 // first delete all forms that are now out of date
50 50 divIndex = $(".single_form").index($( "#instruments" ))
51 51 $(".single_form").slice(divIndex).empty()
52 52 // second populate the instruments html if '0' not selected
53 53 if (category != '0') {
54 54 $(".single_form").slice(divIndex,divIndex+1).load(url);
55 55 }
56 56 }
57 57
58 58 function populateYear (select) {
59 59 var is_global = 0;
60 60 if ($("#id_isGlobal")[0].checked) {
61 61 is_global = 1;
62 62 }
63 63 // this method may redirect if instrument is not local
64 64 var kinst = select.options[select.selectedIndex].value;
65 65 var redirectUrl = redirectLookup[kinst]();
66 66 if (redirectUrl.length > 0) {
67 67 // redirect
68 68 alert('Because this data is not local, you will be redirected to ' + redirectUrl);
69 69 window.location.href = redirectUrl;
70 70 } else {
71 71 var url = '{% url 'get_years' %}' + '?isGlobal=' + is_global + '&instruments=' + kinst;
72 72 // first delete all forms that are now out of date
73 73 divIndex = $(".single_form").index($( "#years" ))
74 74 $(".single_form").slice(divIndex).empty()
75 75 // second populate the years html if '0' not selected
76 76 if (kinst != '0') {
77 77 $(".single_form").slice(divIndex,divIndex+1).load(url);
78 78 }
79 79 }
80 80 }
81 81
82 82 function populateMonth (select) {
83 83 var year = select.options[select.selectedIndex].value;
84 84 var kinst = $("#id_instruments")[0].options[$("#id_instruments")[0].selectedIndex].value;
85 85 var is_global = 0;
86 86 if ($("#id_isGlobal")[0].checked) {
87 87 is_global = 1;
88 88 }
89 89
90 90 var url = '{% url 'get_months' %}' + '?isGlobal=' + is_global + '&instruments=' + kinst + '&years=' + year;
91 91 // first delete all forms that are now out of date
92 92 divIndex = $(".single_form").index($( "#months" ))
93 93 $(".single_form").slice(divIndex).empty()
94 94 // second populate the years html if '0' not selected
95 95 if (kinst != '0') {
96 96 $(".single_form").slice(divIndex,divIndex+1).load(url);
97 97 }
98 98 }
99 99
100 100 function populateCalendar (select) {
101 101 var year = $("#id_years")[0].options[$("#id_years")[0].selectedIndex].value;
102 102 var month = select.options[select.selectedIndex].value;
103 103 var kinst = $("#id_instruments")[0].options[$("#id_instruments")[0].selectedIndex].value;
104 104 var is_global = 0;
105 105 if ($("#id_isGlobal")[0].checked) {
106 106 is_global = 1;
107 107 }
108 108 var url = '{% url 'get_calendar' %}' + '?isGlobal=' + is_global + '&instruments=' + kinst + '&years=' + year + '&months=' + month;
109 109 // first delete all forms that are now out of date
110 110 divIndex = $(".single_form").index($( "#calendar" ))
111 111 $(".single_form").slice(divIndex).empty()
112 112 // second populate the calendar html if '0' not selected
113 113 if (year != '0') {
114 114 $(".single_form").slice(divIndex,divIndex+1).load(url, function() {
115 115 createCalendar();
116 116 });
117 117 }
118 118 }
119 119
120 120 function populateFile (select) {
121 121 var expId = select.options[select.selectedIndex].value;
122 122 var url = '{% url 'get_files' %}' + '?experiment_list=' + expId;
123 123 // first delete all forms that are now out of date
124 124 divIndex = $(".single_form").index($( "#file_select" ))
125 125 $(".single_form").slice(divIndex).empty()
126 126 // second populate the file_list html if '0' not selected
127 127 if (expId != '0') {
128 128 $(".single_form").slice(divIndex,divIndex+1).load(url);
129 129 }
130 130 }
131 131
132 132 function changeFile (select) {
133 133 var basename = select.options[select.selectedIndex].value;
134 134 {% if form.exp_id %}
135 135 var url = '{% url 'change_files' %}' + '?experiment_list={{ form.exp_id.label }}&file_list=' + basename;
136 136 {% else %}
137 137 var exp_id = $("#id_experiment_list")[0].options[$("#id_experiment_list")[0].selectedIndex].value;
138 138 var url = '{% url 'change_files' %}' + '?experiment_list=' + exp_id + '&file_list=' + basename;
139 139 {% endif %}
140 140 // first delete all forms that are now out of date
141 141 divIndex = $(".single_form").index($( "#file_buttons" ))
142 142 $(".single_form").slice(divIndex).empty()
143 143 // second populate the file_list html if '0' not selected
144 144 if (basename != '0') {
145 145 $(".single_form").slice(divIndex,divIndex+1).load(url);
146 146 }
147 147 }
148 148
149 149 {% include "madweb/fileDownload.js" %}
150 150
151 151 </script>
152 152 {% endblock %}
153 153
154 154
155 155 {% block isGlobal %}
156 156 <div class="col-md-12 single_form" id="isGlobal">
157 157 {{ form.isGlobal.label }} {{ form.isGlobal }}
158 158 </div> <!-- end subdivide -->
159 159 {% endblock %}
160 160
161 161 {% block categories %}
162 162 <!-- subdivide selection column for categories to be possibly filled in by ajax - single_form 0 -->
163 163 <div class="col-md-12 single_form" id="categories">
164 164
165 165 {% if form.categories %}
166 166 {% include "madweb/categories.html" %}
167 167 {% endif %}
168 168
169 169 </div> <!-- end subdivide -->
170 170 {% endblock %}
171 171
172 172
173 173 {% block instruments %}
174 174 <!-- subdivide selection column for instruments to be possibly filled in by ajax - single_form 0 -->
175 175 <div class="col-md-12 single_form" id="instruments">
176 176
177 177 {% if form.instruments %}
178 178 {% include "madweb/instruments.html" %}
179 179 {% endif %}
180 180
181 181 </div> <!-- end subdivide -->
182 182 {% endblock %}
183 183
184 184
185 185 {% block years %}
186 186 <!-- subdivide selection column for year to be possibly filled in by ajax - single_form 1 -->
187 187 <div class="col-md-12 single_form" id="years">
188 188
189 189 {% if form.years %}
190 190 {% include "madweb/years.html" %}
191 191 {% endif %}
192 192
193 193 </div> <!-- end subdivide -->
194 194 {% endblock %}
195 195
196 196
197 197 {% block months %}
198 198 <!-- subdivide selection column for month to be possibly filled in by ajax - single_form 1 -->
199 199 <div class="col-md-12 single_form" id="months">
200 200
201 201 {% if form.months %}
202 202 {% include "madweb/months.html" %}
203 203 {% endif %}
204 204
205 205 </div> <!-- end subdivide -->
206 206 {% endblock %}
207 207
208 208
209 209 {% block calendar %}
210 210 <!-- subdivide selection column for calendar to be possibly filled in by ajax - single_form 2 -->
211 211 <div class="col-md-12 single_form" id="calendar">
212 212
213 213 {% if form.days %}
214 214 {% include "madweb/calendar.html" %}
215 215 {% endif %}
216 216
217 217 </div> <!-- end subdivide -->
218 218 {% endblock %}
219 219
220 220 {% block experiment_select %}
221 221 <!-- this select only appears if there are multiple experiments in the day -->
222 222 <div class="col-md-12 single_form" id="experiment_select">
223 223 {% if form.experiment_list %}
224 224 {% include "madweb/exp_list.html" %}
225 225 {% endif %}
226 226 </div> <!-- end subdivide -->
227 227 {% endblock %}
228 228
229 229 {% block file_select %}
230 230 <!-- file select div -->
231 231 <div class="col-md-12 single_form" id="file_select">
232 232 {% if form.file_list|length > 1 %}
233 233 {% include "madweb/file_list.html" %}
234 234 {% elif form.days and not form.experiment_list %}
235 235 <center><p> This experiment has no Madrigal CEDAR format Hdf5 files. Showing only plots and auxillary files instead.</p></center>
236 236 {% include "madweb/show_plots.html" %}
237 237 {% endif %}
238 238 </div> <!-- end subdivide -->
239 239 {% endblock %}
240 240
241 241 {% block file_buttons %}
242 242 <!-- file select div -->
243 243 <div class="col-md-12 single_form" id="file_buttons">
244 244 {% if form.file_buttons %}
245 245 {% include "madweb/file_buttons.html" %}
246 246 {% endif %}
247 247 </div> <!-- end subdivide -->
248 248 <div>&nbsp;</div>
249 249 {% endblock %}
250 250
251 251 {% block file_data %}
252 252 <!-- file select div -->
253 253 <div class="col-md-12 single_form" id="file_data">
254 254 {% if form.show_plots %}
255 255 {% include "madweb/show_plots.html" %}
256 256 {% endif %}
257 257 </div> <!-- end subdivide -->
258 258 {% endblock %}
259 259
260 {% block file_plot %}
261 <!-- file select div -->
262 <div class="col-md-12 single_form" id="file_plot">
263 {% if form.show_plots %}
264 {% include "madweb/parameter_selection.html" %}
265 {% endif %}
266 </div> <!-- end subdivide -->
267 {% endblock %}
268
@@ -1,239 +1,242
1 1 '''
2 2 Created on Jul 16, 2013
3 3
4 4 @author: Jose Antonio Sal y Rosas Celi
5 5 @contact: arturo.jasyrc@gmail.com
6 6
7 7 As imported and slightly modified by Bill Rideout Jan 20, 2015
8 8
9 9 $Id: urls.py 7246 2020-10-12 14:54:26Z brideout $
10 10 '''
11 11
12 12 from django.conf.urls import url
13 13 from . import views
14 14
15 15 urlpatterns = [ url(r'^$',
16 16 views.index,
17 17 name='index'),
18 18 url(r'^index.html/?$',
19 19 views.index,
20 20 name='index'),
21 21 url(r'^single/?$',
22 22 views.check_registration(views.view_single),
23 23 name='view_single'),
24 24 url(r'^register/?$',
25 25 views.view_registration,
26 26 name='view_registration'),
27 27 url(r'^getCategories/?$',
28 28 views.get_categories,
29 29 name='get_categories'),
30 30 url(r'^getInstruments/?$',
31 31 views.get_instruments,
32 32 name='get_instruments'),
33 33 url(r'^getYears/?$',
34 34 views.get_years,
35 35 name='get_years'),
36 36 url(r'^getMonths/?$',
37 37 views.get_months,
38 38 name='get_months'),
39 39 url(r'^getCalendar/?$',
40 40 views.get_calendar,
41 41 name='get_calendar'),
42 42 url(r'^populateCalendarExperiment/?$',
43 43 views.populate_calendar_experiment,
44 44 name='populate_calendar_experiment'),
45 45 url(r'^getFiles/?$',
46 46 views.get_files,
47 47 name='get_files'),
48 48 url(r'^changeFiles/?$',
49 49 views.change_files,
50 50 name='change_files'),
51 51 url(r'^showPlots/?$',
52 52 views.show_plots,
53 53 name='show_plots'),
54 url(r'^view_plot/?$',
55 views.view_plot,
56 name='plot'),
54 57 url(r'^downloadAsIs/?$',
55 58 views.download_as_is,
56 59 name='download_as_is'),
57 60 url(r'^downloadFileAsIs/?$',
58 61 views.download_file_as_is,
59 62 name='download_file_as_is'),
60 63 url(r'^printAsIs/?$',
61 64 views.print_as_is,
62 65 name='print_as_is'),
63 66 url(r'^listRecords/?$',
64 67 views.list_records,
65 68 name='list_records'),
66 69 url(r'^showInfo/?$',
67 70 views.show_info,
68 71 name='show_info'),
69 72 url(r'^showDoi/?$',
70 73 views.show_doi,
71 74 name='show_doi'),
72 75 url(r'^getAdvanced/?$',
73 76 views.get_advanced,
74 77 name='get_advanced'),
75 78 url(r'^advancedDownload/?$',
76 79 views.advanced_download,
77 80 name='advanced_download'),
78 81 url(r'^advancedPrint/?$',
79 82 views.advanced_print,
80 83 name='advanced_print'),
81 84 url(r'^list/?$',
82 85 views.check_registration(views.view_list),
83 86 name='view_list'),
84 87 url(r'^downloadAsIsScript/?$',
85 88 views.download_as_is_script,
86 89 name='download_as_is_script'),
87 90 url(r'^generateDownloadFilesScript/?$',
88 91 views.generate_download_files_script,
89 92 name='generate_download_files_script'),
90 93 url(r'^downloadAdvancedScript/?$',
91 94 views.download_advanced_script,
92 95 name='download_advanced_script'),
93 96 url(r'^generateDownloadAdvancedScript/?$',
94 97 views.generate_download_advanced_script,
95 98 name='generate_download_advanced_script'),
96 99 url(r'^generateParmsScript/?$',
97 100 views.generate_parms_script,
98 101 name='generate_parms_script'),
99 102 url(r'^generateParmsFiltersScript/?$',
100 103 views.generate_parms_filters_script,
101 104 name='generate_parms_filters_script'),
102 105 url(r'^listExperiments/?$',
103 106 views.list_experiments,
104 107 name='list_experiments'),
105 108 url(r'^viewRecordPlot/?$',
106 109 views.view_record_plot,
107 110 name='view_record_plot'),
108 111 url(r'^viewRecordImage/?$',
109 112 views.view_record_image,
110 113 name='view_record_image'),
111 114 url(r'^showExperiment/?$',
112 115 views.check_registration(views.show_experiment),
113 116 name='show_experiment'),
114 117 url(r'^madExperiment.cgi/*$',
115 118 views.check_registration(views.show_experiment_v2),
116 119 name='show_experiment_v2'),
117 120 url(r'^chooseScript/?$',
118 121 views.check_registration(views.choose_script),
119 122 name='choose_script'),
120 123 url(r'^ftp/$',
121 124 views.check_registration(views.ftp),
122 125 name='ftp'),
123 126 url(r'^ftp/fullname/([^/]+)/email/([^/]+)/affiliation/([^/]+)/kinst/(\d+)/$',
124 127 views.ftp_instrument,
125 128 name='ftp_instrument'),
126 129 url(r'^ftp/fullname/([^/]+)/email/([^/]+)/affiliation/([^/]+)/kinst/(\d+)/year/(\d+)/$',
127 130 views.ftp_year,
128 131 name='ftp_year'),
129 132 url(r'^ftp/fullname/([^/]+)/email/([^/]+)/affiliation/([^/]+)/kinst/(\d+)/year/(\d+)/kindat/(\d+)/$',
130 133 views.ftp_kindat,
131 134 name='ftp_kindat'),
132 135 url(r'^ftp/fullname/([^/]+)/email/([^/]+)/affiliation/([^/]+)/kinst/(\d+)/year/(\d+)/kindat/(\d+)/format/([^/]+)/$',
133 136 views.ftp_files,
134 137 name='ftp_files'),
135 138 url(r'^ftp/fullname/([^/]+)/email/([^/]+)/affiliation/([^/]+)/kinst/(\d+)/year/(\d+)/kindat/(\d+)/format/([^/]+)/fullFilename/([^/]+)/$',
136 139 views.ftp_download,
137 140 name='ftp_download'),
138 141 url(r'ftpMultipleDownload/$',
139 142 views.ftp_multiple_download,
140 143 name='ftp_multiple_download'),
141 144 url(r'^instMetadata/?$',
142 145 views.instrument_metadata,
143 146 name='instrument_metadata'),
144 147 url(r'^siteMetadata/?$',
145 148 views.site_metadata,
146 149 name='site_metadata'),
147 150 url(r'^parameterMetadata/?$',
148 151 views.parameter_metadata,
149 152 name='parameter_metadata'),
150 153 url(r'^kindatMetadata/?$',
151 154 views.kindat_metadata,
152 155 name='kindat_metadata'),
153 156 url(r'^madCalculator/?$',
154 157 views.madrigal_calculator,
155 158 name='madrigal_calculator'),
156 159 url(r'^madCalculatorOutput/?$',
157 160 views.madrigal_calculator_output,
158 161 name='madrigal_calculator_output'),
159 162 url(r'^getMetadata/*$',
160 163 views.get_metadata,
161 164 name='get_metadata'),
162 165 url(r'^looker/?$',
163 166 views.looker_main,
164 167 name='looker_main'),
165 168 url(r'^lookerForm/?$',
166 169 views.looker_form,
167 170 name='looker_form'),
168 171 url(r'^lookerOutput/?$',
169 172 views.looker_output,
170 173 name='looker_output'),
171 174 url(r'^getVersionService.py/*$',
172 175 views.get_version_service,
173 176 name='get_version_service'),
174 177 url(r'^getInstrumentsService.py/*$',
175 178 views.get_instruments_service,
176 179 name='get_instruments_service'),
177 180 url(r'^getExperimentsService.py/*$',
178 181 views.get_experiments_service,
179 182 name='get_experiments_service'),
180 183 url(r'^getExperimentFilesService.py/*$',
181 184 views.get_experiment_files_service,
182 185 name='get_experiment_files_service'),
183 186 url(r'^getParametersService.py/*$',
184 187 views.get_parameters_service,
185 188 name='get_parameters_service'),
186 189 url(r'^isprintService.py/*$',
187 190 views.isprint_service,
188 191 name='isprint_service'),
189 192 url(r'^getMadfile.cgi/*$',
190 193 views.get_madfile_service,
191 194 name='get_madfile_service'),
192 195 url(r'^madCalculatorService.py/*$',
193 196 views.mad_calculator_service,
194 197 name='mad_calculator_service'),
195 198 url(r'^madTimeCalculatorService.py/*$',
196 199 views.mad_time_calculator_service,
197 200 name='mad_time_calculator_service'),
198 201 url(r'^madCalculator2Service.py/*$',
199 202 views.mad_calculator2_service,
200 203 name='mad_calculator2_service'),
201 204 url(r'^madCalculator2Service.py',
202 205 views.mad_calculator2_service,
203 206 name='mad_calculator2_service'),
204 207 url(r'^madCalculator3Service.py/*$',
205 208 views.mad_calculator3_service,
206 209 name='mad_calculator3_service'),
207 210 url(r'^madCalculator3Service.py',
208 211 views.mad_calculator3_service,
209 212 name='mad_calculator3_service'),
210 213 url(r'^geodeticToRadarService.py',
211 214 views.geodetic_to_radar_service,
212 215 name='geodetic_to_radar_service'),
213 216 url(r'^radarToGeodeticService.py',
214 217 views.radar_to_geodetic_service,
215 218 name='radar_to_geodetic_service'),
216 219 url(r'^listFileTimesService.py',
217 220 views.list_file_times_service,
218 221 name='list_file_times_service'),
219 222 url(r'^downloadWebFileService.py',
220 223 views.download_web_file_service,
221 224 name='download_web_file_service'),
222 225 url(r'^traceMagneticFieldService.py',
223 226 views.trace_magnetic_field_service,
224 227 name='trace_magnetic_field_service'),
225 228 url(r'^globalFileSearchService.py',
226 229 views.global_file_search_service,
227 230 name='global_file_search_service'),
228 231 url(r'^getUrlListFromGroupIdService.py',
229 232 views.get_url_list_from_group_id_service,
230 233 name='get_url_list_from_group_id_service'),
231 234 url(r'^setGroupIdFromUrlListService.py',
232 235 views.set_group_id_from_url_list_service,
233 236 name='set_group_id_from_url_list_service'),
234 237 url(r'docs/name/(.+)$',
235 238 views.docs,
236 239 name='docs'),
237 240
238 241 ]
239 242
1 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,118 +1,120
1 1 {% load bootstrap3 %}
2 2
3 3 {% comment %}
4 4 Written by Bill Rideout brideout@haystack.mit.edu
5 5
6 6 Base template for Madrigal single experiment web interface
7 7
8 8 $Id: base_single.html 7320 2021-03-04 21:23:07Z brideout $
9 9 {% endcomment %}
10 10
11 11 {# Load CSS and JavaScript #}
12 12 {% bootstrap_css %}
13 13 {% bootstrap_javascript %}
14 14 {% load static %}
15 15
16 16 <link rel="stylesheet" href="{% static "bootstrap_calendar/css/bootstrap_calendar.css" %}" type="text/css" />
17 17 <script type="text/javascript" src="{% static "bootstrap_calendar/js/bootstrap_calendar.js" %}"></script>
18 18
19 19 <!DOCTYPE html>
20 20 <html>
21 21 <head>
22 22 <meta charset="UTF-8">
23 23 <meta name="viewport" content="width=device-width, initial-scale=1.0">
24 24 <link rel="shortcut icon" type="image/png" href="/static/favicon.ico"/>
25 <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
25 26 <title>{% block title %}Madrigal Database{% endblock %}</title>
26 27 <style type="text/css">
27 28 html body {
28 29 background-color: {{bg_color}};
29 30 }
30 31 .breadcrumb > li + li:before {
31 32 content: none;
32 33 }
33 34 </style>
34 35 {% block extra_head %}{% endblock %}
35 36 {% block ajax_js %}{% endblock %}
36 37 </head>
37 38 <body>
38 39 <div class="loader" style="display:none"></div>
39 40 <div class="container-fluid">
40 41 {% include "navbar.html" %}
41 42
42 43 <center><h4>Select single Madrigal experiment</h4></center>
43 44
44 45 <div class="row">
45 46 <div class="col-sm-12">
46 47 {% bootstrap_messages %}
47 48 </div>
48 49 </div>
49 50
50 51 {% if form.errors %}
51 52 <div class="row">
52 53 <div class="col-sm-12">
53 54 <p style="color: red;">
54 55 Please correct the error{{ form.errors|pluralize }} below.
55 56 {{ form.errors }}
56 57 </p>
57 58 </div>
58 59 </div>
59 60 {% endif %}
60 61
61 62 <div class="row">
62 63
63 64 <div class="col-sm-3">
64 65 {% block isGlobal %}{% endblock %}
65 66 {% block categories %}{% endblock %}
66 67 {% block instruments %}{% endblock %}
67 68 {% block years %}{% endblock %}
68 69 {% block months %}{% endblock %}
69 70 {% block calendar %}{% endblock %}
70 71 </div>
71 72
72 73 <div class="col-sm-9">
73 74 {% block experiment_select %}{% endblock %}
74 75 {% block file_select %}{% endblock %}
75 76 {% block file_buttons %}{% endblock %}
76 77 {% block file_data %}{% endblock %}
78 {% block file_plot %}{% endblock %}
77 79 </div>
78 80
79 81 </div>
80 82 <p></p>
81 83
82 84 {% comment %}
83 85
84 86 <div class="row">
85 87 <div class="col-sm-12">{% block download %}{% endblock %}</div>
86 88 </div>
87 89 <p></p>
88 90
89 91 <div class="row">
90 92 <div class="col-sm-12">{% block information %}{% endblock %}</div>
91 93 </div>{% endcomment %}
92 94
93 95 <p><hr></p>
94 96
95 97 <footer class="row">
96 98 <div class="col-sm-6">
97 99 <p>Madrigal database</p>
98 100 </div>
99 101 <div class="col-sm-6" style="text-align:right">
100 102 <p>
101 103 </p>
102 104 </div>
103 105 </footer>
104 106
105 107 </div> <!-- container-fluid -->
106 108
107 109 <script>
108 110 $('[data-toggle="tooltip"]').tooltip();
109 111 $('[data-toggle="tooltip"]').on('show.bs.tooltip', function() {
110 112 // Only one tooltip should ever be open at a time
111 113 $('.tooltip').not(this).hide();
112 114 });
113 115 $('.my-dropdown').dropdown();
114 116 $('.my-dropdown').tooltip();
115 117 </script>
116 118
117 119 </body>
118 120 </html> No newline at end of file
@@ -1,130 +1,131
1 1 {% comment %}
2 2 Written by Bill Rideout brideout@haystack.mit.edu
3 3
4 4 Generic navbar code shared by all Madrigal pages
5 5
6 6 $Id: navbar.html 6641 2018-11-06 18:02:21Z brideout $
7 7 {% endcomment %}
8 8 <style>
9 9 /* --- Style --- This CSS for a custom color navbar for Madrigal was generated using url http://work.smarchal.com/twbscolor/css/e74c3cc0392becf0f1ffbbbc0 */
10 10 .navbar-default {
11 11 background-color: #21A7EB;
12 12 border-color: #2182EB;
13 13 }
14 14 .navbar-default .navbar-brand {
15 15 color: #ecf0f1;
16 16 }
17 17 .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
18 18 color: #ffbbbc;
19 19 }
20 20 .navbar-default .navbar-text {
21 21 color: #ecf0f1;
22 22 }
23 23 .navbar-default .navbar-nav > li > a {
24 24 color: #ecf0f1;
25 25 }
26 26 .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
27 27 color: #ffbbbc;
28 28 }
29 29 .navbar-default .navbar-nav > li > .dropdown-menu {
30 30 background-color: #21A7EB;
31 31 }
32 32 .navbar-default .navbar-nav > li > .dropdown-menu > li > a {
33 33 color: #ecf0f1;
34 34 }
35 35 .navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
36 36 .navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
37 37 color: #ffbbbc;
38 38 background-color: #2182EB;
39 39 }
40 40 .navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
41 41 background-color: #21A7EB;
42 42 }
43 43 .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
44 44 color: #ffbbbc;
45 45 background-color: #2182EB;
46 46 }
47 47 .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
48 48 color: #ffbbbc;
49 49 background-color: #2182EB;
50 50 }
51 51 .navbar-default .navbar-toggle {
52 52 border-color: #2182EB;
53 53 }
54 54 .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
55 55 background-color: #2182EB;
56 56 }
57 57 .navbar-default .navbar-toggle .icon-bar {
58 58 background-color: #ecf0f1;
59 59 }
60 60 .navbar-default .navbar-collapse,
61 61 .navbar-default .navbar-form {
62 62 border-color: #ecf0f1;
63 63 }
64 64 .navbar-default .navbar-link {
65 65 color: #ecf0f1;
66 66 }
67 67 .navbar-default .navbar-link:hover {
68 68 color: #ffbbbc;
69 69 }
70 70
71 71 @media (max-width: 767px) {
72 72 .navbar-default .navbar-nav .open .dropdown-menu > li > a {
73 73 color: #ecf0f1;
74 74 }
75 75 .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
76 76 color: #ffbbbc;
77 77 }
78 78 .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
79 79 color: #ffbbbc;
80 80 background-color: #2182EB;
81 81 }
82 82 }
83 83 </style>
84 84 <nav class="navbar navbar-default" role="navigation">
85 85 <div class="navbar-header">
86 86 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapse">
87 87 <span class="sr-only">Toggle navigation</span>
88 88 <span class="glyphicon glyphicon-arrow-down"></span>
89 89 MENU
90 90 </button>
91 91 </div>
92 92 <div class="collapse navbar-collapse" id="collapse">
93 93 <ul class="nav navbar-nav">
94 94 <li {{ home_active|safe }}><a href="{% url 'index' %}" data-toggle="tooltip" data-original-title="Click here to return to the home page of the {{ site_name }} Madrigal site." data-placement="bottom">{{ site_name }} Home</a></li>
95 95 <li class="dropdown"><a href="#" data-toggle="dropdown" class="my-dropdown" title="Use this dropdown menu to access all data anywhere on any Madrigal site. See the tooltips for each choice for more information." data-placement="right">Access data<span class="caret"></span></a>
96 96 <ul class="dropdown-menu">
97 97 <li {{ list_active|safe }}><a href="{% url 'view_list' %}" data-toggle="tooltip" data-original-title="List a range of experiments on any Madrigal site that you can then choose from, and then access its data" data-placement="right">List experiments</a></li>
98 98 <li {{ single_active|safe }}><a href="{% url 'view_single' %}" data-toggle="tooltip" data-original-title="Navigate to a single experiment on any Madrigal site, and access that experiment&#39;s data" data-placement="right">Select single experiment</a></li>
99 99 <li {{ script_active|safe }}><a href="{% url 'choose_script' %}" data-toggle="tooltip" data-original-title="Use this link to create a command that will download data from a range of experiments at once" data-placement="right">Create a command to download multiple exps</a></li>
100 100 <li {{ ftp_active|safe }}><a href="{% url 'ftp' %}" data-toggle="tooltip" data-original-title="Simple ftp-like UI" data-placement="right">FTP-like access</a></li>
101 101 </ul>
102 102 </li>
103 103 <li class="dropdown"><a href="#" data-toggle="dropdown" class="my-dropdown" title="Use this dropdown menu to access all Madrigal metadata. See the tooltips for each choice for more information." data-placement="right">Access metadata<span class="caret"></span></a>
104 104 <ul class="dropdown-menu">
105 105 <li {{ site_active|safe }}><a href="{% url 'site_metadata' %}" data-toggle="tooltip" data-original-title="List all metadata related to individual Madrigal sites." data-placement="right">Madrigal site metadata</a></li>
106 106 <li {{ inst_active|safe }}><a href="{% url 'instrument_metadata' %}" data-toggle="tooltip" data-original-title="List all metadata related to individual Madrigal instruments." data-placement="right">Instrument metadata</a></li>
107 107 <li {{ parm_active|safe }}><a href="{% url 'parameter_metadata' %}" data-toggle="tooltip" data-original-title="List all metadata related to individual CEDAR parameters." data-placement="right">CEDAR Parameters</a></li>
108 108 <li {{ kindat_active|safe }}><a href="{% url 'kindat_metadata' %}" data-toggle="tooltip" data-original-title="List all metadata related to individual Madrigal kind of data file codes (also called kindats). Each Madrigal file has a single kind of data code." data-placement="right">Kind of data metadata</a></li>
109 109 <li {{ filter_active|safe }}><a href="{% url 'docs' 'filter_desc.html' %}" data-toggle="tooltip" data-original-title="Describe use of filters in Madrigal." data-placement="right">Filter string metadata</a></li>
110 110 </ul>
111 111 </li>
112 112 <li class="dropdown"><a href="#" data-toggle="dropdown" class="my-dropdown" title="Click here to access modeling tools associated with Madrigal." data-placement="right">Run models<span class="caret"></span></a>
113 113 <ul class="dropdown-menu">
114 114 <li {{ madCalculator_active|safe }}><a href="{% url 'madrigal_calculator' %}" data-toggle="tooltip" data-original-title="Calculate any Madrigal parameter for a given time and range of lat, lon, and alt." data-placement="right">Run Madrigal derivation engine</a></li>
115 115 <li {{ looker_active|safe }}><a href="{% url 'looker_main' %}" data-toggle="tooltip" data-original-title="Simple Geodetic and Geomagnetic (IGRF) coordinate transformations (aka looker)." data-placement="right">Looker</a></li>
116 116 <li><a href="http://models.haystack.mit.edu/models/" data-toggle="tooltip" data-original-title="Run ISR empirical models developed from historical ISR data by Shunrong Zhang." data-placement="right">ISR empirical models</a></li>
117 117 </ul>
118 118 </li>
119 119 <li {{ doc_active|safe }}><a href="docs/name/madContents.html" data-toggle="tooltip" data-original-title="Click here to see Madrigal documentation on the web interface, using scripts to automate data access, Madrigal administration, and information for Madrigal developers." data-placement="bottom">Documentation</a></li>
120 120 <li class="dropdown"><a href="#" data-toggle="dropdown" class="my-dropdown" title="Use this dropdown menu to navigate to another Madrigal site." data-placement="left">Other Madrigal sites<span class="caret"></span></a>
121 121 <ul class="dropdown-menu">
122 122 {% for siteName, siteUrl in site_list %}
123 123 <li><a href="{{ siteUrl }}" data-toggle="tooltip" data-original-title="Navigate to Madrigal site at {{ siteName }}" data-placement="left">{{ siteName }}</a></li>
124 124 {% endfor %}
125 125 </ul>
126 126 </li>
127 127 <li><a href="http://cedar.openmadrigal.org/openmadrigal" data-toggle="tooltip" data-original-title="Click here to go to OpenMadrigal, where you can download API&#39;s in python, Matlab, and IDL to run Madrigal scripts, and access Madrigal&#39;s source code." data-placement="bottom">OpenMadrigal</a></li>
128 <li><a href="{% url 'updata:updata_index' %}" data-toggle="tooltip" data-original-title="Click here to upload data to Madrigal database." data-placement="bottom">Upload Madrigal Data</a></li>
128 129 </ul>
129 130 </div>
130 131 </nav> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now