Giter Club home page Giter Club logo

myhpi's Introduction

myHPI

tests Coverage Status

This tool is used to manage the student representative website at https://myhpi.de. It is a CMS based on Wagtail/Django and adds several functionalities like polls.

Development setup

For a quick start, use the dev container, e.g. by installing the Dev Containers extension in Visual Studio Code or using the built-in feature in JetBrains IDEs. This automatically installs all dependencies in a container. After starting the container, setup your local data by following the Manual Setup from step 9 (creating a superuser).

Manual setup

To set up a development version on your local machine, you need to execute the following steps:

  1. Check out repository and cd to it
  2. Set up a virtualenv for the project with Python >=3.11 and activate it (e.g., python3 -m venv venv and source venv/bin/activate)
  3. Install poetry (if not already installed): curl -sSL https://install.python-poetry.org/ | python -
  4. Install dependencies with poetry install
  5. Create env file by copying the .env.example file to .env, e.g. cp .env.example .env (Notice that for some functionality like OIDC some settings must be changed)
  6. Migrate the database with python manage.py migrate
  7. Install bootstrap with python tools/install_bootstrap.py
  8. Optionally: Compile translations with python manage.py compilemessages (does not work on Windows, recommended to skip this step or see docs)
  9. Optionally: Create test data with python manage.py create_test_data
  10. Create a local superuser with python manage.py createsuperuser
  11. Start the development server with python manage.py runserver
  12. Open your web browser, visit http://localhost:8000/admin and log in with the user you just created

Tests

Test the code with python manage.py test myhpi.tests.

Code style

We recommend installing a pre-commit hook with pre-commit install. That will (look at .pre-commit-config.yaml) before every commit

  • run autoflake with a couple of flags to remove unused imports,
  • run isort . to sort imports,
  • run black . to format the code. You can also check out the IDE integration

If you want to do that manually, run pre-commit run --all-files. Next to that, we also run pylint myhpi to check for semantic issues in the code.

Tips

  • To create translations, run python manage.py makemessages -l de -i venv.

Reset database

  1. Delete db.sqlite3
  2. Conduct development setup steps 7+

myhpi's People

Contributors

abc013 avatar benbals avatar dasgoogle avatar dependabot[bot] avatar dropforge avatar felixauringer avatar frcroth avatar jeriox avatar jesterpandemonium avatar ksturtzkopf avatar lukasrad02 avatar paula-kli avatar silvanverhoeven avatar t4rika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

myhpi's Issues

Custom calendars

It would be nice to have a page where users can select from public calendars they are interested in to create a personal ical link which holds this personal selection of calendars (e.g., just a selection of several Studentenklubs).

Print layout

Minutes on myHPI are often printed. It is important to have a properly styled print version of minute pages.

Design and implement a print version of myHPI minutes. Use the current print layout of myHPI minutes as reference.

Basic support:

  • Proper layout with title and content; no menu, table of contents etc.
  • Metadata of minutes
  • Labels (and their color?)
  • Links
  • Images

Keep in mind/Should be supported (in the future?):

  • Proper print mode for other page types of myHPI (like information pages)
  • Abbreveations
  • Attachements

Notice:

  • Layout should use few ink and barely any colors, if at all
  • Multiple organisations use minutes. Do not brand minutes solely to the FSR

Clean up workflow file

Because of various workarounds, the file .github/workflows/test.yml has many steps that should not be needed.

Allow polls to be created

As of #23, there is functionality for polls in myHPI. Our current tree configuration does not allow for polls/poll lists to be created anywhere. This should be changed accordingly.

Site preview in editing mode

1327 allowed the user to quickly preview the page while editing it. In Wagtail, this requires saving the draft and clicking the preview button, which opens a new tab. It would be convenient to have a preview inside of the editor.

see #12 for an extension that offers this functionality

Convenience functions when creating minutes

There are several small things in 1327 that make taking minutes easier:

  • #99
  • The minutes title defaults to the title of the last minutes
  • The date defaults to today
  • The author and chair default to the values from the last minutes
  • The participants default to all members of the respective group
  • The URL/slug defaults to the current date

These would also be handy for us.

Support dots in commands

The enter and leave commands break if writing names with dots, e.g. "Prof. Friedrich". Just support all characters except "(" and ")".

Debug data set

Provide a debug dataset with minutes, user etc. for local testing.
Explain usage in README. Alternatively explain steps to setup root page etc. locally

Can't create minutes list

I can't create a minutes list.

image

I'm not entirely sure why and at some point I could create a minute list, since I already have one.

Style links properly

Currently, links are styled differently and not necessarily reasonable. Define and implement a system of how to style links on myHPI. Pay attention to the following:

  • The color should fit to the general accent color of the website (e.g. have the same color)
  • Notice basic accessibility standards, e.g. make sure that there are either more cues for link than just color or at least make sure links always stand out, even with red-green color blindness
  • There are different environments for links → either find a proper solution for all of them or clearly define where which style should be used. Make sure that these different styles are still consistent/intuitive
    • Text
    • Menu
    • Breadcrumbs
    • Table of Contents
    • ...
  • What happen when clicking on a link – should the background fill, shoud there be a box around the link, should we color already visited links differently?

Create share links for documents

Minutes are visible for certain user groups. On top of that, there is the requirement to make minutes accessible to other people (e.g. CEO, study dean) for review. This is usually the case while the minutes is not published yet. These people won't be members of the user groups that the minutes is published for later on.

It would be great to be able to create Google Docs-sytle share links, which allow anyone with the link to be able to view the minutes, regardless of the permissions.

Rework markdown handling

While developing the proof of concept, @T4rikA and me tried to use https://github.com/torchbox/wagtail-markdown for markdown rendering. There were some problems where the library was not flexible enough for our approach. We decided to patch these issues inside this project to deliver a PoC quickly. These issues should be identified and ideally patched in the upstream repository.

Image Chooser shouldn't display preview

Currently if you insert an image, the image is displayed in a preview size.
This should be changed to display a higher resolution (800px is generated from wagtail).

Use a regex to find the higher resolution path from the preview path

Replace ModelChoiceFields with select2 fields

We are using a ManyToManyFields on our pages, e.g. for the participants in minutes. This is rendered as a plain HTML multiselect by wagtail when editing the page:
grafik
As the production instance will have around 1000 users (all students), selecting the correct participants will be a huge pain.
1327 is using select2 via https://django-select2.readthedocs.io/en/latest/ for such cases, which renders a single textbox where one can search for the person in question:
grafik
grafik
We should replace the wagtail panels for these ManyToManyFields with select2 fields or a similar option.

Email organization tool

We thought of a system that tracks all incoming emails and lists them in an overview. Users can then remove them from the list by marking them as "done", using a one-click forwarding option to previously defined distribution lists. Emails should also be removed if there has already been an answer to the email.

Category Color Scheme

The current design has a single accent color, which makes it possible to change that for basically any color. It may be cool to divide the content of myHPI into three or four seperate dategories, like "Information", "Onboarding" and "Student Representation", each having it own color of the HPI color set (e.g. Onboarding: yellow, Information: Orange, Repres.: Red).

If doing this, think about:

  • How to define categories?
  • How to easily and cleanly set the accent color of a category (if possible, only one central point for doing so) – at least via code, maybe even via an UI?
  • How to deal with links if links have the primary color and that is very bright (HPI yellow), see also #50

Minutes navigation

Buttons for navigating to next/previous minutes document on minutes view page

Notifications for minutes

As a user I have the option to subscribe to minutes, e.g. FSR minutes.
Every time the FSR publishes a new minute I get a notification (possibly a mail or something in myHPI)

Minutes label filter

Minutes lists should get a filter option that allows filtering the entries by a specific label.

Add Footer

Add a footer to the website. It should

  • contain links to social media profiles of the FSR (i.e. Twitter)
  • a link to this GitHub Repository
  • a link to the Data Policy and Imprint
  • Language settings (?)

Create design

think about

  • mobile design
  • navbar
  • printing of minutes

Fixed sidebar

Make the sidebar of information pages containing metadata and table of contents (TOC) fix, so it is always reachable.

Notice:

  • The menu may get larger
  • Make it responsive
  • The sidebar can get longer than the height of the screen
  • Maybe it is nice to have a collapsable TOC?
  • Ensure proper accessibility of TOC, for screenreaders and via keyboard

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.