html

HTML

Below, catalogue names written in capitals are variables:

  • OAHPA = oahpa, nu_oahpa, univ_oahpa, bxr_oahpa, crk_oahpa, ...
  • DRILL = drill, bxr_drill, ...

Overall look

  • The css-settings reside in ped/OAHPA/media/css/OAHPA.css
    • Note that sme oahpa is found in both either oahpa or univ_oahpa, dependent upon version (univ_oahpa is the corrent one).
    • Note also that there is a lack of correspondence in the css naming, there are paths like ped/bxr_oahpa/media/css/fkv_oahpa.css TODO: Fix this.
  • The main page for OAHPA is defined in ped/OAHPA/templates/OAHPA_main.html
  • The basic look for all the games (divs, menubars) are given in the file ped/OAHPA/templates/oahpa.html
  • The file game.html in ped/OAHPA/DRILL/templates contains the basic functionality for all the games.

In addition, it is possible to alter the pages of individual games by editing the files

ped/OAHPA/DRILL/templates/mgame_n.html (Morfa for nouns)
ped/OAHPA/DRILL/templates/mgame_l.html (Morfa numerals)
ped/OAHPA/DRILL/templates/mgame_a.html (Morfa for adjectives)
ped/OAHPA/DRILL/templates/mgame_v.html (Morfa for verbs)
ped/OAHPA/DRILL/templates/leksa.html (Leksa common nouns)
ped/OAHPA/DRILL/templates/leksa_place.html (Leksa placenames)
ped/OAHPA/DRILL/templates/num.html (Numra cardinal)
ped/OAHPA/DRILL/templates/num_ord.html (Numra ordinals)
ped/OAHPA/DRILL/templates/clock.html (Numra clock)
ped/OAHPA/DRILL/templates/dato.html (Numra date)
ped/OAHPA/DRILL/templates/vasta.html
ped/OAHPA/DRILL/templates/sahka.html

Game pages involve definitions from several html-pages. For example, S-MORFA: mgame_x.html, mgame.html, game.html and oahpa.html.

The files contain template tags like the following:

{% block navbar %}
..
{% endblock %}

They enable several pages to be generated from one source file. In addition, some variables are inside double braces. However, the rest of the page is plain html and it may be edited as any html-file. If there is an error you may always return to the previous svn-version. Remember to test.

Examples

If you want to update a text in English, write inside the trans-tags in the html-file for the main page or the game :

{% trans ".." %}

To make a new box for option xxx in Leksa Placenames under geography choices, you have to add this to the files:

1. oahpa/drill/forms.py: 
GEOGRAPHY_CHOICES =  ('xxx', _('xxx')), 
and     # For placename quizz
    xxx = forms.BooleanField(required=False,initial=0)


2. oahpa/drill/views.py:         
if 'xxx' in settings_form.data:
            self.settings['geography'].append('xxx')

3. oahpa/drill/templates/quizz_n.html: 
{{ settingsform.xxx }}{% trans "xxx" %}<br/>