desklab / gcampus

GewässerCampus is an educational project on limnology aiming to provide students the possibility to analyse, publish and discuss results of self-conducted measurements of water-quality in rivers and lakes.
https://gewaessercampus.de
GNU Affero General Public License v3.0
3 stars 1 forks source link

Add tabbed layout #80

Closed 3j14 closed 1 year ago

3j14 commented 1 year ago

This pull requests introduces a new layout that uses tabs to navigate the different steps of the measurement form or the two pages of the course administration.

To make the tabs work on mobile devices, they are not places within the title bar but instead below in the content:

Screenshot Measurement Form

For easier configuration, two classes TabNavigation and Tab have been introduced. These classes are subclasses of Renderable and their __str__ method returns renderable HTML.

Additionally, the package structure of gcampus/core/views has been changed and may require thorough review.

Note: There is now only one add-measurement endpoint. After adding the measurement, the title changes to "Edit Measurement #…".

Other fixes:

To-do:

nlwach commented 1 year ago

I really like the new design of the tabs. Some minor things:

3j14 commented 1 year ago

@nlwach Thank you for your feedback!

Regarding the color of the disabled tab: Yes, I will change this and make the difference more noticeable.

As for discarding the measurement: Hm, good point. Obviously the button should do something. Making it delete the measurement is difficult because the same form is also displayed when editing the form. In that context, discard would not mean to delete the measurement but discard changes.

nlwach commented 1 year ago

@jnsdrtlf good point. I will implement this. How do you feel about having a modal to confirm to discard the changes?

nlwach commented 1 year ago

The discard button behaves now the following way: In the first tab the discard button redirects to the map view. In the other tabs the button redirects to the measurement detail page

3j14 commented 1 year ago

@nlwach thanks for your changes and review! Merged now :)