Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 71
- Log:
Start of upgrade to Typo 4.0.0, the latest stable release since
2.6.0. Note test/mocks/themes/azure changes from a file to a
directory, so the file has been removed in this revision and
the directory will be added in the next revision.
- Author:
- adh
- Date:
- Mon Aug 07 22:18:11 +0100 2006
- Size:
- 2726 Bytes
1 | # The methods added to this helper will be available to all templates in the application. |
2 | require 'digest/sha1' |
3 | |
4 | module ApplicationHelper |
5 | def server_url_for(options = {}) |
6 | url_for options.update(:only_path => false) |
7 | end |
8 | |
9 | def config_value(name) |
10 | this_blog[name] |
11 | end |
12 | |
13 | def config |
14 | this_blog |
15 | end |
16 | |
17 | def item_link(title, item, anchor=nil) |
18 | link_to title, item.location(anchor) |
19 | end |
20 | |
21 | alias_method :article_link, :item_link |
22 | alias_method :page_link, :item_link |
23 | alias_method :comment_url_link, :item_link |
24 | |
25 | def url_of(item, only_path=true, anchor=nil) |
26 | item.location(anchor, only_path) |
27 | end |
28 | |
29 | alias_method :trackback_url, :url_of |
30 | alias_method :comment_url, :url_of |
31 | alias_method :article_url, :url_of |
32 | alias_method :page_url, :url_of |
33 | |
34 | def pluralize(size, word) |
35 | case size |
36 | when 0 then "no #{word}s" |
37 | when 1 then "1 #{word}" |
38 | else "#{size} #{word}s" |
39 | end |
40 | end |
41 | |
42 | def comments_link(article) |
43 | article_link(pluralize(article.comments.size, "comment"), |
44 | article, 'comments') |
45 | end |
46 | |
47 | def trackbacks_link(article) |
48 | article_link(pluralize(article.trackbacks.size, "trackback"), |
49 | article, 'trackbacks') |
50 | end |
51 | |
52 | def check_cache(aggregator, *args) |
53 | hash = "#{aggregator.to_s}_#{args.collect { |arg| Digest::SHA1.hexdigest(arg) }.join('_') }".to_sym |
54 | controller.cache[hash] ||= aggregator.new(*args) |
55 | end |
56 | |
57 | def js_distance_of_time_in_words_to_now(date) |
58 | time = date.utc.strftime("%a, %d %b %Y %H:%M:%S GMT") |
59 | "<span class=\"typo_date\" title=\"#{time}\">#{time}</span>" |
60 | end |
61 | |
62 | def meta_tag(name, value) |
63 | tag :meta, :name => name, :content => value unless value.blank? |
64 | end |
65 | |
66 | def date(date) |
67 | "<span class=\"typo_date\">#{date.utc.strftime("%d. %b")}</span>" |
68 | end |
69 | |
70 | def render_theme(options) |
71 | options[:controller]=Themes::ThemeController.active_theme_name |
72 | render_component(options) |
73 | end |
74 | |
75 | def toggle_effect(domid, true_effect, true_opts, false_effect, false_opts) |
76 | "$('#{domid}').style.display == 'none' ? new #{false_effect}('#{domid}', {#{false_opts}}) : new #{true_effect}('#{domid}', {#{true_opts}}); return false;" |
77 | end |
78 | |
79 | def article_html(article, what = :all) |
80 | article.html(@controller, what) |
81 | end |
82 | |
83 | def comment_html(comment) |
84 | comment.html(@controller, :body) |
85 | end |
86 | |
87 | def page_html(page) |
88 | page.html(@controller,:body) |
89 | end |
90 | |
91 | def strip_html(text) |
92 | text.strip_html |
93 | end |
94 | |
95 | def markup_help_popup(markup, text) |
96 | if markup and markup.commenthelp.size > 1 |
97 | "<a href=\"#{url_for :controller => '/articles', :action => 'markup_help', :id => markup.id}\" onClick=\"return popup(this, 'Typo Markup Help')\">#{text}</a>" |
98 | else |
99 | '' |
100 | end |
101 | end |
102 | end |