Luna LMS

Check-in [44cea75da9]
Login

Check-in [44cea75da9]

Overview
Comment:Removing previous course count display, replacing by a dynamic counter at the top.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | view
Files: files | file ages | folders
SHA3-256: 44cea75da92a23b75da1f7dc38769d2965ec87fc57cadb811ec9494ee6c4f958
User & Date: florian 2024-10-16 10:14:44
Context
2024-10-16
10:15
Merged changes from view. check-in: 5e71483a64 user: florian tags: development
10:14
Removing previous course count display, replacing by a dynamic counter at the top. Leaf check-in: 44cea75da9 user: florian tags: view
2024-10-15
16:15
Displaying total number of courses above course list now. check-in: 4a9e4aa69a user: florian tags: view
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to luna_lms/webapp.py.

1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984

		return_str += '<main class="w3-row-padding general_left_right_margin" style="scroll-behavior: smooth;">'

		return_str += '<div class="w3-col luna-l3 luna-m3 spacer"></div>'

		return_str += '<div class="w3-col luna-l6 luna-m6 half-col-pad-left">'

		if not "term" in kwargs.keys():

			return_str += '<p style="margin-bottom:2rem;">'

			if len(titles) == 1:

				return_str += _('Es gibt zur Zeit 1 Kurs.')

			else:

				return_str += '{} {} {}'.format(_('Es gibt zur Zeit'), len(titles), _('Kurse.'))

			return_str += '</p>'

		return_str += '<form class="search" action="/courses" method="get">'

		value = ""

		if "term" in kwargs.keys() and kwargs["term"].strip():

			value = html.escape(kwargs["term"])







<
<
<
<
<
<
<
<
<
<
<
<
<
<







1957
1958
1959
1960
1961
1962
1963














1964
1965
1966
1967
1968
1969
1970

		return_str += '<main class="w3-row-padding general_left_right_margin" style="scroll-behavior: smooth;">'

		return_str += '<div class="w3-col luna-l3 luna-m3 spacer"></div>'

		return_str += '<div class="w3-col luna-l6 luna-m6 half-col-pad-left">'















		return_str += '<form class="search" action="/courses" method="get">'

		value = ""

		if "term" in kwargs.keys() and kwargs["term"].strip():

			value = html.escape(kwargs["term"])
1999
2000
2001
2002
2003
2004
2005













2006
2007
2008
2009
2010
2011
2012
2013
2014







2015
2016
2017
2018
2019
2020
2021
			return_str += '''	<select name="filter" class="inactive" disabled>
		<option value="filter">{}</option>
	</select>
'''.format(_("Alle Filter"))

		return_str += '</form>'














		return_str += '<div>'

		return_str += '</div>'

		if "term" in kwargs.keys() and kwargs["term"].strip():

			if len(titles):
				return_str += '<p>{} {} <strong>{}</strong>:</p>'.format(len(titles),
																			_("Such-Ergebnisse für"),







																			html.escape(kwargs["term"]))
			else:
				return_str += '<p>{} <strong>{}</strong>:'.format(_("Such-Ergebnisse für"),
																	html.escape(kwargs["term"]))

				return_str += '<br>{}</p>'.format(_("Für die Suche gab es keine Ergebnisse."))








>
>
>
>
>
>
>
>
>
>
>
>
>







|
|
>
>
>
>
>
>
>







1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
			return_str += '''	<select name="filter" class="inactive" disabled>
		<option value="filter">{}</option>
	</select>
'''.format(_("Alle Filter"))

		return_str += '</form>'

		if not "term" in kwargs.keys():

			return_str += '<p>'

			counter_str = '<span id="course_pagination_counter">{}</span> {} {} {}'

			return_str += counter_str.format(PAGINATE_COURSES,
												_('von'),
												len(titles),
												_('Kursen'))

			return_str += '</p>'

		return_str += '<div>'

		return_str += '</div>'

		if "term" in kwargs.keys() and kwargs["term"].strip():

			if len(titles):

				result_str = _("Such-Ergebnisse für")

				if len(titles) == 1:

					result_str = _("Such-Ergebnis für")

				return_str += '<p>{} {} <strong>{}</strong>:</p>'.format(len(titles),
																			result_str,
																			html.escape(kwargs["term"]))
			else:
				return_str += '<p>{} <strong>{}</strong>:'.format(_("Such-Ergebnisse für"),
																	html.escape(kwargs["term"]))

				return_str += '<br>{}</p>'.format(_("Für die Suche gab es keine Ergebnisse."))

2107
2108
2109
2110
2111
2112
2113

2114
2115
2116
2117
2118
2119
2120
2121




2122
2123
2124
2125
2126


2127
2128

2129
2130
2131
2132
2133
2134
2135
			return_str += '<br>'

		return_str += '''<script>
/* Partly generated by codeium.com */
window.addEventListener('DOMContentLoaded', function() {

	var paginationDivs = document.getElementsByClassName("course_pagination");

	var visibleIndex = 0;

	// Hide all visibily, keep for screen readers
	for (var i = 0; i < paginationDivs.length; i++) {
		paginationDivs[i].classList.add('screenreader_only');
	}

	var paginationMore = document.getElementById('course_pagination_more');





	function displayVisible() {

		paginationDivs[visibleIndex].classList.remove('screenreader_only');



		if (visibleIndex == paginationDivs.length - 1){
			paginationMore.style.display = "none";

		} else {
			paginationMore.style.display = "inline-block";
		}
	}

	paginationMore.addEventListener('click', function() {
		if (visibleIndex < paginationDivs.length - 1) {







>








>
>
>
>





>
>


>







2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
			return_str += '<br>'

		return_str += '''<script>
/* Partly generated by codeium.com */
window.addEventListener('DOMContentLoaded', function() {

	var paginationDivs = document.getElementsByClassName("course_pagination");
	var courses = document.getElementsByClassName("course_listing");
	var visibleIndex = 0;

	// Hide all visibily, keep for screen readers
	for (var i = 0; i < paginationDivs.length; i++) {
		paginationDivs[i].classList.add('screenreader_only');
	}

	var paginationMore = document.getElementById('course_pagination_more');
	var paginationCounter = document.getElementById('course_pagination_counter');

	/* Get pagination steps as handed over in the generated HTML. */
	var paginationAfter = parseInt(paginationCounter.innerHTML);

	function displayVisible() {

		paginationDivs[visibleIndex].classList.remove('screenreader_only');

		paginationCounter.innerHTML = (visibleIndex + 1) * paginationAfter;

		if (visibleIndex == paginationDivs.length - 1){
			paginationMore.style.display = "none";
			paginationCounter.innerHTML = courses.length;
		} else {
			paginationMore.style.display = "inline-block";
		}
	}

	paginationMore.addEventListener('click', function() {
		if (visibleIndex < paginationDivs.length - 1) {