Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 2861 Bytes
1 | module Admin::BaseHelper |
2 | |
3 | def render_flash |
4 | output = [] |
5 | |
6 | for key,value in @flash |
7 | output << "<span class=\"#{key.downcase}\">#{value}</span>" |
8 | end if @flash |
9 | |
10 | output.join("<br/>\n") |
11 | end |
12 | |
13 | def render_tasks |
14 | output = [] |
15 | |
16 | for key,value in @tasks |
17 | output << "<a href=\"#{value}\">#{key}</a>" |
18 | end if @tasks |
19 | |
20 | output.join("<br/>\n") |
21 | end |
22 | |
23 | def current_user_notice |
24 | unless session[:user] |
25 | link_to "log in", :controller => "/accounts", :action=>"login" |
26 | else |
27 | link_to "log out", :controller => "/accounts", :action=>"logout" |
28 | end |
29 | end |
30 | |
31 | def tab(label, options = {}) |
32 | if controller.controller_name =~ /#{options[:controller].split('/').last}/ |
33 | content_tag :li, link_to(label, options, {"class"=> "active"}), {"class"=> "active"} |
34 | else |
35 | content_tag :li, link_to(label, options) |
36 | end |
37 | end |
38 | |
39 | def cancel(url = {:action => 'list'}) |
40 | link_to "Cancel", url |
41 | end |
42 | |
43 | def save(val = "Store") |
44 | '<input type="submit" value="' + val + '" class="primary" />' |
45 | end |
46 | |
47 | def confirm_delete(val = "Delete") |
48 | '<input type="submit" value="' + val + '" />' |
49 | end |
50 | |
51 | def link_to_show(record) |
52 | link_to image_tag('go'), :action => 'show', :id => record.id |
53 | end |
54 | |
55 | def link_to_edit(record) |
56 | link_to image_tag('go'), :action => 'edit', :id => record.id |
57 | end |
58 | |
59 | def link_to_destroy(record) |
60 | link_to image_tag('delete'), :action => 'destroy', :id => record.id |
61 | end |
62 | |
63 | def text_filter_options |
64 | text_filter_options = Array.new |
65 | text_filter_options << [ 'None', 'none' ] |
66 | text_filter_options << [ 'Textile', 'textile' ] if defined?(RedCloth) |
67 | text_filter_options << [ 'Markdown', 'markdown' ] if defined?(BlueCloth) |
68 | text_filter_options << [ 'SmartyPants', 'smartypants' ] if defined?(RubyPants) |
69 | text_filter_options << [ 'Markdown with SmartyPants', 'markdown smartypants' ] if defined?(RubyPants) and defined?(BlueCloth) |
70 | text_filter_options |
71 | end |
72 | |
73 | def alternate_class |
74 | @class = @class != '' ? '' : 'class="shade"' |
75 | end |
76 | |
77 | def task_quickpost(title) |
78 | content_tag :li, link_to_function(title, toggle_effect('quick-post', 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
79 | end |
80 | |
81 | def task_quicknav(title) |
82 | content_tag :li, link_to_function(title, toggle_effect('quick-navigate', 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
83 | end |
84 | |
85 | def task_overview |
86 | task('Back to overview', 'list') |
87 | end |
88 | |
89 | def task_new(title) |
90 | task(title, 'new') |
91 | end |
92 | |
93 | def task_destroy(title, id) |
94 | task(title, 'destroy', id) |
95 | end |
96 | |
97 | def task_edit(title, id) |
98 | task(title, 'edit', id) |
99 | end |
100 | |
101 | def task_show(title, id) |
102 | task(title, 'show', id) |
103 | end |
104 | |
105 | def task(title, action, id = nil) |
106 | content_tag :li, link_to(title, :action => action, :id => id) |
107 | end |
108 | |
109 | end |