paulkore / trakr-django

Simple web-app to keep track of group expenses
0 stars 0 forks source link

Completely exclude HTML of inactive money record view (responsive UI) #16

Open paulkore opened 9 years ago

paulkore commented 9 years ago

UI responsiveness is achieved by rendering one of two views based on a media query:

Currently, the inactive view is hidden using CSS "display: none".

This isn't good enough, as the HTML content of the hidden view is still present in the background which creates the following problems:

The solution is to completely exclude the inactive view HTML instead of hiding it.

paulkore commented 9 years ago

Currently responsiveness is achieved using CSS media queries, but the limitation of this approach is that they only affect CSS on the client side, and there's no easy way to integrate with them from the server-side, where templates are processed.

Look into the django-responsive library: https://django-responsive.readthedocs.org

paulkore commented 9 years ago

Unfortunately, 'django-responsive' feels abandoned. It uses 'screen.width' which doesn't work, as it is the width of the device's screen and only matches the viewport width in fullscreen mode.

paulkore commented 9 years ago

Fortunately, there is hope in what appears to be a live branch: django-responsive2 https://pypi.python.org/pypi/django-responsive2/ https://django-responsive2.readthedocs.org

paulkore commented 9 years ago

Unfortunately, it suffers from the same issue as the original django-responsive :(

paulkore commented 9 years ago

I got in touch with @mishbahr, the contributor to 'django-responsive2'

He confirmed that this is a known issue, and described a potential fix.

It is likely that I will attempt making that contribution to django-responsive2 in the near future. (Sounds like a cool challenge)