Permalink
Browse files

Initial Commit of Rubyflow from the uploaded file

  • Loading branch information...
0 parents commit 4af11fc67c475d19401aae0fad97873ad66c2a03 @Sutto Sutto committed Jul 23, 2008
Showing with 13,109 additions and 0 deletions.
  1. +12 −0 .gitignore
  2. +27 −0 README.txt
  3. +10 −0 Rakefile
  4. +35 −0 app/controllers/application.rb
  5. +90 −0 app/controllers/categories_controller.rb
  6. +73 −0 app/controllers/comments_controller.rb
  7. +4 −0 app/controllers/home_controller.rb
  8. +168 −0 app/controllers/items_controller.rb
  9. +66 −0 app/controllers/session_controller.rb
  10. +51 −0 app/controllers/users_controller.rb
  11. +43 −0 app/helpers/application_helper.rb
  12. +2 −0 app/helpers/categories_helper.rb
  13. +2 −0 app/helpers/comments_helper.rb
  14. +2 −0 app/helpers/home_helper.rb
  15. +2 −0 app/helpers/items_helper.rb
  16. +2 −0 app/helpers/session_helper.rb
  17. +2 −0 app/helpers/users_helper.rb
  18. +17 −0 app/models/category.rb
  19. +6 −0 app/models/comment.rb
  20. +56 −0 app/models/item.rb
  21. +80 −0 app/models/user.rb
  22. +8 −0 app/views/categories/_part_of_tree.html.erb
  23. +32 −0 app/views/categories/edit.html.erb
  24. +8 −0 app/views/categories/index.html.erb
  25. +31 −0 app/views/categories/new.html.erb
  26. +23 −0 app/views/categories/show.html.erb
  27. +27 −0 app/views/comments/edit.html.erb
  28. +24 −0 app/views/comments/index.html.erb
  29. +21 −0 app/views/comments/new.html.erb
  30. +18 −0 app/views/comments/show.html.erb
  31. +8 −0 app/views/home/_signup_captcha.html.erb
  32. +9 −0 app/views/home/index.html.erb
  33. +6 −0 app/views/items/_item.html.erb
  34. +8 −0 app/views/items/_paginator.html.erb
  35. +14 −0 app/views/items/category.html.erb
  36. +32 −0 app/views/items/edit.html.erb
  37. +12 −0 app/views/items/index.html.erb
  38. +21 −0 app/views/items/index.rss.builder
  39. +9 −0 app/views/items/list_for_tags.html.erb
  40. +28 −0 app/views/items/new.html.erb
  41. +8 −0 app/views/items/search.html.erb
  42. +41 −0 app/views/items/show.html.erb
  43. +17 −0 app/views/layouts/categories.html.erb
  44. +17 −0 app/views/layouts/comments.html.erb
  45. +17 −0 app/views/layouts/items.html.erb
  46. +55 −0 app/views/layouts/main.html.erb
  47. +16 −0 app/views/session/new.html.erb
  48. +15 −0 app/views/users/index.html.erb
  49. +27 −0 app/views/users/new.html.erb
  50. +109 −0 config/boot.rb
  51. +64 −0 config/environment.rb
  52. +18 −0 config/environments/development.rb
  53. +19 −0 config/environments/production.rb
  54. +22 −0 config/environments/test.rb
  55. +10 −0 config/initializers/inflections.rb
  56. +5 −0 config/initializers/mime_types.rb
  57. +15 −0 config/pythonflow.yml
  58. +62 −0 config/routes.rb
  59. +18 −0 config/rubyflow.yml
  60. +22 −0 db/migrate/001_create_users.rb
  61. +9 −0 db/migrate/002_add_admin_flag_to_users.rb
  62. +31 −0 db/migrate/003_add_open_id_authentication_tables.rb
  63. +19 −0 db/migrate/004_create_items.rb
  64. +9 −0 db/migrate/005_change_tags_to_text_on_items.rb
  65. +16 −0 db/migrate/006_create_categories.rb
  66. +16 −0 db/migrate/007_create_comments.rb
  67. +9 −0 db/migrate/008_add_byline_to_item.rb
  68. +9 −0 db/migrate/009_add_comments_count_to_items.rb
  69. +9 −0 db/migrate/010_user_approved_for_feed.rb
  70. +81 −0 db/schema.rb
  71. +124 −0 lib/authenticated_system.rb
  72. +10 −0 lib/authenticated_test_helper.rb
  73. +40 −0 public/.htaccess
  74. +30 −0 public/404.html
  75. +30 −0 public/422.html
  76. +30 −0 public/500.html
  77. +10 −0 public/dispatch.cgi
  78. +24 −0 public/dispatch.fcgi
  79. +10 −0 public/dispatch.rb
  80. 0 public/favicon.ico
  81. BIN public/images/rails.png
  82. +2 −0 public/javascripts/application.js
  83. +963 −0 public/javascripts/controls.js
  84. +972 −0 public/javascripts/dragdrop.js
  85. +1,120 −0 public/javascripts/effects.js
  86. +4,225 −0 public/javascripts/prototype.js
  87. +5 −0 public/robots.txt
  88. +360 −0 public/stylesheets/main.css
  89. +74 −0 public/stylesheets/scaffold.css
  90. +3 −0 script/about
  91. +3 −0 script/console
  92. +3 −0 script/destroy
  93. +3 −0 script/generate
  94. +3 −0 script/performance/benchmarker
  95. +3 −0 script/performance/profiler
  96. +3 −0 script/performance/request
  97. +3 −0 script/plugin
  98. +3 −0 script/process/inspector
  99. +3 −0 script/process/reaper
  100. +3 −0 script/process/spawner
  101. +3 −0 script/runner
  102. +3 −0 script/server
  103. +13 −0 test/fixtures/categories.yml
  104. +11 −0 test/fixtures/comments.yml
  105. +19 −0 test/fixtures/items.yml
  106. +19 −0 test/fixtures/users.yml
  107. +45 −0 test/functional/comments_controller_test.rb
  108. +8 −0 test/functional/home_controller_test.rb
  109. +41 −0 test/functional/items_controller_test.rb
  110. +85 −0 test/functional/session_controller_test.rb
  111. +65 −0 test/functional/users_controller_test.rb
  112. +31 −0 test/integration/stories_test.rb
  113. +39 −0 test/test_helper.rb
  114. +8 −0 test/unit/category_test.rb
  115. +8 −0 test/unit/comment_test.rb
  116. +21 −0 test/unit/item_test.rb
  117. +98 −0 test/unit/user_test.rb
  118. +13 −0 vendor/plugins/acts_as_state_machine/CHANGELOG
  119. +20 −0 vendor/plugins/acts_as_state_machine/MIT-LICENSE
  120. +33 −0 vendor/plugins/acts_as_state_machine/README
  121. +28 −0 vendor/plugins/acts_as_state_machine/Rakefile
  122. +11 −0 vendor/plugins/acts_as_state_machine/TODO
  123. +5 −0 vendor/plugins/acts_as_state_machine/init.rb
  124. +268 −0 vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb
  125. +224 −0 vendor/plugins/acts_as_state_machine/test/acts_as_state_machine_test.rb
  126. +18 −0 vendor/plugins/acts_as_state_machine/test/database.yml
  127. +67 −0 vendor/plugins/acts_as_state_machine/test/fixtures/conversation.rb
  128. +11 −0 vendor/plugins/acts_as_state_machine/test/fixtures/conversations.yml
  129. +2 −0 vendor/plugins/acts_as_state_machine/test/fixtures/person.rb
  130. +11 −0 vendor/plugins/acts_as_state_machine/test/schema.rb
  131. +38 −0 vendor/plugins/acts_as_state_machine/test/test_helper.rb
  132. +26 −0 vendor/plugins/acts_as_tree/README
  133. +22 −0 vendor/plugins/acts_as_tree/Rakefile
  134. +1 −0 vendor/plugins/acts_as_tree/init.rb
  135. +96 −0 vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb
  136. 0 vendor/plugins/acts_as_tree/test/abstract_unit.rb
  137. +219 −0 vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb
  138. 0 vendor/plugins/acts_as_tree/test/database.yml
  139. 0 vendor/plugins/acts_as_tree/test/fixtures/mixin.rb
  140. 0 vendor/plugins/acts_as_tree/test/fixtures/mixins.yml
  141. 0 vendor/plugins/acts_as_tree/test/schema.rb
  142. +51 −0 vendor/plugins/restful_authentication/README
  143. +22 −0 vendor/plugins/restful_authentication/Rakefile
  144. +1 −0 vendor/plugins/restful_authentication/generators/authenticated/USAGE
  145. +262 −0 vendor/plugins/restful_authentication/generators/authenticated/authenticated_generator.rb
  146. +3 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/activation.html.erb
  147. +116 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_system.rb
  148. +10 −0 ...or/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
  149. +31 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/controller.rb
  150. +19 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/fixtures.yml
  151. +74 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/functional_spec.rb
  152. +85 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/functional_test.rb
  153. +2 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/helper.rb
  154. +14 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/login.html.erb
  155. +25 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/mailer.rb
  156. +31 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/mailer_test.rb
  157. +22 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/migration.rb
  158. +141 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/model.rb
  159. +65 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/model_controller.rb
  160. +84 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/model_functional_spec.rb
  161. +86 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/model_functional_test.rb
  162. +2 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/model_helper.rb
  163. +11 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/observer.rb
  164. +16 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/signup.html.erb
  165. +8 −0 ...or/plugins/restful_authentication/generators/authenticated/templates/signup_notification.html.erb
  166. +172 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/unit_spec.rb
  167. +160 −0 vendor/plugins/restful_authentication/generators/authenticated/templates/unit_test.rb
  168. +1 −0 vendor/plugins/restful_authentication/install.rb
  169. +29 −0 vendor/plugins/restful_authentication/lib/restful_authentication/rails_commands.rb
@@ -0,0 +1,12 @@
+.DS_Store
+log/*.log
+log/*.pid
+#config/development.sphinx.conf
+tmp/**/*
+config/database.yml
+db/*.sqlite3
+coverage
+doc/plugins/*
+doc/*
+#db/sphinx/development/*
+Capfile
@@ -0,0 +1,27 @@
+RUBYFLOW
+Developed by Peter Cooper - 2008
+
+---
+
+All code developed by Peter Cooper within this project is in the public domain.
+Plugins, Rails, and derivative code is licensed as it was originally (mostly MIT).
+
+This code is entirely unsupported, lacks tests, and could well make your machine
+explode. If you use it, you understand this and accept all the risks.
+
+---
+
+TO GET STARTED
+
+I have not tested these instructions, but from memory..
+
+Check config/database.yml and run migrations.
+
+The RubyFlow code is designed to deal with multiple sites from one codebase (although not one installation).
+The settings for a particular site are in config/[sitename].yml
+The site name for the current installation is set on the first line of config/environment.rb
+Current the setting is for "rubyflow", so config/rubyflow.yml is used.
+Change the chosen site in config/environment.rb and create your own YML file.
+
+Note that the chosen site name is added as a class to the BODY tag. This makes it easy to use the same
+CSS file for multiple sites but apply site specific tweaks with BODY.sitename prefixes in the CSS!
@@ -0,0 +1,10 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
@@ -0,0 +1,35 @@
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+class ApplicationController < ActionController::Base
+ helper :all # include all helpers, all the time
+
+ # See ActionController::RequestForgeryProtection for details
+ # Uncomment the :secret if you're not using the cookie session store
+ protect_from_forgery # :secret => '????? you'll need to sort this out yourself!'
+
+ include AuthenticatedSystem
+
+ def go_404
+ render :text => '404 Not Found', :status => 404
+ end
+
+ def items_per_page
+ 50
+ end
+ helper_method :items_per_page
+
+ # do_pagination is used in before_filters by actions that use pagination
+ # If a "page" param is provided, use that to set the page, otherwise assume we're on page 1
+ # Then set up a pagination_options hash that can be used with 'find' to sort out the SQL!
+ # If param "all" is set, pagination is forgotten and ALL items should be returned
+ def do_pagination
+ @page_number = 1
+ if params[:page] && params[:page].to_i > 0
+ @page_number = params[:page].to_i
+ end
+ @pagination = true
+ @pagination_options = { :limit => items_per_page, :offset => (@page_number - 1) * items_per_page }
+ @pagination_options = {} if params[:all]
+ end
+end
@@ -0,0 +1,90 @@
+class CategoriesController < ApplicationController
+ # You need to be an admin to play with categories (not actually used in this app yet)
+ before_filter :admin_required, :except => [:show, :index]
+
+ layout 'main'
+
+ # GET /categories
+ # GET /categories.xml
+ def index
+ @top_category = Category.find_by_parent_id(nil)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => Category.find(:all) }
+ end
+ end
+
+ # GET /categories/1
+ # GET /categories/1.xml
+ def show
+ @category = Category.find(params[:id]) rescue Category.find_by_name(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @category }
+ end
+ end
+
+ # GET /categories/new
+ # GET /categories/new.xml
+ def new
+ @category = Category.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @category }
+ end
+ end
+
+ # GET /categories/1/edit
+ def edit
+ @category = Category.find(params[:id]) rescue Category.find_by_name(params[:id])
+ end
+
+ # POST /categories
+ # POST /categories.xml
+ def create
+ @category = Category.new(params[:category])
+
+ respond_to do |format|
+ if @category.save
+ flash[:notice] = 'Category was successfully created.'
+ format.html { redirect_to(@category) }
+ format.xml { render :xml => @category, :status => :created, :location => @category }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @category.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /categories/1
+ # PUT /categories/1.xml
+ def update
+ @category = Category.find(params[:id]) rescue Category.find_by_name(params[:id])
+
+ respond_to do |format|
+ if @category.update_attributes(params[:category])
+ flash[:notice] = 'Category was successfully updated.'
+ format.html { redirect_to(@category) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @category.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /categories/1
+ # DELETE /categories/1.xml
+ def destroy
+ @category = Category.find(params[:id]) rescue Category.find_by_name(params[:id])
+ @category.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(categories_url) }
+ format.xml { head :ok }
+ end
+ end
+end
@@ -0,0 +1,73 @@
+class CommentsController < ApplicationController
+ before_filter :admin_required, :except => [:create]
+
+ layout 'main'
+
+ # GET /comments/1/edit
+ def edit
+ @comment = Comment.find(params[:id])
+ end
+
+ # POST /comments
+ # POST /comments.xml
+ def create
+ @comment = Comment.new(params[:comment])
+ @item = Item.find(params[:item_id])
+ @comment.item = @item
+
+ if logged_in?
+ @comment.user = current_user
+ else
+ @comment.byline = "Anonymous Coward" if @comment.byline.empty?
+ @comment.content = @comment.content.gsub(/((<a\s+.*?href.+?\".*?\")([^\>]*?)>)/, '\2 rel="nofollow" \3>')
+ unless Digest::SHA1.hexdigest(params[:captcha].upcase.chomp)[0..5] == params[:captcha_guide]
+ @item.errors.add("Word")
+ flash.now[:notice] = "Your comment could not be posted. Scroll down, correct, and retry. Did you get the CAPTCHA right?"
+ render :template => 'items/show'
+ return
+ end
+ end
+
+
+ respond_to do |format|
+ if @comment.save
+ flash[:notice] = 'Comment was successfully created.'
+ format.html { redirect_to(@comment.item) }
+ format.xml { render :xml => @comment, :status => :created, :location => @comment }
+ else
+ flash.now[:notice] = "Your comment could not be posted. Scroll down, correct, and retry."
+ format.html { render :template => 'items/show' }
+ format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /comments/1
+ # PUT /comments/1.xml
+ def update
+ @comment = Comment.find(params[:id])
+
+ respond_to do |format|
+ if @comment.update_attributes(params[:comment])
+ flash[:notice] = 'Comment was successfully updated.'
+ format.html { redirect_to(@comment) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /comments/1
+ # DELETE /comments/1.xml
+ def destroy
+ @comment = Comment.find(params[:id])
+ @comment.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(comments_url) }
+ format.xml { head :ok }
+ end
+ end
+end
@@ -0,0 +1,4 @@
+class HomeController < ApplicationController
+ layout 'main'
+
+end
Oops, something went wrong.

0 comments on commit 4af11fc

Please sign in to comment.