From 5a2696cdb150070ef21f40e7d28096eeed7edca5 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 5 Jun 2019 17:23:31 +0100 Subject: Make the modal modular --- app/templates/_partials/modals.html | 23 +++++++++++++++++++++-- app/templates/admin/manage_datasets.html | 21 ++++----------------- app/templates/admin/manage_users.html | 21 ++++----------------- app/templates/annotate/index.html | 4 ++-- 4 files changed, 31 insertions(+), 38 deletions(-) (limited to 'app/templates') diff --git a/app/templates/_partials/modals.html b/app/templates/_partials/modals.html index 1ffd85f..834d4fe 100644 --- a/app/templates/_partials/modals.html +++ b/app/templates/_partials/modals.html @@ -1,4 +1,4 @@ -{% macro modal(id, title, message) %} +{% macro info(id, title, message) %} {% endmacro %} + +{% macro confirm(id, title, message) %} + +{% endmacro %} diff --git a/app/templates/admin/manage_datasets.html b/app/templates/admin/manage_datasets.html index c7df06e..7de6592 100644 --- a/app/templates/admin/manage_datasets.html +++ b/app/templates/admin/manage_datasets.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% import "_partials/modals.html" as modals %} + {% block styles %} {{ super() }} @@ -21,23 +23,8 @@ - - +{{ modals.confirm("delete", "Delete Dataset", "You are about to delete the +dataset and all associated tasks and annotations. Are you sure?") }}

Task Completion Overview

diff --git a/app/templates/admin/manage_users.html b/app/templates/admin/manage_users.html index 0e365d4..6e3b51a 100644 --- a/app/templates/admin/manage_users.html +++ b/app/templates/admin/manage_users.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% import "_partials/modals.html" as modals %} + {% block styles %} {{ super() }} @@ -21,23 +23,8 @@ - - + {{ modals.confirm("delete", "Delete User", "You are about to delete the user + and all associated tasks and annotations. Are you sure?") }}

User Overview

diff --git a/app/templates/annotate/index.html b/app/templates/annotate/index.html index f4172b6..efb617b 100644 --- a/app/templates/annotate/index.html +++ b/app/templates/annotate/index.html @@ -31,11 +31,11 @@
-{{ modals.modal("submitNoCP", "No Change Points Selected", "Please use the +{{ modals.info("submitNoCP", "No Change Points Selected", "Please use the \"No Change Points\" button when you think there are no change points in the time series.") }} -{{ modals.modal("NoCPYesCP", "Change Points Selected", "There are selected +{{ modals.info("NoCPYesCP", "Change Points Selected", "There are selected change points, please click the Reset button before clicking the \"No change points\" button.") }} -- cgit v1.2.3