savage-beast 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/README.rdoc +42 -0
- data/Rakefile +25 -0
- data/VERSION +1 -0
- data/app/controllers/application.rb +6 -0
- data/app/controllers/beast_application_controller.rb +3 -0
- data/app/controllers/forums_controller.rb +64 -0
- data/app/controllers/moderators_controller.rb +10 -0
- data/app/controllers/monitorships_controller.rb +22 -0
- data/app/controllers/posts_controller.rb +134 -0
- data/app/controllers/topics_controller.rb +110 -0
- data/app/helpers/count_helper.rb +13 -0
- data/app/helpers/forums_helper.rb +15 -0
- data/app/helpers/moderators_helper.rb +2 -0
- data/app/helpers/monitorships_helper.rb +2 -0
- data/app/helpers/posts_helper.rb +3 -0
- data/app/helpers/topics_helper.rb +3 -0
- data/app/models/forum.rb +26 -0
- data/app/models/moderatorship.rb +6 -0
- data/app/models/monitorship.rb +5 -0
- data/app/models/monitorships_sweeper.rb +9 -0
- data/app/models/post.rb +33 -0
- data/app/models/posts_sweeper.rb +12 -0
- data/app/models/topic.rb +94 -0
- data/app/views/forums/_form.html.erb +21 -0
- data/app/views/forums/edit.html.erb +12 -0
- data/app/views/forums/index.html.erb +77 -0
- data/app/views/forums/new.html.erb +10 -0
- data/app/views/forums/show.html.erb +94 -0
- data/app/views/layouts/_head.html.erb +34 -0
- data/app/views/layouts/_post.rss.builder +9 -0
- data/app/views/layouts/application.html.erb +29 -0
- data/app/views/layouts/beast.html.erb +29 -0
- data/app/views/monitorships/create.js.rjs +4 -0
- data/app/views/monitorships/destroy.js.rjs +4 -0
- data/app/views/posts/_edit.html.erb +38 -0
- data/app/views/posts/edit.html.erb +14 -0
- data/app/views/posts/edit.js.rjs +6 -0
- data/app/views/posts/index.html.erb +53 -0
- data/app/views/posts/index.rss.builder +20 -0
- data/app/views/posts/monitored.html.erb +55 -0
- data/app/views/posts/monitored.rss.builder +15 -0
- data/app/views/posts/update.js.rjs +3 -0
- data/app/views/topics/_form.html.erb +28 -0
- data/app/views/topics/edit.html.erb +10 -0
- data/app/views/topics/index.html.erb +2 -0
- data/app/views/topics/new.html.erb +18 -0
- data/app/views/topics/show.html.erb +183 -0
- data/app/views/topics/show.rss.builder +16 -0
- data/config/routes.rb +18 -0
- data/generators/beast/beast_generator.rb +88 -0
- data/generators/beast/templates/migrations/create_savage_tables.rb +73 -0
- data/generators/beast/templates/public/images/clearbits/_readme.txt +12 -0
- data/generators/beast/templates/public/images/clearbits/add.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/addressbook.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/alert.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/apple.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow1_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow2_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_e.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_n.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_s.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/arrow3_w.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ascii.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/back.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_blank.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_circle.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_ne.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_nw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_se.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bg_rounded_sw.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bigsmile.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/binary.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/blah.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/bstop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/buy.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/calday.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/calendar.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/camera.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cart.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cd.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cellphone.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/chat.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/check.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/close.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/comment.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/cube.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/day.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/denied.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/document.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/download.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/edit.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/eject.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/equalizer.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/first.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/flag.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/flash.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/folder.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/forward.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/frown.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ftp.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/graph.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/heart.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/home.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/html.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/ipod.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/last.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/lock.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/loop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mail.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/man.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/manman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/music.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mute.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/mute_centered.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/newwindow.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/next.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/night.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/open.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/pause.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/phone.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/play.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/previous.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/quicktime.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/redo.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/reload.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/sad.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/save.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/scream.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/search.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/seconds.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/smile.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/smirk.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/star.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/stop.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/subtract.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/switch.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/target.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tcp.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/time.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/toggle.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tongue.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tools.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/trackback.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/trash.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/tv.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/type.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/undo.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/unlock.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/upload.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/user.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/video.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/volume_high.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/volume_low.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/wifi.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/window.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/woman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/womanman.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/work.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/zoomin.gif +0 -0
- data/generators/beast/templates/public/images/clearbits/zoomout.gif +0 -0
- data/generators/beast/templates/public/images/feed-icon.png +0 -0
- data/generators/beast/templates/public/images/rails.png +0 -0
- data/generators/beast/templates/public/images/reply_background.png +0 -0
- data/generators/beast/templates/public/images/small_circle.gif +0 -0
- data/generators/beast/templates/public/images/spinner.gif +0 -0
- data/generators/beast/templates/public/images/spinner_black.gif +0 -0
- data/generators/beast/templates/public/images/spinner_bounce.gif +0 -0
- data/generators/beast/templates/public/javascripts/beast.js +80 -0
- data/generators/beast/templates/public/stylesheets/display.css +941 -0
- data/lang/en.yml +206 -0
- data/lib/beast.rb +79 -0
- data/lib/savage_beast/application_helper.rb +91 -0
- data/lib/savage_beast/authentication_system.rb +47 -0
- data/lib/savage_beast/user_init.rb +79 -0
- data/lib/tasks/capistrano.rake +90 -0
- data/lib/tasks/deploy_edge.rake +44 -0
- data/lib/tasks/savage_beast.rake +133 -0
- data/po/beast.pot +712 -0
- data/po/nl/beast.po +700 -0
- data/tested_plugins/acts_as_list/README +23 -0
- data/tested_plugins/acts_as_list/init.rb +3 -0
- data/tested_plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
- data/tested_plugins/acts_as_list/test/list_test.rb +332 -0
- data/tested_plugins/gibberish/LICENSE +18 -0
- data/tested_plugins/gibberish/README +118 -0
- data/tested_plugins/gibberish/Rakefile +14 -0
- data/tested_plugins/gibberish/init.rb +3 -0
- data/tested_plugins/gibberish/lang/es.yml +3 -0
- data/tested_plugins/gibberish/lang/fr.yml +3 -0
- data/tested_plugins/gibberish/lib/gibberish.rb +8 -0
- data/tested_plugins/gibberish/lib/gibberish/localize.rb +88 -0
- data/tested_plugins/gibberish/lib/gibberish/string_ext.rb +17 -0
- data/tested_plugins/gibberish/test/gibberish_test.rb +203 -0
- data/tested_plugins/gibberish/test/lang/es.yml +1 -0
- data/tested_plugins/gibberish/test/lang/fr.yml +1 -0
- data/tested_plugins/mislav-will_paginate/CHANGELOG.rdoc +110 -0
- data/tested_plugins/mislav-will_paginate/LICENSE +18 -0
- data/tested_plugins/mislav-will_paginate/README.rdoc +107 -0
- data/tested_plugins/mislav-will_paginate/Rakefile +53 -0
- data/tested_plugins/mislav-will_paginate/examples/apple-circle.gif +0 -0
- data/tested_plugins/mislav-will_paginate/examples/index.haml +69 -0
- data/tested_plugins/mislav-will_paginate/examples/index.html +92 -0
- data/tested_plugins/mislav-will_paginate/examples/pagination.css +90 -0
- data/tested_plugins/mislav-will_paginate/examples/pagination.sass +91 -0
- data/tested_plugins/mislav-will_paginate/init.rb +1 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate.rb +78 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/array.rb +16 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/collection.rb +146 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/core_ext.rb +32 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/finder.rb +264 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope.rb +170 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/named_scope_patch.rb +37 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/version.rb +9 -0
- data/tested_plugins/mislav-will_paginate/lib/will_paginate/view_helpers.rb +402 -0
- data/tested_plugins/mislav-will_paginate/test/boot.rb +21 -0
- data/tested_plugins/mislav-will_paginate/test/collection_test.rb +143 -0
- data/tested_plugins/mislav-will_paginate/test/console +8 -0
- data/tested_plugins/mislav-will_paginate/test/database.yml +22 -0
- data/tested_plugins/mislav-will_paginate/test/finder_test.rb +476 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/admin.rb +3 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/developer.rb +14 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/developers_projects.yml +13 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/project.rb +15 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/projects.yml +6 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/replies.yml +29 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/reply.rb +7 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/schema.rb +38 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/topic.rb +10 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/topics.yml +30 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/user.rb +2 -0
- data/tested_plugins/mislav-will_paginate/test/fixtures/users.yml +35 -0
- data/tested_plugins/mislav-will_paginate/test/helper.rb +40 -0
- data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_case.rb +43 -0
- data/tested_plugins/mislav-will_paginate/test/lib/activerecord_test_connector.rb +75 -0
- data/tested_plugins/mislav-will_paginate/test/lib/load_fixtures.rb +11 -0
- data/tested_plugins/mislav-will_paginate/test/lib/view_test_process.rb +178 -0
- data/tested_plugins/mislav-will_paginate/test/tasks.rake +59 -0
- data/tested_plugins/mislav-will_paginate/test/view_test.rb +365 -0
- data/tested_plugins/white_list/README +29 -0
- data/tested_plugins/white_list/Rakefile +22 -0
- data/tested_plugins/white_list/init.rb +2 -0
- data/tested_plugins/white_list/lib/white_list_helper.rb +97 -0
- data/tested_plugins/white_list/test/white_list_test.rb +132 -0
- data/tested_plugins/white_list_formatted_content/init.rb +27 -0
- metadata +322 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
2
|
+
|
3
|
+
xml.rss "version" => "2.0",
|
4
|
+
'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
|
5
|
+
'xmlns:atom' => "http://www.w3.org/2005/Atom" do
|
6
|
+
xml.channel do
|
7
|
+
xml.title "Recent Posts in '{topic}' | Beast"[:recent_posts_in_topic,@topic.title]
|
8
|
+
xml.link forum_topic_url # implicitly uses (@forum, @topic)
|
9
|
+
xml.language "en-us"[:feed_language]
|
10
|
+
xml.ttl "60"
|
11
|
+
xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port+request.relative_url_root}/open_search.xml"
|
12
|
+
xml.description @topic.body
|
13
|
+
|
14
|
+
render :partial => "layouts/post", :collection => @posts, :locals => {:xm => xml}
|
15
|
+
end
|
16
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
map.resources :posts, :name_prefix => 'all_', :collection => { :search => :get }
|
3
|
+
map.resources :forums, :topics, :posts, :monitorship
|
4
|
+
|
5
|
+
%w(forum).each do |attr|
|
6
|
+
map.resources :posts, :name_prefix => "#{attr}_", :path_prefix => "/#{attr.pluralize}/:#{attr}_id"
|
7
|
+
end
|
8
|
+
|
9
|
+
map.resources :forums do |forum|
|
10
|
+
forum.resources :topics do |topic|
|
11
|
+
topic.resources :posts
|
12
|
+
topic.resource :monitorship, :controller => :monitorships
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# screws up default / defined by the application
|
17
|
+
# map.forum_home '', :controller => 'forums', :action => 'index'
|
18
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
# Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
|
4
|
+
|
5
|
+
Rails::Generator::Commands::Base.class_eval do
|
6
|
+
def file_contains?(relative_destination, line)
|
7
|
+
File.read(destination_path(relative_destination)).include?(line)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Rails::Generator::Commands::Create.class_eval do
|
12
|
+
def insert_into(file, line)
|
13
|
+
logger.insert "#{line} into #{file}"
|
14
|
+
unless options[:pretend] || file_contains?(file, line)
|
15
|
+
pattern = if file =~ /routes.rb$/ then /Routes.draw\s+do\s*.+$/ else /^(class|module) .+$/ end
|
16
|
+
gsub_file file, pattern do |match|
|
17
|
+
"#{match}\n #{line}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Rails::Generator::Commands::Destroy.class_eval do
|
24
|
+
def insert_into(file, line)
|
25
|
+
logger.remove "#{line} from #{file}"
|
26
|
+
unless options[:pretend]
|
27
|
+
gsub_file file, "\n #{line}", ''
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Rails::Generator::Commands::List.class_eval do
|
33
|
+
def insert_into(file, line)
|
34
|
+
logger.insert "#{line} into #{file}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class BeastGenerator < Rails::Generator::Base
|
39
|
+
|
40
|
+
def manifest
|
41
|
+
record do |m|
|
42
|
+
m.insert_into "config/routes.rb", <<-'ROUTES'
|
43
|
+
# Savage beast routes BEGIN
|
44
|
+
map.resources :posts, :name_prefix => 'all_', :collection => { :search => :get }
|
45
|
+
map.resources :forums, :topics, :posts, :monitorship
|
46
|
+
|
47
|
+
%w(forum).each do |attr|
|
48
|
+
map.resources :posts, :name_prefix => "#{attr}_", :path_prefix => "/#{attr.pluralize}/:#{attr}_id"
|
49
|
+
end
|
50
|
+
|
51
|
+
map.resources :forums do |forum|
|
52
|
+
forum.resources :topics do |topic|
|
53
|
+
topic.resources :posts
|
54
|
+
topic.resource :monitorship, :controller => :monitorships
|
55
|
+
end
|
56
|
+
end
|
57
|
+
# Savage beast routes END
|
58
|
+
|
59
|
+
ROUTES
|
60
|
+
|
61
|
+
m.insert_into 'app/models/user.rb', 'include SavageBeast::UserInit'
|
62
|
+
m.insert_into 'app/helpers/application_helper.rb', 'include SavageBeast::ApplicationHelper'
|
63
|
+
|
64
|
+
destination_root = "/public/"
|
65
|
+
templates_dir = (Pathname(__FILE__).dirname + 'templates').expand_path
|
66
|
+
|
67
|
+
%w(stylesheets images javascripts).each { |asset|
|
68
|
+
destination_path = destination_root + asset
|
69
|
+
assets_dir = templates_dir + 'public' + asset
|
70
|
+
|
71
|
+
m.directory destination_path + "/savage_beast"
|
72
|
+
|
73
|
+
Pathname.glob(assets_dir + '**' + '*') do |file|
|
74
|
+
destination_file = (assets_dir + 'savage_beast' + file.relative_path_from(assets_dir)).relative_path_from(templates_dir).to_s
|
75
|
+
source_file = file.relative_path_from(templates_dir).to_s
|
76
|
+
|
77
|
+
if file.directory?
|
78
|
+
m.directory destination_file
|
79
|
+
else
|
80
|
+
m.file source_file, destination_file
|
81
|
+
end
|
82
|
+
end
|
83
|
+
}
|
84
|
+
|
85
|
+
m.migration_template "migrations/create_savage_tables.rb", 'db/migrate', :migration_file_name => "create_savage_tables"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
class CreateSavageTables < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "forums" do |t|
|
4
|
+
t.string "name"
|
5
|
+
t.string "description"
|
6
|
+
t.integer "topics_count", :default => 0
|
7
|
+
t.integer "posts_count", :default => 0
|
8
|
+
t.integer "position"
|
9
|
+
t.text "description_html"
|
10
|
+
end
|
11
|
+
|
12
|
+
create_table "moderatorships" do |t|
|
13
|
+
t.integer "forum_id"
|
14
|
+
t.integer "user_id"
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index "moderatorships", ["forum_id"], :name => "index_moderatorships_on_forum_id"
|
18
|
+
|
19
|
+
create_table "monitorships" do |t|
|
20
|
+
t.integer "topic_id"
|
21
|
+
t.integer "user_id"
|
22
|
+
t.boolean "active", :default => true
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table "posts" do |t|
|
26
|
+
t.integer "user_id"
|
27
|
+
t.integer "topic_id"
|
28
|
+
t.text "body"
|
29
|
+
t.datetime "created_at"
|
30
|
+
t.datetime "updated_at"
|
31
|
+
t.integer "forum_id"
|
32
|
+
t.text "body_html"
|
33
|
+
end
|
34
|
+
|
35
|
+
add_index "posts", ["forum_id", "created_at"], :name => "index_posts_on_forum_id"
|
36
|
+
add_index "posts", ["user_id", "created_at"], :name => "index_posts_on_user_id"
|
37
|
+
add_index "posts", ["topic_id", "created_at"], :name => "index_posts_on_topic_id"
|
38
|
+
|
39
|
+
create_table "topics" do |t|
|
40
|
+
t.integer "forum_id"
|
41
|
+
t.integer "user_id"
|
42
|
+
t.string "title"
|
43
|
+
t.datetime "created_at"
|
44
|
+
t.datetime "updated_at"
|
45
|
+
t.integer "hits", :default => 0
|
46
|
+
t.integer "sticky", :default => 0
|
47
|
+
t.integer "posts_count", :default => 0
|
48
|
+
t.datetime "replied_at"
|
49
|
+
t.boolean "locked", :default => false
|
50
|
+
t.integer "replied_by"
|
51
|
+
t.integer "last_post_id"
|
52
|
+
end
|
53
|
+
|
54
|
+
add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
|
55
|
+
add_index "topics", ["forum_id", "sticky", "replied_at"], :name => "index_topics_on_sticky_and_replied_at"
|
56
|
+
add_index "topics", ["forum_id", "replied_at"], :name => "index_topics_on_forum_id_and_replied_at"
|
57
|
+
|
58
|
+
add_column :users, :posts_count, :integer, :default => 0
|
59
|
+
add_column :users, :last_seen_at, :datetime
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.down
|
63
|
+
remove_column :users, :posts_count
|
64
|
+
remove_column :users, :last_seen_at
|
65
|
+
|
66
|
+
drop_table :topics
|
67
|
+
drop_table :posts
|
68
|
+
drop_table :monitorships
|
69
|
+
drop_table :moderatorships
|
70
|
+
drop_table :forums
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Title : Clearbits
|
2
|
+
Designer : P.J. Onori
|
3
|
+
Email : somerandomdude@somerandomdude.net
|
4
|
+
URL : http://www.somerandomdude.net/
|
5
|
+
|
6
|
+
Description : A collection of 16x16 pixel icons for various subjects
|
7
|
+
|
8
|
+
Created : 1/31/06
|
9
|
+
|
10
|
+
|
11
|
+
Use : Consume and enjoy. Please make sure to show some love and be generous with the
|
12
|
+
linkage if you decide to use them.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|