Skip to content
This repository
Newer
Older
100644 37 lines (22 sloc) 3.309 kb
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
1 = Themes
2
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
3 Themes let you customize the appearance of your Calagator instance. This directory contains the default theme and you'll add other themes into here.
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
4
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
5 == Setup
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
6
527e52da »
2011-05-24 Improved theme documentation
7 You need to do a few things to tell your server what theme to use:
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
8
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
9 1. Pick a name for your theme, such as "mysite".
527e52da »
2011-05-24 Improved theme documentation
10 2. Create a theme configuration file at "config/theme.txt" containing only your theme name. This tells Calagator which theme it should use. You probably shouldn't add this file to version control because it's a run-time server setting like your secrets file, but don't forget to deploy this file to your production server.
11 3. You can also set or override this setting through the "THEME" environment variable, e.g. "THEME=mysite script/server". This should be used for testing other themes during development, not for setting your theme in production.
12 4. You'll need to restart your Calagator instance after creating or changing the "config/theme.txt" file. However, once it's restarted, any changes you make within your theme will be reloaded automatically if you're using the default Rails "development" environment.
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
13
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
14 == Creating a theme
5fa8116a »
2009-01-24 Updated environment.rb to use the new settings/secrets/themes.
15
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
16 You need to create the actual theme:
9f5c2960 »
2011-05-13 THEME: Added partial to describe appropriate content for your site. S…
17
527e52da »
2011-05-24 Improved theme documentation
18 1. Copy the default theme to create your own (e.g. copy "themes/default" to "themes/mysite" to create a new "mysite" theme). You should add the files in this directory to version control for your Calagtor instance's fork.
19 2. Edit the theme's settings file (e.g. "themes/mysite/settings.yml") to specify where your server is, what it's called and such. The default theme's settings file is full of comments that will explain how to change it.
20 3. Your Calagator instance loads the theme's settings on startup, so if you change them, you will need to restart.
9f5c2960 »
2011-05-13 THEME: Added partial to describe appropriate content for your site. S…
21
fb09f3cd »
2011-05-23 THEME: Improve theming documentation, made it clearer and more detailed.
22 == Customizing content
23
24 You need to customize some content in your theme:
25
26 * "themes/YOUR_THEME/views/site/about.html.erb" -- Describe in detail what your site is about, who runs it, how to use it, etc.
27 * "themes/YOUR_THEME/views/site/_appropriateness.html.erb" -- Describe what is appropriate content for your site, this message will be shown on the "Add event" and "Import event(s)" pages.
28 * "themes/YOUR_THEME/views/site/_description.html.erb" -- Describe briefly what your site is about in the sidebar on the homepage.
29
30 == Maintaining compatibility
31
32 You should try to maintain compatibility between your custom theme and future Calagator releases. If you're running only stable releases, please read the CHANGES.md entries mentioning "[THEME]" because they will describe new features and changes to the theming system that you may need to incorporate into your theme. If you're running development releases, e.g. pulling from the "master" branch, then you should pay close attention to commits that mention "THEME" in them, and may also want to view changes made to the "default" theme by running "git log -p themes/default/".
33
34 == Future
35
36 We recognize that putting complex logic into the theme is a bad idea. Unfortunately, this was the easiest way to build it and works well enough. In the future, we'd like to redo the theming from scratch so that the logic lives in the app and the theme just displays the data provided to it using a well-defined API. This probably won't happen any time soon though, so if you'd like to either do this work or sponsor it, please get in touch.
Something went wrong with that request. Please try again.