Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1112 Bytes
1 | class Theme |
2 | cattr_accessor :cache_theme_lookup |
3 | @@cache_theme_lookup = false |
4 | |
5 | attr_accessor :name, :path, :description_html |
6 | |
7 | def initialize(name, path) |
8 | @name, @path = name, path |
9 | end |
10 | |
11 | def layout |
12 | "../../themes/#{name}/layouts/default" |
13 | end |
14 | |
15 | def description |
16 | File.read("#{path}/about.markdown") rescue "### #{name}" |
17 | end |
18 | |
19 | # Find a theme, given the theme name |
20 | def self.find(name) |
21 | self.new(name,theme_path(name)) |
22 | end |
23 | |
24 | def self.themes_root |
25 | RAILS_ROOT + "/themes" |
26 | end |
27 | |
28 | def self.theme_path(name) |
29 | themes_root + "/" + name |
30 | end |
31 | |
32 | def self.theme_from_path(path) |
33 | name = path.scan(/[-\w]+$/i).flatten.first |
34 | self.new(name, path) |
35 | end |
36 | |
37 | def self.find_all |
38 | installed_themes.inject([]) do |array, path| |
39 | array << theme_from_path(path) |
40 | end |
41 | end |
42 | |
43 | def self.installed_themes |
44 | cache_theme_lookup ? @theme_cache ||= search_theme_directory : search_theme_directory |
45 | end |
46 | |
47 | def self.search_theme_directory |
48 | glob = "#{themes_root}/[a-zA-Z0-9]*" |
49 | Dir.glob(glob).select do |file| |
50 | File.readable?("#{file}/about.markdown") |
51 | end.compact |
52 | end |
53 | end |