diff --git a/advlabdb/customClasses.py b/advlabdb/customClasses.py
index 6f3bb01..72f4812 100644
--- a/advlabdb/customClasses.py
+++ b/advlabdb/customClasses.py
@@ -9,25 +9,19 @@ from advlabdb.utils import userActiveSemester
def adminViewIsAccessible():
return current_user.has_role("admin")
-def handleAdminView():
- flash("User active semester: " + userActiveSemester(flashWarning=True).label)
class SecureAdminIndexView(AdminIndexView):
def is_accessible(self):
return adminViewIsAccessible()
- def _handle_view(self, *args, **kwargs):
- handleAdminView()
- return super()._handle_view(*args, **kwargs)
-
class SecureModelView(ModelView):
can_export = True
can_set_page_size = True
+ list_template = "admin_list.html"
+ create_template = "admin_create.html"
+ edit_template = "admin_edit.html"
+
def is_accessible(self):
return adminViewIsAccessible()
-
- def _handle_view(self, *args, **kwargs):
- handleAdminView()
- return super()._handle_view(*args, **kwargs)
diff --git a/advlabdb/templates/admin/actions.html b/advlabdb/templates/admin/actions.html
new file mode 100644
index 0000000..02257bb
--- /dev/null
+++ b/advlabdb/templates/admin/actions.html
@@ -0,0 +1,34 @@
+{% import 'admin/static.html' as admin_static with context %}
+
+{% macro dropdown(actions, btn_class='btn dropdown-toggle') -%}
+ {{ _gettext('With selected') }}
+
+{% endmacro %}
+
+{% macro form(actions, url) %}
+ {% if actions %}
+
+ {% block fa_form %}
+ {{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }}
+ {% endblock %}
+
+{% endblock %}
+
+{% block tail %}
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/index.html b/advlabdb/templates/admin/index.html
new file mode 100644
index 0000000..fbfdf4c
--- /dev/null
+++ b/advlabdb/templates/admin/index.html
@@ -0,0 +1,4 @@
+{% extends 'admin/master.html' %}
+
+{% block body %}
+{% endblock %}
diff --git a/advlabdb/templates/admin/layout.html b/advlabdb/templates/admin/layout.html
new file mode 100644
index 0000000..a2f63ea
--- /dev/null
+++ b/advlabdb/templates/admin/layout.html
@@ -0,0 +1,102 @@
+{% macro menu_icon(item) -%}
+{% set icon_type = item.get_icon_type() %}
+{%- if icon_type %}
+ {% set icon_value = item.get_icon_value() %}
+ {% if icon_type == 'glyph' %}
+
+ {% else %}
+
+ {% endif %}
+ ×
+ {{ m }}
+
+ {% endfor %}
+ {% endif %}
+ {% endwith %}
+{% endmacro %}
diff --git a/advlabdb/templates/admin/lib.html b/advlabdb/templates/admin/lib.html
new file mode 100644
index 0000000..6bfdb05
--- /dev/null
+++ b/advlabdb/templates/admin/lib.html
@@ -0,0 +1,256 @@
+{% import 'admin/static.html' as admin_static with context %}
+
+{# ---------------------- Pager -------------------------- #}
+{% macro pager(page, pages, generator) -%}
+{% if pages > 1 %}
+
+{% endif %}
+{%- endmacro %}
+
+{% macro simple_pager(page, have_next, generator) -%}
+
+{%- endmacro %}
+
+{# ---------------------- Modal Window ------------------- #}
+{% macro add_modal_window(modal_window_id='fa_modal_window', modal_label_id='fa_modal_label') %}
+
+
+ {# bootstrap version > 3.1.0 required for this to work #}
+
+
+
+
+{% endmacro %}
+
+{% macro add_modal_button(url='', title='', content='', modal_window_id='fa_modal_window', btn_class='icon') %}
+
+ {{ content|safe }}
+
+{% endmacro %}
+
+{# ---------------------- Forms -------------------------- #}
+{% macro render_field(form, field, kwargs={}, caller=None) %}
+ {% set direct_error = h.is_field_error(field.errors) %}
+
+{% endmacro %}
+
+{% macro render_header(form, text) %}
+
{{ text }}
+{% endmacro %}
+
+{% macro render_form_fields(form, form_opts=None) %}
+ {% if form.hidden_tag is defined %}
+ {{ form.hidden_tag() }}
+ {% else %}
+ {% if csrf_token %}
+
+ {% endif %}
+ {% for f in form if f.widget.input_type == 'hidden' %}
+ {{ f }}
+ {% endfor %}
+ {% endif %}
+
+ {% if form_opts and form_opts.form_rules %}
+ {% for r in form_opts.form_rules %}
+ {{ r(form, form_opts=form_opts) }}
+ {% endfor %}
+ {% else %}
+ {% for f in form if f.widget.input_type != 'hidden' %}
+ {% if form_opts %}
+ {% set kwargs = form_opts.widget_args.get(f.short_name, {}) %}
+ {% else %}
+ {% set kwargs = {} %}
+ {% endif %}
+ {{ render_field(form, f, kwargs) }}
+ {% endfor %}
+ {% endif %}
+{% endmacro %}
+
+{% macro form_tag(form=None, action=None) %}
+
+{% endmacro %}
+
+{% macro render_form_buttons(cancel_url, extra=None, is_modal=False) %}
+
+
+{% endmacro %}
+
+{% macro render_form(form, cancel_url, extra=None, form_opts=None, action=None, is_modal=False) -%}
+ {% call form_tag(action=action) %}
+ {{ render_form_fields(form, form_opts=form_opts) }}
+ {{ render_form_buttons(cancel_url, extra, is_modal) }}
+ {% endcall %}
+{% endmacro %}
+
+{% macro form_css() %}
+
+
+
+ {% if config.MAPBOX_MAP_ID %}
+
+
+ {% endif %}
+ {% if editable_columns %}
+
+ {% endif %}
+{% endmacro %}
+
+{% macro form_js() %}
+ {% if config.MAPBOX_MAP_ID %}
+
+
+
+ {% if config.MAPBOX_SEARCH %}
+
+
+ {% endif %}
+ {% endif %}
+
+ {% if editable_columns %}
+
+ {% endif %}
+
+{% endmacro %}
+
+{% macro extra() %}
+ {% if admin_view.can_create %}
+
+ {% endif %}
+ {% if admin_view.can_edit %}
+
+ {% endif %}
+{% endmacro %}
diff --git a/advlabdb/templates/admin/master.html b/advlabdb/templates/admin/master.html
new file mode 100644
index 0000000..8f27dad
--- /dev/null
+++ b/advlabdb/templates/admin/master.html
@@ -0,0 +1 @@
+{% extends admin_base_template %}
diff --git a/advlabdb/templates/admin/model/create.html b/advlabdb/templates/admin/model/create.html
new file mode 100644
index 0000000..9e0834e
--- /dev/null
+++ b/advlabdb/templates/admin/model/create.html
@@ -0,0 +1,30 @@
+{% extends 'admin/master.html' %}
+{% import 'admin/lib.html' as lib with context %}
+{% from 'admin/lib.html' import extra with context %} {# backward compatible #}
+
+{% block head %}
+ {{ super() }}
+ {{ lib.form_css() }}
+{% endblock %}
+
+{% block body %}
+ {% block navlinks %}
+
+ {% endblock %}
+
+ {% block create_form %}
+ {{ lib.render_form(form, return_url, extra(), form_opts) }}
+ {% endblock %}
+{% endblock %}
+
+{% block tail %}
+ {{ super() }}
+ {{ lib.form_js() }}
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/details.html b/advlabdb/templates/admin/model/details.html
new file mode 100644
index 0000000..0008c5a
--- /dev/null
+++ b/advlabdb/templates/admin/model/details.html
@@ -0,0 +1,52 @@
+{% extends 'admin/master.html' %}
+{% import 'admin/lib.html' as lib with context %}
+
+{% block body %}
+ {% block navlinks %}
+
+ {% endblock %}
+
+ {% block details_search %}
+
+ {{ _gettext('Filter') }}
+
+
+ {% endblock %}
+
+ {% block details_table %}
+
+ {% for c, name in details_columns %}
+
+
+ {{ name }}
+
+
+ {{ get_value(model, c) }}
+
+
+ {% endfor %}
+
+ {% endblock %}
+{% endblock %}
+
+{% block tail %}
+ {{ super() }}
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/edit.html b/advlabdb/templates/admin/model/edit.html
new file mode 100644
index 0000000..5bd4099
--- /dev/null
+++ b/advlabdb/templates/admin/model/edit.html
@@ -0,0 +1,40 @@
+{% extends 'admin/master.html' %}
+{% import 'admin/lib.html' as lib with context %}
+{% from 'admin/lib.html' import extra with context %} {# backward compatible #}
+
+{% block head %}
+ {{ super() }}
+ {{ lib.form_css() }}
+{% endblock %}
+
+{% block body %}
+ {% block navlinks %}
+
+ {% endblock %}
+
+ {% block edit_form %}
+ {{ lib.render_form(form, return_url, extra(), form_opts) }}
+ {% endblock %}
+{% endblock %}
+
+{% block tail %}
+ {{ super() }}
+ {{ lib.form_js() }}
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/inline_field_list.html b/advlabdb/templates/admin/model/inline_field_list.html
new file mode 100644
index 0000000..b19dc2e
--- /dev/null
+++ b/advlabdb/templates/admin/model/inline_field_list.html
@@ -0,0 +1,15 @@
+{% import 'admin/model/inline_list_base.html' as base with context %}
+
+{% macro render_field(field) %}
+ {{ field }}
+
+ {% if h.is_field_error(field.errors) %}
+
+ {% endif %}
+{% endmacro %}
+
+{{ base.render_inline_fields(field, template, render_field, check) }}
diff --git a/advlabdb/templates/admin/model/inline_form.html b/advlabdb/templates/admin/model/inline_form.html
new file mode 100644
index 0000000..6ae3f6c
--- /dev/null
+++ b/advlabdb/templates/admin/model/inline_form.html
@@ -0,0 +1,4 @@
+{% import 'admin/lib.html' as lib with context %}
+
+ {{ lib.render_form_fields(field.form, form_opts=form_opts) }}
+
diff --git a/advlabdb/templates/admin/model/inline_list_base.html b/advlabdb/templates/admin/model/inline_list_base.html
new file mode 100644
index 0000000..79a93db
--- /dev/null
+++ b/advlabdb/templates/admin/model/inline_list_base.html
@@ -0,0 +1,45 @@
+{% macro render_inline_fields(field, template, render, check=None) %}
+
+ {# existing inline form fields #}
+
+ {% for subfield in field %}
+
+ {%- if not check or check(subfield) %}
+
+
+ {{ field.label.text }} #{{ loop.index }}
+
+ {% if subfield.get_pk and subfield.get_pk() %}
+
+
{{ _gettext('Delete?') }}
+ {% else %}
+
+ {% endif %}
+
+
+
+
+ {%- endif -%}
+ {{ render(subfield) }}
+
+ {% endfor %}
+
+
+ {# template for new inline form fields #}
+
+ {% filter forceescape %}
+
+
+ {{ _gettext('New') }} {{ field.label.text }}
+
+
+
+ {{ render(template) }}
+
+ {% endfilter %}
+
+
{{ _gettext('Add') }} {{ field.label.text }}
+
+{% endmacro %}
diff --git a/advlabdb/templates/admin/model/layout.html b/advlabdb/templates/admin/model/layout.html
new file mode 100644
index 0000000..792eb5b
--- /dev/null
+++ b/advlabdb/templates/admin/model/layout.html
@@ -0,0 +1,107 @@
+{% macro filter_options(btn_class='dropdown-toggle') %}
+
+ {{ _gettext('Add Filter') }}
+
+
+{% endmacro %}
+
+{% macro export_options(btn_class='dropdown-toggle') %}
+ {% if admin_view.export_types|length > 1 %}
+
+
+ {{ _gettext('Export') }}
+
+
+
+ {% else %}
+
+ {{ _gettext('Export') }}
+
+ {% endif %}
+{% endmacro %}
+
+{% macro filter_form() %}
+
+
+{% endmacro %}
+
+{% macro search_form(input_class=None) %}
+
+{% endmacro %}
+
+{% macro page_size_form(generator, btn_class='dropdown-toggle') %}
+
+ {{ page_size }} {{ _gettext('items') }}
+
+
+{% endmacro %}
diff --git a/advlabdb/templates/admin/model/list.html b/advlabdb/templates/admin/model/list.html
new file mode 100755
index 0000000..08c1d57
--- /dev/null
+++ b/advlabdb/templates/admin/model/list.html
@@ -0,0 +1,197 @@
+{% extends 'admin/master.html' %}
+{% import 'admin/lib.html' as lib with context %}
+{% import 'admin/static.html' as admin_static with context%}
+{% import 'admin/model/layout.html' as model_layout with context %}
+{% import 'admin/actions.html' as actionlib with context %}
+{% import 'admin/model/row_actions.html' as row_actions with context %}
+
+{% block head %}
+ {{ super() }}
+ {{ lib.form_css() }}
+{% endblock %}
+
+{% block body %}
+ {% block model_menu_bar %}
+
+
+ {{ _gettext('List') }}{% if count %} ({{ count }}){% endif %}
+
+
+ {% if admin_view.can_create %}
+
+ {%- if admin_view.create_modal -%}
+ {{ lib.add_modal_button(url=get_url('.create_view', url=return_url, modal=True), title=_gettext('Create New Record'), content=_gettext('Create')) }}
+ {% else %}
+ {{ _gettext('Create') }}
+ {%- endif -%}
+
+ {% endif %}
+
+ {% if admin_view.can_export %}
+ {{ model_layout.export_options() }}
+ {% endif %}
+
+ {% block model_menu_bar_before_filters %}{% endblock %}
+
+ {% if filters %}
+
+ {{ model_layout.filter_options() }}
+
+ {% endif %}
+
+ {% if can_set_page_size %}
+
+ {{ model_layout.page_size_form(page_size_url) }}
+
+ {% endif %}
+
+ {% if actions %}
+
+ {{ actionlib.dropdown(actions) }}
+
+ {% endif %}
+
+ {% if search_supported %}
+
+ {{ model_layout.search_form() }}
+
+ {% endif %}
+ {% block model_menu_bar_after_filters %}{% endblock %}
+
+ {% endblock %}
+
+ {% if filters %}
+ {{ model_layout.filter_form() }}
+
+ {% endif %}
+
+ {% block model_list_table %}
+
+
+
+
+ {% block list_header scoped %}
+ {% if actions %}
+
+
+
+ {% endif %}
+ {% block list_row_actions_header %}
+ {% if admin_view.column_display_actions %}
+
+ {% endif %}
+ {% endblock %}
+ {% for c, name in list_columns %}
+ {% set column = loop.index0 %}
+
+ {% if admin_view.is_sortable(c) %}
+ {% if sort_column == column %}
+
+ {{ name }}
+ {% if sort_desc %}
+
+ {% else %}
+
+ {% endif %}
+
+ {% else %}
+ {{ name }}
+ {% endif %}
+ {% else %}
+ {{ name }}
+ {% endif %}
+ {% if admin_view.column_descriptions.get(c) %}
+
+ {% endif %}
+
+ {% endfor %}
+ {% endblock %}
+
+
+ {% for row in data %}
+
+ {% block list_row scoped %}
+ {% if actions %}
+
+
+
+ {% endif %}
+ {% block list_row_actions_column scoped %}
+ {% if admin_view.column_display_actions %}
+
+ {% block list_row_actions scoped %}
+ {% for action in list_row_actions %}
+ {{ action.render_ctx(get_pk_value(row), row) }}
+ {% endfor %}
+ {% endblock %}
+
+ {%- endif -%}
+ {% endblock %}
+
+ {% for c, name in list_columns %}
+
+ {% if admin_view.is_editable(c) %}
+ {% set form = list_forms[get_pk_value(row)] %}
+ {% if form.csrf_token %}
+ {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=form.csrf_token._value()) }}
+ {% elif csrf_token %}
+ {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=csrf_token()) }}
+ {% else %}
+ {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c)) }}
+ {% endif %}
+ {% else %}
+ {{ get_value(row, c) }}
+ {% endif %}
+
+ {% endfor %}
+ {% endblock %}
+
+ {% else %}
+
+
+ {% block empty_list_message %}
+
+ {{ admin_view.get_empty_list_message() }}
+
+ {% endblock %}
+
+
+ {% endfor %}
+
+
+ {% block list_pager %}
+ {% if num_pages is not none %}
+ {{ lib.pager(page, num_pages, pager_url) }}
+ {% else %}
+ {{ lib.simple_pager(page, data|length == page_size, pager_url) }}
+ {% endif %}
+ {% endblock %}
+ {% endblock %}
+
+ {% block actions %}
+ {{ actionlib.form(actions, get_url('.action_view')) }}
+ {% endblock %}
+
+ {%- if admin_view.edit_modal or admin_view.create_modal or admin_view.details_modal -%}
+ {{ lib.add_modal_window() }}
+ {%- endif -%}
+{% endblock %}
+
+{% block tail %}
+ {{ super() }}
+
+ {% if filter_groups %}
+
{{ filter_groups|tojson|safe }}
+
{{ active_filters|tojson|safe }}
+ {% endif %}
+
+ {{ lib.form_js() }}
+
+
+ {{ actionlib.script(_gettext('Please select at least one record.'),
+ actions,
+ actions_confirmation) }}
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/modals/create.html b/advlabdb/templates/admin/model/modals/create.html
new file mode 100644
index 0000000..abc1cf5
--- /dev/null
+++ b/advlabdb/templates/admin/model/modals/create.html
@@ -0,0 +1,24 @@
+{% import 'admin/static.html' as admin_static with context%}
+{% import 'admin/lib.html' as lib with context %}
+
+{# store the jinja2 context for form_rules rendering logic #}
+{% set render_ctx = h.resolve_ctx() %}
+
+{% block body %}
+
+
+ {# "save and add" button is removed from modal (it won't function properly) #}
+ {% block create_form %}
+ {{ lib.render_form(form, return_url, extra=None, form_opts=form_opts,
+ action=url_for('.create_view', url=return_url),
+ is_modal=True) }}
+ {% endblock %}
+
+{% endblock %}
+
+{% block tail %}
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/modals/details.html b/advlabdb/templates/admin/model/modals/details.html
new file mode 100755
index 0000000..9abb55d
--- /dev/null
+++ b/advlabdb/templates/admin/model/modals/details.html
@@ -0,0 +1,40 @@
+{% import 'admin/static.html' as admin_static with context%}
+{% import 'admin/lib.html' as lib with context %}
+
+{% block body %}
+
+
+
+ {% block details_search %}
+
+ {{ _gettext('Filter') }}
+
+
+ {% endblock %}
+
+ {% block details_table %}
+
+ {% for c, name in details_columns %}
+
+
+ {{ name }}
+
+
+ {{ get_value(model, c) }}
+
+
+ {% endfor %}
+
+ {% endblock %}
+
+{% endblock %}
+
+{% block tail %}
+
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/modals/edit.html b/advlabdb/templates/admin/model/modals/edit.html
new file mode 100644
index 0000000..8897810
--- /dev/null
+++ b/advlabdb/templates/admin/model/modals/edit.html
@@ -0,0 +1,26 @@
+{% import 'admin/static.html' as admin_static with context%}
+{% import 'admin/lib.html' as lib with context %}
+
+{# store the jinja2 context for form_rules rendering logic #}
+{% set render_ctx = h.resolve_ctx() %}
+
+{% block body %}
+
+
+ {# "save and continue" button is removed from modal (it won't function properly) #}
+ {% block edit_form %}
+ {{ lib.render_form(form, return_url, extra=None, form_opts=form_opts,
+ action=url_for('.edit_view', id=request.args.get('id'), url=return_url),
+ is_modal=True) }}
+ {% endblock %}
+
+{% endblock %}
+
+{% block tail %}
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/model/row_actions.html b/advlabdb/templates/admin/model/row_actions.html
new file mode 100644
index 0000000..74d65ca
--- /dev/null
+++ b/advlabdb/templates/admin/model/row_actions.html
@@ -0,0 +1,38 @@
+{% import 'admin/lib.html' as lib with context %}
+
+{% macro link(action, url, icon_class=None) %}
+
+
+
+{% endmacro %}
+
+{% macro view_row(action, row_id, row) %}
+ {{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon glyphicon-eye-open') }}
+{% endmacro %}
+
+{% macro view_row_popup(action, row_id, row) %}
+ {{ lib.add_modal_button(url=get_url('.details_view', id=row_id, url=return_url, modal=True), title=action.title, content='
') }}
+{% endmacro %}
+
+{% macro edit_row(action, row_id, row) %}
+ {{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon glyphicon-pencil') }}
+{% endmacro %}
+
+{% macro edit_row_popup(action, row_id, row) %}
+ {{ lib.add_modal_button(url=get_url('.edit_view', id=row_id, url=return_url, modal=True), title=action.title, content='
') }}
+{% endmacro %}
+
+{% macro delete_row(action, row_id, row) %}
+
+{% endmacro %}
diff --git a/advlabdb/templates/admin/rediscli/console.html b/advlabdb/templates/admin/rediscli/console.html
new file mode 100644
index 0000000..368f55d
--- /dev/null
+++ b/advlabdb/templates/admin/rediscli/console.html
@@ -0,0 +1,27 @@
+{% extends 'admin/master.html' %}
+{% import 'admin/lib.html' as lib with context %}
+{% import 'admin/static.html' as admin_static with context%}
+
+{% block head %}
+ {{ super() }}
+
+{% endblock %}
+
+{% block body %}
+
+{% endblock %}
+
+{% block tail %}
+ {{ super() }}
+
+
{{ admin_view.get_url('.execute_view')|tojson|safe }}
+
+{% endblock %}
diff --git a/advlabdb/templates/admin/rediscli/response.html b/advlabdb/templates/admin/rediscli/response.html
new file mode 100644
index 0000000..f4a950a
--- /dev/null
+++ b/advlabdb/templates/admin/rediscli/response.html
@@ -0,0 +1,32 @@
+{% macro render(item, depth=0) %}
+ {% set type = type_name(item) %}
+
+ {% if type == 'tuple' or type == 'list' %}
+ {% if not item %}
+ Empty {{ type }}.
+ {% else %}
+ {% for n in item %}
+ {{ loop.index }}) {{ render(n, depth + 1) }}
+ {% endfor %}
+ {% endif %}
+ {% elif type == 'bool' %}
+ {% if depth == 0 and item %}
+ OK
+ {% else %}
+
{{ item }}
+ {% endif %}
+ {% elif type == 'str' or type == 'unicode' %}
+ "{{ item }}"
+ {% elif type == 'bytes' %}
+ "{{ item.decode('utf-8') }}"
+ {% elif type == 'TextWrapper' %}
+
{{ item }}
+ {% elif type == 'dict' %}
+ {% for k, v in item.items() %}
+ {{ loop.index }}) {{ k }} - {{ render(v, depth + 1) }}
+ {% endfor %}
+ {% else %}
+ {{ item }}
+ {% endif %}
+{% endmacro %}
+{{ render(result) }}
\ No newline at end of file
diff --git a/advlabdb/templates/admin/static.html b/advlabdb/templates/admin/static.html
new file mode 100644
index 0000000..de632ee
--- /dev/null
+++ b/advlabdb/templates/admin/static.html
@@ -0,0 +1,3 @@
+{% macro url() -%}
+ {{ get_url('{admin_endpoint}.static'.format(admin_endpoint=admin_view.admin.endpoint), *varargs, **kwargs) }}
+{%- endmacro %}
diff --git a/advlabdb/templates/admin_create.html b/advlabdb/templates/admin_create.html
new file mode 100644
index 0000000..3d03b5d
--- /dev/null
+++ b/advlabdb/templates/admin_create.html
@@ -0,0 +1,6 @@
+{% extends "admin/model/create.html" %}
+
+{% block body %}
+ User's active semester: {{userActiveSemester().label}}
+ {{super()}}
+{% endblock %}
diff --git a/advlabdb/templates/admin_edit.html b/advlabdb/templates/admin_edit.html
new file mode 100644
index 0000000..86bc81f
--- /dev/null
+++ b/advlabdb/templates/admin_edit.html
@@ -0,0 +1,6 @@
+{% extends "admin/model/edit.html" %}
+
+{% block body %}
+ User's active semester: {{userActiveSemester().label}}
+ {{super()}}
+{% endblock %}
diff --git a/advlabdb/templates/admin_list.html b/advlabdb/templates/admin_list.html
new file mode 100644
index 0000000..609b1d8
--- /dev/null
+++ b/advlabdb/templates/admin_list.html
@@ -0,0 +1,6 @@
+{% extends "admin/model/list.html" %}
+
+{% block body %}
+ User's active semester: {{userActiveSemester(flashWarning=True).label}}
+ {{super()}}
+{% endblock %}