2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-01-19 09:22:32 +00:00
troggle/media
2021-10-31 17:59:11 +02:00
..
admin tidy obsolete troggle/code/reset_db 2021-04-10 01:14:23 +01:00
css Bigger buttons, phone compatible 2021-05-01 18:35:08 +01:00
js remove unused JS code after checking it is redundant 2021-10-26 01:02:27 +03:00
jslib jslib docum 2021-10-31 17:59:11 +02:00
204plan.gif
eieshole.jpg
expoBanner.gif
goesser.jpg
icon_addlink.gif
icon_changelink.gif
icon_deletelink.gif
loserBanner.jpg
nav-bg.gif
open-quote.gif
readme.txt static files redone 2020-06-18 21:50:16 +01:00
SilkRoadsilouetteAndrew.png
survex.lang survex syntax colouring - local copies 2021-03-21 01:36:08 +00:00
survex.xml survex syntax colouring - local copies 2021-03-21 01:36:08 +00:00
surveyHover.gif
timemachine.gif

Confusions and incompatibilities when migrating to Django 1.10
meant conslidating the places we get CSS files and site media such as gifs 
for page annoations.

Situation as of 17/6/2020:
We have 3 folders for CSS files in 3 very different places:
1 in expoweb repo
1 in troggle repo
1 not in either repo but intimately needed by troggle

These are (in /home/expo/ ):
1. expoweb/css/ (used by the handbook)
2. troggle/media/css/ (used by troggle pages)
3. static/admin/css (used by django control panel and django plugins)

1. expoweb/css/        flatviews.flatpage      - the url is /css/main2.css
2. troggle/media/css/  MEDIA_ROOT, MEDIA_URL   - the url is /site_media/css/main3.css
3. static/admin/css    STATIC_ROOT, STATIC_URL - the url is /static/admin/css/base.css

After installing Django, weneed to manually copy its CSS etc. files from,
e.g. /usr/lib/python3.7/site-packages/django/contrib/admin/static/admin/css
to
/static/admin/css/base.css
if there are changes. But our old set of gifs is probably better.

from django.contrib.staticfiles import views as staticviews
from flatpages import views as flatviews

1.    url(r'^(.*)$', flatviews.flatpage, name="flatpage"),

2.    url(r'^site_media/(?P<path>.*)$', staticviews.serve,  {'document_root': settings.MEDIA_ROOT, 
            'show_indexes': True}),
3.    url(r'^static/(?P<path>.*)$',     staticviews.serve,  {'document_root': settings.STATIC_ROOT,
            'show_indexes': True}),

Also (for development only):
    url(r'^expofiles/(?P<path>.*)$',  staticviews.serve,  {'document_root': settings.EXPOFILES, 
            'show_indexes': True}),