diff options
Diffstat (limited to 'doc/THEMES.md')
-rw-r--r-- | doc/THEMES.md | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/THEMES.md b/doc/THEMES.md index c5e4a3eee..8a4828a99 100644 --- a/doc/THEMES.md +++ b/doc/THEMES.md @@ -7,7 +7,7 @@ inserting your own logo and colour scheme. You may also want to tweak the different states that a request can go through. You'll also want to edit the categories that public bodies can appear in (i.e. the groupings on the left hand side of the -"[View authorities](http://www.whatdotheyknow.com/body/list/all)" page +"[View authorities](https://www.whatdotheyknow.com/body/list/all)" page on WhatDoTheyKnow. There may also be other things you want to customise; drop a line on @@ -36,15 +36,15 @@ places: This document is about what you can do in a theme. -By default, the sample theme ("alavetelitheme") has already been -installed. See the setting `THEME_URLS` in `general.yml` for an +By default, the sample theme ("alavetelitheme") has already been +installed. See the setting `THEME_URLS` in `general.yml` for an explanation. You can also install the sample theme by hand, by running: - ./script/plugin install git://github.com/mysociety/alavetelitheme.git - -The sample theme contains examples for nearly everything you might + bundle exec rails plugin install git://github.com/mysociety/alavetelitheme.git + +The sample theme contains examples for nearly everything you might want to customise. You should probably make a copy, rename it, and use that as the basis for your own theme. @@ -61,13 +61,13 @@ changing much in the core theme. The ideal would be if you are able to rebrand the site by only changing the CSS. You will also need to add custom help pages, as described below. -# Branding the site +# Branding the site The core templates that comprise the layout and user interface of an -Alaveteli site live in `app/views/`. They are use Rails' ERB syntax. +Alaveteli site live in `app/views/`. They use Rails' ERB syntax. For example, the template for the home page lives at -`app/views/general/frontpage.rhtml`, and the template for the "about -us" page is at `app/views/help/about.rhtml`. +`app/views/general/frontpage.html.erb`, and the template for the "about +us" page is at `app/views/help/about.html.erb`. Obviously, you *could* edit those core files directly, but this would be a Bad Idea, because you would find it increasingly hard to do @@ -90,7 +90,7 @@ the main Rails app -- see `alavetelitheme/install.rb` to see how this happens. The partial at -`alavetelitheme/lib/views/general/_before_head_end.rhtml` includes the +`alavetelitheme/lib/views/general/_before_head_end.html.erb` includes the custom CSS in your theme's stylesheet folder (by convention, in `alavetelitheme/public/stylesheets/`), with: @@ -137,20 +137,20 @@ The latter must have one method: When you've added your extra states, you also need to create the following files in your theme: -* `lib/views/general/_custom_state_descriptions.rhtml`: Descriptions +* `lib/views/general/_custom_state_descriptions.html.erb`: Descriptions of your new states, suitable for displaying to end users -* `lib/views/general/_custom_state_transitions_complete.rhtml`: +* `lib/views/general/_custom_state_transitions_complete.html.erb`: Descriptions for any new states that you might characterise as 'completion' states, for displaying on the categorisation form that we ask requestors to fill out -* `lib/views/general/_custom_state_transitions_pending.rhtml`: As +* `lib/views/general/_custom_state_transitions_pending.html.erb`: As above, but for new states you might characterise as 'pending' states. You can see examples of these customisations in [this commit](https://github.com/sebbacon/informatazyrtare-theme/commit/2b240491237bd72415990399904361ce9bfa431d) for the Kosovan version of Alaveteli, Informata Zyrtare (ignore the -file `lib/views/general/_custom_state_transitions.rhtml`, which is +file `lib/views/general/_custom_state_transitions.html.erb`, which is unused). # Adding new pages in the navigation @@ -158,7 +158,7 @@ unused). `alavetelitheme/lib/config/custom-routes.rb` allows you to extend the base routes in Alaveteli. The example in `alavetelitheme` adds an extra help page. You can also use this to override the behaviour of specific pages if -necessary. +necessary. # Adding or overriding models and controllers |