Repository: pretalx/pretalx

Issue:
Show present time in public schedule
This is an issue that is well-suited for external contributors – let me know if I can be of any help, either via this issue or via support@pretalx.com.

## What this is about

pretalx provides a display of the public schedule of a conference. As a conference attendee, it would be very helpful to see a red line going horizontally through the public schedule view indicating the current time to help navigate the schedule relative to what is happening *now*.

This should be moved with javascript, but initially rendered without js.

## How to get started

First of all, leave a comment on this issue to make sure nobody else starts working on this issue at the same time!

Next, you need pretalx running locally on your machine. First, [fork](https://github.com/pretalx/pretalx/fork) the repository to your own GitHub account. Then clone it locally (or [set it as your remote](https://help.github.com/articles/configuring-a-remote-for-a-fork/) if you already cloned it earlier)

Follow the [developer setup guide](https://docs.pretalx.org/en/latest/developer/setup.html), and then play around with pretalx a bit.
Have a look at the places impacting this issue. Look at the code responsible for the issues (searching for relevant words or files should help you find your way around). We have an explanation of our [code structure](https://docs.pretalx.org/en/latest/developer/concepts.html) and the actual [data models](https://docs.pretalx.org/en/latest/developer/interfaces/models.html).


## How to do this

Look at the `pretalx/agenda/views/schedule.py` file, and the `pretalx/agenda/templates/agenda/schedule.html`. This is where the schedule is produced and rendered. You'll want to add a new JavaScript file `pretalx/static/agenda/js/schedule.js`, and implement the feature there.

Take care not to forget about timezones! The event schedule will always be shown in the event time, so you'll have to work with that. pretalx already vendors `moment.js`, so you should find all functionality you need there.

Also have a look at the closely related #194.

## Submit the PR

There are a number of tutorials on the Pull Request workflow online, for example this [short version](https://guides.github.com/introduction/flow/) by GitHub itself and this [more in-depth tutorial](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github).

Remember to provide documentation and tests, if applicable. Run the tests before opening your PR, including style checks. We have a [contribution guide](https://docs.pretalx.org/en/latest/developer/contributing.html), which ought to prove helpful at this stage.


Discussion:

Resolving patch:
diff --git a/src/pretalx/agenda/views/schedule.py b/src/pretalx/agenda/views/schedule.py
--- a/src/pretalx/agenda/views/schedule.py
+++ b/src/pretalx/agenda/views/schedule.py
@@ -329,7 +329,10 @@ def get_schedule_data(self):
                     .replace(second=0, minute=0)
                 )
                 end = date.get('last_end').astimezone(timezone)
-                date['height'] = int((end - start).total_seconds() / 60 * 2)
+                height_seconds = (end - start).total_seconds()
+                date['display_start'] = start
+                date['height_seconds'] = height_seconds
+                date['height'] = int(height_seconds / 60 * 2)
                 date['hours'] = []
                 step = start
                 while step < end:


Test patch: