diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ADMIN.md | 19 | ||||
-rw-r--r-- | doc/INSTALL.md | 9 | ||||
-rw-r--r-- | doc/THEME-ASSETS-UPGRADE.md | 74 | ||||
-rw-r--r-- | doc/TRANSLATE.md | 2 |
4 files changed, 79 insertions, 25 deletions
diff --git a/doc/ADMIN.md b/doc/ADMIN.md deleted file mode 100644 index 6248e6cfc..000000000 --- a/doc/ADMIN.md +++ /dev/null @@ -1,19 +0,0 @@ -Doing development work on the administration interface -====================================================== - -The Alaveteli admin interface uses Twitter's Bootstrap project to prettify it. - -If you want to work on the CSS, you'll want to use -[bootstrap-sass](https://github.com/thomas-mcdonald/bootstrap-sass). Do something like: - - - $ gem install bootstrap-sass - $ gem install compass - $ compass compile --config .compass/config.rb - -To change the JavaScript, edit `public/admin/javascripts/admin.coffee` -and then run: - - $ coffee -c public/admin/javascripts/admin.coffee - -That will update `public/admin/javascripts/admin.js`.
\ No newline at end of file diff --git a/doc/INSTALL.md b/doc/INSTALL.md index f39789936..3decb53a3 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -15,11 +15,10 @@ This creates an instance that runs in development mode, so we wouldn't recommend you use it for a production system without changing the configuration. -If you haven't used Amazon Web Services before, then you can get -a Micro instance which will be -[free for a year](http://aws.amazon.com/free/). You will find -that a micro instance isn't powerful enough for anything other -very basic testing of Alaveteli, however. +Unfortunately, Alaveteli will not run properly on a free Micro +instance due to the low amount of memory available on those +instances; you will need to use at least a Small instance, which +Amazon will charge for. The AMI can be found in the EU West (Ireland) region, with the ID ami-0f24c678 and name “Basic Alaveteli installation diff --git a/doc/THEME-ASSETS-UPGRADE.md b/doc/THEME-ASSETS-UPGRADE.md new file mode 100644 index 000000000..2c6e49986 --- /dev/null +++ b/doc/THEME-ASSETS-UPGRADE.md @@ -0,0 +1,74 @@ +This document has notes on switching your Alaveteli theme to use +the Rails asset pipeline. + +Firstly, add the following to your `lib/alavetelitheme.rb`, in +order to add the subdirectories of your theme's `assets` +directory to `config.assets.path`: + + # Prepend the asset directories in this theme to the asset path: + ['stylesheets', 'images', 'javascripts'].each do |asset_type| + theme_asset_path = File.join(File.dirname(__FILE__), + '..', + 'assets', + asset_type) + Rails.application.config.assets.paths.unshift theme_asset_path + end + +In the root of your theme, create these directories: + + assets + \ images + \ stylesheets + \ javascripts + +i.e. `assets` is at the same level as `lib` and `locale-theme`. + +Move any image files from `public/images` to `assets/images`. +Now change any references to those images with a literal `<img>` +tag to use `image_tag` instead. For example, instead of: + + <img src="/images/helpmeinvestigate.png" alt="" class="rss"> + +... you should have: + + image_tag('helpmeinvestigate.png', :alt => "", :class => "rss") + +You should similarly move your stylesheets into +`assets/stylesheets`. If a stylesheet refers to images, you +should rename the `.css` file to `.css.scss`, and change `url` +to the sass-rails `image-url` helper. e.g. instead of: + + background-image: url(../images/mysociety.png); + +... you should have: + + background-image: image-url('mysociety.png'); + +If your only stylesheet is called `custom.css`, as in the +example theme, you shouldn't need to make any other changes to +the CSS. If you have added additional stylesheets +(e.g. `extra.css`), then you'll need to both: + +1. add them to +`lib/views/general/_stylesheet_includes.html.erb`, for example +with: + + <%= stylesheet_link_tag "extra" %> + +2. add the following in `lib/alavetelitheme.rb`: + + config.assets.precompile.push 'extra.css' + +Any custom Javascript should be moved to `assets/javascripts` in +your theme directory, and, simlarly to the additional CSS, it +should be mentioned in `lib/alavetelitheme.rb` with: + + config.assets.precompile.push 'fancy-effects.js' + +You should be left with nothing in the `public` directory after +making these changes, except possibly custom error pages. + +Remove the code that symlinks the theme 'public' directory to a +subdirectory of the main application's 'public' directory from +install.rb. Also remove the code from uninstall.rb that removes that +symlink. The asset pipeline will handle making assets available. diff --git a/doc/TRANSLATE.md b/doc/TRANSLATE.md index 2a8b0269e..aef2cfdc9 100644 --- a/doc/TRANSLATE.md +++ b/doc/TRANSLATE.md @@ -79,7 +79,7 @@ must: language, using `bundle exec rake gettext:store_model_attributes`, followed by `bundle exec rake gettext:find` - * careful of including msgids from themes in `vendor/plugin`; + * careful of including msgids from themes in `lib/themes`; you might want to move them out of the way before running the above commands * this updates the PO template, but also merges it with the |