{% include "shared/partial/modal_toc.html" %}
-{% for tour in tours %}
-{% include "shared/partial/popover_tour.html" with tour_name=tour.name tour_robust=tour.robust %}
-{% endfor %}
-{% if tip_name %}
-{% include "shared/partial/tooltip_tip.html" %}
-{% endif %}
{% include "shared/partial/popover_simplify.html" %}
{% endblock %}
diff --git a/src/pages/templates/pages/wordbank.html b/src/pages/templates/pages/wordbank.html
index 99e0ac253..6349e3cf2 100644
--- a/src/pages/templates/pages/wordbank.html
+++ b/src/pages/templates/pages/wordbank.html
@@ -79,10 +79,4 @@
Rate some words!
-{% for tour in tours %}
-{% include "shared/partial/popover_tour.html" with tour_name=tour.name tour_robust=tour.robust %}
-{% endfor %}
-{% if tip_name %}
-{% include "shared/partial/tooltip_tip.html" %}
-{% endif %}
{% endblock %}
diff --git a/src/pages/templatetags/list_helpers.py b/src/pages/templatetags/list_helpers.py
new file mode 100644
index 000000000..bc032f7da
--- /dev/null
+++ b/src/pages/templatetags/list_helpers.py
@@ -0,0 +1,29 @@
+from django import template
+from django.template.defaultfilters import stringfilter
+
+register = template.Library()
+
+@register.filter(is_safe=True)
+def list_index(sequence, position):
+ try:
+ return sequence[position]
+ except:
+ return None
+
+@register.filter(is_safe=True)
+def list_index_prev(sequence, position):
+ if 0 >= position:
+ return None
+ try:
+ return sequence[int(position) - 1]
+ except:
+ return None
+
+@register.filter(is_safe=True)
+def list_index_next(sequence, position):
+ if len(sequence) - 1 == position:
+ return None
+ try:
+ return sequence[int(position) + 1]
+ except:
+ return None
\ No newline at end of file
diff --git a/src/pages/views.py b/src/pages/views.py
index 3ebf69420..3fe300d4f 100644
--- a/src/pages/views.py
+++ b/src/pages/views.py
@@ -28,7 +28,7 @@
from library.models import Book, BookVersion, Paradata, Annotation, BookTrend, \
Customization, BookAssignment
from roster.models import ClusiveUser, Period, Roles, UserStats, Preference
-from tips.models import TipHistory, CTAHistory, CompletionType
+from tips.models import TipHistory, CTAHistory, CompletionType, TourList
from translation.util import TranslateApiManager
logger = logging.getLogger(__name__)
@@ -128,6 +128,7 @@ def get(self, request, *args, **kwargs):
self.dashboard_popular_view = self.clusive_user.dashboard_popular_view
self.tip_shown = TipHistory.get_tip_to_show(self.clusive_user, page='Dashboard')
+ self.tours = TourList(self.clusive_user, page='Dashboard')
# Decision-making data
user_stats = UserStats.objects.get(user=request.clusive_user)
@@ -224,12 +225,10 @@ def get_context_data(self, **kwargs):
context['panels'] = self.panels
context['data'] = self.data
context['clusive_user'] = self.clusive_user
- # BEGIN: Sample Tour
- # Sample tour with single item list
- context['tip_name'] = None
- context['tours'] = [{'name': self.tip_shown.name, 'robust': True }] if self.tip_shown else None
- # END: Sample Tour
- context['tip_shown'] = self.tip_shown
+ # 'tour' is a special case and uses the older tooltip functionality
+ context['tip_name'] = 'tour' if self.tip_shown and self.tip_shown.name == 'tour' else None # tour tooltip
+ context['tip_shown'] = self.tip_shown.name if self.tip_shown and self.tip_shown.name != 'tour' else None # Singleton tour item
+ context['tours'] = self.tours
context['has_teacher_resource'] = self.clusive_user.role == Roles.TEACHER or self.clusive_user.role == Roles.PARENT
return context
@@ -691,6 +690,7 @@ def get(self, request, *args, **kwargs):
# See if there's a Tip that should be shown
self.tip_shown = TipHistory.get_tip_to_show(clusive_user, page=self.page_name, version_count=len(versions))
+ self.tours = TourList(clusive_user, page=self.page_name, version_count=len(versions))
# See if there's a custom question
customizations = Customization.objects.filter(book=book, periods=clusive_user.current_period) \
@@ -718,12 +718,9 @@ def get(self, request, *args, **kwargs):
'annotations': annotationList,
'cuelist': json.dumps(cuelist),
'hide_cues': hide_cues,
- # BEGIN: Sample Tour
- # Sample tour with single item list
'tip_name': None,
- 'tours': [{'name': self.tip_shown.name, 'robust': True }] if self.tip_shown else None,
- # END: Sample Tour
- 'tip_shown': self.tip_shown,
+ 'tip_shown': self.tip_shown.name if self.tip_shown else None,
+ 'tours': self.tours,
'has_teacher_resource': True,
'customization': customizations[0] if customizations else None,
'starred': pdata.starred,
@@ -748,13 +745,14 @@ def get(self, request, *args, **kwargs):
# Check for Tip
clusive_user = request.clusive_user
tip_shown = TipHistory.get_tip_to_show(clusive_user, page='Wordbank')
+ tours = TourList(clusive_user, page='Wordbank')
self.extra_context = {
'words': WordModel.objects.filter(user=request.clusive_user, interest__gt=0).order_by('word'),
'clusive_user': clusive_user,
'tip_name': None,
- 'tours': [{'name': tip_shown.name, 'robust': True }] if tip_shown else None,
- 'tip_shown': tip_shown,
+ 'tip_shown': tip_shown.name if tip_shown else None,
+ 'tours': tours,
'has_teacher_resource': False,
}
return super().get(request, *args, **kwargs)
diff --git a/src/roster/templates/roster/manage.html b/src/roster/templates/roster/manage.html
index a47a6f32b..1d6b02b5d 100644
--- a/src/roster/templates/roster/manage.html
+++ b/src/roster/templates/roster/manage.html
@@ -87,13 +87,7 @@
If you have made changes to your Google Classroom class roster (e.g., you added or removed a student), use this option to update your class list in Clusive.
- {% endif %}
+ {% endif %}
{% endif %}
-{% for tour in tours %}
-{% include "shared/partial/popover_tour.html" with tour_name=tour.name tour_robust=tour.robust %}
-{% endfor %}
-{% if tip_name %}
-{% include "shared/partial/tooltip_tip.html" %}
-{% endif %}
{% endblock %}
diff --git a/src/roster/views.py b/src/roster/views.py
index 0249bc2de..6f4ce2224 100644
--- a/src/roster/views.py
+++ b/src/roster/views.py
@@ -49,7 +49,7 @@
from roster.models import ClusiveUser, Period, PreferenceSet, Roles, ResearchPermissions, MailingListMember, \
RosterDataSource
from roster.signals import user_registered
-from tips.models import TipHistory
+from tips.models import TipHistory, TourList
logger = logging.getLogger(__name__)
@@ -472,6 +472,7 @@ def get(self, request, *args, **kwargs):
user = request.clusive_user
# See if there's a Tip that should be shown
self.tip_shown = TipHistory.get_tip_to_show(user, page="Manage")
+ self.tours = TourList(user, page="Manage")
if not user.can_manage_periods:
self.handle_no_permission()
return super().get(request, *args, **kwargs)
@@ -481,12 +482,9 @@ def get_context_data(self, **kwargs):
if self.current_period is not None:
context['people'] = self.make_people_info_list(self.request.user)
context['period_name_form'] = PeriodNameForm(instance=self.current_period)
- # BEGIN: Sample Tour
- # Sample tour with single item list
context['tip_name'] = None
- context['tours'] = [{'name': self.tip_shown.name, 'robust': True }] if self.tip_shown else None
- # END: Sample Tour
- context['tip_shown'] = self.tip_shown
+ context['tip_shown'] = self.tip_shown.name if self.tip_shown else None
+ context['tours'] = self.tours
context['has_teacher_resource'] = False # "Learn more" link would be circular
context['clusive_user'] = self.request.clusive_user
return context
diff --git a/src/shared/templates/shared/base.html b/src/shared/templates/shared/base.html
index a501711a8..a8a3a5adf 100644
--- a/src/shared/templates/shared/base.html
+++ b/src/shared/templates/shared/base.html
@@ -50,7 +50,10 @@
{% block sidebar_bottom_start %}
{% include "shared/partial/sidebar_bottom_start.html" with show_reading_feedback=False %}
{% endblock%}
+
+
{% if tour_name == "settings" %}
@@ -67,7 +64,6 @@
- {% endif %}
{% if tour_name == "settings" %}
@@ -75,74 +71,38 @@
Change the font, colors, and more! Settings let you choose the look, supports, and reading tools to make Clusive all your own.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about settings
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="SSETTINGS" resource_name="settings" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "readaloud" %}
Click the page read aloud icon to hear the entire page. Select text and click read aloud in the context menu to hear a smaller selection or a single word read aloud.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
-
-
- {% endif %}
- {% endif %}
-
-
-
-
-
+
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "wordbank" %}
The Word bank collects words you’ve looked up or rated. Check out how you’ve rated words. Change ratings as your word knowledge grows. Get back to your previous page by clicking on the back button.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
-
-
- {% endif %}
- {% endif %}
-
-
-
-
-
+
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "switch" %}
Switch gives three challenge options for some texts. Open Switch, check out the vocabulary in each version, and choose to stay, or change challenge levels. It’s up to you!
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about switch
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="SWITCH" resource_name="switch" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "context" %}
@@ -155,38 +115,16 @@
Translate or simplify
Hear the words read aloud
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
-
-
- {% endif %}
- {% endif %}
-
-
-
-
-
+
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "view" %}
View the Clusive library by all readings, or in smaller groupings like class readings, readings you’ve starred, public readings, or readings you’ve uploaded.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
-
-
- {% endif %}
- {% endif %}
-
-
-
-
-
+
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "book_actions" %}
{% if clusive_user.role == 'TE' %}
@@ -195,18 +133,11 @@
{% endif %}
Click “More actions” (three dots) to assign or customize any book, and for books you uploaded to Clusive, to edit information or delete a book.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about book actions
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="CREAD" resource_name="book actions" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "activity" %}
{% if clusive_user.role == 'TE' %}
@@ -216,18 +147,11 @@
{% endif %}
Get a quick overview of student activity. Hover over active reading time bars for titles and reading time. Click a bar to see readings students have in common. Triangles show readings you have assigned.
Select timeframe and sort by hours, books, or student name.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about student activities data
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="READDTL" resource_name="student activities data" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "student_reactions" %}
{% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
@@ -241,18 +165,11 @@
Click on a reaction word and see Clusive readings that inspired you and others to react with that word.
{% endif %}
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about students' reactions
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="SREACT" resource_name="students' reactions" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "reading_data" %}
{% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
@@ -266,31 +183,18 @@
See assigned readings your recent readings, and popular readings to check out. Go to the library to find more things to read. Have a document you want to upload? Click Upload a new reading to get started!
{% endif %}
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about students' reactions
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="SREADP" resource_name="student reading data" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "thoughts" %}
Reflect on how a reading made you feel, answer questions your teacher has posted, and mark how much you’ve learned. Your thoughts on how the reading made you feel are collected on your student dashboard.
-
-
-
-
-
-
-
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "manage" %}
{% if clusive_user.role == 'TE' %}
@@ -299,18 +203,11 @@
{% endif %}
Import, add or edit classes and student information in Clusive.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about manage
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="CCLASS" resource_name="manage" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "resources" %}
{% if clusive_user.role == 'TE' %}
@@ -319,66 +216,41 @@
{% endif %}
Get tips, resources and videos for getting you and your students started in Clusive, and for building teaching skills with Clusive tools and features.
-
-
- {% if has_teacher_resource %}
- {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
- Learn more about resources
- {% endif %}
- {% endif %}
-
-
-
-
-
+ {% if clusive_user.role == 'TE' or clusive_user.role == 'PA' %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id="RESOURCES" resource_name="resources" %}
+ {% else %}
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
+ {% endif %}
{% elif tour_name == "filters" %}
Use filters to find readings based on topics, reading levels, and word count. Click on one or more topics or filters and get readings that match any of your selections.
-
-
-
-
-
-
-
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% elif tour_name == "search" %}
Search for readings by part of all of a title, author name, publisher, even words that are included in the descriptions on reading tiles. Looking for topic or subject areas? Use the Library filters instead!.
-
-
-
-
-
-
-
+ {% include "shared/partial/popover_tour_footer.html" with resource_id=None %}
{% endif %}
{% if tour_name != "context" and tour_name != "activity" %}
{% endif %}
+{% endfor %}
+{% if tours %}
+{% endif %}
diff --git a/src/shared/templates/shared/partial/popover_tour_footer.html b/src/shared/templates/shared/partial/popover_tour_footer.html
new file mode 100644
index 000000000..e9800270b
--- /dev/null
+++ b/src/shared/templates/shared/partial/popover_tour_footer.html
@@ -0,0 +1,34 @@
+{% load i18n %}
+{% load list_helpers %}
+
+
\ No newline at end of file
diff --git a/src/shared/templates/shared/partial/sidebar_bottom_end.html b/src/shared/templates/shared/partial/sidebar_bottom_end.html
new file mode 100644
index 000000000..8f726147e
--- /dev/null
+++ b/src/shared/templates/shared/partial/sidebar_bottom_end.html
@@ -0,0 +1,10 @@
+{% load list_helpers %}
+