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:
- 3498 Bytes
1 | module Admin::BaseHelper |
2 | include ActionView::Helpers::DateHelper |
3 | |
4 | def state_class(item) |
5 | item.state.memento.underscore.sub(/.*\//, '') |
6 | end |
7 | |
8 | def render_flash |
9 | output = [] |
10 | |
11 | for key,value in flash |
12 | output << "<span class=\"#{key.to_s.downcase}\">#{value}</span>" |
13 | end if flash |
14 | |
15 | output.join("<br/>\n") |
16 | end |
17 | |
18 | def render_tasks |
19 | output = [] |
20 | |
21 | for key,value in @tasks |
22 | output << "<a href=\"#{value}\">#{key}</a>" |
23 | end if @tasks |
24 | |
25 | output.join("<br />\n") |
26 | end |
27 | |
28 | def current_user_notice |
29 | unless session[:user] |
30 | link_to "log in", :controller => "/accounts", :action=>"login" |
31 | else |
32 | link_to "log out", :controller => "/accounts", :action=>"logout" |
33 | end |
34 | end |
35 | |
36 | def tab(label, options = {}) |
37 | if controller.controller_name =~ /#{options[:controller].split('/').last}/ |
38 | content_tag :li, link_to(label, options, {"class"=> ""}), {"class"=> ""} |
39 | else |
40 | content_tag :li, link_to(label, options) |
41 | end |
42 | end |
43 | |
44 | def cancel(url = {:action => 'list'}) |
45 | link_to "Cancel", url |
46 | end |
47 | |
48 | def save(val = "Store") |
49 | '<input type="submit" value="' + val + '" class="primary" />' |
50 | end |
51 | |
52 | def confirm_delete(val = "Delete") |
53 | '<input type="submit" value="' + val + '" />' |
54 | end |
55 | |
56 | def link_to_show(record) |
57 | link_to image_tag('go.png'), :action => 'show', :id => record.id |
58 | end |
59 | |
60 | def link_to_edit(record) |
61 | link_to image_tag('edit.png', :alt => "edit", :title => "Edit content"), :action => 'edit', :id => record.id |
62 | end |
63 | |
64 | def link_to_destroy(record) |
65 | link_to image_tag('delete.png', :alt => "delete", :title => "Delete content"), :action => 'destroy', :id => record.id |
66 | end |
67 | |
68 | def text_filter_options |
69 | TextFilter.find(:all).collect do |filter| |
70 | [ filter.description, filter ] |
71 | end |
72 | end |
73 | |
74 | def alternate_class |
75 | @class = @class != '' ? '' : 'class="shade"' |
76 | end |
77 | |
78 | def reset_alternation |
79 | @class = nil |
80 | end |
81 | |
82 | def task_quickpost(title) |
83 | content_tag :li, link_to_function(title, toggle_effect('quick-post', 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
84 | end |
85 | |
86 | def task_quicknav(title) |
87 | content_tag :li, link_to_function(title, toggle_effect('quick-navigate', 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
88 | end |
89 | |
90 | def task_overview |
91 | task('Back to overview', 'list') |
92 | end |
93 | |
94 | def task_new(title) |
95 | task(title, 'new') |
96 | end |
97 | |
98 | def task_destroy(title, id) |
99 | task(title, 'destroy', id) |
100 | end |
101 | |
102 | def task_edit(title, id) |
103 | task(title, 'edit', id) |
104 | end |
105 | |
106 | def task_show(title, id) |
107 | task(title, 'show', id) |
108 | end |
109 | |
110 | def task_help(title, id) |
111 | task(title, 'show_help', id) |
112 | end |
113 | |
114 | def task(title, action, id = nil) |
115 | content_tag :li, link_to(title, :action => action, :id => id) |
116 | end |
117 | |
118 | def task_add_resource_metadata(title,id) |
119 | link_to_function(title, toggle_effect('add-resource-metadata-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
120 | end |
121 | |
122 | def task_edit_resource_metadata(title,id) |
123 | link_to_function(title, toggle_effect('edit-resource-metadata-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
124 | end |
125 | |
126 | def task_edit_resource_mime(title,id) |
127 | link_to_function(title, toggle_effect('edit-resource-mime-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) |
128 | end |
129 | |
130 | def time_delta_from_now_in_words(timestamp) |
131 | distance_of_time_in_words_to_now(timestamp) + ((Time.now < timestamp) ? ' from now' : ' ago') |
132 | end |
133 | end |