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:
- 1408 Bytes
1 | class ArchivesSidebar < Sidebar |
2 | description 'Displays links to monthly archives' |
3 | setting :show_count, true, :label => 'Show article counts', :input_type => :checkbox |
4 | setting :count, 10, :label => 'Number of Months' |
5 | |
6 | attr_accessor :archives |
7 | |
8 | def parse_request(contents, params) |
9 | # The original query that was here instantiated every article and every |
10 | # tag, and then sorted through them just to do a 'group by date'. |
11 | # Unfortunately, there's no universally-supported way to do this |
12 | # across all three of our supported DBs. So, we resort to a bit of |
13 | # DB-specific code. |
14 | if Content.connection.kind_of? ActiveRecord::ConnectionAdapters::SQLiteAdapter |
15 | date_func = "strftime('%Y', published_at) as year, strftime('%m', published_at) as month" |
16 | else |
17 | date_func = "extract(year from published_at) as year,extract(month from published_at) as month" |
18 | end |
19 | |
20 | article_counts = Content.find_by_sql(["select count(*) as count, #{date_func} from contents where type='Article' and published = ? and published_at < ? group by year,month order by year desc,month desc limit ? ",true,Time.now,count.to_i]) |
21 | |
22 | @archives = article_counts.map do |entry| |
23 | { |
24 | :name => "#{Date::MONTHNAMES[entry.month.to_i]} #{entry.year}", |
25 | :month => entry.month.to_i, |
26 | :year => entry.year.to_i, |
27 | :article_count => entry.count |
28 | } |
29 | end |
30 | end |
31 | end |