Code Monkey home page Code Monkey logo

zorza's Introduction

Zorza

(/'zɔʐa/ ZAW-zha - Polish for aurora)
An informational website for schools with an advanced timetable interface.

  • View class, group, teacher, classroom timetables
  • Set a default timetable for easy repeated access
  • Find out about upcoming schedule changes, cancelled lessons and teacher substitutions
  • Fast experience - minimal use of JavaScript and good caching
  • No registration - everything works without user accounts
  • Use on any device - fully responsive design
  • Check which classrooms are occupied at a given time
  • Access school documents and files quickly
  • Not a student information system, but can be complementary to one
  • See remaining break time and substitutions also on a publicly installed screen

Setup

Install Python 3.5 or later and set up a Python virtual environment, then install Django 2.2.5 or later (you can use pip install -r requirements.txt).

Now you can git clone the repository. You will need to create a zorza/localsettings.py file and set DEBUG, SECRET_KEY, LANGUAGE_CODE, TIME_ZONE.

The root (/) url is an alias for /pages/home/, which is a Django flatpage. Create a flatpage with the URL /home/ in Django administration (/admin/), otherwise you will get a 404. You have to create an account first with ./manage.py createsuperuser. In the footer there is a link to the flatpage with URL /about/.

Populating the timetable database should be done by scripts. The zorza_scripts repository is a collection of scripts for importing timetables generated by aSc TimeTables and tailoring the database for a specific usecase.

Very basic example timetable and flatpage data can be loaded by ./manage.py loaddata fixtures/demo.json.

For a production setup, consult https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ and https://docs.djangoproject.com/en/2.2/howto/deployment/ .

The directories mediafiles, staticfiles, and favicons have to be served directly by the web server. Example nginx configuration for that:

	location /media  {
		alias /sites/zorza/mediafiles;
	}
	location /static {
		alias /sites/zorza/staticfiles;
	}
	location ~ ^/(android|apple-touch-icon|browserconfig|favicon|manifest|safari)(.*)\.(png|xml|ico|json|svg)$ {
		root /sites/zorza/staticfiles/favicons;
	}

This software is designed with response caching in mind because the content is mostly static and by nature not requiring urgent updates. Set CACHE_MIDDLEWARE_SECONDS in localsettings.py and configure your web server for response caching.

The page /timetable/display/ displays remaining break/period time and teacher substitutions. It's intended to be run fullscreen in a browser on a public big screen. Use browser zoom to make it look right.

Administration

Custom admin commands (see ./manage.py COMMAND --help):

  • uploaddir - uploads a directory of files to a category
  • cleanup - removes old substitutions etc.

To access substitution editing forms or the calendar (DayPlan formset) the user needs the add_substitution or add_dayplan permission respectively. To access Django Admin is_staff is needed, as is normal with Django.

After timetable changes or group changes in real world, such that teacher/class/group ids saved in the default timetable cookie correspond to a different thing than before, you must increment/add the integer TIMETABLE_VERSION in localsettings.py. Otherwise you risk default timetables being wrong or 404s.

License and credits

This project is licensed under AGPLv3.

The header image is a modified photograph by Simo "Ximonic" Räsänen and is available under CC BY-SA 3.0.

The logo font is Raleway.

This project includes medium-editor by Davi Ferreira (http://www.daviferreira.com) licensed under the MIT license.

Contributing

See CONTRIBUTING.md

zorza's People

Contributors

bober-bash avatar dietpawel avatar igifigi avatar matik1665 avatar opti0 avatar wikku avatar zuzkal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zorza's Issues

The current substitutions formset user experience is unnatural

Currently one has to enter the period id to make a form bound and select the substitute or mark the lesson as cancelled (by selecting None).
Instead, in the dropdown there should be choices for no Substitution object at all, Substitution with substitute=None (lesson cancelled), and Substitution with a selected teacher.

We could show a list of the absent teacher's lessons on the chosen day - with period number, subject, classroom. The user wouldn't have to enter any period numbers, just use a <select>. Furthermore, there would be more useful information available immediately to the user.

This seems hard to achieve with Django formsets though and would probably require hacky Form classes, views, and templates.

display: Implement smarter reloading

Currently the display uses HTML meta refresh which can fail when the network connection is dropped.

The page could instead be downloaded in the background using JavaScript and reloaded on success.

Add "personalize" button in personalized view

Current behaviour:
Personalization button (the one that leads to URL with /personalize/) is visible only in "class" view (URL with /class/), not in "personalized" view (URL with /groups/).

Desirable behaviour:
Personalization button is also visible in "personalized" view.
Preferably it should retain choices that user made to get such view (i.e. if personalized view includes groups 144 and 938, their corresponding checkboxes would be checked automatically).
If class that should be selected is ambigious, appropriate error with option to return to main site should appear.

Explanation:
It would be easier to correct groups. Especially useful for 1st grade students that don't know their groups in advance.

Add database checks

The timetable app assumes some things about the database that aren't stated or checked anywhere,
like a teacher can have only one lesson at a time, Period numbers should be consecutive integers

Teacher ordering is not locale-aware with SQLite

Django ORM ordering with the SQLite backend compares bytes and is not locale-aware by default.
A workaround is to sort using locale.strxfrm.

Solutions include

  • installing and using collations in SQLite
  • ordering Teacher objects by their ids (set their ids so we have alphabetical order)
  • a custom model manager

Set default time zone for school tz, not user

During my stay in CA I noticed that zorza uses the tz that the user is currently in,
which is obviously wrong, cause the school may be in different tz and all the lessons are scheduled for school's tz. As you may notice on ss, there is at least one misbehaving feature - the displayed day in the timetable.

Screenshot_2023-09-20-23-04-12-729_com.android.chrome.jpg

Screenshot_2023-09-20-23-04-09-993_com.android.chrome.jpg

Issues with displaying absences

Now you will see absences for next 7 caslendar days instead of all planed absences. Ex. on 22.09 you see absences only till 28.09 but not for 29.09 even if added.

Błąd podczas korzystania z planów lekcji

Najłatwiej będzie, jeśli po prostu zilustruję przykładem. Jak odtworzyć błąd:
KROK 1:
Wybierz dowolnego nauczyciela/klasę/salę z list.
image
KROK 2:
Po wejściu do wybranego planu lekcji użyj elementu "wstecz" w przeglądarce, a na urządzeniach mobilnych guzika "cofnij".
KROK 3:
Przeniesie nas to do poprzedniej lokalizacji, jednak wybrany nauczyciel/klasa/sala nadal będzie widoczna jako wybrana.
image
Z tego powodu uwidacznia się kilka usterek:

  • znika pasek przewijania, mimo, że jest potrzebny, gdyż strona się nie mieści na ekranie
  • nie można ponownie wrócić do wcześniejszego wyboru. (np. Dalsze wybieranie 'Helt Marta' nic nie da.).
    Po odświeżeniu strony ta działa normalnie.

Remove hardcoded date format strings

Arguments to the now template tag and the date template filter in display.html, timetable_base.html, substitutions.html, dayplans.html, should be internationalized

Room reservations

  • Zarezerwowana sala powinna być widoczna w opcji "Pokaż lekcje o danej porze"
  • Brak wyświetlanego numeru lekcji przy rezerwacji sali na dole strony
  • Formularz do dodawania rezerwacji sali
  • Informacja o rezerwacji widoczna w planie sali

Room reservation double

It is possible to add the same room reservation twice at the same time/by the same person.
obraz

Create a form for adding group/class absences

Using the Django admin site for adding absences is very cumbersome.
My idea is to have a page similar to add_substitutions1, with a group select dropdown, date select, and either checkboxes for periods or a text field for comma/space separated period numbers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.