Commit 83b3f23e authored by cermak's avatar cermak
Browse files

Add data browser

parent a8c19629
......@@ -6,9 +6,23 @@ from django.utils.html import strip_tags
from django.urls import reverse
from django.http import HttpResponseRedirect
from .models import *
from data_browser.helpers import AdminMixin as DataBrowserMixin
import requests
import datetime
from django.contrib.auth.admin import UserAdmin
custom_fieldsets = list(UserAdmin.fieldsets)
#custom_fieldsets.append((None, {'fields': ('contact', )}))
class CustomUserAdmin(DataBrowserMixin, UserAdmin):
fieldsets = custom_fieldsets
ddb_extra_fields = ['contact']
admin.site.unregister(User)
admin.site.register(User, CustomUserAdmin)
class StatusAdminForm(forms.ModelForm):
class Meta:
model = Status
......@@ -270,7 +284,7 @@ class ExperimentsAdminForm(forms.ModelForm):
model = Experiments
fields = '__all__'
class ExperimentsAdmin(admin.ModelAdmin):
class ExperimentsAdmin(DataBrowserMixin, admin.ModelAdmin):
form = ExperimentsAdminForm
list_display = ['instrument', 'proposal', 'created', 'start', 'end', 'duration', 'responsible', 'local_contact', 'all_options']
readonly_fields = ['created', 'last_updated', 'duration']
......
{% extends "admin/change_list_object_tools.html" %}
{% block object-tools-items %}
{{ block.super }}
{% if ddb_url %}
<li><a href="{{ ddb_url }}" class="viewlink">Data Browser and Reports</a></li>
{% endif %}
{% endblock %}
\ No newline at end of file
......@@ -138,6 +138,7 @@
<Content Include="app\static\pdfstyle.css" />
<Content Include="app\templates\404.html" />
<Content Include="app\templates\500.html" />
<Content Include="app\templates\admin\change_list_object_tools.html" />
<Content Include="app\templates\admin\publication_list.html" />
<Content Include="app\templates\ajax\fulldays.html" />
<Content Include="app\templates\ajax\events.html" />
......
......@@ -44,6 +44,7 @@ INSTALLED_APPS = [
'multichoice',
'true_false',
'essay',
'data_browser',
]
SITE_ID = 1
......
......@@ -183,5 +183,10 @@ urlpatterns += [
#quiz
urlpatterns += (
url('q/', include('quiz.urls')),
)
\ No newline at end of file
path('q/', include('quiz.urls')),
)
#data browser
urlpatterns += (
path("data-browser/", include("data_browser.urls")),
)
......@@ -13,6 +13,7 @@ pip
django-xhtml2pdf
git+https://github.com/me2d09/pinax-notifications.git
git+https://github.com/me2d09/django_quiz.git
git+https://github.com/me2d09/django-data-browser.git
backports-datetime-fromisoformat
django-oauth-toolkit
requests
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment