46 | | We need a front-end decision maker to decide which template(s) we are using: |
47 | | * configuration settings: 000_config.py |
48 | | * prepopulate: tasks.cfg |
49 | | * tbc Theme: static/styles/sahana.css, views/layout.html, modules/eden/layouts.py |
50 | | * tbc Menus: modules/eden/menus.py, models/01_menu.py |
51 | | * tbc Message Parser |
| 46 | Configuration is done using these files: |
| 47 | * /private/templates/000_config.py |
| 48 | * /private/templates/default/config.py |
| 49 | * /private/templates/<template>/config.py |
55 | | This front-end selection should use a simple Web Setup (local deployments) to select between templates. |
| 53 | 000_config.py includes: |
| 54 | * FINISHED_EDITING_CONFIG_FILE |
| 55 | * machine-specific configuration (Debug, Database, SMTP, API Keys, etc) |
| 56 | * a setting to define which template folder to run |
| 57 | * importing of settings from templates/<template>/config.py |
| 58 | * optional local overrides to the template's settings |
| 59 | |
| 60 | Prepopulate options are defined in the template's config.py |
| 61 | * operating exactly as currently: DeveloperGuidelines/PrePopulate |
| 62 | |
| 63 | === Future extensions === |
| 64 | These are proposed extensions which need refining: |
| 65 | |
| 66 | Message Parser: |
| 67 | * private/templates/<template>/parser.py |
| 68 | Theme: |
| 69 | * static/styles/<template>/style.css |
| 70 | * static/img/<template>/*.png |
| 71 | * views/<template>/layout.html |
| 72 | * controllers/default.py index() |
| 73 | Menus: |
| 74 | * private/templates/<template>/menus.py |
| 75 | * subclasses modules/eden/menus.py to allow overrides |
| 76 | * private/templates/<template>/layouts.py |
| 77 | * subclasses modules/eden/layouts.py to allow overrides |
| 78 | * models/01_menu.py should no longer be required |
| 79 | Fields: |
| 80 | * private/templates/<template>/fields.py |
| 81 | * includes any local overrides to field labels/readable/writable/DAL-level required |
| 82 | * modules/s3/s3fields.py |
| 83 | * S3Field to subclass Field to read settings from fields.py |
58 | | Remove /private/templates/demo (move all contents up 1 level for consistency to find across all functions which use templates) |
59 | | |
60 | | Split 000_config.py into 2 files: |
61 | | * Machine-specific configuration (Debug, SMTP, Database, API Keys, etc) |
62 | | * Instance-type configuration |
63 | | |
64 | | Have 2 settings: |
65 | | * Template: For which 000_config extensions to use |
66 | | * Prepopulate: Any additional prepopulate folders to add to the list (comes from the template) |
67 | | |
68 | | Build the running 000_config.py from the default file, with modifications based on the selected Template |
69 | | * so don't simply file copy but use some intelligence to uncomment/modify options in the default file |
70 | | |
71 | | Currently 000_config calls the prepopulate options. |
72 | | * selecting between alternate 000_config.py files requires external shell scripting, which bypasses the hmac_key automation |
73 | | |
74 | | We should move template selection to TEMPLATE in 0000_template.py? |
75 | | * move the CANARY_UPDATE_CHECK_ID back to 0000_update_check.py to make it easier to write the 0000_template.py? |
| 86 | Implmentation Steps for the next phase (no 'future extensions' yet) |
| 87 | 1. git mv /private/templates/demo/* /private/templates |
| 88 | * move all contents of 'demo' up 1 level for consistency to find across all functions which use templates |
| 89 | 1. split 000_config.py into 2 files: |
| 90 | * Machine-specific configuration (Debug, SMTP, Database, API Keys, etc): /private/templates/000_config.py |
| 91 | * Instance-type configuration: /private/templates/<template>/config.py |
| 92 | 1. revert CANARY to using 0000_update,py |
| 93 | 1. make update_check remove 0000_template.py |
| 94 | 1. update the CANARY_UPDATE_CHECK_ID to force update_check to run |