-
Notifications
You must be signed in to change notification settings - Fork 0
/
HACKING.txt
73 lines (48 loc) · 2.09 KB
/
HACKING.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
These are very quick rough notes on the code structure.
* The site uses django templating. This should make it transportable
(other templating engines should be easy to accomodate also)
* Please try and code in a "platform independant way" as possible.
=== fg-master ===
Currently the logo and main stylesheet are served off the fg-master domain.
This is experimental with the following objectives:-
* makes the load faster as a browser can connect to different sources.
( some browsers/servers only allow for example five connections per server, with
more than one server, page elements can be downloaded in parallel)
* Makes for changing the logo globally, or the style globally very easy
* Downside is that its much more difficult to maintain
=== fg-cache ===
This server has the wrong name and should be fg-libs or fg-stash
Contains all the javascript libraries and any other third party stuff, this stuff
is cached ie sends content-expires headers.
=== fg-www ===
app.yaml contains the "configuration" of the application.
The main.py handles the incoming calls and passes them to the app/Handler.py class
the calls are in the form
/section/page/
eg
/support/
/support/docs/
and display the "section.page.html" template.
the html templates are in templates/ directory
All (we'll 99%) of the templates extends "MAIN.html".
The {% block content %} and {% block right_box %} are populated in each template.
The function calls to external resources are in app/fetch.py
The FG_App class is a "proxy" for fetch.py calls and is passed to the templating engine.
(Indeed fetch.py could be embedded in this class maybe)
FG_App also contains the navigation, and probably needs
refactoring/restructuring to make it cleaner.
eg example fetch
## fetch.py
def fetch_pilots():
## code here
return data
## FG_App class
class FG_Aircraft:
def fetch_pilots(self):
return app.fetch.fetch_pilots()
## Handler
templates_vars['app'] = FG_App() # instance passed to template
## Html templates (note no () on function call (wish we could pass varibles, liek Smarty.php)
<ul>
{% for pilot in app.fetch_pilots %}
....