Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 171
- Log:
Initial import of Beast 0.9 from downloaded Tarball. Beast is a Ruby
On Rails based forum application. The original tarball came from the
following location:http://s3.amazonaws.com/beast-forum/beast-0.9.tar.gz
The forum post which announced this version's availability was at:
http://beast.caboo.se/forums/1/topics/446
- Author:
- rool
- Date:
- Fri Mar 02 15:51:55 +0000 2007
- Size:
- 2435 Bytes
1 | require 'md5' |
2 | |
3 | module ApplicationHelper |
4 | |
5 | def submit_tag(value = "Save Changes", options={} ) |
6 | or_option = options.delete(:or) |
7 | return super + "<span class='button_or'>or " + or_option + "</span>" if or_option |
8 | super |
9 | end |
10 | |
11 | def ajax_spinner_for(id, spinner="spinner.gif") |
12 | "<img src='/images/#{spinner}' style='display:none; vertical-align:middle;' id='#{id.to_s}_spinner'> " |
13 | end |
14 | |
15 | def avatar_for(user, size=32) |
16 | image_tag "http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.md5(user.email)}&rating=PG&size=#{size}", :size => "#{size}x#{size}", :class => 'photo' |
17 | end |
18 | |
19 | def feed_icon_tag(title, url) |
20 | (@feed_icons ||= []) << { :url => url, :title => title } |
21 | link_to image_tag('feed-icon', :size => '14x14', :alt => "Subscribe to #{title}"), url |
22 | end |
23 | |
24 | def format_text(text) |
25 | white_list(RedCloth.new(auto_link(text.to_s)).to_html) |
26 | end |
27 | |
28 | def search_posts_title |
29 | returning (params[:q].blank? ? 'Recent Posts' : "Searching for '#{h params[:q]}'") do |title| |
30 | title << " by #{h User.find(params[:user_id]).display_name}" if params[:user_id] |
31 | title << " in #{h Forum.find(params[:forum_id]).name}" if params[:forum_id] |
32 | end |
33 | end |
34 | |
35 | def search_posts_path(rss = false) |
36 | options = params[:q].blank? ? {} : {:q => params[:q]} |
37 | options[:format] = 'rss' if rss |
38 | [[:user, :user_id], [:forum, :forum_id]].each do |(route_key, param_key)| |
39 | return send("#{route_key}_posts_path", options.update(param_key => params[param_key])) if params[param_key] |
40 | end |
41 | all_posts_path(options) |
42 | end |
43 | |
44 | def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false) |
45 | from_time = from_time.to_time if from_time.respond_to?(:to_time) |
46 | to_time = to_time.to_time if to_time.respond_to?(:to_time) |
47 | distance_in_minutes = (((to_time - from_time).abs)/60).round |
48 | |
49 | case distance_in_minutes |
50 | when 0..1 then (distance_in_minutes==0) ? 'a few seconds ago' : '1 minute ago' |
51 | when 2..59 then "#{distance_in_minutes} minutes ago" |
52 | when 60..90 then "1 hour ago" |
53 | when 90..1440 then "#{(distance_in_minutes.to_f / 60.0).round} hours ago" |
54 | when 1440..2160 then '1 day ago' # 1 day to 1.5 days |
55 | when 2160..2880 then "#{(distance_in_minutes.to_f / 1440.0).round} days ago" # 1.5 days to 2 days |
56 | else from_time.strftime("%b %e, %Y %l:%M%p").gsub(/([AP]M)/) { |x| x.downcase } |
57 | end |
58 | end |
59 | |
60 | end |