-
Notifications
You must be signed in to change notification settings - Fork 1
/
theming.utf8
74 lines (55 loc) · 3.24 KB
/
theming.utf8
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
70
71
72
73
QUESTION
========
THEMING.1: How did Stanford get its theme to work on edX?
We are asking with the perspective of a course launch mid-September (internal to our institute).
We don't really care that Stanford's solution is hacky.
What we would like to do is be able to install the theme
https://github.com/Stanford-Online/edx-theme
with the convenience of a playbook. (if possible, or as a general procedure which we apply via playbooks or shellscripts)
We can do the next step of modifying the stanford theme to make it suit our style.
We figured we at least need to change the variable edxapp_theme_name, for instance directly in
playbooks/edx-east/roles/edxapp/vars/main.yml
We did that and it seems to be recognized: it copies Stanford-online/edx-theme into a folder stanford in the directory /opt/wwc/themes
But nothing else much seems to happen...
Note:
lms/envs/common.py also contains the variable 'USE_CUSTOM_THEME' and the function enable_theme, see its docstring
rakelib/assets.rake contains THEME_NAME = ENV_TOKENS['THEME_NAME']
One can add "THEME_NAME":"stanford" to env.json, still does not seem to make a difference
THEMING.2: Is the theme applied during the playbook? After the setup? Recommendations?
THEMING.3: Say we update a theme. how do we play it onto a server? How difficult is it to play it onto a running machine? Is it just a matter of shutting down edx for maintenance, putting the themes, and restarting edx?
ANSWER
======
THEMING.1:
You seem to be on the right track. I've investigated this a bit, and as far as I can tell
without looking directly at your installation, your troubles might come from the way you
set the theme name.
First, you actually have two other variables related to the theme name that you can set:
```
edxapp_theme_name: 'stanford'
edxapp_theme_source_repo: 'https://github.com/antoviaque/edx-theme.git'
edxapp_theme_version: 'HEAD'
```
You have already changed `edxapp_theme_source_repo`, but check that you also changed
`edxapp_theme_name`.
Also, unless this was changed since the last time I installed a theme, you also need to
set the `THEME_NAME` like this, still in your ansible playbooks (the files
`/opt/wwc/*.json` are handled by ansible, so you shouldn't alter them directly):
```
generic_env_config: &edxapp_generic_env
...
'THEME_NAME': 'stanford'
```
This will make ansible add the `THEME_NAME` variable to the env tokens. This is similar
to what you did, but besides not doing it from ansible, you might have been doing the
change in the wrong file, as the lms environment is found in `/opt/wwc/lms*.env.json`
(there can be several variants of the LMS service on a single host, and thus different
files).
THEMING.2:
The theme is not strictly speaking "applied" during the playbook - the original files from
edx-platform will remain unchanged. Rather, the theme repository is fetched (as you
observed) and the configuration variables get the code from `edx-platform` to load the
templates and static files from the theme directory.
Note that the theming capabilities currently don't allow to override everything from
edx-platform, so depending on the design that you will want to implement, you might also
have to alter `edx-platform` directly (this is actually what Stanford did for some of
their own changes).